query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Remove the specified resource from storage.
public function destroy($id) { $resul=DB::table('especialidad')->where('id', $id)->delete(); if($resul){ \Session::flash('flash_message_correcto', 'registro eliminado exitosamente.'); //return view("mensajes.msj_correcto")->with("msj","Usuario Registrado Correctamente"); } else { \Session::flash('flash_message_rechazado', 'Huvo un error al eliminar registro vuelva a intentarlo'); // return view("mensajes.msj_rechazado")->with("msj","hubo un error vuelva a intentarlo"); } return redirect ()->route('formNewEspecialidad'); }
{ "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
Test exception for empty file
protected function prepareEnvForEmptyFile() { $file = 'magento_empty.jpg'; /** @var \Magento\Framework\Filesystem $filesystem */ $filesystem = $this->objectManager->get(\Magento\Framework\Filesystem::class); $tmpDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP); $filePath = $tmpDirectory->getAbsolutePath($file); $_FILES['options_1_file'] = [ 'name' => 'test.jpg', 'type' => 'image/jpeg', 'tmp_name' => $filePath, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testReadNonExistingFile()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n try {\n file_get_contents($filename);\n\n $this->fail('Expected read of non-existing file to fail');\n } catch (\\PHPUnit_Framework_Error_Warning $e) {\n $this->assertContains('failed to open stream', $e->getMessage());\n }\n }", "public function testReadEmptyFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('empty');\n }", "public function testAssertFileNoFile(): void\n {\n $this->expectException(AssertionFailedError::class);\n $this->expectExceptionMessage('Failed asserting that file was sent.');\n $this->get('/posts/get');\n $this->assertFileResponse('foo');\n }", "public function testFileExceptions() {\n $xsl_service = new ExcelFileProcessorService();\n\n try {\n $xsl_service->processFile('foo');\n $this->fail();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), 'The file does not exists');\n }\n }", "public function testConstructNoExistingFile(): void\n {\n $this->expectException(NotReadableException::class);\n $this->getThumbCreatorInstance('noExistingFile.gif');\n }", "public function testToGetJsonFileIfNotExist()\n {\n // when\n $actual = $this->tested->getJsonFromFile('file.json');\n\n // then\n $this->expectException($actual);\n }", "public function testAssertFileNoResponse(): void\n {\n $this->expectException(AssertionFailedError::class);\n $this->expectExceptionMessage('No response set, cannot assert content');\n $this->assertFileResponse('foo');\n }", "public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}", "public function testGetErrorsByFileEmpty()\n { \n $this->_mockXMLHandler\n ->expects($this->once())\n ->method('loadXML')\n ->with($this->equalTo(self::$_cbXMLBasic))\n ->will($this->returnValue(simplexml_load_file(self::$_cbXMLBasic)));\n \n $list = $this->_cbErrorHandler->getErrorsByFile(self::$_cbXMLBasic, $this->_fileName);\n \n $this->assertTrue(is_array($list) && empty($list));\n }", "public function testProcessorInvalidFile()\n {\n $xml = '\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc\n accumsan leo quis arcu convallis faucibus. Mauris pharetra dolor\n faucibus, ultrices ex in, porttitor urna. Aliquam erat volutpat.\n Curabitur consectetur purus ex, at porta ex viverra in. Nullam\n rutrum sem quis lacus pellentesque rutrum. Quisque vitae arcu eros.\n Maecenas luctus enim at vehicula varius. In lacinia lorem vehicula\n elementum fermentum. Aenean venenatis ac massa eu maximus. Lorem\n ipsum dolor sit amet, consectetur adipiscing elit. Quisque et\n varius eros.\n ';\n\n $processor = new Processor();\n $user = new User();\n $version = new Version($user);\n\n $this->expectException(\\Exception::class);\n $processor->process($xml, $version);\n }", "public function testGetLinesFromFileThrowsExceptionIfFileDoesNotExist(): void\n {\n $file = '/hopefully/this/file/does/not/exist';\n $parser = new IniParser($file);\n\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('File not found: ' . $file);\n\n $parser->getLinesFromFile();\n }", "public function testReadWithNonExistentFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('fake_values');\n }", "public static function fileDoesNotExist()\n {\n return self::logicalNot(self::fileExists());\n }", "public function testSaveUnableToCreateFile(): void\n {\n $this->expectException(NotWritableException::class);\n $this->expectExceptionMessage('Unable to create file `' . DS . 'noExisting`');\n $this->getThumbCreatorInstance('400x400.jpg')->resize(200)->save(['target' => DS . 'noExisting']);\n }", "public function testCreateInvalidFile()\n {\n new MaterializedResource(new GenericResource('file_not_found.txt'), '/probably/not/a/directory');\n }", "public function testConstructFileAlreadyExists()\n {\n file_put_contents($this->file, null);\n\n $SerializedArray = new SerializedArray($this->file);\n $this->assertEquals($this->file, $this->getProperty($SerializedArray, 'file'));\n }", "public function testLoadFile_invalidFileName() : void\n {\n $spreadsheet = SpreadsheetUtil::loadFile('junk.xls');\n $this->assertNull($spreadsheet);\n }", "public function testExecuteWithBadFile()\n {\n\n $this->commandTester->execute(\n array(\n 'file_path' => __DIR__. '/../Fixtures/stockd.csv',\n '--test_run' => true,\n )\n );\n// $this->assertEquals('File could not be found.' . PHP_EOL, $this->commandTester->getDisplay());\n $this->assertRegexp('/File could not be found./', $this->commandTester->getDisplay());\n\n }", "public function testCreateDataCollectionFailsBecauseOfMissingFiles(): void\n {\n $path = __DIR__ . '/../../../fixtures/missing-file';\n\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage(sprintf('File \"%s/core/default-browser.json\" does not exist.', $path));\n\n $this->object->createDataCollection($path);\n }", "public function testFileNotFoundException ()\n {\n $this->tran->loadFile(2);\n $this->tran->loadFile();\n $this->tran->loadFile(true);\n $this->tran->loadFile('asd');\n }", "public function testReadFile1()\n {\n IniReader::readFile('nonexist.ini');\n }", "public function testMalformedFilePath() {\n $configuration = [\n 'path' => 'non-existent-path',\n 'ids' => ['id'],\n ];\n\n $csv = new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);\n $this->expectException(Warning::class);\n $this->expectExceptionMessage('fopen(non-existent-path): failed to open stream: No such file or directory');\n $csv->initializeIterator();\n }", "public function testException()\n {\n $file = ROOT . 'dir' . DS . 'notWritableFile';\n try {\n throw new NotWritableException(null, 0, null, $file);\n } catch (NotWritableException $e) {\n $this->assertSame('File or directory `dir/notWritableFile` is not writable', $e->getMessage());\n $this->assertSame($file, $e->getFilePath());\n }\n\n try {\n throw new NotWritableException();\n } catch (NotWritableException $e) {\n $this->assertSame('File or directory is not writable', $e->getMessage());\n $this->assertNull($e->getFilePath());\n }\n }", "public function testExceptionConfiFileNotFound() {\r\n $this->model->create($this->post());\r\n }", "public function testScanWithInvalidFileEndingShouldReturnNull(): void\n {\n $processor = new Processor(self::$defaultOptions);\n $fileInfo = new \\SplFileObject('vfs://invalidFileEnding.php');\n\n $result = $processor->scan($fileInfo);\n\n self::assertNull($result);\n }", "public function testIsVendorFileThrowsExceptionIfNoValidFileReferenceIsProvided()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorFile(__DIR__ . '/this/files/does/not/exist');\n }", "public function testFailure()\n {\n $this->assertFileExists('/home/albert/PhpstormProjects/is601b');\n }", "public function test_cohortsync_with_emptyfile() {\n\n $csvfilename = $this->set_csv_file();\n $cohortsync = new cohortsync($this->trace, $csvfilename);\n\n $this->assertEquals(1, count($cohortsync->get_errors()));\n $errormsg = $cohortsync->get_errors()[0];\n $this->assertStringContainsString('is not readable or does not exist', $errormsg->out());\n\n }", "public function testGetBackupWithInvalidFile()\n {\n $bad_file_name = 'no-file.tar.gz';\n\n $this->backups->expects($this->once())\n ->method('getBackupByFileName')\n ->with($this->equalTo($bad_file_name))\n ->will($this->throwException(new TerminusNotFoundException()));\n\n $this->setExpectedException(TerminusNotFoundException::class);\n\n $this->command->getBackup('mysite.dev', ['file' => $bad_file_name,]);\n }", "public function testWithEmptyFile()\n {\n $config = array(\n 'file' => realpath(dirname(__FILE__)).'/../csv/empty.csv',\n 'skip_lines' => 1,\n 'header_line' => -1\n );\n\n $node_csv = new \\Giift\\Etl\\Extractor\\Csv($config);\n $node_csv->addOutput($this->node_loader);\n\n $node_csv->extract();\n\n $rs = $this->node_loader->getResult();\n\n $this->assertNotNull($rs);\n $this->assertEmpty($rs);\n }", "public function testGetReadMeFileContents_ThrowsExceptionWhenMissingFile() {\n $this->expectException( ReadMeFileDoesNotExists::class );\n $mockFileSystem = vfsStream::setup();\n $spider = new Spider( $mockFileSystem->url(), false );\n unlink( $mockFileSystem->url() . '/' . Spider::README_FILE_NAME );\n $spider->getReadMeFileContents();\n }", "protected function detectMissingFiles() {}", "public function canNotOpen()\n {\n $this->assertFalse(@fopen(vfsStream::url('foo')));\n }", "public function testDownloadSupplementaryFileNonexist()\n {\n $mockFileStorage = Mockery::mock(FileStorageManager::class);\n $mockFileStorage->shouldReceive(\"getSupplementaryFileByHash\")\n ->withArgs(['a123'])->andReturn(null)->once();\n $this->presenter->fileStorage = $mockFileStorage;\n\n Assert::exception(function () {\n $request = new \\Nette\\Application\\Request(\n $this->presenterPath,\n 'GET',\n ['action' => 'downloadSupplementaryFile', 'hash' => 'a123']\n );\n $response = $this->presenter->run($request);\n }, NotFoundException::class, 'Not Found - Supplementary file not found in the storage');\n }", "public function testInvalidAccessReaction()\n {\n $this->createTestInstance()->removeTemporaryFile('nonexistent');\n }", "public function testGetFilesWithErrors()\n {\n $this->_mockXMLHandler\n ->expects($this->once())\n ->method('loadXML')\n ->with($this->equalTo(self::$_cbXMLFile))\n ->will($this->returnValue(simplexml_load_file(self::$_cbXMLFile)));\n \n $this->_mockXMLHandler\n ->expects($this->atLeastOnce())\n ->method('countItems')\n ->will($this->returnValue(rand(1,100)));\n \n $files = $this->_cbErrorHandler->getFilesWithErrors(self::$_cbXMLFile);\n \n $this->assertTrue(5 === count($files[0]));\n $this->assertEquals($this->_fileName, $files[0]['complete']);\n }", "public function test_upload_file_not_exist() {\n\t\t$filename = '*/:<>?\\|';\n\t\t$upload_path = '';\n\t\t$bucket = '';\n\t\t$response = 'response';\n\t\t$expected_argument = array();\n\t\t$expected_response = false;\n\t\t$s3_helper = $this->create_s3_helper_partial_mock( $this->create_s3_client_partial_mock( $expected_argument, $response ) );\n\t\t$this->assertEquals( $expected_response, $s3_helper->upload( Path_Creator::create_file_path( $filename ), $upload_path, $bucket ) );\n\t}", "public function notFakeFile() {\n\t $check = filesize($this->value[\"tmp_name\"]);\n\t if($check !== false) {\n\t return true;\n\t } else {\n\t \treturn false;\n\t }\n\t}", "static function readFile(string $fileName){\r\n self::$_fileName = $fileName;\r\n try{\r\n $fileHandle = fopen(self::$_fileName, 'r');\r\n self::$_fileContents = fread($fileHandle, filesize(self::$_fileName));\r\n if(!isset($fileHandle) || empty(self::$_fileContents)){\r\n throw new Exception(\"The file is empty\");\r\n }\r\n}\r\n catch(Exception $ex){\r\n echo $ex->getMessage();\r\n }\r\n return self::$_fileContents;\r\n}", "public function testScanFileWithoutMatchShouldReturnEmptyResult(): void\n {\n $processor = new Processor(self::$defaultOptions);\n $fileObject = new \\SplFileObject('vfs://noMatch.php.dist');\n\n $scanResult = $processor->scan($fileObject);\n\n self::assertInstanceOf(ResultContainer::class, $scanResult);\n self::assertEmpty($scanResult);\n self::assertEquals($fileObject->getPathname(), $scanResult->getPathName());\n }", "public function test_non_existent_uploadedfile() {\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $talkpoint->id, $user->id, 'Talkpoint 001', 'mod_talkpoint_web_test.txt', null, 'file', 0, $now, $now),\n ),\n )));\n\n // request the file\n $client = new Client($this->_app);\n $client->request('GET', '/uploadedfile/1');\n $this->assertTrue($client->getResponse()->isNotFound());\n $this->assertContains(get_string('storedfilecannotread', 'error'), $client->getResponse()->getContent());\n }", "public function testUnlinkNonExistingFile()\n {\n $this->assertFalse(unlink(static::$baseFile . '/fs/tmp.txt'));\n }", "public static function getInvalidFile(): string\n {\n return \"some/non/existing/file.txt\";\n }", "public static function getInvalidFile()\n {\n return 'some/non/existing/file.txt';\n }", "public function test_missing_image_file() {\n\t\t$out = wp_read_image_metadata( DIR_TESTDATA . '/images/404_image.png' );\n\t\t$this->assertFalse( $out );\n\t}", "public function testTouchNonExistingFile()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n\n $this->assertFalse(file_exists($filename));\n\n $this->assertTrue(touch($filename, 1, 2));\n\n clearstatcache();\n $this->assertTrue(file_exists($filename));\n\n $stat = stat($filename);\n $this->assertSame(1, $stat['mtime']);\n $this->assertSame(2, $stat['atime']);\n }", "public function testCreateDataCollectionFailsBecauseOfEmptyDirectory(): void\n {\n $path = __DIR__ . '/../../../fixtures/empty-directory';\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage(sprintf('Directory \"%s/browsers\" was empty.', $path));\n\n $this->object->createDataCollection($path);\n }", "public function testFilesEmpty()\n {\n $this->assertArrayEmpty($this->get_reflection_property_value('files'));\n }", "public function testThatSimulateThrowsExceptionWhenSimulationDataIsEmpty()\n {\n $this->setExpectedException( 'Gravity\\EmptySimulationDataException' );\n $this->obj->simulateData( array(), array() );\n }", "public function testEmpty() {\r\n\t\t$phpcheckstyle = $GLOBALS['PHPCheckstyle'];\r\n\r\n\t\t$phpcheckstyle->processFiles(array(\r\n\t\t\t'./test/sample/empty.php'\r\n\t\t));\r\n\r\n\t\t$errorCounts = $phpcheckstyle->getErrorCounts();\r\n\r\n\t\t$this->assertEquals(0, $errorCounts['error'], 'We expect 0 error');\r\n\t\t$this->assertEquals(0, $errorCounts['ignore'], 'We expect 0 ignored checks');\r\n\t\t$this->assertEquals(0, $errorCounts['info'], 'We expect 0 info');\r\n\t\t$this->assertEquals(1, $errorCounts['warning'], 'We expect 1 warnings');\r\n\t}", "public function testUploadFileNotFound()\n {\n $this->expectException(FilestackException::class);\n $this->expectExceptionCode(400);\n\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client\n );\n $client->upload('/some/bad/filepath');\n }", "public function testReadWithExistentFileWithoutExtension() {\n $reader = new ConfigReader($this->path);\n $reader->read('no_php_extension');\n }", "public function testCsvReaderThrowsFileNotFoundExceptionIfFileNotFound() {\n \n $this->expectException(new Csv_Exception_FileNotFound('File does not exist or is not readable: \"./data/nonexistant.csv\".'));\n $reader = new Csv_Reader('./data/nonexistant.csv');\n \n }", "public function testInvalidFileImport(): void\n {\n $this->expectException(ValidationException::class);\n $file_path = base_path('tests/data/aircraft.csv');\n $this->importSvc->importAirports($file_path);\n }", "public function it_should_throw_is_specified_dump_file_is_not_readable()\n {\n $root = vfsStream::setup('root');\n $dumpFle = vfsStream::newFile('foo.sql', 0000);\n $root->addChild($dumpFle);\n $path = $root->url() . '/foo.sql';\n\n $driver = $this->stubProphecy(ExtendedMySql::class);\n $driver->load($path)->shouldNotBeCalled();\n\n $this->expectException(\\InvalidArgumentException::class);\n\n $sut = $this->make_instance();\n $sut->_setDriver($driver->reveal());\n\n $sut->importSqlDumpFile($path);\n }", "function is_readable_and_not_empty($file_path = '') {\n\t\t\tif (empty($file_path)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn is_readable($file_path) && 0 !== filesize($file_path);\n\t\t}", "public function testGetFiles() : void {\n $expected = 0;\n $this->assertEquals($expected, count($this->dataManager->getFiles([])));\n }", "public function test_non_existent_servefile() {\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $talkpoint->id, $user->id, 'Talkpoint 001', 'mod_talkpoint_web_test.txt', null, 'file', 0, $now, $now),\n ),\n )));\n\n // request the file\n $client = new Client($this->_app);\n $client->request('GET', '/servefile/1');\n $this->assertTrue($client->getResponse()->isNotFound());\n $this->assertContains(get_string('storedfilecannotread', 'error'), $client->getResponse()->getContent());\n }", "public function testIfExceptionIsThrownWhenConfigurationIsNotValid()\n {\n $path = $this->getTestDataDir() . '/config.invalid.yml';\n\n $this->assertTrue(is_readable($path), 'Invalid configuration file is missing.');\n\n $reader = new Reader(new Configuration());\n $reader->read($path);\n }", "public function testFileReaderThrowsAnExceptionWhenSeekingOutOfBounds()\n {\n $this->expectException(OutOfBoundsException);\n $fileReader = new ChunkedFileReader($this->__testFilePath);\n $fileReader->seek(100);\n }", "static function checkForEmptyFileField($fieldname) {\n if (!isset($_FILES[$fieldname]['name'])) {\n new SystemMessage(\"File field cannot be left empty\")\n\n ;\n forward();\n }\n }", "public function thereShouldBeNoOutput()\n {\n if ($this->output != \"\") {\n throw new \\Exception('Output has been detected: '.$this->output);\n }\n }", "private function ensureUploadedFileIsValid(): void\n {\n if ($this->hasMoveTo === true) {\n throw new RuntimeException(\"Uploaded file has already been moved.\");\n }\n\n if ($this->error !== UPLOAD_ERR_OK) {\n throw new RuntimeException(\"Uploaded file error: \" . self::UPLOAD_ERRORS[$this->error]);\n }\n }", "public function is_empty($filename){\n\t\tif(empty($filename)){\n\t\t\treturn true;\n\t\t}\n\t}", "public function is_empty($filename){\n\t\tif(empty($filename)){\n\t\t\treturn true;\n\t\t}\n\t}", "public function testAddDataWithInvalidTemplateFileType()\n {\n $this->expectException(\\LogicException::class);\n $this->template_data->add(array('name' => 'Jonathan'), 123);\n }", "public function testUploadFail_FileExists()\n {\n $file = array(\"name\"=>\"zipSubfolder.zip\", \"size\"=>500, \"tmp_name\"=>__DIR__.'/zipSubfolder.zip');\n\n $service = $this->setMockPluginUploaderServiceExtract();\n\n // Create test file\n @touch(__DIR__.'/../../../storage/uploads/pluginuploader/zipSubfolder.zip');\n $result = $service->upload($file);\n @unlink(__DIR__.'/../../../craft/storage/uploads/pluginuploader/zipSubfolder.zip');\n\n // check we got the correct result\n $this->assertEquals('Sorry, file already exists.', $result);\n }", "public function filesizeValid()\n\t{\n\t\tif ($this->files['size'] > $this->max_filesize) {\n\t\t\tthrow new Exception(\"File is too big\",7);\n\t\t}\n\n\t\t//Check that the file is not too less\n\t\tif ($this->files['size'] < $this->min_filesize) {\n\t\t throw new Exception(\"File is too less than\",8);\n\t\t}\n\t\n\t}", "public function testFileNotOnDisk(){\n $generated_attachment = factory(Attachment::class)->create([self::ATTACHMENT_PARAMETER_UUID=>$this->generateValidUuid()]);\n\n //WHEN\n $response = $this->get(sprintf(self::WEB_ATTACHMENT_URI, $generated_attachment->uuid));\n\n //THEN\n $this->assertResponseStatus($response, HttpStatus::HTTP_NOT_FOUND);\n }", "public function testCreateFile()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n\n $this->assertFalse(file_exists($filename));\n\n file_put_contents($filename, 'It works!');\n\n $this->assertTrue(file_exists($filename));\n $this->assertSame('It works!', file_get_contents($filename));\n }", "public function testEmptyDirectoryShouldReturnEmptyResult(): void\n {\n $iterator = new FileIterator('vfs://', []);\n self::assertEmpty(iterator_to_array($iterator->iterate()));\n }", "public function testNoViolationsInFileOnValidVersion()\n {\n $file = $this->sniffFile(__FILE__, '5.3');\n $this->assertNoViolation($file);\n }", "public function testTemplateFileNotExists1()\n {\n $tpl = $this->smarty->createTemplate('notthere.tpl');\n $this->assertFalse($tpl->source->exists);\n }", "protected function assertFilesDontExist()\n {\n $this->assertFileNotExists($this->getSeedFilePath('LarafolioSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('ImagesTableSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('ProjectsTableSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('TextBlocksTableSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('UsersTableSeeder.php'));\n\n $this->assertFileNotExists(database_path('factories/ModelFactory.php'));\n }", "protected function isFile() {}", "public function test_cohortsync_with_notfoundfile() {\n global $CFG;\n\n $csvfilename = $CFG->dirroot.'/admin/tool/cohortsync/tests/fixtures/cohorts_notfound.csv';\n\n $cohortsync = new cohortsync($this->trace, $csvfilename);\n\n $this->assertEquals(1, count($cohortsync->get_errors()));\n $errormsg = $cohortsync->get_errors()[0];\n $this->assertStringContainsString('not readable or does not exist', $errormsg->out());\n }", "public function checkFileEmpty($filepath): bool\n {\n return (filesize($filepath) == 0);\n }", "public function testBrokenCredentialFile()\n {\n // create ourselves a new test instance\n $this->initTestEnvironment('I_do_not_exist_at_all');\n }", "public function testRefusesToProvideQuotationIfFileSpecifiedInFileArrayDoesNotExist()\n {\n $jobs = array(\n 'job_01' => array(\n 'type' => 'file',\n 'file_key' => 'file_01',\n 'lc_src' => 'en',\n 'lc_tgt' => 'ja',\n 'tier' => 'standard',\n ),\n );\n\n $files = array('file_01' => __DIR__.'/testfiles/non_existent_file');\n\n $serviceAPI = new Service();\n\n $this->expectException(Exception::class);\n $this->expectExceptionMessage('Could not find file');\n $serviceAPI->quote($jobs, $files);\n }", "public function testNoViolationsInFileOnValidVersion()\n {\n $file = $this->sniffFile(__FILE__, '7.3');\n $this->assertNoViolation($file);\n }", "public function test_SaveException_NoPath()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to save setting: Path not specified.\");\n $config = new Config_Dir();\n $config->save();\n }", "function isEmpty() {\n\t\tif ($this->f) {\n\t\t\treturn filesize($this->path) == 0;\n\t\t}\n\t\treturn true;\n\t}", "public function testThrowsExceptionOnInvalidAddFileContent()\n {\n $parser = new Parser($this->createTwig());\n $parser->addFileContent(\"Invalid XML\");\n }", "public function testNoViolationsInFileOnValidVersion()\n {\n $file = $this->sniffFile(__FILE__, '8.1');\n $this->assertNoViolation($file);\n }", "public function testGetContentNotFound()\n {\n $mock_response = new MockHttpResponse(\n 404,\n 'File not found'\n );\n\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $stub_http_client->method('request')\n ->willReturn($mock_response);\n\n $this->expectException(FilestackException::class);\n $this->expectExceptionCode(404);\n\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client);\n $client->getContent('some-bad-file-handle-testing');\n }", "public function testMigrateExceptionPathMissing() {\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage('You must declare the \"path\" to the source CSV file in your source settings.');\n new CSV([], $this->pluginId, $this->pluginDefinition, $this->migration);\n }", "function check_file_error($file_error) {\nif ($file_error === 0) {\nreturn true;\n}else {\necho \"There is an error uploading the file\";\n}\n}", "public function testGetImageInfoFromBlobException()\n {\n $rwongBlob = file_get_contents(__FILE__);\n $this->setExpectedException('Exception');\n Tinebase_ImageHelper::getImageInfoFromBlob($rwongBlob);\n }", "public function testNoViolationsInFileOnValidVersion()\n {\n $file = $this->sniffFile(__FILE__, '5.5');\n $this->assertNoViolation($file);\n }", "public function testDeleteFile()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testFailSetFilename()\n {\n $logger = new \\Arch\\Logger\\File();\n $logger->setFilename(NULL);\n }", "public function check_files()\n {\n }", "public function testGetFilesDataReturnsNull()\n {\n $this->assertNull($this->class->get_files_data('invalid'));\n }", "public function testCsvReaderThrowsCannotDetermineDialectIfDataCorrupt() {\n \n //$this->expectException(new Csv_Exception_CannotDetermineDialect('File does not exist or is not readable: \"./data/nonexistant.csv\".'));\n $reader = new Csv_Reader('./data/corrupt.csv');\n \n }", "public function testNoViolationsInFileOnValidVersion()\n {\n $file = $this->sniffFile(__FILE__, '5.6');\n $this->assertNoViolation($file);\n }", "public function testNoViolationsInFileOnValidVersion()\n {\n $file = $this->sniffFile(__FILE__, '5.6');\n $this->assertNoViolation($file);\n }", "public function testNoViolationsInFileOnValidVersion()\n {\n $file = $this->sniffFile(__FILE__, '5.2');\n $this->assertNoViolation($file);\n }", "public function testEmptyBlob()\n {\n $blob = new \\RequirementBlob();\n\n $f_blob = new \\FulfilmentBlob();\n\n $this->assertTrue($blob->isFulFilledBy($f_blob));\n }", "function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}", "function checkFileIsValid($file) \n {\n if (!is_file($file)) {\n throw new \\InvalidArgumentException(\n sprintf('\"%s\" is not a file or not exists.', $file)\n );\n }\n if (is_file($file) && mb_stripos($file, '.htm') === false) {\n throw new \\InvalidArgumentException(\n sprintf('\"%s\" is not a valid file.', $file)\n );\n }\n }", "public function testReadIncompleteFile()\n {\n $input = <<<ICS\nBEGIN:VCALENDAR\nVERSION:1.0\nBEGIN:VEVENT\nX-FUNAMBOL-FOLDER:DEFAULT_FOLDER\nX-FUNAMBOL-ALLDAY:0\nDTSTART:20111017T110000Z\nDTEND:20111017T123000Z\nX-MICROSOFT-CDO-BUSYSTATUS:BUSY\nCATEGORIES:\nLOCATION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Netviewer Meeting\nPRIORITY:1\nSTATUS:3\nX-MICROSOFT-CDO-REPLYTIME:20111017T064200Z\nSUMMARY;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:Kopieren: test\nCLASS:PUBLIC\nAALARM:\nRRULE:\nX-FUNAMBOL-BILLINGINFO:\nX-FUNAMBOL-COMPANIES:\nX-FUNAMBOL-MILEAGE:\nX-FUNAMBOL-NOAGING:0\nATTENDEE;STATUS=NEEDS ACTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:'Heino' [email protected]\nATTENDEE;STATUS=NEEDS ACTION;ENCODING=QUOTED-PRINTABLE;CHARSET=UTF-8:'Markus' [email protected]\nATTENDEE;STATUS=NEEDS AC\nICS;\n\n Reader::read($input);\n }" ]
[ "0.7472158", "0.71330583", "0.70316035", "0.6961544", "0.69586366", "0.6825338", "0.6812045", "0.67485785", "0.66976506", "0.6680771", "0.6591244", "0.6583535", "0.6558809", "0.6463081", "0.6462595", "0.63898975", "0.63826966", "0.6344426", "0.63380784", "0.6302774", "0.62880605", "0.6263969", "0.62475395", "0.62456733", "0.624471", "0.6243912", "0.62220514", "0.6219309", "0.62159413", "0.61700755", "0.6168232", "0.61497635", "0.6142141", "0.61354035", "0.6131066", "0.6109231", "0.6093554", "0.6077728", "0.60605425", "0.6047061", "0.6047059", "0.604132", "0.6014353", "0.60056394", "0.5998903", "0.59819514", "0.5975951", "0.5962035", "0.5948455", "0.59438664", "0.5920739", "0.59135747", "0.59121317", "0.5910111", "0.58974934", "0.5888477", "0.5872538", "0.5837847", "0.5836194", "0.5833611", "0.5832396", "0.5824448", "0.5809287", "0.57980984", "0.57980984", "0.5793909", "0.579269", "0.5788364", "0.57875556", "0.57852", "0.57832986", "0.57815725", "0.57772857", "0.577542", "0.57707673", "0.576349", "0.5754307", "0.5742025", "0.57404065", "0.57379943", "0.5737788", "0.5732606", "0.57302576", "0.57223743", "0.57164615", "0.5715489", "0.5714495", "0.57102203", "0.57025355", "0.56974727", "0.5690295", "0.56886107", "0.56873953", "0.5682027", "0.5681301", "0.5681301", "0.5678368", "0.56755745", "0.56739104", "0.56692475", "0.56655014" ]
0.0
-1
Sets the application locale and translation based on the locale param, if one is not provided it defaults to english
public function routeShutdown(Zend_Controller_Request_Abstract $request) { $config = Zend_Registry::get('config'); $frontController = Zend_Controller_Front::getInstance(); $params = $request->getParams(); $registry = Zend_Registry::getInstance(); // Steps setting the locale. // 1. Default language is set in config // 2. TLD in host header // 3. Locale params specified in request $locale = $registry->get('Zend_Locale'); // Check host header TLD. $tld = preg_replace('/^.*\./', '', $request->getHeader('Host')); // Provide a list of tld's and their corresponding default languages $tldLocales = $frontController->getParam('tldLocales'); if (is_array($tldLocales) && array_key_exists($tld, $tldLocales)) { // The TLD in the request matches one of our specified TLD -> Locales $locale->setLocale(strtolower($tldLocales[$tld])); } elseif (isset($params['locale'])) { // There is a locale specified in the request params. $locale->setLocale(strtolower($params['locale'])); } // Now that our locale is set, let's check which language has been selected // and try to load a translation file for it. $language = $locale->getLanguage(); $translate = Garp_I18n::getTranslateByLocale($locale); Zend_Registry::set('Zend_Translate', $translate); Zend_Form::setDefaultTranslator($translate); if (!$config->resources->router->locale->enabled) { return; } $path = '/' . ltrim($request->getPathInfo(), '/\\'); // If the language is in the path, then we will want to set the baseUrl // to the specified language. $langIsInUrl = preg_match('/^\/' . $language . '\/?/', $path); $uiDefaultLangIsInUrl = false; $uiDefaultLanguage = false; if (isset($config->resources->locale->uiDefault)) { $uiDefaultLanguage = $config->resources->locale->uiDefault; $uiDefaultLangIsInUrl = preg_match('/^\/' . $uiDefaultLanguage . '\/?/', $path); } if ($langIsInUrl || $uiDefaultLangIsInUrl) { if ($uiDefaultLangIsInUrl) { $frontController->setBaseUrl( $frontController->getBaseUrl() . '/' . $uiDefaultLanguage ); } else { $frontController->setBaseUrl($frontController->getBaseUrl() . '/' . $language); } } elseif (!empty($config->resources->router->locale->enabled) && $config->resources->router->locale->enabled ) { $redirectUrl = '/' . $language . $path; if ($frontController->getRouter()->getCurrentRouteName() === 'admin' && !empty($config->resources->locale->adminDefault) ) { $adminDefaultLanguage = $config->resources->locale->adminDefault; $redirectUrl = '/' . $adminDefaultLanguage . $path; } elseif ($uiDefaultLanguage) { $redirectUrl = '/' . $uiDefaultLanguage . $path; } if ($request->getQuery()) { $redirectUrl .= '?' . http_build_query($request->getQuery()); } $this->getResponse() ->setRedirect($redirectUrl, 301); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setLocale()\n\t{\n\t\tif ($locale = $this->app->session->get('admin_locale'))\n\t\t{\n\t\t\t$this->app->setLocale($locale);\n\t\t} else {\n \\Session::put('admin_locale', \\Config::get('app.locale'));\n }\n\t}", "function setLocale($locale);", "public function settingLocale() {}", "public function setLocale($locale = null);", "public function setLocale($locale);", "function locale(string $locale = null)\n{\n if (!$locale) {\n return app('translator')->getLocale();\n }\n\n app('translator')->setLocale($locale);\n}", "public static function setLocale($app, $locale)\n {\n if ($locale != $app['locale']) {\n $app['config']->set('general/locale', $locale);\n $app['locale'] = $locale;\n\n $app->initLocale();\n \n // Reset translator\n $app['translator'] = new Translator($locale, new MessageSelector());\n $app['translator']->setFallbackLocales($app['locale_fallbacks']);\n foreach ($app['translator.loaders'] as $str => $loader) {\n $app['translator']->addLoader($str, $loader);\n }\n $resources = \\Bolt\\Provider\\TranslationServiceProvider::addResources($app, $locale);\n foreach ($resources as $resource) {\n call_user_func_array(array($app['translator'], 'addResource'), $resource);\n }\n foreach ($app['locale_fallbacks'] as $fallback) {\n if ($fallback !== $locale) {\n $resources = \\Bolt\\Provider\\TranslationServiceProvider::addResources($app, $fallback);\n foreach ($resources as $resource) {\n call_user_func_array(array($app['translator'], 'addResource'), $resource);\n }\n }\n }\n } \n }", "function set_language($locale) {\n\t\t\t$this->i18n_locale = $locale;\n\t\t}", "public function setLocale($locale)\n {\n //\n }", "public function setLocale($val)\n {\n $this->locale = $val;\n }", "public function locale(string $locale = null);", "function setLocale($locale) {\n\t\t$this->locale = $locale;\n\t}", "public static function setLocale($locale){\n \\Illuminate\\Foundation\\Application::setLocale($locale);\n }", "public function setDefaultLocale()\n {\n $this->setLocale('en');\n $locale = \\Locale::getDefault();\n if ($locale) {\n $this->setLocale($locale);\n }\n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new APS_I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function setLocale($locale)\n {\n // Check if is allowed and set default locale if not\n if (!\\Language::allowed($locale)) {\n $locale = config('app.locale');\n }\n\n // Set app language\n \\App::setLocale($locale);\n\n // Set carbon language\n if (config('language.carbon')) {\n // Carbon uses only language code\n if (config('language.mode.code') == 'long') {\n $locale = explode('-', $locale)[0];\n }\n\n Carbon::setLocale($locale);\n }\n }", "private function set_locale() {\n\n\t\t$plugin_i18n = new I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Soisy_Pagamento_Rateale_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\t}", "function _setlocale($category, $locale)\r\n\t{\r\n\t\tglobal $CURRENTLOCALE, $EMULATEGETTEXT;\r\n\t\tif ($locale === 0) { // use === to differentiate between string \"0\"\r\n\t\t\tif ($CURRENTLOCALE != '')\r\n\t\t\t\treturn $CURRENTLOCALE;\r\n\t\t\telse\r\n\t\t\t// obey LANG variable, maybe extend to support all of LC_* vars\r\n\t\t\t// even if we tried to read locale without setting it first\r\n\t\t\t\treturn _setlocale($category, $CURRENTLOCALE);\r\n\t\t} else {\r\n\t\t\tif (function_exists('setlocale')) {\r\n\t\t\t\t$ret = setlocale($category, $locale);\r\n\t\t\t\tif (($locale == '' and !$ret) or // failed setting it by env\r\n\t\t\t\t\t($locale != '' and $ret != $locale)) { // failed setting it\r\n\t\t\t\t\t// Failed setting it according to environment.\r\n\t\t\t\t\t$CURRENTLOCALE = _get_default_locale($locale);\r\n\t\t\t\t\t$EMULATEGETTEXT = 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$CURRENTLOCALE = $ret;\r\n\t\t\t\t\t$EMULATEGETTEXT = 0;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// No function setlocale(), emulate it all.\r\n\t\t\t\t$CURRENTLOCALE = _get_default_locale($locale);\r\n\t\t\t\t$EMULATEGETTEXT = 1;\r\n\t\t\t}\r\n\t\t\t// Allow locale to be changed on the go for one translation domain.\r\n\t\t\tglobal $text_domains, $default_domain;\r\n\t\t\tif (array_key_exists($default_domain, $text_domains)) {\r\n\t\t\t\tunset($text_domains[$default_domain]->l10n);\r\n\t\t\t}\r\n\t\t\treturn $CURRENTLOCALE;\r\n\t\t}\r\n\t}", "public function __construct()\n\t{\n\t\t\\App::setLocale('en');\n\t}", "public function settingLanguage() {}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Service_Tracker_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "public function actionSetLocale($locale = 'en_us')\n {\n //Set cookies\n $localeCookie = new CHttpCookie('Locale', $locale);\n $localeCookie->expire = time() + 15 * 24 * 3600;\n Yii::app()->request->cookies['Locale'] = $localeCookie;\n\n //Set application langauge\n Yii::app()->setLanguage($locale);\n }", "function setLocale($key) {\n\t\t\t$this->locale = $key;\n\t\t}", "public function setLocale($locale) {\n\n\t\t// Set the locale manually?\n\t\tif (isset($locale) && in_array($locale, $this->validLocales)) {\n\t\t\t$this->locale = $locale;\n\t\t\treturn;\n\t\t}\n\n\t\t// Is the locale explicitly set as a GET parameter?\n\t\tif (isset($_GET['locale']) && in_array($_GET['locale'], $this->validLocales)) {\n\t\t\t$this->locale = $_GET['locale'];\n\t\t\treturn;\n\t\t}\n\n\t\t// Get language from the browser settings and do a 302 redirect\n\t\tif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n\t\t\t$httpLangs = array();\n\t\t\tforeach ($this->validLocales as $l) {\n\t\t\t\t$httpLangs[] = array('locale' => $l, 'pos' => stripos($_SERVER['HTTP_ACCEPT_LANGUAGE'], $l));\n\t\t\t}\n\t\t\tusort($httpLangs, 'Content::sortHttpLangs');\n\t\t\t$this->locale = $httpLangs[0]['locale'];\n\t\t\theader('Location: /'.$this->locale.$this->getNonLocalUrl(), true, 302);\n\t\t\texit;\n\t\t}\n\n\t\t// Set language to default\n\t\t// This is really just a fallback in case I made a mistake, actually it should never happen\n\t\t$this->locale = $this->validLocales[0];\n\t}", "private function set_locale()\n {\n\n $plugin_i18n = new myFOSSIL_Resources_i18n();\n $plugin_i18n->set_domain( $this->get_plugin_name() );\n\n $this->loader->add_action( 'plugins_loaded', $plugin_i18n,\n 'load_plugin_textdomain' );\n\n }", "private function setLocale() {\n if ($this->_language == 'french')\n setlocale (LC_ALL, 'fr_FR.iso88591', 'fr_FR@euro', 'fr_FR', 'french', 'fra');\n else if ($this->_language == 'english')\n setlocale (LC_ALL, 'en_GB.iso88591', 'en_GB', 'english', 'eng');\n }", "function switch_to_locale($locale)\n {\n }", "public function setLocale($locale): void\n {\n $this['config']->set('app.locale', $locale);\n\n $this['translator']->setLocale($locale);\n }", "function set_locale($locale) {\n\t\t\t$this->i18n_locale = $locale;\n\t\t\treturn $this->i18n_locale;\n\t\t}", "public function setLocale($locale)\n {\n $this['config']->set('app.locale', $locale);\n $this['translator']->setLocale($locale);\n }", "public function __construct()\n {\n app()->setLocale('arm');\n }", "public function setLocale()\n {\n $lang = Request::segment(2);\n\n try {\n $this->language->set($lang);\n return Redirect::back();\n } catch (Exception $e) {\n //show error\n }\n }", "private function processLocale(): void\n {\n if ($this->request->has(self::LOCALE) && null !== $this->request->get(self::LOCALE, null)) {\n $this->setLocale($this->request->get(self::LOCALE));\n }\n }", "function setLocale($localename)\r\n\t{\r\n\t\t$this->pathLocale = $localename;\r\n\t\t$f = $this->_getFileName();\r\n\t\t/* load language configuration */\r\n\t\tif (file_exists($f))\r\n\t\t{\r\n\t\t\tglobal $tmp;\r\n\t\t\tinclude($f);\r\n\t\t\tif ($this->varMode == 'names')\r\n\t\t\t{\r\n#\t\t\t\t$this->lang = array_merge($this->lang, ${$this->varName});\r\n\t\t\t\t$this->lang = ${$this->varName};\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function set_locale() {\n\n if (function_exists('determine_locale')) {\n $locale = determine_locale();\n } else {\n // @todo Remove when start supporting WP 5.0 or later.\n $locale = is_admin() ? get_user_locale() : get_locale();\n }\n $locale = apply_filters('plugin_locale', $locale, 'careerfy-frame');\n \n unload_textdomain('careerfy-frame');\n load_textdomain('careerfy-frame', WP_LANG_DIR . '/plugins/careerfy-frame-' . $locale . '.mo');\n load_plugin_textdomain('careerfy-frame', false, dirname(dirname(plugin_basename(__FILE__))) . '/languages');\n }", "public function setLocale ($locale) {\n\t\t$this->locale = $locale;\n\t}", "public function setCurrentLocale($currentLocale);", "public function setLocale($locale) {\n $this->locale = $locale;\n }", "protected function setLang() {\n \n /*\n //setlocale (LC_ALL,\"russian\");\n //setlocale (LC_ALL,\"\");\n $locale = 'ru_RU';\n putenv('LANG='.$locale);\n setlocale(LC_ALL,\"\");\n setlocale(LC_MESSAGES,$locale);\n setlocale(LC_CTYPE,$locale);\n \n //putenv(\"LANG=ru_RU\");\n \n bindtextdomain (\"messages\", XPATH_TEMPLATE_FRONT . DS . 'locale');\n textdomain (\"messages\");\n bind_textdomain_codeset(\"messages\", \"UTF-8\");*/\n \n //setlocale(LC_MESSAGES, $this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n putenv(\"LC_MESSAGES=\".$this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n bindtextdomain('messages', XPATH_TEMPLATE_FRONT . DS . 'locale' . DS);\n bind_textdomain_codeset('messages', 'UTF-8');\n textdomain('messages');\n }", "function restore_current_locale()\n {\n }", "private function initLocale()\n {\n if (!$this->initialised) {\n putenv(\"LANG=$this->locale\");\n setlocale(LC_ALL, $this->locale);\n\n $this->initialised = true;\n }\n }", "public function setLocale($locale) {\n\t\t$this->_locale = $locale;\n\t}", "function setLocale($inLocale = null) {\n\t\t$locale = false;\n\t\t$source = false;\n\t\tif ( $inLocale === null || strlen($inLocale) < 2 ) {\n\t\t\tif ( !$locale && isset($_COOKIE['locale']) ) {\n\t\t\t\t$locale = strip_tags(trim(stripslashes($_COOKIE['locale'])));\n\t\t\t\t$source = self::LOCALE_SOURCE_COOKIE;\n\t\t\t}\n\t\t\tif ( !$locale && $this->getSession() instanceof mvcSessionBase ) {\n\t\t\t\t$locale = $this->getSession()->getParam('locale');\n\t\t\t\t$source = self::LOCALE_SOURCE_SESSION;\n\t\t\t}\n\t\t\tif ( !$locale && isset($_REQUEST['lang']) ) {\n\t\t\t\t$locale = strip_tags(trim(stripslashes($_REQUEST['lang'])));\n\t\t\t\t$source = self::LOCALE_SOURCE_REQUEST;\n\t\t\t}\n\t\t\tif ( !$locale && strlen($this->getRequestUri()) > 0 ) {\n\t\t\t\t// check first chunk of request\n\t\t\t\t$pieces = explode('/', $this->getRequestUri());\n\t\t\t\tif ( strlen($pieces[0]) == 0 ) {\n\t\t\t\t\tunset($pieces[0]);\n\t\t\t\t}\n\t\t\t\t$locale = array_shift($pieces);\n\t\t\t\t$source = self::LOCALE_SOURCE_URI;\n\t\t\t}\n\t\t} else {\n\t\t\t$locale = strip_tags(trim(stripslashes($inLocale)));\n\t\t\t$source = self::LOCALE_SOURCE_OTHER;\n\t\t}\n\t\t\n\t\tif ( systemLocale::isValidLocale($locale, true) ) {\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE, $locale);\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE_SOURCE, $source);\n\t\t} else {\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE, (string) system::getLocale());\n\t\t\t$this->setParam(self::PARAM_REQUEST_LOCALE_SOURCE, self::LOCALE_SOURCE_SYSTEM);\n\t\t}\n\t\treturn $this;\n\t}", "public function setLocale($language)\n\t{\n\t\t// We'll want to reconsider the below statement.\n\t\t// We'll want to manually add all languages so we can verify no husky stuff is going on.\n\t\tswitch ($language)\n\t\t{\n\t\t\tdefault:\n\t\t\t\t$locale = 'en_EN';\n\t\t\t\tbreak;\n\t\t\tcase 'English':\n\t\t\t\t$locale = 'en_EN';\n\t\t\t\tbreak;\n\t\t\tcase 'Danish':\n\t\t\t\t$locale = 'da_DK';\n\t\t\t\tbreak;\n\t\t\tcase 'Dutch':\n\t\t\t\t$locale = 'nl_NL';\n\t\t\t\tbreak;\n\t\t}\n\n\t\tputenv('LC_ALL=' . $locale);\n\t\tsetlocale(LC_ALL, $locale);\n\t\tbindtextdomain('messages', './locale');\n\t\ttextdomain('messages');\n\t}", "public static function setDefaultLocale($locale): void\n {\n static::$defaultFormatSettings['locale'] = static::resolveLocaleCode($locale);\n }", "function site_locale($locale = null)\n{\n if ($locale) {\n return config(['app.locale' => $locale]);\n }\n\n return config('app.locale');\n}", "public function locale();", "function setLocale($args) {\n\t\t$setLocale = isset($args[0]) ? $args[0] : null;\n\t\t\n\t\t$site = &Request::getSite();\n\t\t$journal = &Request::getJournal();\n\t\tif ($journal != null) {\n\t\t\t$journalSupportedLocales = $journal->getSetting('supportedLocales');\n\t\t\tif (!is_array($journalSupportedLocales)) {\n\t\t\t\t$journalSupportedLocales = array();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (Locale::isLocaleValid($setLocale) && (!isset($journalSupportedLocales) || in_array($setLocale, $journalSupportedLocales)) && in_array($setLocale, $site->getSupportedLocales())) {\n\t\t\t$session = &Request::getSession();\n\t\t\t$session->setSessionVar('currentLocale', $setLocale);\n\t\t}\n\t\t\n\t\tif(isset($_SERVER['HTTP_REFERER'])) {\n\t\t\tRequest::redirect($_SERVER['HTTP_REFERER']);\n\t\t}\n\t\t\n\t\t$source = Request::getUserVar('source');\n\t\tif (isset($source) && !empty($source)) {\n\t\t\tRequest::redirect(Request::getProtocol() . '://' . Request::getServerHost() . $source, false);\n\t\t}\n\t\t\n\t\tRequest::redirect('index');\t\t\n\t}", "public function setLocale(Locale $locale){\n\t\t$this->_locale = $locale;\n\t}", "protected function setLocaleForMailer(): void\n {\n if (function_exists('switch_to_locale') && ($locale = $this->params->locale)) {\n \\switch_to_locale($locale);\n }\n }", "public function setLocale($locale = null)\n {\n if (class_exists('\\Locale')) {\n $this->locale = \\Locale::lookup(\n $this->getAvailableLocales(),\n $locale,\n true,\n $this->getSettings()->locale->default\n );\n }\n\n if (empty($this->locale)) {\n $this->locale = $this->getSettings()->locale->default;\n }\n\n // Set up locale environment for gettext.\n bindtextdomain(self::TEXT_DOMAIN_NAME, self::TEXT_DOMAIN_LOCATION);\n bind_textdomain_codeset(self::TEXT_DOMAIN_NAME, 'UTF-8');\n textdomain(self::TEXT_DOMAIN_NAME);\n putenv('LANG=' . $this->locale);\n putenv('LC_MESSAGES=' . $this->locale);\n $locale = setlocale(LC_MESSAGES, $this->locale);\n\n Logger::get()->info(sprintf('Locale is now %s [%s] (domain \"%s\" at %s)',\n $locale,\n $this->locale,\n self::TEXT_DOMAIN_NAME,\n realpath(self::TEXT_DOMAIN_LOCATION)\n ));\n }", "public function restore_current_locale()\n {\n }", "private function set_locale()\n {\n $plugin_i18n = new MailChimp_WooCommerce_i18n();\n $this->loader->add_action('init', $plugin_i18n, 'load_plugin_textdomain');\n }", "private function setLang(){\n\n\t\tif( isset($_GET['lang']) )\n\t\t\t$lang\t= $_GET['lang'];\n\n\t\telse{\n\t\t\t$sess_lang\t= session('lang');\n\t\t\t$lang\t\t= $sess_lang ? $sess_lang : App::getLocale();\n\t\t}\n\n\t\tsession(['lang'=>$lang]);\n\t\tApp::setLocale( $lang );\n\t}", "public function setLocale($locale) {\n $availableLanguages = $this->languageSettings['available'];\n if (array_key_exists($locale, $availableLanguages)) {\n $locale_code = $locale;\n } else {\n $default = $this->languageSettings['default'];\n $locale_code = $default;\n }\n $session = new SessionManager();\n $session->putParameter('locale', $locale_code);\n }", "public function setDefaultLocale($defaultLocale = null);", "public function setLocale(MvcEvent $e) {\n $translator = $e->getApplication()->getServiceManager()->get('translator');\n $translator->setLocale('ru_RU');\n \n }", "private function registerLocale()\n\t{\n\t\t$this->app->singleton('glottos.locale', function($app) {\n\t\t\treturn new Locale($this->getConfig('default_language_id'), $this->getConfig('default_country_id'));\n\t\t});\n\t}", "public function setLocale($locale)\n {\n $this['config']->set('app.locale', $locale);\n\n $this['translator']->setLocale($locale);\n\n $this['events']->dispatch(new LocaleUpdated($locale));\n }", "protected function _initLocale()\n {\n $this->bootstrap('Cache');\n $this->bootstrap('Log');\n\n $locale = new Zend_Locale();\n\n Zend_Registry::set('Zend_Locale', $locale);\n if (Zend_Registry::get('cache') !== NULL) {\n Zend_Translate::setCache(Zend_Registry::get('cache'));\n }\n\n $defaultLanguage = 'en';\n\n $options = array(\n 'log' => $this->getResource('log'),\n 'logUntranslated' => true,\n 'clear' => true,\n 'reload' => true\n );\n\n $translate = new Zend_Translate(\n 'tmx', APPLICATION_PATH . '/data/language',\n 'auto',\n $options\n );\n $actual = $translate->getLocale();\n\n Zend_Registry::set('Zend_Translate', $translate);\n\n // make the routes translatable\n Zend_Controller_Router_Route::setDefaultTranslator($translate);\n\n if (!$translate->isAvailable($locale->getLanguage())) {\n // not available languages are rerouted to another language\n $translate->setLocale($defaultlanguage);\n }\n\n $translate->getLocale();\n }", "public function setLocale(Request $request, string $locale): void\n {\n Site::setLocale($locale);\n $request->session()->put($this->makeKey($this->localeKey), $locale);\n }", "public function getLocale()\n {\n return 'en';\n }", "public function bootstrapLocale(MvcEvent $event)\n {\n $services = $event->getApplication()->getServiceManager();\n $auth = $services->get('Omeka\\AuthenticationService');\n $translator = $services->get('MvcTranslator');\n\n $locale = null;\n if ($auth->hasIdentity()) {\n // User is logged in.\n $userId = $auth->getIdentity()->getId();\n $services->get('Omeka\\Settings\\User')->setTargetId($userId);\n $locale = $services->get('Omeka\\Settings\\User')->get('locale');\n }\n if (!$locale) {\n $locale = $services->get('Omeka\\Settings')->get('locale');\n }\n if (!$locale) {\n // The translator already loaded the configured locale.\n $locale = $translator->getDelegatedTranslator()->getLocale();\n }\n if (extension_loaded('intl')) {\n \\Locale::setDefault($locale);\n }\n $translator->getDelegatedTranslator()->setLocale($locale);\n\n // Enable automatic translation for validation error messages.\n AbstractValidator::setDefaultTranslator($translator);\n }", "private function setLanguage() {\n//\t\tYii::app()->language = @Yii::app()->user->getState('lang');\n\t}", "function getDefaultLocale();", "private function setLocale()\n {\n $plugin_i18n = new I18n();\n $plugin_i18n->setDomain(Plugin_Name::PLUGIN_ID);\n\n add_action('plugins_loaded', [$plugin_i18n, 'loadPluginTextdomain']);\n }", "private function establishLocale(&$locale)\n {\n if (is_null($locale)) {\n $locale = App::getLocale();\n }\n }", "function default_locale()\n{\n return Config::getDefaultLocale();\n}", "function dev_change_locale( $locale ) {\n\n $dev_locale = filter_input( INPUT_GET, 'dev_lang', FILTER_SANITIZE_STRING );\n\n\tif ( ! empty( $dev_locale ) ) {\n\t\t$locale = $dev_locale;\n\t}\n\n\treturn $locale;\n}", "public function switchLang($locale)\n {\n if( array_key_exists($locale, Config::get('translatable')['locales']) ) {\n\n App::setLocale($locale);\n }\n\n return Redirect::back();\n }", "function setLocale($locale) {\n\t\treturn $this->setData('locale', $locale);\n\t}", "public function getDefaultLocale();", "public static function updateLocale($lang_code){\n $lang = Config::get('app.locale');\n if(isset($lang_code)){\n $lang = $lang_code;\n }\n App::setLocale($lang);\n }", "protected function setLanguage() {\r\n\t\t$this->language = $GLOBALS['TSFE']->config['config']['language'];\r\n\t}", "protected function initializeL10nLocales() {}", "public static function init()\n {\n if ($DefaultLocale = Application::$Configuration->Get('DefaultLocale')) {\n Localization::$CurrentLocale = $DefaultLocale;\n }\n if ($locale = Application::$Request['lng']) {\n Localization::$CurrentLocale = $locale;\n Application::$Session['locale'] = $locale;\n } elseif ($locale = Application::$Session['locale']) {\n Localization::$CurrentLocale = $locale;\n }\n // Loading locale strings\n $localeDir = Application::$Configuration->ProjectPath . 'Localization/' . Localization::$CurrentLocale;\n if (is_dir($localeDir)) {\n $localeDirHndl = opendir($localeDir);\n while ($localeFile = readdir($localeDirHndl)) {\n if (!in_array($localeFile, array('.', '..'))) {\n require_once($localeDir . '/' . $localeFile);\n }\n }\n }\n }", "protected function initializeCurrentLocale() {\n $locale = null;\n\n if ($this->negotiator) {\n $locale = $this->negotiator->getLocale($this);\n }\n\n if (!$locale) {\n $locale = $this->getDefaultLocale();\n }\n\n $this->setCurrentLocale($locale);\n }", "public function setLocaleOverride(ContextInterface $ctx, SetLocaleOverrideRequest $request): void;", "public function changeLocale($current_route){\n\t\tif(strlen($current_route) <= 2){\n\t\t\t$CountryLanguage = CountryLanguage::where('wp_language', $current_route)->first();\n\t\t\tif(isset($CountryLanguage) && !empty($CountryLanguage->language_code)){\n\t\t\t\tConfig::set('app.locale', $CountryLanguage->language_code);\n\t\t\t}\n\t\t}\n\t}", "private function _initInternationalization()\n {\n $ER = error_reporting(~ E_NOTICE & ~ E_STRICT);\n if(function_exists('date_default_timezone_set')){\n $timezone = App::config()->project->timezone;\n // Set default timezone, due to increased validation of date settings\n // which cause massive amounts of E_NOTICEs to be generated in PHP 5.2+\n date_default_timezone_set(empty($timezone) ? date_default_timezone_get() : $timezone);\n }\n error_reporting($ER);\n $i18n = new App_I18n();\n $languages = $i18n->getSiteLanguages();\n $default_request_lang = 'en';\n $default_site_locale = 'en_US';\n foreach($languages as $lang){\n if($lang['is_active'] and $lang['is_default'] > 0){\n $default_request_lang = $lang['request_lang'];\n $default_site_locale = $lang['locale'];\n break;\n }\n }\n Zend_Locale::setDefault($default_request_lang);\n $i18n->setLocale(new Zend_Locale($default_request_lang));\n App::setI18N($i18n);\n $this->_language_identificator = $default_request_lang;\n }", "public function setLocale(string $locale = null)\n {\n $locales = [];\n if (empty($locale)) {\n array_push(\n $locales,\n 'en-EN.utf8',\n 'en_EN.utf8',\n 'en-EN',\n 'en-US.utf8',\n 'en_US.utf8',\n 'en-US',\n 'en',\n 'en_US'\n );\n\n if (!defined('BBN_LOCALE')) {\n // No user detection for CLI: default language\n if ($this->_mode === 'cli') {\n if (defined('BBN_LANG')) {\n $lang = BBN_LANG;\n }\n }\n else {\n $user_locales = self::detectLanguage();\n if (!defined('BBN_LANG') && $user_locales) {\n if (strpos($user_locales[0], '-')) {\n if ($lang = X::split($user_locales[0], '-')[0]) {\n define('BBN_LANG', $lang);\n }\n }\n elseif (strpos($user_locales[0], '_')) {\n if ($lang = X::split($user_locales[0], '_')[0]) {\n define('BBN_LANG', $lang);\n }\n }\n elseif ($user_locales[0]) {\n define('BBN_LANG', $user_locales[0]);\n }\n }\n\n if (!defined('BBN_LANG')) {\n throw new \\Exception(\"Impossible to determine the language\");\n }\n\n $lang = BBN_LANG;\n }\n\n if (isset($lang)) {\n array_unshift(\n $locales,\n $lang . '-' . strtoupper($lang) . '.utf8',\n $lang . '_' . strtoupper($lang) . '.utf8',\n $lang . '-' . strtoupper($lang),\n $lang\n );\n\n if (!empty($user_locales)) {\n array_unshift($locales, ...$user_locales);\n }\n }\n }\n }\n elseif (!strpos($locale, '-') && !strpos($locale, '_')) {\n if ($locale === 'en') {\n array_unshift(\n $locales,\n 'en_US.utf8',\n 'en-US.utf8',\n 'en_US',\n 'en-US'\n );\n }\n\n array_unshift(\n $locales,\n strtolower($locale) . '-' . strtoupper($locale) . '.utf8',\n strtolower($locale) . '_' . strtoupper($locale) . '.utf8',\n strtolower($locale) . '-' . strtoupper($locale),\n strtolower($locale)\n );\n }\n else {\n $locales[] = $locale;\n }\n\n if ($confirmed = $this->_tryLocales($locales)) {\n if (!defined('BBN_LOCALE')) {\n define('BBN_LOCALE', $confirmed);\n }\n\n $this->_locale = $confirmed;\n if (!isset($lang)) {\n $lang = X::split(X::split($this->_locale, '-')[0], '_')[0];\n }\n\n putenv(\"LANG=\".$lang);\n putenv(\"LC_MESSAGES=\".$this->_locale);\n setlocale(LC_MESSAGES, $this->_locale);\n }\n else {\n throw new \\Exception(\"Impossible to find a corresponding locale on this server for this app\");\n }\n }", "public function handle(): void\n {\n app(\"translation\")->setLocale(\"tr\");\n }", "public function init()\n {\n// $lang = $this->getRequest()->getParam('lang');\n $lang = Zend_Registry::isRegistered('lang') ? Zend_Registry::get('lang') : '';\n\n if (!$lang) {\n $locale = new Zend_Locale('auto');\n $lang = array_key_exists($locale->getLanguage(), $this->_locales)\n ? $locale->getLanguage() : $this->_defaultLanguage;\n }\n\n if (!array_key_exists($lang, $this->_locales)) {\n $lang = $this->_defaultLanguage;\n }\n\n $this->setTranslatorLang($lang);\n }", "public static function setLocale(Locale $locale)\n {\n self::$locale = $locale;\n }", "public function setTranslatableLocale($locale) {\n $this->locale = $locale;\n }", "public function system_language_auto(){\n\t\t// Get my current\n\t\t\t$tld = $this->zajlib->tld;\n\t\t\t$subdomain = $this->zajlib->subdomain;\n\t\t\tunset($_GET['locale']);\n\t\t\tunset($_GET['disable_locale_cookie']);\n\t\t\tunset($_COOKIE['ofw_locale']);\n\t\t// No setting means that default is set\n\t\t\t$this->zajlib->tld = 'com';\n\t\t\t$this->zajlib->subdomain = 'www';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical($this->zajlib->lang->get_default_locale(), $setting);\n\t\t// Set my tld (should be stronger than query string)\n\t\t\t$this->zajlib->tld = 'hu';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('hu_HU', $setting);\n\t\t// Set my subdomain (should be stronger than tld)\n\t\t\t$this->zajlib->subdomain = 'en';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('en_US', $setting);\n\t\t// Set my query string (should be strong than tld or subdomain)\n\t\t\t$_GET['locale'] = 'fr_FR';\n\t\t\t$setting = $this->zajlib->lang->auto();\n\t\t\tzajTestAssert::areIdentical('fr_FR', $setting);\n\t\t// Reset tld and subdomain and other cleanup\n\t\t\t$this->zajlib->subdomain = $subdomain;\n\t\t\t$this->zajlib->tld = $tld;\n\t}", "function setWpLocale($lang) {\n\t$localLocale = $_COOKIE['dk_locale'];\n\t$currentSite = get_current_blog_id();\n\t$siteDetail = get_blog_details($currentSite);\n\n\tif ($localLocale == 'en_CA' || $currentSite == '3') {\n\t\t$val = 'en_CA';\n\t\theader( 'Location: '. $siteDetail->siteurl);\n\t\tsetcookie(\"dk_locale\", $val, time()+3600*24);\n\t\tsetlocale(LC_MONETARY, $val);\n\n\t\treturn $val;\n\t} else if($localLocale == 'fr_CA' || $currentSite == '2') {\n\t\t$val = 'fr_CA';\n\t\theader( 'Location: '. $siteDetail->siteurl);\n\t\tsetcookie(\"dk_locale\", $val, time()+3600*24);\n\t\tsetlocale(LC_MONETARY, $val);\n\n\t\treturn $val;\n\t} else {\n\t\tsetcookie(\"dk_locale\", $lang, time()+3600*24);\n\t\tsetlocale(LC_MONETARY, $lang);\n\t\treturn $lang;\n\t}\n\t\n}", "protected function _initLocale() {\n Zend_Locale::setDefault('zh_HK');\n }", "public function setTranslatableLocale($locale)\n {\n $this->locale = $locale;\n }", "public function setTranslatableLocale($locale)\n {\n $this->locale = $locale;\n }", "private function applyLocaleSettings()\n {\n LocaleFilter::MANUALLY_ENABLED_HERE;\n $localeSubscriber = new LocaleSubscriber();\n $localeSubscriber->setContainer($this->getContainer());\n $localeSubscriber->enableLocaleFilter($this->locale);\n // translate to current locale\n $this->getContainer()->get('stof_doctrine_extensions.listener.translatable')->setTranslatableLocale($this->locale);\n }", "public function __construct($locale = 'en_UK')\n {\n $this->locale = $locale;\n }", "protected function setDefaultLocale($locale)\n {\n $this->defaultLocales = static::getLocaleSplitted($locale);\n }", "public function init() \n\t{\n\t\t$sLang = $this->getRequest()->getParam('lang');\n\t\t\n\t\tif(!empty($_SESSION['lang']) && !empty($sLang) && $_SESSION['lang'] != $sLang) {\n\t\t\tunset ($_SESSION['lang']);\n\t\t\tunset ($_SESSION['languages']);\n\t\t}\n\t\t\n\t\tif(!empty($sLang)) {\n\t\t\t$_SESSION['lang'] = $sLang;\n\t\t\tswitch ($sLang) {\n\t\t\t\tcase 'en':\n\t\t\t\t\t$_SESSION['languages'] = 'English';\n\t\t\t\tbreak;\n\t\t\t\tcase 'ru':\n\t\t\t\t\t$_SESSION['languages'] = 'Russian';\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$_SESSION['languages'] = 'English';\n\t\t\t}\n\t\t}\t\n\t\tif(! array_key_exists($sLang, $this->_aLocales)) {\n\t\t\t$sLang = $this->_sDefaultLanguage;\n\t\t}\n\n\t\t// generate path to the gettext language file\n\t\t$sLanguageFilePath = $this->_sLanguagesDirectoryPath . '/'. $sLang . '.php';\n\t\tif(! file_exists($sLanguageFilePath)) {\n\t\t\t$sLanguageFilePath = $this->_sLanguagesDirectoryPath . '/' . $this->_sDefaultLanguage . '.php';\n\t\t\t$sLang = $this->_sDefaultLanguage;\n\t\t}\n\n\t\t// get current locale by current language\n\t\t$sLocale = $this->_aLocales[$sLang];\n\n\t\t// setup translate object\n\t\t$oTranslate = new Zend_Translate('array', $sLanguageFilePath, $sLang);\n\t\t\n\t\tZend_Registry::set('Zend_Translate', $oTranslate);\n\t\tZend_Validate_Abstract::setDefaultTranslator($oTranslate);\n\t\t\n\n\t\t$this->_actionController->_locale = $sLocale;\n\t\t$this->_actionController->_lang = $sLang;\n\t\t$this->_actionController->_translate = $oTranslate;\n\n\t\t$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');\n\t\t$viewRenderer->view->locale = $sLocale;\n\t\t$viewRenderer->view->lang = $sLang;\n\t\t$viewRenderer->view->translate = $oTranslate;\n\t}", "public function setLocale($locale) {\n $this->__locale__ = func_num_args() > 1? func_get_args(): $locale;\n return $this;\n }", "public function set_locale($locale) {\r\n $locale = setlocale(LC_ALL, $locale);\r\n // the locale change was unsuccessful\r\n if ($locale === false) {\r\n return false;\r\n }\r\n $this->locale = $locale;\r\n Application::config()->locale = $this->locale;\r\n return true;\r\n }", "public static function changeLang($lang) {\n //App::setLocale($lang);\n app()->setLocale($lang);\n }", "public function setLocale($locale)\n {\n $previous = app('url')->previous();\n $next = str_replace(url('/'), '', $previous);\n $tmp = explode('/', $next);\n array_shift($tmp);\n array_shift($tmp);\n $next = $locale . '/' . implode('/', $tmp);\n\n return redirect($next);\n }", "public function setLocale($locale)\n\t {\n\t \t $this->json['params'][$this->account]['locale'] = $locale;\n\t \t \n\t \t return $this;\n\t }", "public function setLocaleManager(LocaleManagerInterface $localeManager);" ]
[ "0.7523601", "0.7406689", "0.7375916", "0.7262457", "0.7259713", "0.7111117", "0.70815027", "0.70719916", "0.704677", "0.6906252", "0.69012874", "0.6872902", "0.68638027", "0.6849639", "0.6819131", "0.68163747", "0.68025166", "0.68016076", "0.679265", "0.67859286", "0.6774652", "0.67582667", "0.675433", "0.67084646", "0.6689397", "0.6672869", "0.667225", "0.6610203", "0.6610042", "0.6604109", "0.6603699", "0.65934026", "0.6589108", "0.65608954", "0.6541209", "0.65341175", "0.6512576", "0.65001106", "0.64568335", "0.64518267", "0.643125", "0.64179975", "0.64174724", "0.640039", "0.63933367", "0.63885665", "0.63830024", "0.6377855", "0.6375683", "0.6346083", "0.63326406", "0.6327387", "0.6327264", "0.6304064", "0.6296157", "0.6272204", "0.62704533", "0.625669", "0.6254276", "0.6251912", "0.62265223", "0.6213006", "0.6212317", "0.621033", "0.62056327", "0.62003213", "0.6190635", "0.6185384", "0.6184301", "0.617417", "0.6167565", "0.61460304", "0.6144297", "0.61411387", "0.6137593", "0.613723", "0.61138356", "0.61131185", "0.61101615", "0.61040735", "0.61013573", "0.60895747", "0.60786194", "0.6073916", "0.6070161", "0.6051728", "0.60416144", "0.6034834", "0.6023453", "0.6018119", "0.6018119", "0.600344", "0.5985661", "0.59848666", "0.5966102", "0.5947416", "0.59433275", "0.59259707", "0.59207577", "0.5908912", "0.5896406" ]
0.0
-1
Create a new job instance.
public function __construct($data) { $this->data = $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "abstract public function makeJob();", "abstract public function makeJob();", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "public function createJobExecution(JobInstance $job)\n {\n return new JobExecution();\n }", "public function setJobName(string $jobName): JobInstanceInterface;", "public function __construct(Job $job)\n {\n $this->job = $job;\n }", "public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function create(JobRequest $jobRequest)\n {\n $job = new Job();\n\n $job->business_person = $jobRequest->business_person;\n $job->principal_phone = $jobRequest->principal_phone;\n $job->optional_phone = $jobRequest->optional_phone;\n $job->init_date = $jobRequest->init_date;\n $job->finish_date = $jobRequest->finish_date;\n $job->city = $jobRequest->city;\n\n $job->save();\n\n return compact('job');\n }", "public function createNewJob($jobBody, $queue)\n {\n $job = new Job($jobBody, $queue);\n\n if ($this->jobHasBeenAddedFromOutside($job)) {\n $this->addMissingJobTimeData($job);\n }\n\n return $job;\n }", "protected function createJobFromPayload($payload = [])\n {\n return new Job([\n 'title' => $payload['jobTitle'],\n 'name' => $payload['jobTitle'],\n 'description' => $payload['descriptionFragment'],\n 'url' => $payload['jobViewUrl'],\n 'sourceId' => $payload['jobListingId'],\n 'location' => $payload['location'],\n 'industry' => $payload['jobCategory']\n ]);\n }", "public function created(Job $job)\n {\n //\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "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}", "static public function factory($job, $conn, $handle, $initParams=array())\n {\n if (empty($initParams['path'])) {\n $paths = explode(',', NET_GEARMAN_JOB_PATH);\n $file = null;\n\n foreach ($paths as $path) {\n $tmpFile = $path . '/' . $job . '.php';\n\n if (file_exists(realpath($tmpFile))) {\n $file = $tmpFile;\n break;\n }\n }\n }\n else {\n $file = $initParams['path'];\n }\n\n if ( ! file_exists($file) ) {\n throw new Net_Gearman_Job_Exception('Invalid Job class file: ' . (empty($file) ? '<empty>' : $file));\n }\n\n include_once $file;\n\n if (empty($initParams['class_name'])) {\n $class = NET_GEARMAN_JOB_CLASS_PREFIX . $job;\n }\n else {\n $class = $initParams['class_name'];\n }\n\n if (!class_exists($class)) {\n throw new Net_Gearman_Job_Exception('Invalid Job class: ' . (empty($class) ? '<empty>' : $class) . ' in ' . (empty($file) ? '<empty>' : $file) );\n }\n\n $instance = new $class($conn, $handle, $initParams);\n if (!$instance instanceof Net_Gearman_Job_Common) {\n throw new Net_Gearman_Job_Exception('Job is of invalid type: ' . get_class($instance));\n }\n\n return $instance;\n }", "public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }", "private function createJob (string $cronTab) : CronJobInterface\n {\n return new class ($cronTab) implements CronJobInterface\n {\n /** @var string */\n private $cronTab;\n\n\n /**\n */\n public function __construct (string $cronTab)\n {\n $this->cronTab = $cronTab;\n }\n\n\n /**\n */\n public function getCronTab () : string\n {\n return $this->cronTab;\n }\n\n\n /**\n */\n public function getName () : string\n {\n return \"My Job\";\n }\n\n\n /**\n */\n public function execute (BufferedSymfonyStyle $io) : CronStatus\n {\n return new CronStatus(true);\n }\n };\n }", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "public function getNewJob() {\n # we can grab a locked job if we own the lock\n $rs = $this->runQuery(\"\n SELECT id\n FROM \" . self::$jobsTable . \"\n WHERE queue = ?\n AND (run_at IS NULL OR NOW() >= run_at)\n AND (locked_at IS NULL OR locked_by = ?)\n AND failed_at IS NULL\n AND attempts < ?\n ORDER BY created_at DESC\n LIMIT 10\n \", array($this->queue, $this->name, $this->max_attempts));\n\n // randomly order the 10 to prevent lock contention among workers\n shuffle($rs);\n\n foreach ($rs as $r) {\n $job = new DJJob($this->name, $r[\"id\"], array(\n \"max_attempts\" => $this->max_attempts,\n \"fail_on_output\" => $this->fail_on_output\n ));\n if ($job->acquireLock()) return $job;\n }\n\n return false;\n }", "public function store(Request $request): JobResource\n {\n $jobTypes = Factory::listTypes();\n $validValues = $this->validate(\n $request,\n [\n 'sample_code' => ['filled', 'string', 'alpha_dash'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'string', Rule::in($jobTypes->pluck('id'))],\n 'parameters' => ['filled', 'array'],\n ]\n );\n $parametersValidation = $this->_prepareNestedValidation(\n Factory::validationSpec($validValues['type'], $request)\n );\n $validParameters = $this->validate($request, $parametersValidation);\n $type = $validValues['type'];\n $validParameters = $validParameters['parameters'] ?? [];\n $job = Job::create(\n [\n 'sample_code' => $validValues['sample_code'] ?? null,\n 'name' => $validValues['name'],\n 'job_type' => $type,\n 'status' => Job::READY,\n 'job_parameters' => [],\n 'job_output' => [],\n 'log' => '',\n 'user_id' => \\Auth::guard('api')->id(),\n ]\n );\n $job->setParameters(Arr::dot($validParameters));\n $job->save();\n $job->getJobDirectory();\n\n return new JobResource($job);\n }", "public function __construct(JobPoster $job)\n {\n $this->job = $job;\n }", "public function create()\n {\n // Display form to create a new job\n return view('jobs.create');\n }", "public function __construct(Job $job)\n {\n parent::__construct();\n\n $this->job = $job;\n }", "protected function getJobInstance(): JobInstance\n {\n if (!isset($this->jobInstance)) {\n $id = $this->argument('instanceId');\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n $this->jobInstance = JobInstance::findOrFail(intval($id));\n }\n\n return $this->jobInstance;\n }", "public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "public function create() {}", "public function __construct()\n {\n $this->jobService = new JobService();\n }", "public function create()\n {\n $job=new Job;\n return view('jobs.create',[\n 'job'=>$job,]);\n //\n }", "public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }", "public function create()\n {\n return view('admin.job.create');\n }", "public function createAction(Request $request)\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(){}", "public function create(Request $request) {\n $jobPost = new Job();\n $jobPost->user_id = Auth::user()->id;\n\n // Substract one credit from user's subscription\n $userPlans = Auth::user()->plans;\n\n foreach ($userPlans as $plan) {\n if ($plan->credits > 0) {\n $plan->credits = $plan->credits - 1;\n $plan->save();\n }\n }\n\n $jobPostData = $request::input('jobPost');\n foreach ($jobPostData as $key => $value) {\n $jobPost[$key] = $value;\n }\n\n $jobPost->save();\n\n return $jobPost;\n }", "public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }", "public function create()\n {\n return view('profile.job.create');\n }", "public function create()\n {\n return view('job.add_job');\n }", "public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create()\n {}", "public function createTask()\n {\n return factory($this->model)->create();\n }", "public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createJob(array $settings, $metaData = [], $priority = 0)\n {\n return $this->client->createJob([\n 'Role' => config('media-converter.iam_arn'),\n 'Settings' => $settings,\n 'Queue' => config('media-converter.queue_arn'),\n 'UserMetadata' => $metaData,\n 'StatusUpdateInterval' => $this->getStatusUpdateInterval(),\n 'Priority' => $priority,\n ]);\n }", "public function addNewJobOpo()\n {\n }", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public static function createJob($mysqli,$name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate){\n $insert = \"INSERT INTO job (job_name,job_desc,cust_email,trade_name,area,preferred_cost,date_needed,offer_end_date) VALUES (?,?,?,?,?,?,?,?)\";\n $stmt = $mysqli->prepare($insert);\n $stmt->bind_param('sssssiss', $name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate); \n $stmt->execute();\n $stmt->close();\n $job = new Job(['JobName'],['JobDesc'],['Email'],['Trade'],['Area'],['JobCost'],['JobDate'],['EstDate']);\n return $job;\n }", "public function store(Request $request)\n {\n $job = new Job();\n $job->title = $request->title;\n $job->description = $request->description;\n $job->company_name = $request->company_name;\n $this->repo->save($job);\n return new JobsResources($job);\n }", "public function create()\n {\n $fields = Field::all();\n $jobTypes = config('user.job_type');\n\n return view('job.create', [\n 'fields' => $fields,\n 'jobTypes' => $jobTypes,\n ]);\n }", "public static function create($queue, $class, array $data = null, $run_at = 0)\n {\n $id = static::createId($queue, $class, $data, $run_at);\n\n $job = new static($queue, $id, $class, $data);\n\n if ($run_at > 0) {\n if (!$job->delay($run_at)) {\n return false;\n }\n } elseif (!$job->queue()) {\n return false;\n }\n\n Stats::incr('total', 1);\n Stats::incr('total', 1, Queue::redisKey($queue, 'stats'));\n\n return $job;\n }", "public function create()\n {\n return $this->objectManager->create($this->className);\n }", "public function create() {\r\n }", "public function create()\n {\n //TODO\n }", "public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }", "public function __construct(int $status, Job $job)\n {\n $this->status = $status;\n $this->job = $job;\n\n $this->updateTask($this->status, $this->job);\n }", "public function create()\n {\n return new $this->class;\n }", "public function create() {\n }", "public function create() {\n }", "public function create() {\n\t \n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create()\n {\n return view('admin.jobs.create');\n }", "public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }", "public function run()\n {\n Job::factory()->count(100)->create();\n \n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n {\n return view('admin.jobs.create');\n\n }", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}", "public function createJobWithSalesPrices(array $inputData): Job;", "public function create(Job $job)\n {\n $states = $job->prepareStates();\n $countries = $job->prepareCountries();\n $hours = $job->prepareHours();\n $minutes = $job->prepareMinutes();\n $ampm = $job->prepareAmpm();\n $open = $job->prepareOpen();\n return view('companies.create', compact(['states','countries','hours','minutes','ampm','open']));\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }" ]
[ "0.6920272", "0.6905722", "0.6905722", "0.6869542", "0.6808916", "0.65271425", "0.65184414", "0.64918077", "0.6489135", "0.6468623", "0.6425879", "0.64058304", "0.63938236", "0.63899404", "0.63753885", "0.6304669", "0.6256802", "0.6241474", "0.620155", "0.61789167", "0.60741454", "0.60695714", "0.6047274", "0.60462874", "0.6028435", "0.6027225", "0.6021894", "0.60214204", "0.59231514", "0.58802027", "0.5874528", "0.58576655", "0.58098435", "0.5805053", "0.58005697", "0.5789109", "0.57851434", "0.57767034", "0.5775661", "0.5755982", "0.5702295", "0.5683395", "0.5683395", "0.5683395", "0.5683376", "0.5679739", "0.5678496", "0.5659406", "0.56529284", "0.56470996", "0.5634536", "0.5632702", "0.5632702", "0.5628215", "0.5625956", "0.5621957", "0.56141514", "0.56048644", "0.5604791", "0.5601149", "0.5601067", "0.5599652", "0.5595376", "0.55932534", "0.55932534", "0.55932015", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55362236", "0.5534658", "0.5531583", "0.55224913", "0.5522197", "0.5517534", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.5514842", "0.549955", "0.5497938", "0.54876786", "0.54876786", "0.54876786" ]
0.0
-1
Test that the index route returns a rendered response containing the text 'homepage'
public function testGetHomepage() { $response = $this->runApp('GET', '/'); $this->assertEquals(200, $response->getStatusCode()); $this->assertContains('homepage', (string)$response->getBody()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testIndex()\n {\n $client = static::createClient();\n\n $client->request('GET', '/');\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode(), 'la route \"homepage\" ne fonctionne plus.');\n }", "public function test_show_homepage()\n {\n $response = $this->get('/');\n $response->assertStatus(200);\n }", "public function homepageTest()\n {\n $response = $this->get('/');\n $response->assertStatus(200);\n }", "public function testHomepage()\n {\n\n $client = $this->createClient();\n $router = self::$kernel->getContainer()->get('router');\n $router->generate('homepage');\n\n $crawler = $client->request('GET', $router->generate('homepage'));\n $this->assertTrue($crawler->filter('html:contains(\"hello\")')->count() > 0);\n }", "public function testIndex()\n {\n $this->get('/')\n ->assertSuccessful()\n ->assertViewIs('layouts.home.index')\n ->assertSee('Welcome to a E-Ticket System');\n }", "public function testFrontendHome()\n {\n $this->visit('/')->seeStatusCode(200);\n }", "public function testIndex()\n {\n $this->call('GET', '/');\n $this->assertResponseOk();\n }", "public function testHomepage()\n {\n $resp = $this->client->get('/');\n $this->assertEquals('200', $resp->getStatusCode(), 'top page status code');\n $this->assertStringContainsString(\n 'Welcome to the <strong>Symfony Demo</strong> application',\n $resp->getBody()->getContents()\n );\n }", "public function testHome()\n {\n $response = $this->get(route('home'));\n\n $response->assertStatus(200);\n }", "public function testIndex()\n {\n $this->get(route('index'))\n ->assertResponseStatus(200);\n }", "public function testIndex()\n\t{\n\t\t$client = static::createClient();\n\n\t\t$crawler = $client->request('GET', '/');\n\n\t\t$this->assertEquals(200, $client->getResponse()->getStatusCode());\n\t}", "public function test_home_page()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function test_home_page()\n {\n $response = $this->get('/');\n $response->assertStatus(200);\n }", "public function testIndex()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testIndex()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testIndex()\n {\n $response = $this->get('/');\n $response->assertStatus(200);\n }", "public function testHomeView()\n\t{\n\t\t$response = $this->call('GET', '/');\n\t\t$view = $response->original;\n\t\t\n\t\t$this->assertEquals('home.index', $view['name']);\n\t}", "public function testHomepage()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n $response->see('Welcome to my library');\n }", "public function test_home()\n {\n $response = $this->get('/');\n $response->assertResponseOk();\n }", "public function test_it_can_see_home()\n {\n $response = $this->get('/');\n $response->assertSeeText('Tin đặc biệt');\n $response->assertSeeText('Tìm kiếm nâng cao');\n $response->assertStatus(200);\n }", "public function testIndexRouteIsWorking()\n {\n $client = static::createClient();\n $client->request('GET', '/');\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertSelectorExists('.profit_amount');\n $this->assertSelectorTextContains('.navbar-brand', 'Margin Calculator');\n\n return null;\n }", "public function testHomePage()\n\t{\n\t\t$crawler = $this->client->request('GET', '/');\n\n\t\t$this->assertTrue($this->client->getResponse()->isOk());\n\t}", "public function testHome()\n {\n // home画面\n $response = $this->get('/home');\n // レシピデータ取得\n $recipe = \\App\\Models\\Recipe::get();\n // レシピデータがあるか\n $this->assertNotNull($recipe);\n // ステータス、表示確認\n $response->assertStatus(200)\n ->assertViewIs('home')\n ->assertSee('糖質制限商品')\n ->assertSee('オススメ商品')\n ->assertSee('レシピ一覧')\n ->assertSee('料理名')\n ->assertSee('糖質量')\n ->assertSee('評価')\n ->assertSee('詳細');\n }", "public function test_home(){\n $response = $this->get('/');\n $response->assertResponseStatus(200);\n }", "public function testHomePageReturns200()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testHomePageAvailability()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testSeeHomepageTest()\n {\n $response = $this->actingAs(\\App\\User::firstOrFail())->get('/home');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function testIndex()\n {\n $client = static::createClient();\n\n $crawler = $client->request('GET', '/');\n\n $this->assertContains('Hello World', $client->getResponse()->getContent());\n }", "public function testHomePageIsWorking() {\n $this->client->request('GET', '/');\n\n Assert::true($this->client->getResponse()->isOk());\n }", "public function testIndex()\n {\n $client = static::createClient();\n $crawler = $client->request('GET', '/');\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertCount(1, $crawler->filter('h1'));\n $this->assertEquals(1, $crawler->filter('html:contains(\"Trick List\")')->count());\n }", "public function testRootViewIs()\n {\n $response = $this->get(route('root'));\n $response->assertViewIs('static_pages.home');\n }", "public function testRootGetRoute()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n $response->assertSee('Enter url to crawl');\n $response->assertSee('Last Pages Crawled');\n }", "public function testHomeGetDefault()\n {\n $env = Environment::mock(\n [\n 'REQUEST_METHOD' => 'GET',\n 'REQUEST_URI' => '/home'\n ]\n );\n\n $req = Request::createFromEnvironment($env);\n $this->app->getContainer()['request'] = $req;\n\n $response = $this->app->run(true);\n\n $this->assertInstanceOf('\\Slim\\Http\\Response', $response);\n\n $this->assertSame(200, $response->getStatusCode());\n $this->assertRegExp(\n '/text\\/html;\\s*charset=utf-8/i',\n $response->getHeader('Content-type')[0]\n );\n\n $this->assertNotNull($response->getBody());\n }", "public function homepage()\n {\n return new Response('<html><body><h1>Hello World</h1></body></html>');\n }", "public function testHomeGet()\n {\n\n $response = $this->get('/');\n\n $response->assertStatus(200);\n $response->assertSeeText(\"Intive FDV test\");\n $response->assertSeeText(\"ACME RENTAL'S BIKES\");\n $response->assertSeeText(\"Please input the Quantity of bikes you may want to rent\");\n $response->assertSeeText(\"# Bikes\");\n $response->assertSeeText(\"Rent\");\n $response->assertSessionMissing('inputBike');\n $response->assertViewIs(\"home\");\n\n $this->assertTrue($response->isOk(), \"Wrong params\");\n\n }", "public function testIndex(): void\n {\n $response = $this->client->request('GET', '/');\n $this->assertEquals(200, $response->getStatusCode());\n\n $body = $response->getBody();\n $content = $body->getContents();\n\n /*\n * Match the title of the page.\n */\n $this->assertRegExp('/<title>MVC Design Pattern!<\\/title>/', $content);\n\n /*\n * Match the header of the page.\n *\n * <h1>An example of the Model View Controller - Design Pattern.</h1>\n */\n $this->assertRegExp('/<h1>[a-zA-Z -.]+<\\/h1>/', $content);\n\n /*\n * Match all cards.\n */\n $re = '/<div class=\"card\">/';\n $matches = [];\n\n preg_match_all($re, $content, $matches);\n\n $this->assertEquals(6, count($matches[0]));\n\n return;\n }", "public function testIndexPage()\n {\n $this->visit('/')\n ->see('Read a Blog')\n ->see('Admin')\n ->see('Sign in')\n ->dontSee('Logout');\n }", "public function testWelcomePage()\n {\n $response = $this->get('/');\n $response->assertStatus(200);\n }", "public function clientTest(): Response\n {\n return $this->templating->renderResponse('client/index.html.twig');\n }", "public function index()\n {\n return response()->json(\n ['data' => 'This is a test homepage'],\n Response::HTTP_ACCEPTED\n );\n }", "public function testWelcome()\n {\n $response = $this->get('/');\n\n $response->assertOk();\n }", "public function testIndex(): void\n {\n $response = $this\n ->actingAs($this->user)\n ->get('/');\n $response->assertViewIs('home');\n $response->assertSeeText('Сообщения от всех пользователей');\n }", "public function testLandingStatusAndView()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200, \"'/' should return a status 200\");\n $response->assertViewIs('welcome', \"'/' should return the 'welcome' view\");\n }", "public function testIfIndexPageRenderTemplate()\n {\n $response = $this->get('/customers');\n\n $response->assertViewIs('customers.index');\n }", "public function index() : Response\n {\n return $this->output( \"home\" );\n }", "public function testIndex()\n\t{\n\t\t// correct route for posts\n\t\t$this->call('GET', '/api/posts');\n\t}", "public function testMainControllerIndexReturnsResponse()\n {\n $streamMock = $this->getMock('Psr\\Http\\Message\\StreamInterface');\n $requestMock = $this->getMock('Psr\\Http\\Message\\ServerRequestInterface');\n $responseMock = $this->getMock('Psr\\Http\\Message\\ResponseInterface');\n $twigMock = $this->getMock('Twig_Environment');\n\n $streamMock\n ->expects($this->once())\n ->method('write')\n ->with('<h1>Hello, World! ;D</h1>');\n\n $responseMock\n ->expects($this->once())\n ->method('getBody')\n ->will($this->returnValue($streamMock));\n\n $twigMock\n ->expects($this->once())\n ->method('render')\n ->with($this->equalTo('index.html'), $this->equalTo(['smiley' => ';D']))\n ->will($this->returnValue('<h1>Hello, World! ;D</h1>'));\n\n $controller = new MainController;\n $controller->setTemplateDriver($twigMock);\n\n $response = $controller->index($requestMock, $responseMock);\n\n $this->isInstanceOf('Psr\\Http\\Message\\Response', $response);\n }", "public function testStartView()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n $response->assertSee('Log in to play');\n }", "public function testIndex()\n {\n $this->visit('/')\n ->see('STUDENT MONEY ASSISTANCE');\n }", "public function testHomepage()\n {\n $this->visit('/') //routes\n ->see('Laravel 5');\n }", "public function test_welcome()\n {\n $this->get('/admin/home')\n ->assertStatus(200)\n ->assertSee('INICIO en el lado del administrador.');\n }", "public function index(): Response\n {\n return $this->render(\"home/index.html.twig\");\n }", "public function testIndexActionCanBeAccessed()\n\t{\n\t\t$this->dispatch('/');\n\t\t$this->assertResponseStatusCode(200);\n\t\t$this->assertModuleName('DEC');\n\t\t$this->assertControllerName('DEC\\Controller\\Index');\n\t\t$this->assertControllerClass('IndexController');\n\t\t$this->assertMatchedRouteName('home');\n\t}", "public function test_project_home()\n {\n $response = $this->get('/project');\n $response->assertStatus(200);\n }", "public function testLeaseIndexFrontEnd()\n {\n $this->get(route('lease'))->assertStatus(200);\n }", "public function test_home()\n {\n $user=$this->user;\n $this->actingAs($user);\n $response = $this->get('/');\n\n $response->assertSee('Dashboard');\n $response->assertStatus(200);\n }", "public function testIndex()\n {\n Page::create([\n 'slug' => 'index',\n 'title' => 'Test Index',\n ]);\n $this->get('/')->assertStatus(200)->assertSee('Test Index');\n }", "public function testHome()\n {\n $user = User::find($this->user_id);\n $response = $this->actingAs($user)->get('/home');\n $response->assertStatus(200);\n }", "public function test_shoppers_index_page_is_rendered()\n {\n $shopper = Shopper::withoutEvents(function () {\n return Shopper::factory()->create();\n });\n\n $this->actingAs($shopper);\n\n $response = $this->get(route('shoppers.index'));\n\n $response->assertStatus(200);\n }", "public function testIndex()\n {\n $this->getBrowser()->\n getAndCheck('partenaire', 'index', '/partenaire/index', 404)\n ;\n }", "public function testHomePageAndChangeColorPage()\n {\n $client = $this->makeClient();\n $client->request('GET', '/');\n $this->assertStatusCode(200, $client);\n }", "public function testRootOK()\n {\n $response = $this->get('/');\n $response->assertStatus(200);\n }", "public function testBackendHome()\n {\n $user = factory(App\\User::class)->create();\n \n $route = $this->actingAs($user);\n $route->visit('/home');\n $route->seeStatusCode(200);\n }", "public function testStaticPagesReturn200()\n {\n // Child-Pugh\n $response = $this->fr()->get('/child-pugh');\n $response->assertStatus(200);\n\n // Cirrhose\n $response = $this->fr()->get('/cirrhose');\n $response->assertStatus(200);\n\n // FAQ\n $response = $this->fr()->get('/faq');\n $response->assertStatus(200);\n\n // Qui Sommes-nous?\n $response = $this->fr()->get('/qui-sommes-nous');\n $response->assertStatus(200);\n }", "public function testHome()\n {\n $this->visit('/')->see('Comité Cantonal de Deportes y Recreación de Grecia');\n\n \n }", "public function index(): Response {\n return response( 'Index is working' );\n }", "public function index()\n {\n // With an easy way to generate different responses needed in your application. Please look at the docs for\n // any further information.\n return responseManager()->createSceneResponse('welcome');\n }", "public function test_a_guest_can_browse_home()\n {\n $this->get('/')->assertStatus(200);\n }", "public function testBasicTest()\n {\n\t$this->withoutExceptionHandling();\n $response = $this->get('/home');\n\n\t$response->dumpHeaders();\n\t$response->dump();\n $response->assertStatus(200);\n }", "public function testIndex()\n {\n $response = $this->getJson(route('users.index'), $this->headers);\n\n $response->assertStatus(200);\n }", "public function testRenderIndexNoCode()\n {\n // Populate data\n $this->_populate();\n \n // Make Request\n $this->call('GET', '/dashboard');\n\n $this->assertRedirectedTo('/dashboard/login');\n }", "public function testIndexSuccess()\n {\n $this->setAdminSession();\n $this->get($this->indexUrl);\n $this->assertResponseOk();\n }", "public function test_example_empty()\n {\n $response = $this->get('/');\n $response->assertStatus(200);\n }", "public function index()\n {\n if (isset($_GET['test'])) {\n return view('guest.home');\n } else {\n return view('guest.landing_content');\n }\n }", "public function testYatzyWelcomeView()\n {\n $data = [\n \"header\" => \"Yatzy page\",\n \"message\" => \"This is the yatzy page\",\n ];\n $controller = new Yatzy();\n $res = $controller();\n $responseBody = $res->getBody()->__toString();\n $this->assertStringContainsString($data[\"header\"], $responseBody);\n $this->assertStringContainsString($data[\"message\"], $responseBody);\n }", "public function testRouteIndexClienteOk()\n {\n $this->call('GET', 'cliente');\n $this->assertResponseOk();\n }", "public function action_index()\n\t{\n\t\treturn Response::forge(View::forge('index/hello'));\n\t}", "public function testWelcomeRoute()\n {\n $this->visit('/')\n ->see('Chemiatria');\n }", "public function testFrontendOverView()\n {\n $this->authentication();\n $this->visit(route('rental.frontend.index'));\n $this->seeStatusCode(200);\n $this->see('Verhuur info.');\n }", "public function index()\n\t{\n\n\t\treturn \\Cache::remember('homepage', 30, function() {\n\n\t\t\t$response = file_get_contents(app()->basePath('index.html'));\n\n\t\t\t$response = str_replace('{{url}}', env('APP_URL'), $response);\n\n\t\t\treturn $response;\n\n\t\t});\n\n\t}", "public function testIndexActionGet()\n {\n $res = $this->controller->indexActionGet();\n $this->assertContains(\"View all items\", $res->getBody());\n }", "public function user_can_see_home_page()\n {\n $user = factory(User::class)->create();\n $this->get('/')\n ->assertStatus(200);\n }", "public function testClienteIndex()\n {\n $this->withoutExceptionHandling();\n $response = $this->get('/cliente');\n $response->assertStatus(200);\n $response->assertViewIs('cliente.index');\n }", "public function testPageIndex()\n {\n $response = $this->actingAs(User::inRandomOrder()->first(), 'api')->json('GET', '/api/pages');\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'meta',\n 'links',\n 'data' => [\n '*' => [\n \"name\",\n \"id\",\n \"slug\",\n ],\n ],\n ]);\n }", "public function testBasicExample()\n {\n $this->visit('/')\n ->see('API tester');\n }", "public function testIndexRedirect()\n {\n $response = $this->get('/');\n\n $response->assertStatus(302);\n }", "public function testIndexActionCanBeAccessed()\n {\n $this->dispatch('/venue');\n $this->assertResponseStatusCode(200);\n }", "public function testPageFound()\n {\n $client = static::createClient();\n $client->request('GET', getenv(\"TEST_BASE_URL\"));\n $this->assertResponseIsSuccessful();\n }", "public function testPrimaryRoutes()\n\t{\n\t/*\t//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test base route\n\t\t// Should show post id 1\n\t\t$response = $this->call('GET', '/');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\n\t\t// Test /home is post 1\n\t\t$clicksBefore = Router::where('slug', '=', 'home')->first()->clicks;\n\t\t$response = $this->call('GET', '/home');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(1, $post->id);\n\t\t$this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid);\n\t\t$clicksAfter = Router::where('slug', '=', 'home')->first()->clicks;\n\t\t$this->assertEquals(++$clicksBefore, $clicksAfter);\n\n\t\t// Test /about is post 2\n\t\t$response = $this->call('GET', '/about');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(2, $post->id);\n\t\t$this->assertEquals('f1112648-782e-aad3-785d-640fcfefaa9b', $post->uuid);\n\n\n\t\t// ##### Login as mReschke #####\n\t\tAuth::login(User::find(2)); Auth::user()->login();\n\n\t\t// Test /13/mreschke-home-page (non named route)\n\t\t$response = $this->call('GET', '/13/mreschke-home-page');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(13, $post->id);\n\t\t$this->assertEquals('1a52e0e3-3174-7b2b-a582-03a39e52e34a', $post->uuid);\n\n\t\t// Test /14/squaethem-home-page (non named route)\n\t\t$response = $this->call('GET', '/14/squaethem-home-page');\n\t\t$post = $response->original['post'];\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewHas('post');\n\t\t$this->assertEquals(14, $post->id);\n\t\t$this->assertEquals('e80e907e-50d4-8ed4-70f7-5d1815672966', $post->uuid);\n\t\t*/\n\n\t}", "public function home(): Response\n {\n\n $articleRepo= $this->getDoctrine()->getRepository(Article::class);\n\n // Récupération du paramètre pour savoir combien d'articles seront affichés sur l'acceuil\n $articlesNumber = $this->getParameter('homepage_articles_number');\n\n // Récupération des derniers articles publiés\n $articles = $articleRepo->findBy([], ['publicationDate' => 'DESC'], $articlesNumber);\n\n return $this->render('main/index.html.twig', [\n 'articles' => $articles,\n ]);\n }", "public function index(): Response\n {\n return new Response('', Response::HTTP_OK);\n }", "public function test_index_rest()\n {\n $item = Rest::factory()->create();\n $response = $this->get('/api/v1/rest');\n $response->assertStatus(200);\n $response->assertJsonFragment([\n 'message' => $item->message,\n 'url' => $item->url\n ]);\n }", "public function index()\n {\n $appCommand = new AppCommand($this->app);\n $appCommand->fresh();\n\n $this->appUrl = 'http://e2framework-test.loc/';\n \n $tests = [\n \"view\" => $this->testView(),\n \"404\" => $this->test404(),\n \"env\" => $this->testEnv(),\n \"config\" => $this->testConfig(),\n \"db()->all\" => $this->testDbAll(),\n \"db()->findById\" => $this->testDbFindById(),\n \"db()->findByColumn\" => $this->testDbFindByColumn(),\n \"db()->insert\" => $this->testDbInsert(),\n \"db()->createTable\" => $this->testDbCreateTable(),\n ];\n\n return $this->app->view('tests', ['tests' => $tests]);\n }", "public function testRenderIndex()\n {\n // Populate data\n $this->_populate();\n \n // Make Request\n $this->withSession($this->adminSession)\n ->call('GET', '/branch');\n \n // Verify response\n foreach ($this->branchData as $branch)\n {\n $this->assertPageContain($branch['name']);\n }\n \n $this->assertViewHas('regions');\n $this->assertViewHas('dataTl');\n $this->assertViewHas('branches');\n }", "public function testBasicTest()\n {\n $response = $this->get('/');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function index(){\n return response('', 200);\n }", "public function testBasicTest()\n {\n $response = $this->get('/');\n $response->assertStatus(200);\n }", "public function index_returns_an_ok_response(): void\n {\n $user = $this->createUserWithPermission('show-admin-menu');\n\n $response = $this->actingAs($user)->get(route('admin.health.index'));\n\n $response->assertOk();\n $response->assertViewIs('health.index');\n $response->assertViewHas('results');\n $response->assertSeeText('Database Health Checks');\n }", "public function test_login_page_home_index()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/home')\n ->clickLink('Login')\n ->assertSee('Login')\n ->assertPathIs('/login');\n });\n }", "public function testIndexAction()\n {\n// $this->logInAsSuperAdmin();\n\n $crawler = $this->client->request('GET', '/admin/dashboard');\n\n $this->assertTrue($this->client->getResponse()->isSuccessful());\n $this->assertEquals(1, $crawler->filter('h2:contains(\"Tableau de bord\")')->count());\n }" ]
[ "0.8230956", "0.81625956", "0.80345523", "0.7953266", "0.7889178", "0.788659", "0.7834922", "0.78030264", "0.77678484", "0.77647597", "0.77269", "0.7697698", "0.766863", "0.76499385", "0.76499385", "0.7640043", "0.76259047", "0.76009697", "0.7586198", "0.75156784", "0.750895", "0.7463644", "0.745073", "0.7434651", "0.73870325", "0.73778754", "0.7332253", "0.73267347", "0.7300677", "0.72929263", "0.7277429", "0.72728324", "0.7246042", "0.7240485", "0.72384864", "0.7236854", "0.72346765", "0.7219765", "0.7201835", "0.7181901", "0.71633524", "0.7161899", "0.7143176", "0.7131114", "0.7126794", "0.7104188", "0.7104017", "0.7101377", "0.7088304", "0.7064753", "0.705493", "0.7041355", "0.7033878", "0.702041", "0.70164824", "0.7015871", "0.7007087", "0.6995176", "0.69872606", "0.6947967", "0.69405746", "0.6930532", "0.69114286", "0.69038564", "0.68778694", "0.6876267", "0.6871983", "0.6863729", "0.68445814", "0.6839686", "0.6834246", "0.68227464", "0.68065643", "0.6770507", "0.6757132", "0.67506874", "0.67447084", "0.6736347", "0.67342925", "0.67210186", "0.6714102", "0.67111796", "0.6704338", "0.6700541", "0.67003536", "0.6699206", "0.66990775", "0.66979873", "0.66852343", "0.6681602", "0.6678712", "0.66742975", "0.6671934", "0.6671192", "0.6666232", "0.66630054", "0.66612524", "0.66576695", "0.6655943", "0.6642609" ]
0.7996679
3
constructor (registers additional tasks to methods)
public function __construct($config = array()) { parent::__construct($config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t// Register Extra tasks\n\t\t$this->registerTask( 'add' , \t'edit' );\n\t}", "function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t// Map the save tasks.\n\t\t$this->registerTask('save2new',\t\t'save');\n\t\t$this->registerTask('apply',\t\t'save');\n\n\t\t// Map the publishing state tasks.\n\t\t$this->registerTask('unpublish',\t'publish');\n\t\t$this->registerTask('archive',\t\t'publish');\n\t}", "public function __construct( ){\r\n\t\tparent::__construct();\r\n\t\t$this->registerTask('show', 'display' );\r\n\t\t$this->registerTask('check', 'checkstatus' );\r\n\t}", "public function __construct($task)\n {\n $this->task = $task;\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->task = new \\App\\Console\\Tasks\\TaskController();\n }", "function __construct($config = array())\n\t{\n\t\tparent::__construct($config);\n\t\t$this->registerTask( 'show', 'display' );\n\t\t$this->registerTask('postInstall', 'postInstall');\n\t\t$this->registerTask('information', 'information');\n\t}", "public function __construct() {\n $this->_done = new Callbacks();\n $this->_failed = new Callbacks();\n $this->_progress = new Callbacks();\n }", "function __construct(){\n\n\t\t\t$this->enqueues();\n\n\t\t}", "public function __construct(){\n\t\tini_set('session.use_cookies', '0');\n\t\t$task = lc('uri')->get(TASK_KEY, 'common');\n\t\tif(!method_exists($this, 'web_'.$task) || !is_callable(array($this, 'web_'.$task))){\n\t\t\t$task = 'common';\n\t\t}\n\t\t$this->{'web_'.$task}();\n\t}", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\tparent::registerDefaultTask('migrate');\n\t}", "public function __construct($config = array())\n\t{\n\t\tparent::__construct($config);\n \n\t\t// Define standard task mappings. \n $this->registerTask('runall', 'run');\n\t}", "public function __construct(Task $task)\n {\n $this->task = $task;\n }", "public function __construct(Task $task)\n {\n $this->task = $task;\n }", "public function instantiate($task);", "public function __construct() {\n\t\t\t$this->init_globals();\n\t\t\t$this->init_actions();\n\t\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t\n\t\t$this->extension = new AtomicOperationsExtension();\n\t\t$this->applyExtension($this->extension);\n\t}", "public function __construct()\n {\n parent::__construct();\n\n $this->apis[] = new DynatraceProblems();\n $this->apis[] = new Alarms();\n $this->apis[] = new Metric(env('CACHETHQ_METRIC'));\n }", "function __construct()\n {\n parent::__construct();\n\n// if(!authCheck($this->post('auth'))){\n// returnFailedResponse();\n// exit();\n// }\n\n $this->check_auth_client = $this->tasks->check_auth_client();\n\n }", "public function __construct()\n {\n // for example creates \"thread\"\n }", "public function __construct() {\n $this->eventManager = new EventManager;\n $this->mh = curl_multi_init();\n }", "function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}", "public function initialize() {\n\t\t$this->registerMethod(\"get\");\n\t\t$this->registerMethod(\"set\");\n\t\t$this->registerMethod(\"getScheduleList\");\n\t\t$this->registerMethod(\"getScheduledJob\");\n\t\t$this->registerMethod(\"setScheduledJob\");\n\t\t$this->registerMethod(\"deleteScheduledJob\");\n\t\t$this->registerMethod(\"executeScheduledJob\");\n\t}", "public function __construct(){\n\n\t\t//iniciando o array de rotas\n\t\t$this->initRotues();\n\n\t\t$this->run($this->getUrl());\n\n\t}", "public function __construct(TaskRepository $tasks) \n {\n $this->middleware('auth');\n\n $this->tasks = $tasks;\n }", "public function __construct()\n {\n $this->init_class();\n $this->init_method();\n }", "public function __construct()\r\n {\r\n $this->includes();\r\n $this->setup();\r\n $this->hooks();\r\n }", "public function __construct() {\n\t /*\n\t $this->set_methods([])\n ->set_namespace('')\n ->set_args([])\n ->set_callback([])\n ->set_is_override(false)\n ->set_permissions_callback([])\n ->set_route('');\n\t */\n\t}", "public function __construct(ECash_Nightly_Event $task) {\n\t\t\n\t\t$this->task = $task;\n\t\t\n\t\t$this->function_name = get_class($task);\n\t\t$this->business_rule_name = $task->getBusinessRuleName();\n\t\t$this->timer_name = $task->getTimerName();\n\t\t$this->process_log_name = $task->getProcessLogName();\n\t\t$this->use_transaction = $task->getUseTransactionFlag();\n\t}", "public function setUp() {\n $this->task = new Task();\n }", "public function __construct()\n\t{\n\t\t// process into quick, hopefully low-memory tasks when accessed\n\t\t// through the browser\n\t\t$this->setSteps([\n\t\t\t'preflight',\n\t\t\t'download',\n\t\t\t'unpack'\n\t\t]);\n\n\t\t$this->logger = ee('Updater/Logger');\n\n\t\t// Attempt to set time and memory limits\n\t\t@set_time_limit(0);\n\t\t@ini_set('memory_limit', '256M');\n\t}", "public function __construct()\n {\n $this->task = new Task();\n unset($_SESSION['error']);\n }", "public function __construct(){\n\t\t// Define constant\n\t\t$this->define_constants();\n\t\t// Run the plugin\n\t\t$this->run_etc();\n\t}", "public function __construct(array $tokens,string $url,$method,array $fields = [],callable $then = null,$id = null)\n {\n parent::__construct();\n if(self::debug) echo \"Task constructed\\n\";\n $this->tokens = serialize($tokens);\n $this->url = $url;\n $this->method = $method;\n $this->fields = serialize($fields);\n //@formatter:off\n if($method !== Twix::REQUEST_GET AND $method !== Twix::REQUEST_POST)\n throw new \\InvalidArgumentException('Invalid Argument: $method expecting Twix::REQUEST_GET OR Twix::REQUEST_POST');\n //@formatter:on\n $this->then = $then;\n\n $this->id = serialize($id);//let it fail silently\n\n }", "public function __construct()\n {\n parent::__construct();\n $this->worker = new \\GearmanWorker();\n $this->worker->addServer();\n $this->worker->addFunction(env('QUEUE_SEMANTIC'), sprintf('\\\\%s::%s', __CLASS__, 'start'));\n }", "public function __construct()\n {\n $this->ParseUrl();\n $this->Dispatch();\n }", "public function __construct(TaskRepository $tasks)\n {\n $this->middleware('auth');\n $this->tasks = $tasks;\n }", "public function __construct() {\n\t\tadd_action( 'add_meta_boxes', array( $this, 'add_metaboxes' ) );\n\t\tadd_action( 'edd_save_download', array( $this, 'save_requirements' ), 10, 2 );\n\t}", "public function __construct() {\r\n\t\tadd_action( 'init', array( $this, 'run_request' ) );\r\n\t}", "public function __construct()\n {\n $this->tasks = new ArrayCollection();\n $this->comments = new ArrayCollection();\n $this->timeEntries = new ArrayCollection();\n }", "public function __construct() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'init' ), 100 );\n\t\tadd_action( 'wc_rs_sync', array( $this, 'start' ) );\n\t\tadd_action( 'wp_ajax_wc_rs_import', array( $this, 'import' ) );\n\t\tadd_action( 'wp_ajax_nopriv_wc_rs_import', array( $this, 'import' ) );\n\t}", "public function __construct() {\n\t\tadd_action( 'init', array(&$this, 'register') );\n\t}", "public function __construct(){\n $this->__classname = get_class($this); \n $this->_methods['default'] = $this->__classname.\"Init\";\n $this->registerMethodAlias(\"createUrl\", array(\"Vimerito\", \"createUrl\"));\n $this->registerMethodAlias(\"loadJsLibrary\", array(\"VLayout\", \"registerUserJavaScriptLibraries\"));\n }", "public function init()\n {\n $this->addAction('doStuff', 'performThingA');\n $this->addAction('doMoreStuff', 'performThingB');\n }", "public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->queue=new Queue();\n $this->check=new Check();\n }", "function __construct() {\n \n self::setQuantumVars();\n \n self::setAutoLoader();\n \n self::initActiveRecord();\n \n self::initSmarty();\n \n self::launcher();\n \n self::output();\n \n }", "public function __construct()\n {\n parent::__construct();\n $this->initAlueCommandLogTrait('console/createTask.log');\n }", "private function __construct()\n\t{\n\t\tadd_filter('cron_schedules', array($this,'addCronSchedules'));\n\t\tadd_action('wp', array($this, 'cronStarterActivation'));\n\t}", "public function __construct()\n\t{\n\t\t$mm = ModuleManager::getInstance();\n\t\tif ($mm->moduleExists('cron') && ($cron = $mm->getModule('cron')) != null)\n\t\t{\n\t\t\t$cron->subscribe(__CLASS__, array($this, 'cron'));\n\t\t}\n\n\t\t$auth = AuthBackend::getInstance();\n\n\t\t// bail if we aren't authenticated\n\t\tif ($auth->getCurrentUserName() == null)\n\t\t{\n\t\t\t// module does nothing if no authentication\n\t\t\treturn;\n\t\t}\n\n\t\t$this->installCommand('new', array($this, 'createProject'));\n\t\t$this->installCommand('info', array($this, 'projectInfo'));\n\t\t$this->installCommand('log', array($this, 'projectLog'));\n\t\t$this->installCommand('del', array($this, 'deleteProject'));\n\t\t$this->installCommand('commit', array($this, 'commitProject'));\n\t\t$this->installCommand('co', array($this, 'checkoutProject'));\n\t\t$this->installCommand(\"copy\", array($this, \"copyProject\"));\n\t\t$this->installCommand('zip', array($this, 'redirectToZip'));\n\t\t$this->installCommand('search', array($this, 'searchProject'));\n\t}", "public function __construct( User $user, Task $task)\n {\n $this->user=$user;\n $this->task=$task;\n }", "public function __construct(){\n\t\t//Set gloriously nice error handling\n\t\trequire_once(AMFPHP_BASE . \"shared/app/php5Executive.php\");\n\t\trequire_once(AMFPHP_BASE . \"shared/exception/php5Exception.php\");\n\t\t\n\t\t$this->exec = new Executive();\n\t\t$this->filters = array();\n\t\t$this->actions = array();\n\t\t$this->registerFilterChain();\n\t\t$this->registerActionChain();\n\t}", "private function __construct() {\n\n // Register taxonomies\n add_action('init', array($this, 'register_taxonomies'));\n\n // Populate taxonomy if it's empty\n add_action('init', array($this, 'populate_default_terms'));\n\n\t\t// set the geo data for this instance\n\t\t$this->what_is_client_ip();\n\t\t$this->get_json_geo_data();\n\t\t$this->save_to_session();\n\t}", "public function __construct()\n {\n $this->paths('app/Actions');\n $this->loadedActions = collect();\n }", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->resolution_summary = \"\";\n\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "private final function __construct() {}", "private function __construct(){ \r\n $this->includes();\r\n $this->hooks();\r\n }", "public function __construct() {\n $this->start();\n }", "private function __construct() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'textdomain' ) );\n\t\tadd_action( 'plugins_loaded', array( $this, 'load_files' ) );\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\t\t{\n\t\t\t\t\t\t\t\t$this->start();\n\t\t\t\t}", "protected final function __construct() {}", "public function addClassTask(string $className, $_ctorArgs = NULL): void {}", "public function __construct() {\n\t\tadd_action( 'rest_api_init', array( $this, 'register_rest_routes' ) );\n\t}", "private function __construct() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'textdomain' ) );\n\t\tadd_action( 'plugins_loaded', array( $this, 'load_files' ) );\n\t}", "public function __construct() {\n $this->load = new Load();\n $this->model = new Model();\n }", "public function __construct() {\n # Get the queue\n $this->queue = Queue::getQueue();\n # Now process\n $this->process();\n }", "public function __construct()\n {\n $this->_baseDir = __DIR__;\n\n // Command line parser\n $this->_cmdParser = $parser = Console_CommandLine::fromXmlString($this->_cmdOptionsStructure);\n try {\n $cmdOptions = $parser->parse();\n if ($cmdOptions->command_name) {\n $this->_cmdOptions = $cmdOptions;\n $this->_cmdOptions->command_name = \"_{$this->_cmdOptions->command_name}\";\n } else {\n $parser->displayUsage();\n exit();\n }\n } catch (Exception $e) {\n $parser->displayError($e->getMessage());\n }\n\n // Load Config\n if (!$this->_cfg = $cfg = @json_decode(file_get_contents('config.json'), true)) {\n die($this->_fgColor('bold_red', \"\\nError: Could not read 'config.json'. Aborting.\\n\"));\n }\n\n // Logger\n $this->_log = new Logger('Tasks');\n $handler = new RotatingFileHandler(\"{$this->_baseDir}/log/report.log\", 10, Logger::INFO);\n $handler->setFormatter(new LineFormatter(\"[%datetime%] %level_name%: %message%\\n\"));\n $this->_log->pushHandler($handler);\n\n // Database\n $capsule = new Capsule;\n foreach ($cfg['databases'] as $k => $v) {\n $capsule->addConnection(\n [\n 'driver' => 'mysql',\n 'host' => $v['host'],\n 'database' => $v['database'],\n 'username' => $v['user'],\n 'password' => $v['password'],\n 'charset' => 'utf8',\n 'collation' => 'utf8_general_ci',\n 'prefix' => ''\n ],\n $k\n );\n }\n $capsule->setAsGlobal();\n\n // BitBucket Credentials\n $this->_bbApi = new Bitbucket\\API\\Api();\n $this->_bbApi->getClient()->addListener(\n new \\Bitbucket\\API\\Http\\Listener\\BasicAuthListener(\n $cfg['api']['bitbucket']['users']['admin']['user'],\n $cfg['api']['bitbucket']['users']['admin']['password']\n )\n );\n\n // Phonegap Build\n $this->_pgbApi = new PhonegapBuildApi($cfg['api']['pgb']['token']);\n\n // Stats\n $this->_report = array(\n 'Date & Time' => date('Y-m-d H:i:s'),\n 'Script Time' => 0,\n 'Method' => ''\n );\n }", "public function __construct(array $taskSuggestion = array())\n {\n $this\n ->setTaskSuggestion($taskSuggestion);\n }", "protected function __construct() {\n\n // Cargamos Clases.\n $this -> setup_hooks();\n }", "protected function __construct() {\n\n // Cargamos Clases.\n $this -> setup_hooks();\n }", "function __construct() {\n\t\t$request = Request::getInstance();\n\t\t$plugin = Plugin::getInstance();\n\t\t$plugin->triggerEvents('load' . $request->getController());\n\t}", "public function __construct() {\n\t\t$this->QuackBehaviour = new Quack();\n\t\t$this->FlyBehaviour = new FlyWithWings();\n\t}", "public function __construct()\n {\n $this->repository = new StatisticVisitRepository();\n $this->actionLate = new LateUserAction();\n $this->actionInTime = new InTimeUserAction();\n }", "public function __construct()\r\n {\r\n $this->loadResources('start');\r\n }", "public function __construct() {\n\t\t$this\n\t\t\t->calculateMaxTargets()\n\t\t\t->generateMap()\n\t\t\t->populateMap();\n\t}", "final private function __construct() {}", "final private function __construct() {}", "function __construct($id, $connection_details, $task_name=NULL, $task_args=NULL)\n\t{\n\t\t$this->task_id = $id;\n\t\t$this->connection = Celery::InitializeAMQPConnection($connection_details);\n\t\t$this->connection_details = $connection_details;\n\t\t$this->task_name = $task_name;\n\t\t$this->task_args = $task_args;\n\t\t$this->amqp = AbstractAMQPConnector::GetConcrete($connection_details['connector']);\n\t}", "public function __construct() {\n\t\t\t$this->schedules = wp_get_schedules();\n\t\t}", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function __construct()\n {\n $this->_cronHelper = Mage::helper(self::XML_PATH_HELPER_CRON);\n }", "public function __construct()\n {\n $this->extendableConstruct();\n }", "final private function __construct()\n {\n \t$this->init();\n }", "public function __construct() {\n\n\t\t$this->actions = [];\n\t\t$this->filters = [];\n\t\t\n\t\t# Components\n\t\t$this->nav = new Nav ();\n\t\t$this->api = new API ();\n\t\t$this->admin = new Admin ();\n\t\t\n\t\t# Define hooks\n\t\t$this->enqueue ();\n\t\t$this->admin_hooks ();\n\t\t$this->admin_ajax_routing ();\n\t\t$this->public_hooks ();\n\t}", "public function __construct() {\n\n\t\t\t/* Load plugin files */\n\t\t\tself::load_plugin_files();\n\t\t}" ]
[ "0.79099035", "0.77711284", "0.75042593", "0.71214086", "0.70046544", "0.6978738", "0.69646394", "0.69072217", "0.6823726", "0.68025994", "0.67829496", "0.673652", "0.673652", "0.6652389", "0.6573815", "0.655598", "0.64912903", "0.64791566", "0.6455497", "0.6450141", "0.6381803", "0.63606954", "0.6357751", "0.6351547", "0.62988937", "0.62916183", "0.6279215", "0.62763584", "0.6274732", "0.62595224", "0.6251338", "0.62412673", "0.62395346", "0.6235689", "0.6230265", "0.6228872", "0.622485", "0.6223278", "0.6216734", "0.6199785", "0.6196961", "0.61903465", "0.6189835", "0.61863196", "0.6160445", "0.6158757", "0.6157653", "0.6154278", "0.6144703", "0.6134902", "0.61317897", "0.6123049", "0.6121036", "0.6112587", "0.6111294", "0.60970485", "0.60873985", "0.6071942", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.6069006", "0.60686445", "0.6066942", "0.6064966", "0.60644615", "0.60631704", "0.60599995", "0.6054589", "0.6048544", "0.60478663", "0.6045417", "0.6045417", "0.6045268", "0.6040072", "0.60397774", "0.6037109", "0.6033863", "0.60319936", "0.60319936", "0.6028396", "0.60138494", "0.6010028", "0.60081816", "0.6007855", "0.60015684", "0.6001266", "0.59968424" ]
0.0
-1
Display a listing of the resource.
public function index() { $settings = Setting::all(); return view('admin.setting.index',compact('settings')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.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(Setting $setting) { // }
{ "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(Setting $setting) { return view('admin.setting.edit',compact('setting')); }
{ "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 actionEdit($id) { }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "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(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $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 editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7855196", "0.76957726", "0.7273917", "0.7241426", "0.71717227", "0.7064183", "0.70528984", "0.69836885", "0.694763", "0.69469565", "0.6941572", "0.69301945", "0.6903868", "0.68989486", "0.68989486", "0.68787694", "0.68641657", "0.6860115", "0.6857286", "0.68464494", "0.6834566", "0.68116575", "0.68075293", "0.6805924", "0.6801357", "0.6796291", "0.67915684", "0.67915684", "0.67874014", "0.678544", "0.67787844", "0.6777662", "0.67675763", "0.676299", "0.6746726", "0.6745706", "0.67450166", "0.67450166", "0.6739429", "0.6734577", "0.6725992", "0.67127997", "0.6694406", "0.6692487", "0.6689421", "0.66884303", "0.6687299", "0.6685663", "0.6682167", "0.66701853", "0.66697115", "0.6666091", "0.6666091", "0.66627705", "0.6661716", "0.6661522", "0.6657919", "0.6656454", "0.6653187", "0.6642113", "0.66332614", "0.66324973", "0.66275465", "0.66275465", "0.6619777", "0.6619387", "0.6617973", "0.66154003", "0.66110945", "0.6607966", "0.66065043", "0.6596376", "0.65953517", "0.65941286", "0.6591486", "0.6590759", "0.6588404", "0.658161", "0.6580548", "0.6579757", "0.6577171", "0.65761065", "0.657386", "0.65686774", "0.6567784", "0.65672046", "0.6566417", "0.65615803", "0.65615714", "0.65615714", "0.65592474", "0.65586483", "0.65568006", "0.6556628", "0.65564895", "0.6555322", "0.65551996", "0.6555016", "0.654888", "0.65477645", "0.65451735" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Setting $setting) { // The request validated and this code will get run $this->validate($request, [ 'site_title' => 'required', 'contact_title' => 'required', 'contact_subtitle' => 'required', 'icon' => 'required', 'copyright' => 'required', 'number' => 'required', ]); if($request->hasFile('site_logo')){ $file = $request->file('site_logo'); $image_enc_name = rand(0,9999).md5($file->getClientOriginalName()); $image_ext = $file->getClientOriginalExtension(); $image_name = $image_enc_name.".".$image_ext; $destinationPath = "logo_image"; $file->move($destinationPath,$image_name); }else{ $image_name = ""; } $setting->site_title = $request->site_title; $setting->contact_title = $request->contact_title; $setting->contact_subtitle = $request->contact_subtitle; $setting->icon = $request->icon; $setting->copyright = $request->copyright; $setting->number = $request->number; $setting->site_logo = $image_name; $setting->save(); Session::flash('success', 'Setting updated successfully'); return redirect()->back(); }
{ "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(Setting $setting) { // }
{ "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
[Aliased] Generates as UUID 4 string Example Usage: uuid() Example Return: 90517cea8a9e46c18c441a3c03611786
function uuid(): string { return \Midnite81\Core\Functions\uuid(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function generateUUID(): string {\n return Str::uuid();\n }", "public static function uuid() {}", "private function uuid() {\n\t\treturn sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n\t\t);\n\t}", "private function uuid()\n {\n $data = random_bytes(16);\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40);\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80);\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }", "private function uuid(): string\n {\n return implode('-', [\n bin2hex(random_bytes(4)),\n bin2hex(random_bytes(2)),\n bin2hex(chr((ord(random_bytes(1)) & 0x0F) | 0x40)) . bin2hex(random_bytes(1)),\n bin2hex(chr((ord(random_bytes(1)) & 0x3F) | 0x80)) . bin2hex(random_bytes(1)),\n bin2hex(random_bytes(6)),\n ]);\n }", "function v4(): string\n{\n return Uuid::uuid4()->toString();\n}", "public function generateUuidV4()\n {\n $bytes = Yii::$app->security->generateRandomKey(16);\n $bytes[6] = chr((ord($bytes[6]) & 0x0f) | 0x40);\n $bytes[8] = chr((ord($bytes[8]) & 0x3f) | 0x80);\n $chunks = str_split(bin2hex($bytes), 4);\n\n return \"{$chunks[0]}{$chunks[1]}-{$chunks[2]}-{$chunks[3]}-{$chunks[4]}-{$chunks[5]}{$chunks[6]}{$chunks[7]}\";\n }", "public function generateUuidV4(): string\n {\n $uuid = new UuidFactory();\n\n return $uuid->uuid4()->toString();\n }", "private static function gen_uuid() {\n\t\t/*\n\t\t * Generates a v4 UUID\n\t\t * \n\t\t */\n\t\treturn sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\t// 32 bits for \"time_low\"\n\t\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n\n\t\t\t// 16 bits for \"time_mid\"\n\t\t\tmt_rand( 0, 0xffff ),\n\n\t\t\t// 16 bits for \"time_hi_and_version\",\n\t\t\t// four most significant bits holds version number 4\n\t\t\tmt_rand( 0, 0x0fff ) | 0x4000,\n\n\t\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t// 8 bits for \"clk_seq_low\",\n\t\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\t\tmt_rand( 0, 0x3fff ) | 0x8000,\n\n\t\t\t// 48 bits for \"node\"\n\t\t\tmt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )\n\t\t);\n\t}", "public static function uuid() {\n\t\t$data = random_bytes(15);\n\n\t\t$data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100\n\t\t$data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10\n\n\t\treturn vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n\t}", "public static function getUuid(): string\n {\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4));\n }", "public function uuid();", "public function uuid();", "private function getNewUuid() {\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n mt_rand( 0, 0x0fff ) | 0x4000,\n mt_rand( 0, 0x3fff ) | 0x8000,\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );\n }", "function wp_generate_uuid4()\n {\n }", "public function generateUUID()\n {\n // See https://github.com/ramsey/uuid/wiki/Ramsey%5CUuid-Cookbook\n if ($keyGenerator = $this->mapping->getKeyGenerator()) {\n switch ($keyGenerator) {\n case \"uuid-v1\":\n return Uuid::uuid1();\n case \"uuid-v4\":\n return Uuid::uuid4();\n /*\n case \"uuid-v3\":\n return Uuid::uuid3(Uuid::NAMESPACE_DNS, 'php.net');\n case \"uuid-v5\":\n return Uuid::uuid5(Uuid::NAMESPACE_DNS, 'php.net');\n */\n }\n }\n return Uuid::uuid4();\n }", "public static function getUuid(): string {\n mt_srand((double)microtime() * 10000);\n $charid = strtolower(md5(uniqid(rand(), TRUE)));\n $hyphen = chr(45);\n $uuid = substr($charid, 0, 8) . $hyphen\n . substr($charid, 8, 4) . $hyphen\n . substr($charid, 12, 4) . $hyphen\n . substr($charid, 16, 4) . $hyphen\n . substr($charid, 20, 12);\n return $uuid;\n }", "private function uuid(){\n return uniqid('');\n }", "public function gen_uuid(): string\n\t{\n\t\treturn sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\t// 32 bits for \"time_low\"\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\t\t\t\n\t\t\t// 16 bits for \"time_mid\"\n\t\t\tmt_rand(0, 0xffff),\n\t\t\t\n\t\t\t// 16 bits for \"time_hi_and_version\",\n\t\t\t// four most significant bits holds version number 4\n\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\t\n\t\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t// 8 bits for \"clk_seq_low\",\n\t\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\t\n\t\t\t// 48 bits for \"node\"\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n\t\t);\n\t}", "function GenerateUUID()\r\r\n{\r\r\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\r\r\n randword(), randword(),\r\r\n randword(),\r\r\n 0x4000 | randword(0x0FFF),\r\r\n 0x8000 | randword(0x3FFF),\r\r\n randword(), randword(), randword());\r\r\n}", "public function uuid() : Uuid;", "public function generateUuid() {\n\t\tif (is_readable(self::UUID_SOURCE)) {\n\t\t\t$uuid = trim(file_get_contents(self::UUID_SOURCE));\n\t\t} elseif (function_exists('mt_rand')) {\n\t\t\t/**\n\t\t\t * Taken from stackoverflow answer, possibly not the fastest or\n\t\t\t * strictly standards compliant\n\t\t\t * @link http://stackoverflow.com/a/2040279\n\t\t\t */\n\t\t\t$uuid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\t\t// 32 bits for \"time_low\"\n\t\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\t\t\t\t// 16 bits for \"time_mid\"\n\t\t\t\tmt_rand(0, 0xffff),\n\t\t\t\t// 16 bits for \"time_hi_and_version\",\n\t\t\t\t// four most significant bits holds version number 4\n\t\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t\t// 8 bits for \"clk_seq_low\",\n\t\t\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\t\t// 48 bits for \"node\"\n\t\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n\t\t\t);\n\t\t} else {\n\t\t\t// chosen by dice roll, guaranteed to be random\n\t\t\t$uuid = '4';\n\t\t}\n\t\treturn $uuid;\n\t}", "public static function getUuid() {\n return sprintf(\n \"%04x%04x-%04x-%04x-%04x-%04x%04x%04x\",\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff),\n mt_rand(0, 0x0fff) | 0x4000,\n mt_rand(0, 0x3fff) | 0x8000,\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff)\n );\n }", "private function uuid4():string {\n\t\t$uuid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\t# 32 bits for \"time_low\"\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\t\t\t# 16 bits for \"time_mid\"\n\t\t\tmt_rand(0, 0xffff),\n\t\t\t# 16 bits for \"time_hi_and_version\",\n\t\t\t# four most significant bits holds version number 4\n\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\t# 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t# 8 bits for \"clk_seq_low\",\n\t\t\t# two most significant bits holds zero and one for variant DCE1.1\n\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\t# 48 bits for \"node\"\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n\t\t);\n\t\treturn str_replace('-', '', $uuid);\n\t}", "function uuid($prefix = ''){\r\n\r\n\t$chars = md5(uniqid(mt_rand(), true));\r\n\r\n\t$uuid = substr($chars, 0, 8) . '-';\r\n\t$uuid .= substr($chars, 8, 4) . '-';\r\n\t$uuid .= substr($chars, 12, 4) . '-';\r\n\t$uuid .= substr($chars, 16, 4) . '-';\r\n\t$uuid .= substr($chars, 20, 12);\r\n\r\n\treturn $prefix.$uuid;\r\n\r\n}", "private function gen_uuid()\n {\n return sprintf(\n '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand(0, 0xFFFF),\n mt_rand(0, 0xFFFF),\n\n // 16 bits for \"time_mid\"\n mt_rand(0, 0xFFFF),\n\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0FFF) | 0x4000,\n\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3FFF) | 0x8000,\n\n // 48 bits for \"node\"\n mt_rand(0, 0xFFFF),\n mt_rand(0, 0xFFFF),\n mt_rand(0, 0xFFFF)\n );\n }", "public static function uuid()\n {\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', // 32 bits for \"time_low\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), // 16 bits for \"time_mid\"\n mt_rand(0, 0xffff), // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0fff) | 0x4000, // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3fff) | 0x8000, // 48 bits for \"node\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));\n }", "public function generateUuid()\n {\n do {\n $uuid = str_uuid();\n } while ($this->countByUuid($uuid) > 0);\n\n return $uuid;\n }", "public static function createUuid() {\n $data = \\openssl_random_pseudo_bytes(16);\n\n // set the version to 0100\n $data[6] = \\chr(\\ord($data[6]) & 0x0f | 0x40);\n // set bits 6-7 to 10\n $data[8] = \\chr(\\ord($data[8]) & 0x3f | 0x80);\n\n return \\vsprintf('%s%s-%s-%s-%s-%s%s%s', \\str_split(\\bin2hex($data), 4));\n }", "function GenerateUuid() \n{ \n $s = strtoupper(md5(uniqid(rand(),true))); \n $uuid = \n substr($s, 0, 8) . '-' . \n substr($s, 8, 4) . '-' . \n substr($s, 12, 4). '-' . \n substr($s, 16, 4). '-' . \n substr($s, 20);\n \n return $uuid;\n}", "function gen_uuid() {\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff),\n // 16 bits for \"time_mid\"\n mt_rand(0, 0xffff),\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0fff) | 0x4000,\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3fff) | 0x8000,\n // 48 bits for \"node\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n );\n }", "function gen_uuid() {\n return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n\n // 16 bits for \"time_mid\"\n mt_rand( 0, 0xffff ),\n\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand( 0, 0x0fff ) | 0x4000,\n\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand( 0, 0x3fff ) | 0x8000,\n\n // 48 bits for \"node\"\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )\n );\n }", "function gen_uuid() \n\t{\n\t\treturn sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t// 32 bits for \"time_low\"\n\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\t\t// 16 bits for \"time_mid\"\n\t\tmt_rand(0, 0xffff),\n\t\t// 16 bits for \"time_hi_and_version\",\n\t\t// four most significant bits holds version number 4\n\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t// 8 bits for \"clk_seq_low\",\n\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t// 48 bits for \"node\"\n\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n\t\t);\n\t}", "public function uuid4()\n {\n $bytes = self::generateBytes(16);\n\n // When converting the bytes to hex, it turns into a 32-character\n // hexadecimal string that looks a lot like an MD5 hash, so at this\n // point, we can just pass it to uuidFromHashedName.\n $hex = bin2hex($bytes);\n\n return self::uuidFromHashedName($hex, 4);\n }", "public static function generateUUID()\n {\n return sprintf(\n '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff),\n // 16 bits for \"time_mid\"\n mt_rand(0, 0xffff),\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0fff) | 0x4000,\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3fff) | 0x8000,\n // 48 bits for \"node\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n );\n }", "public static function generateUUID()\n {\n return sprintf(\n '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff),\n // 16 bits for \"time_mid\"\n mt_rand(0, 0xffff),\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0fff) | 0x4000,\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3fff) | 0x8000,\n // 48 bits for \"node\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n );\n }", "public static function uuid() {\n if (!function_exists('uuid_create'))\n return false;\n\n uuid_create(&$context);\n\n uuid_make($context, UUID_MAKE_V4);\n uuid_export($context, UUID_FMT_STR, &$uuid);\n return trim($uuid);\n }", "static function uuid() \n\t\t{\n\t\t\t// The field names refer to RFC 4122 section 4.1.2\n\t\t\t\n\t\t\treturn sprintf('%04x%04x-%04x-%03x4-%04x-%04x%04x%04x',\n\t\t\t mt_rand(0, 65535), mt_rand(0, 65535), // 32 bits for \"time_low\"\n\t\t\t mt_rand(0, 65535), // 16 bits for \"time_mid\"\n\t\t\t mt_rand(0, 4095), // 12 bits before the 0100 of (version) 4 for \"time_hi_and_version\"\n\t\t\t bindec(substr_replace(sprintf('%016b', mt_rand(0, 65535)), '01', 6, 2)),\n\t\t\t // 8 bits, the last two of which (positions 6 and 7) are 01, for \"clk_seq_hi_res\"\n\t\t\t // (hence, the 2nd hex digit after the 3rd hyphen can only be 1, 5, 9 or d)\n\t\t\t // 8 bits for \"clk_seq_low\"\n\t\t\t mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535) // 48 bits for \"node\" \n\t\t\t\t); \n\t\t}", "public function generateUUID() {\n\n\t\t$uuidtest = sprintf ( '%04x%04x%04x%04x%04x%04x%04x%04x', \n\t\t\t\t// 32 bits for \"time_low\"\n\t\t\t\tmt_rand ( 0, 0xffff ), mt_rand ( 0, 0xffff ), \n\t\t\t\t\n\t\t\t\t// 16 bits for \"time_mid\"\n\t\t\t\tmt_rand ( 0, 0xffff ), \n\t\t\t\t\n\t\t\t\t// 16 bits for \"time_hi_and_version\",\n\t\t\t\t// four most significant bits holds version number 4\n\t\t\t\tmt_rand ( 0, 0x0fff ) | 0x4000, \n\t\t\t\t\n\t\t\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t\t\t// 8 bits for \"clk_seq_low\",\n\t\t\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\t\t\tmt_rand ( 0, 0x3fff ) | 0x8000, \n\t\t\t\t\n\t\t\t\t// 48 bits for \"node\"\n\t\t\t\tmt_rand ( 0, 0xffff ), mt_rand ( 0, 0xffff ), mt_rand ( 0, 0xffff ) );\n\t\t\n\t\treturn $uuidtest;\n\t\n\t}", "public function generateUuid()\n {\n return (new Generator())->uuid();\n }", "public static function GenerateUuid() {\n return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),\n\n // 16 bits for \"time_mid\"\n mt_rand( 0, 0xffff ),\n\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand( 0, 0x0fff ) | 0x4000,\n\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand( 0, 0x3fff ) | 0x8000,\n\n // 48 bits for \"node\"\n mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )\n );\n }", "function get_uuid() {\n\t\t$t = explode(\" \", microtime());\n\t\treturn sprintf('%04x%04x-%04x-%08s-%08s-%04s',\n\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), \n\t\tmt_rand(1, 0xffff), mt_rand(1, 0xffff), \n\t\tgetmypid(),\n\t\tsubstr(\"00000000\" . dechex($t[1]), -8), // get 8HEX of unixtime\n\t\tsubstr(\"0000\" . dechex(round($t[0] * 65536)), -4) // get 4HEX of microtime\n\t\t);\n\t}", "function UUIDv4() \n\t{\n\t\treturn sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t// 32 bits for \"time_low\"\n\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\t\t// 16 bits for \"time_mid\"\n\t\tmt_rand(0, 0xffff),\n\t\t// 16 bits for \"time_hi_and_version\",\n\t\t// four most significant bits holds version number 4\n\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t// 16 bits, 8 bits for \"clk_seq_hi_res\",\n\t\t// 8 bits for \"clk_seq_low\",\n\t\t// two most significant bits holds zero and one for variant DCE1.1\n\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t// 48 bits for \"node\"\n\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n\t\t);\n\t}", "public function uuid(){ }", "public static function getUUID()\n {\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\n // 16 bits for \"time_mid\"\n mt_rand(0, 0xffff),\n\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0fff) | 0x4000,\n\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3fff) | 0x8000,\n\n // 48 bits for \"node\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n );\n }", "public static function guidv4()\n {\n if (function_exists('com_create_guid') === true)\n return trim(com_create_guid(), '{}');\n\n $data = openssl_random_pseudo_bytes(16);\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }", "public function getUuid(): string;", "function gaGenerateUUID() {\n\treturn sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), //32 bits for \"time_low\"\n\t\tmt_rand(0, 0xffff), //16 bits for \"time_mid\"\n\t\tmt_rand(0, 0x0fff) | 0x4000, //16 bits for \"time_hi_and_version\", Four most significant bits holds version number 4\n\t\tmt_rand(0, 0x3fff) | 0x8000, //16 bits, 8 bits for \"clk_seq_hi_res\", 8 bits for \"clk_seq_low\", Two most significant bits holds zero and one for variant DCE1.1\n\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) //48 bits for \"node\"\n\t);\n}", "public static function v4()\n {\n return self::_getUUID()->uuidV4();\n }", "public function generateUUID(): string\n {\n return $this->stringHelper->generateUUID($this->urlInterface->getBaseUrl());\n }", "public static function timeuuid() {}", "function uuid()\n{\n // The field names refer to RFC 4122 section 4.1.2\n return sprintf('%04x%04x-%04x-%03x4-%04x-%04x%04x%04x',\n mt_rand(0, 65535), mt_rand(0, 65535), // 32 bits for \"time_low\"\n mt_rand(0, 65535), // 16 bits for \"time_mid\"\n mt_rand(0, 4095), // 12 bits before the 0100 of (version) 4 for \"time_hi_and_version\"\n bindec(substr_replace(sprintf('%016b', mt_rand(0, 65535)), '01', 6, 2)),\n // 8 bits, the last two of which (positions 6 and 7) are 01, for \"clk_seq_hi_res\"\n // (hence, the 2nd hex digit after the 3rd hyphen can only be 1, 5, 9 or d)\n // 8 bits for \"clk_seq_low\"\n mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535) // 48 bits for \"node\"\n );\n}", "public function generateUuid()\n {\n return Uuid::uuid5(Uuid::NAMESPACE_DNS, md5(uniqid(date('d-m-Y H:i:s'), true)))->toString();\n }", "function uuid($length=8) {\n\t$uuid = \"\";\n\n\tif ($length > 8) {\n\t $uuid = uniqid(md5(rand()), false);\n\t if (strlen($uuid) > $length) {\n\t $uuid = substr($uuid, 0, $length);\n\t }\n\t } else {\n\t $uuid = _uuidSmall($length);\n\t } \n\n return $uuid;\n}", "public static function generateUuid()\n {\n\n return sprintf('%04x%04x-%04x-%03x4-%04x-%04x%04x%04x',\n mt_rand(0, 65535), mt_rand(0, 65535), // 32 bits for \"time_low\"\n mt_rand(0, 65535), // 16 bits for \"time_mid\"\n mt_rand(0, 4095), // 12 bits before the 0100 of (version) 4 for \"time_hi_and_version\"\n bindec(substr_replace(sprintf('%016b', mt_rand(0, 65535)), '01', 6, 2)),\n // 8 bits, the last two of which (positions 6 and 7) are 01, for \"clk_seq_hi_res\"\n // (hence, the 2nd hex digit after the 3rd hyphen can only be 1, 5, 9 or d)\n // 8 bits for \"clk_seq_low\"\n mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535) // 48 bits for \"node\" \n ); \n }", "public function getUuid();", "static function newGuid() { \n $s = strtoupper(md5(uniqid(rand(),true))); \n $guidText = \n substr($s,0,8) . '-' . \n substr($s,8,4) . '-' . \n substr($s,12,4). '-' . \n substr($s,16,4). '-' . \n substr($s,20); \n return strtolower($guidText);\n }", "public static function uuid()\n {\n return Uuid::uuid5(Uuid::NAMESPACE_DNS, self::uniqueKey());\n }", "static function GUID()\n {\n if (function_exists('com_create_guid')) {\n return com_create_guid();\n } else {\n mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.\n $charid = strtoupper(md5(uniqid(rand(), true)));\n $hyphen = chr(45);// \"-\"\n //$uuid = chr(123)// \"{\"\n $uuid = \"\"\n .substr($charid, 0, 8).$hyphen\n .substr($charid, 8, 4).$hyphen\n .substr($charid, 12, 4).$hyphen\n .substr($charid, 16, 4).$hyphen\n .substr($charid, 20, 12);\n //.chr(125);// \"}\"\n return $uuid;\n }\n }", "function gen_uuid($len=8)\n{\n $hex = md5(\"tvbuddy2_mobiotics\" . uniqid(\"\", true));\n\n $pack = pack('H*', $hex);\n\n $uid = base64_encode($pack); // max 22 chars\n\n $uid = preg_replace(\"/[^a-z0-9_]+/i\", \"\", $uid); // mixed case\n\n\n if ($len<4)\n $len=4;\n if ($len>128)\n $len=128; // prevent silliness, can remove\n\n while (strlen($uid)<$len)\n $uid = $uid . gen_uuid(22); // append until length achieved\n\n return substr($uid, 0, $len);\n}", "public static function getNewGuid()\n {\n return sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X',\n mt_rand(0, 65535),\n mt_rand(0, 65535),\n mt_rand(0, 65535),\n mt_rand(16384, 20479),\n mt_rand(32768, 49151),\n mt_rand(0, 65535),\n mt_rand(0, 65535),\n mt_rand(0, 65535)\n );\n }", "function getGUID(){\r\n mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.\r\n $charid = strtoupper(md5(uniqid(rand(), true)));\r\n $hyphen = chr(45);\r\n $uuid = substr($charid, 0, 8).$hyphen\r\n .substr($charid, 8, 4).$hyphen\r\n .substr($charid,12, 4).$hyphen\r\n .substr($charid,16, 4).$hyphen\r\n .substr($charid,20,12);\r\n return $uuid;\r\n}", "function Uuid()\n {\n $unid = uniqid() . str_replace('-', '', Guid());\n $uuid = substr($unid, 0, 8) . '-' . substr($unid, 8, 4) . '-' . substr($unid, 12, 4) . '-' . substr($unid, 16, 4) . '-' . substr($unid, 20, 12);\n return $uuid;\n }", "private function generateUID(){\n if(function_exists(\"random_bytes\")){\n return md5(bin2hex(random_bytes(16)) . time());\n } else if(function_exists(\"openssl_random_pseudo_bytes\")){\n return md5(bin2hex(openssl_random_pseudo_bytes(16)) . time());\n }\n return md5(uniqid() . time());\n }", "public function getGUID(){\n if (function_exists('com_create_guid')){\n return com_create_guid();\n }else{\n mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.\n $charid = strtoupper(md5(uniqid(rand(), true)));\n $hyphen = chr(45);// \"-\"\n $uuid = chr(123)// \"{\"\n .substr($charid, 0, 8).$hyphen\n .substr($charid, 8, 4).$hyphen\n .substr($charid,12, 4).$hyphen\n .substr($charid,16, 4).$hyphen\n .substr($charid,20,12)\n .chr(125);// \"}\"\n return $uuid;\n }\n}", "public function uuid($version = 5)\n\t{\n\t\trequire_once(dirname(__FILE__) . '/uuid.php');\n\t\treturn UUID::generate($version, UUID::URL, $this->__to_String());\n\t}", "function getUUID()\n {\n $sql = \"select gen_random_uuid() as uuid\";\n $data = $this->lireParam($sql);\n return $data[\"uuid\"];\n }", "public function getUuid(): string\n {\n return $this->uuid;\n }", "function makeSecureUUID() {\n\n if (function_exists('com_create_guid') === true) {\n return trim(com_create_guid(), '{}');\n }\n \n return sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', \n mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));\n}", "public function get() {\n if (function_exists('com_create_guid')){\n return com_create_guid();\n }else{\n mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.\n $charid = strtoupper(md5(uniqid(rand(), true)));\n $hyphen = chr(45);// \"-\"\n $uuid = //chr(123)// \"{\"\n substr($charid, 0, 8).$hyphen\n .substr($charid, 8, 4).$hyphen\n .substr($charid,12, 4).$hyphen\n .substr($charid,16, 4).$hyphen\n .substr($charid,20,12);\n //.chr(125);// \"}\"\n return $uuid;\n } \n }", "final public static function uniqueIDGenerator(){\n $letters = range('A', 'Z');\n shuffle($letters);\n return( md5(time() . implode('', $letters) . rand()));\n }", "static public function mdlGeneraUUID(){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"select uuid() as generaUUID\");\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetch();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\t}", "private function make_id () {\n // http://sourceforge.net/projects/phunction/\n return sprintf('%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));\n }", "function gen_uuid($len=8) {\n\n $hex = md5(param('salt-file') . uniqid(\"\", true));\n\n $pack = pack('H*', $hex);\n $tmp = base64_encode($pack);\n\n $uid = preg_replace(\"/[^A-Za-z0-9]/\", \"\", $tmp);\n\n $len = max(4, min(128, $len));\n\n while (strlen($uid) < $len)\n $uid .= gen_uuid(22);\n\n $res=substr($uid, 0, $len);\n return $res;\n}", "public static function makeGuid()\n {\n if (function_exists('com_create_guid')) {\n return strtolower(trim(com_create_guid(), '{}'));\n } else {\n $charid = strtolower(md5(uniqid(rand(), true)));\n $hyphen = chr(45);\n $uuid = substr($charid, 0, 8) . $hyphen\n . substr($charid, 8, 4) . $hyphen\n . substr($charid, 12, 4) . $hyphen\n . substr($charid, 16, 4) . $hyphen\n . substr($charid, 20, 12);\n\n return $uuid;\n }\n }", "function getGUID(){\n if (function_exists('com_create_guid')){\n return com_create_guid();\n }else{\n mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.\n $charid = strtoupper(md5(uniqid(rand(), true)));\n $hyphen = chr(45);// \"-\"\n $uuid = chr(123)// \"{\"\n .substr($charid, 0, 8).$hyphen\n .substr($charid, 8, 4).$hyphen\n .substr($charid,12, 4).$hyphen\n .substr($charid,16, 4).$hyphen\n .substr($charid,20,12)\n .chr(125);// \"}\"\n return $uuid;\n }\n}", "public static function getGuid()\n {\n $data = self::generateCryptoKey(16);\n\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100b = 4\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10\n\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }", "private function createGuid()\n {\n // section 127-0-1-1--751a8510:1443b2e74af:-8000:0000000000000C14 begin\n static $guid = '';\n $uid = uniqid(\"\", true);\n $data = mt_rand();\n $data .= isset($_SERVER['REQUEST_TIME']) ? $_SERVER['REQUEST_TIME'] : mt_rand();\n $data .= isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : mt_rand();\n $data .= isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : mt_rand();\n $data .= isset($_SERVER['LOCAL_PORT']) ? $_SERVER['LOCAL_PORT'] : mt_rand();\n $data .= isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : mt_rand();\n $data .= isset($_SERVER['REMOTE_PORT']) ? $_SERVER['REMOTE_PORT'] : mt_rand();\n $hash = strtoupper(hash('ripemd128', $uid . $guid . md5($data)));\n $guid = mt_rand(1,10) . \n substr($hash, 0, 8) . \n mt_rand(1,10) .\n substr($hash, 8, 4) .\n mt_rand(1,10) .\n substr($hash, 12, 4) .\n mt_rand(1,10) .\n substr($hash, 16, 4) .\n mt_rand(1,10) .\n substr($hash, 20, 12) .\n mt_rand(1,10);\n return $guid; \n // section 127-0-1-1--751a8510:1443b2e74af:-8000:0000000000000C14 end\n }", "function generateUUID($length=10) \n\t{\n $this->UUID = \"sh-\" . time() .\"-\". substr( md5(uniqid()), 0, $length); //md5 the unique number\n\t return $this->UUID;\n }", "public static function createGUID() {\r\n if (function_exists('com_create_guid')) {\r\n return substr(com_create_guid(), 1, 36);\r\n }\r\n else {\r\n mt_srand((double) microtime() * 10000);\r\n $charid = strtoupper(md5(uniqid(rand(), true)));\r\n $hyphen = chr(45);\r\n $uuid = substr($charid, 0, 8) . $hyphen .\r\n substr($charid, 8, 4) . $hyphen .\r\n substr($charid, 12, 4) . $hyphen .\r\n substr($charid, 16, 4) . $hyphen .\r\n substr($charid, 20, 12);\r\n\r\n return $uuid;\r\n }\r\n }", "protected function _uniqueId()\n {\n $t = explode(\" \", microtime());\n\n return sprintf(\n '%08s-%08s-%04s-%04x%04x',\n $this->_ipToHex(),\n substr(\"00000000\" . dechex($t[1]), -8),\n substr(\"0000\" . dechex(round($t[0] * 65536)), -4),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff)\n );\n }", "private function genV4() {\n $rand = $this->rand(16);\n\n $rand[6] = chr(ord($rand[6]) & 0x0f | 0x0f);\n $rand[8] = chr(ord($rand[8]) & 0x3f | 0x80);\n\n // Return the string\n return $this->byteToString($rand);\n }", "function Tguid16()\n {\n $entropicGuid = str_replace('.', '-', uniqid('', true)) . '-' . Guid();\n return $entropicGuid;\n }", "private function generateId()\n {\n $startHex = dechex((int)$this->startTime);\n $uuid = bin2hex(random_bytes(12));\n\n return \"1-{$startHex}-{$uuid}\";\n }", "public function generateGuid() {\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n mt_rand(0, 65535),\n mt_rand(0, 65535),\n mt_rand(0, 65535),\n mt_rand(16384, 20479),\n mt_rand(32768, 49151),\n mt_rand(0, 65535),\n mt_rand(0, 65535),\n mt_rand(0, 65535));\n }", "function createGUID() {\r\n if (function_exists('com_create_guid')) {\r\n return substr(com_create_guid(), 1, 36);\r\n }\r\n else {\r\n mt_srand((double) microtime() * 10000);\r\n $charid = strtoupper(md5(uniqid(rand(), true)));\r\n $hyphen = chr(45);\r\n $uuid = substr($charid, 0, 8) . $hyphen .\r\n substr($charid, 8, 4) . $hyphen .\r\n substr($charid, 12, 4) . $hyphen .\r\n substr($charid, 16, 4) . $hyphen .\r\n substr($charid, 20, 12);\r\n\r\n return $uuid;\r\n }\r\n}", "public static function GUIDv4($trim = true)\n {\n // Windows\n if (function_exists('com_create_guid') === true) {\n if ($trim === true) {\n return trim(com_create_guid(), '{}');\n } else {\n return com_create_guid();\n }\n\n }\n\n // OSX/Linux\n if (function_exists('openssl_random_pseudo_bytes') === true) {\n $data = openssl_random_pseudo_bytes(16);\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }\n\n // Fallback (PHP 4.2+)\n mt_srand((double)microtime() * 10000);\n $charid = strtolower(md5(uniqid(rand(), true)));\n $hyphen = chr(45); // \"-\"\n $lbrace = $trim ? \"\" : chr(123); // \"{\"\n $rbrace = $trim ? \"\" : chr(125); // \"}\"\n $guidv4 = $lbrace .\n substr($charid, 0, 8) . $hyphen .\n substr($charid, 8, 4) . $hyphen .\n substr($charid, 12, 4) . $hyphen .\n substr($charid, 16, 4) . $hyphen .\n substr($charid, 20, 12) .\n $rbrace;\n return $guidv4;\n }", "function shortcode()\n{\n\t//$uuid = substr($chars,0,3) . rand(100,999);\n\t$uuid = rand(100,999) . rand(100,999) . rand(100,999);\n\treturn strtoupper($uuid);\n}", "public\tfunction sp_build_order_no()\n\t{\n mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.\n $uuid = strtoupper(md5(uniqid(rand(), true)));\n // $uuid = substr($charid, 0, 8)\n // .substr($charid, 8, 4)\n // .substr($charid,12, 4)\n // .substr($charid,16, 4)\n // .substr($charid,20,12);\n return $uuid;\n\t}", "public function generateNewId()\n {\n return Uuid::uuid4();\n }", "protected function guidv4($data = null) {\n $data = $data ?? random_bytes(16);\n assert(strlen($data) == 16);\n\n // Set version to 0100\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40);\n // Set bits 6-7 to 10\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80);\n\n // Output the 36 character UUID.\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }", "protected function guidv4($data = null) {\n $data = $data ?? random_bytes(16);\n assert(strlen($data) == 16);\n\n // Set version to 0100\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40);\n // Set bits 6-7 to 10\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80);\n\n // Output the 36 character UUID.\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }", "function generateRandID(){\r\n \t\treturn md5(generateRandStr(16));\r\n \t\t}", "function getGuid() {\r\n\r\n return sprintf('%04x%04x-%04x-%04x-%02x%02x-%04x%04x%04x',\r\n mt_rand(0, 65535),\r\n mt_rand(0, 65535), // 32 bits for \"time_low\"\r\n mt_rand(0, 65535), // 16 bits for \"time_mid\"\r\n mt_rand(0, 4096) + 16384, // 16 bits for \"time_hi_and_version\", with\r\n // the most significant 4 bits being 0100\r\n // to indicate randomly generated version\r\n mt_rand(0, 64) + 128, // 8 bits for \"clock_seq_hi\", with\r\n // the most significant 2 bits being 10,\r\n // required by version 4 GUIDs.\r\n mt_rand(0, 256), // 8 bits for \"clock_seq_low\"\r\n mt_rand(0, 65535), // 16 bits for \"node 0\" and \"node 1\"\r\n mt_rand(0, 65535), // 16 bits for \"node 2\" and \"node 3\"\r\n mt_rand(0, 65535) // 16 bits for \"node 4\" and \"node 5\"\r\n );\r\n\r\n }", "public function getUuid()\n {\n return !empty($this->uuid) ? $this->uuid : '';\n }", "function generateRandID(){\n \t\treturn md5(generateRandStr(16));\n \t\t}", "protected function make_uid()\n\t{\n\t\t$date = date('Ymd\\THisT');\n\t\t$unique = substr(microtime(), 2, 4);\n\t\t$base = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPrRsStTuUvVxXuUvVwWzZ1234567890';\n\t\t$start = 0;\n\t\t$end = strlen( $base ) - 1;\n\t\t$length = 6;\n\t\t$str = null;\n\t\tfor( $p = 0; $p < $length; $p++ )\n\t\t{\n\t\t\t$unique .= $base{mt_rand( $start, $end )};\n\t\t}\n\t\treturn $date . '-' . $unique . ($this->num_to_letter(++$this->uid_counter));\n\t}", "function trCode(string $prefix = null, $entropy = false) {\n $s = uniqid('', $entropy);\n if (!$entropy) {\n $uuid = mb_strtoupper(base_convert($s, 16, 36));\n } else {\n $hex = substr($s, 0, 13);\n $dec = $s[13] . substr($s, 15); // skip the dot\n $uuid = mb_strtoupper(base_convert($hex, 16, 36) . base_convert($dec, 10, 36));\n }\n\n return $prefix ? $prefix . '-' . $uuid : $uuid;\n }", "function Guid($trim = true)\n {\n # Windows\n if (function_exists('com_create_guid') === true) {\n if ($trim === true)\n {\n return trim(com_create_guid(), '{}');\n }\n else\n {\n return com_create_guid();\n }\n }\n\n # OSX/Linux\n if (function_exists('openssl_random_pseudo_bytes') === true)\n {\n $data = openssl_random_pseudo_bytes(16);\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0100\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80); // set bits 6-7 to 10\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }\n\n # Fallback (PHP 4.2+)\n mt_srand((double) microtime() * 10000);\n $charid = strtolower(md5(uniqid(rand(), true)));\n $hyphen = chr(45); // \"-\"\n $lbrace = $trim ? \"\" : chr(123); // \"{\"\n $rbrace = $trim ? \"\" : chr(125); // \"}\"\n $guidv4 = $lbrace .\n substr($charid, 0, 8) . $hyphen .\n substr($charid, 8, 4) . $hyphen .\n substr($charid, 12, 4) . $hyphen .\n substr($charid, 16, 4) . $hyphen .\n substr($charid, 20, 12) . $rbrace;\n\n return $guidv4;\n }", "public function generate(): string;" ]
[ "0.8459579", "0.8408949", "0.83528924", "0.83240914", "0.8323027", "0.8316923", "0.8275305", "0.82140046", "0.8167597", "0.81647694", "0.8162782", "0.81513363", "0.81513363", "0.80990654", "0.8080359", "0.8039191", "0.7994037", "0.7993767", "0.7991543", "0.79565567", "0.79293483", "0.7900426", "0.7895312", "0.7894745", "0.787317", "0.7864154", "0.785712", "0.7856719", "0.7845839", "0.78365374", "0.7830752", "0.78044593", "0.77896154", "0.77892065", "0.77526975", "0.77526975", "0.7746357", "0.77456874", "0.7733919", "0.7712017", "0.770993", "0.7707256", "0.770299", "0.76938814", "0.7656296", "0.75919765", "0.7590217", "0.7579057", "0.7577042", "0.756474", "0.75616086", "0.7547625", "0.7537072", "0.75312805", "0.7425187", "0.7404848", "0.739864", "0.738933", "0.73791635", "0.7372378", "0.7371114", "0.7338342", "0.7335563", "0.73309845", "0.7302299", "0.7301181", "0.726559", "0.7265286", "0.7256205", "0.7243215", "0.72211", "0.72000796", "0.718532", "0.71792364", "0.71669734", "0.71582174", "0.7150321", "0.7141648", "0.71394634", "0.7116841", "0.7108681", "0.71086764", "0.7100879", "0.70948863", "0.7084874", "0.7076219", "0.7071023", "0.7041351", "0.7038591", "0.70185226", "0.69861", "0.69861", "0.6978704", "0.6964629", "0.6956301", "0.69545597", "0.6949464", "0.6906376", "0.6904614", "0.6897686" ]
0.8301882
6
[Aliased] Returns the first argument which is not null, or an empty string Example: first_value(null, '', 'Dave'); Result: Dave
function first_value(): mixed { $args = func_get_args(); return \Midnite81\Core\Functions\first_value(...$args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFirstArgument();", "public function getFirst(): ?string;", "public static function coalesce_empty()\n\t{\n\t\tforeach ( func_get_args() as $arg )\n\t\t{\n\t\t\tif ( ! empty($arg) )\n\t\t\t{\n\t\t\t\treturn $arg;\n\t\t\t}\n\t\t}\n\t}", "function getValueOrNull($value) {\n global $db;\n if(strlen($value) == 0) return \"NULL\";\n else return \"'\".$db->validate($value).\"'\";\n}", "function empty2null($value)\n{\n return $value === '' ? null : $value;\n}", "function coalesce() {\n $args = func_get_args();\n foreach ($args as $arg) {\n if (!empty($arg)) {\n return $arg;\n }\n }\n return $args[0];\n}", "function get_value_or_default($value,$default='')\n{\n\treturn (!empty($value)) ? $default : $value;\n}", "public function first(): string;", "public function getFirstArgument()\n {\n $tokens = $this->getTokens();\n \n foreach ($tokens as $token) {\n if ($token && '-' === $token[0]) {\n continue;\n }\n \n return $token;\n }\n }", "public function getFirstName(): ?string\n {\n return $this->getParam(self::FIRST_NAME);\n }", "function tf_first_set()\r\n {\r\n $args = func_get_args();\r\n foreach ($args as $v) {\r\n if (isset($v)) {\r\n return $v;\r\n }\r\n }\r\n return null;\r\n }", "public static function coalesce()\n\t{\n\t\tforeach ( func_get_args() as $arg )\n\t\t{\n\t\t\tif ( ! is_null($arg) )\n\t\t\t{\n\t\t\t\treturn $arg;\n\t\t\t}\n\t\t}\n\t}", "function coalesce() {\n\tforeach (func_get_args() as $arg) {\n\t\tif (!is_null($arg)) {\n\t\t\treturn $arg;\n\t\t}\n\t}\n\treturn null;\n}", "function null($input)\n{\n return ($input != NULL || $input!='')? $input : \" -- \";\n}", "public function first(string $str) {\n\n }", "public function value(): ?string;", "function first(array $array): mixed\n{\n return $array ? reset($array) : null; // No falses.\n}", "public static function coalesce()\n {\n $args = func_get_args();\n $last = null;\n foreach ($args as $arg) {\n if (!empty($arg)) {\n return $arg;\n }\n $last = $arg;\n }\n return $last;\n }", "function array_first($array)\n{\n if( is_array($array) )\n {\n $keys = array_keys($array);\n if( isset($keys[0]) )\n return $array[$keys[0]];\n }\n return null;\n}", "function pick(){\n $args = func_get_args();\n $val = first(array_filter($args));\n return $val ? $val : end($args);\n}", "function getFirst() ;", "public function getFirstArgument()\n {\n return $this->input->getFirstArgument();\n }", "function value_string($value, $length = NULL){\r\n\tif(is_string($value) || is_numeric($value)){\r\n\t\t//$value = trim($value);\r\n\t\treturn ($length != NULL ? substr($value, 0, $length) : $value);\r\n\t}else{\r\n\t\treturn NULL;\r\n\t}\r\n}", "public function orNull();", "function coalescenull($value, $default1) {\n if (is_null($value)) {\n return $default1;\n } else {\n return $value;\n }\n }", "function alt() {\r\n\tforeach (func_get_args() as $arg) {\r\n\t\tif (!is_null($arg)) {\r\n\t\t\treturn $arg;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn null;\r\n}", "public function getValue(): ?string;", "public function first() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public static function coalesce($args)\n\t{\n\t\t$args = func_get_args();\n\t\tforeach ($args as &$arg)\n\t\t{\n\t\t\tif (isset($arg) && !empty($arg))\n\t\t\t{\n\t\t\t\treturn $arg;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function first(): mixed;", "public function first(): mixed;", "public function getFirstName(): ?string {\n return $this->_firstName;\n }", "public function getFirstName(): ?string\n {\n return $this->firstName;\n }", "public function getFirstName(): ?string\n {\n return $this->firstName;\n }", "public function getFirstName(): ?string\n {\n return $this->firstName;\n }", "public function getFirstName(): ?string\n {\n return $this->FirstName;\n }", "public function getFirstName(): ?string\n {\n return $this->_first_name;\n }", "function first_value_from_array(array $array, mixed $default = null): mixed\n {\n return \\Midnite81\\Core\\Functions\\first_value_from_array($array);\n }", "protected function obtainValue($value) {\n return (strlen($value) > 0) ? $value : null; // if it is empty\n }", "function first($target)\n {\n // target must be an array\n if (!is_array($target)) {\n $target = (array)$target;\n }\n // target is required to have a value.\n if (count($target)) {\n return array_values($target)[0];\n } else {\n return false;\n }\n }", "function value(array $array, int|string $key = null, mixed $default = null): mixed\n{\n if (func_num_args() > 1) {\n return $array[$key] ?? $default;\n }\n return $array ? current($array) : null; // No falses.\n}", "public function getFirstNameOrUsername() {\n return $this->first_name ? : $this->username;\n }", "public function first(): OptionalInterface;", "public static function ensureNullIfEmpty($value)\n\t{\n\t\treturn empty($value)?null:$value;\n\t}", "function ifnull(...$args)\n{\n\t$data = array_shift($args);\n\t\n\tif( count($args) == 0 )\n\t\tScavixWDF\\WdfException::Raise(\"ifnull needs at least one argument\");\n\t\n\tif( is_array($data) )\n\t\t$data = (object)$data;\n\tif( !is_object($data) )\n\t{\n\t\tforeach( $args as $arg )\n\t\t\tif( $arg !== null )\n\t\t\t\treturn $arg;\n\t\treturn null;\n\t}\n\tforeach( $args as $n )\n\t\tif( isset($data->$n) && $data->$n !== null )\n\t\t\treturn $data->$n;\n\treturn null;\n}", "public static function findFirst($parameters=null) {}", "function findName($firstName,$nickName) {\n if($nickName === \"\") {\n $answer = $firstName;\n } else {\n// otherwise, return nickName\n $answer = $nickName;\n }\n return $answer;\n}", "function getFirstName($name) {\r\n\t$n = explode(\" \",$name);\r\n\treturn $n[0];\r\n}", "public function getString($first = false)\n {\n if (stripos($this->param, '?') !== false)\n {\n $param = $this->param;\n }\n //specifs for IN parameter\n else if ($this->param == 'IN')\n {\n $this->param = $this->param . ' ' . self::parseValuesPdo($this->getValue());\n $param = $this->param;\n $this->value = null;\n }\n else if (stripos($this->param, 'IS') === 0)\n {\n $param = $this->param;\n }\n else\n {\n $param = $this->param ? $this->param . ' ?' : '';\n }\n\n $where = $this->filter . ' ' . $param . ' ';\n\n if ($first)\n {\n return $where;\n }\n else\n {\n return strtoupper($this->condition) . ' ' . $where;\n }\n }", "function _get_argument($name, $default = null) {\n $values = $this->_get_arguments($name);\n $len = count($values);\n if ( 0 < $len ) {\n return $values[$len - 1];\n }\n if (null == $default) {\n die(\"Missing argument $name\");\n }\n return $default;\n}", "public function firstOr($default = null);", "public function getGivenName(): ?string;", "private function getR1($value)\n {\n $i = 0;\n $j = 0;\n\n // be-safe !!!\n if ($value === null) {\n return null;\n }\n\n // find 1st vowel\n $i = strlen($value) - 1;\n for ($j = 0; $j < $i; $j++) {\n if ($this->isVowel($value[$j])) {\n break;\n }\n }\n\n if (!($j < $i)) {\n return null;\n }\n\n // find 1st non-vowel\n for (; $j < $i; $j++) {\n if (!($this->isVowel($value[$j]))) {\n break;\n }\n }\n\n if (!($j < $i)) {\n return null;\n }\n\n return substr($value, $j + 1);\n }", "function tep_not_null ($value) {\n\treturn !empty ($value) && trim ($value);\n}", "function getFirstName($force_value = false) {\n $result = parent::getFirstName();\n if(empty($result) && $force_value) {\n $email = $this->getEmail();\n return substr_utf($email, 0, strpos_utf($email, '@'));\n } // if\n return $result;\n }", "protected function getArgument(?string $key = null): mixed\n {\n return $this->input->getArgument($key) ?? '';\n }", "public static function setDefault(mixed $valueRequired = null, array $arguments = []):mixed {\n\n # Set result\n $result = null;\n\n # Check valueRequired\n if($valueRequired === null)\n\n # Return null\n return $result;\n\n # Check id the string is value\n if(is_callable($valueRequired)){\n\n $result = $valueRequired($arguments);\n\n }else{\n\n # Set result\n $result = $valueRequired;\n\n }\n\n # Return result\n return $result;\n\n }", "function pseudoTypeNull(null $var = null) {}", "public function getFirstName()\n {\n return App_Formatting::emptyToNull($this->firstName->getValue());\n }", "function value($value)\n {\n switch (strtolower($value)) {\n case 'true':\n case '(true)':\n return true;\n case 'false':\n case '(false)':\n return false;\n case 'empty':\n case '(empty)':\n return '';\n case 'null':\n case '(null)':\n return null;\n }\n if (($valueLength = strlen($value)) > 1 && $value[0] === '\"' && $value[$valueLength - 1] === '\"') {\n return substr($value, 1, -1);\n }\n return $value;\n }", "protected function realiseFirstElement(): ?string\n {\n $safeKey = null;\n\n if (count($this->array) == 0) {\n if ($this->lazyTail->valid()) {\n $safeKey = $this->realiseCurrentPair();\n } else {\n $this->clearIndexIfAllKeysValid();\n }\n } elseif ($this->lazyTail->valid()) {\n $safeKey = array_keys($this->array)[0];\n }\n\n return $safeKey;\n }", "public function getFirstName()\n {\n return $this->first_name ?? $this->nickname ?? $this->name;\n }", "public static function first($array) {\n if (count($array) == 0) {\n return null;\n }\n $keys = array_keys($array);\n return $array[$keys[0]];\n }", "private function nullable($value)\n {\n return is_null($value) || $value === '';\n }", "public static function findFirst($parameters = null);", "function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}", "public function first($expression): static;", "public function getFirstNames() {\n\t\treturn empty( $this->container['first_names'] ) ? null : $this->container['first_names'];\n\t}", "function _first($ar){\n\treturn array_shift(array_values($ar));\t\n}", "function getFirstElementValue( &$elem, $tagname = '', $prefix = '') {\n\t\t$nextElem = $elem->getFirstChild();\n\t\t$node = NULL;\n\n\t\tif( $GLOBALS['xmlv'] != XMLV4 && $prefix != '' )\n\t\t\t$tagname = $prefix.':'.$tagname;\n\t\t\t\n\t\twhile( $nextElem ) {\n\t\t\tif( ($nextElem->getNodeType() == XML_ELEMENT_NODE) ) { // only node elements\n\t\t\t\tif( $tagname != '' ) {\n\t\t\t\t\tif(strtolower($nextElem->getNodeName()) == $tagname) {\n\t\t\t\t\t\t$node = $nextElem;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n $node = $nextElem;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$nextElem = $nextElem->getNextSibling();\n\t\t}\n\t\tif( $node != NULL ) {\n\t\t\t$elemValue = $node->getFirstChild();\n\t\t\tif( $elemValue != NULL )\n\t\t\t\treturn $elemValue->getContent();\n\t\t}\n\t return NULL;\n\t}", "public function getFirstname(): string;", "function leftpart($string, $separator=\" \", $defaultvalue=\"\") {\n //if ($parts[0]) {\n // return $parts[0];\n //}\n if (is_empty($defaultvalue)) {\n $defaultvalue = $string;\n }\n\n if (contains($string, $separator)) {\n return separatedstring($string, 1, $separator);\n } else {\n return $defaultvalue;\n }\n }", "public static function firstValue($array){\n\t\tforeach($array as $elt) return $elt;\n\t\treturn false;\n\t}", "function _eor() {\r\n\tforeach(func_get_args() as $a) { if (!empty($a)) return $a; }\r\n\treturn null;\r\n}", "function is_blank( $value ) {\n return !isset( $value ) || trim( $value ) === '';\n}", "public abstract function findFirst(): Optional;", "function getFieldGivenName($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_givenName');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_givenName');\n\t\t$tooltip = setToolTipNotification('givenname');\t\t\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.\"<span class='red'>*</span>\".$tooltip.\"</label></br><input type='text' name='givenName' value='\".$value.\"' class='' id='givenName'></br><div id='givenName_err_con'></div>\";\t\t\n\t\t}\n\t\treturn $form_ret;\n\t}", "function _set_null_default_value($value) {\n\t\tif ($value == '') {\n\t\t\treturn \"NULL\";\n\t\t} else {\n\t\t\treturn \"'\".$value.\"'\";\n\t\t}\n\t}", "public function getFirstName()\n {\n if (is_null($this->firstName)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_FIRST_NAME);\n if (is_null($data)) {\n return null;\n }\n $this->firstName = (string) $data;\n }\n\n return $this->firstName;\n }", "final public function getFirst() {\n\t\treturn null;\n\t}", "function not_null($value) {\n if (is_array($value)) {\n if (sizeof($value) > 0)\n return true;\n else\n return false;\n } else {\n if ((is_string($value) || is_int($value)) && ($value != '') && (strlen(trim($value)) > 0))\n return true;\n else\n return false;\n }\n}", "protected function _getFirstname($name)\n {\n if(is_null($name)){\n return \"sds\";\n }\n $_name = explode(\" \", $name);\n return $_name[0];\n }", "public function getFirst($query){\n\t\treturn $query[0];\n\t}", "function getValue($key, $undefined)\n{\n $val = get($key);\n if (is_null($val) || $val === \"\") {\n return $undefined;\n }\n return $val;\n}", "function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}", "function atkNvl()\n{\n\tfor ($i = 0; $i < func_num_args(); $i++)\n\t{\n\t\t$arg = func_get_arg($i);\n\t\tif (!is_null($arg))\n\t\t{\n\t\t\treturn $arg;\n\t\t}\n\t}\n\n\treturn null;\n}", "public function firstOrDefault($default=null)\n {\n if($this->length()>0)\n {\n return $this->getAt(0);\n }\n return $default;\n }", "public static function first();", "public function getFirstname() {\n return $this->getValue('firstname');\n }", "public function getDefault(): ?string;", "public function first($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "function get_form_val($key, $default='', $getfirst=TRUE)\r\n{\r\n if ($getfirst)\r\n {\r\n return (empty($_GET[$key]) ? (empty($_POST[$key]) ? $default : $_POST[$key]) : $_GET[$key]);\r\n }\r\n else\r\n {\r\n return (empty($_POST[$key]) ? (empty($_GET[$key]) ? $default : $_GET[$key]) : $_POST[$key]);\r\n }\r\n}", "public function singleOrDefault($default=null)\n {\n if($this->length()==1)\n {\n return $this->getAt(0);\n }\n return $default;\n }", "function is_blank($value) {\n if (is_object($value) && method_exists($value, 'is_blank')) return $value->is_blank();\n if (is_string($value)) $value = trim($value);\n return is_empty($value);\n}", "public function testFirst()\r\n {\r\n self::assertEquals(1, Arr::first([1, 2, 3]));\r\n self::assertEquals('a', Arr::first(['a', 'b', 'c']));\r\n self::assertNotEquals('b', Arr::first(['a', 'b', 'c']));\r\n\r\n self::assertEquals(2, Arr::first([1, 2, 3], function ($value) {\r\n return $value === 2;\r\n }));\r\n self::assertEquals(null, Arr::first([1, 2, 3], function ($value) {\r\n return $value === 20;\r\n }));\r\n\r\n self::assertInternalType('int', Arr::first([1, 2, 3]));\r\n self::assertInternalType('string', Arr::first(['a', 'b', 'c']));\r\n }", "function issetor(&$variable, $placeholder = ''){\n if(isset($variable)){\n return $variable;\n } else {\n return $placeholder;\n }\n}", "function is_empty($value) {\n if (is_array($value)) {\n return empty($value);\n } elseif (is_string($value)) {\n return strlen($value) == 0;\n } else {\n return $value === null;\n }\n}", "function get_full_passed($argumento) { \n $findArg = $this->full_passed($argumento); \n\n if ($findArg) {\n return $this->parsed[$findArg][1];\n } \n\n return; \n }", "private function _value( $value=null, $fallback='', $trim=false )\n {\n if( is_null( $value ) || $value === false || $value === '' )\n {\n return $fallback;\n }\n return $trim ? trim( $value ) : $value;\n }", "public function getFirst()\n {\n $this->update();\n if (isset($this->data[0])) {\n return $this->updateValueIfNeeded($this->data, 0);\n }\n return null;\n }" ]
[ "0.6878833", "0.67094123", "0.65026397", "0.6456112", "0.6428809", "0.63297784", "0.62991554", "0.62442124", "0.6211647", "0.6173616", "0.61408085", "0.61316526", "0.61298984", "0.60309505", "0.6011201", "0.5921431", "0.59159076", "0.5913029", "0.59048975", "0.5902153", "0.58874935", "0.58430624", "0.583784", "0.5835234", "0.5792395", "0.5751863", "0.5734011", "0.57293385", "0.57159483", "0.57123244", "0.57123244", "0.571041", "0.56644386", "0.56644386", "0.56644386", "0.56335944", "0.56169873", "0.5596708", "0.55914766", "0.5585203", "0.558144", "0.55645627", "0.55592346", "0.5544946", "0.55190235", "0.5515183", "0.5503457", "0.5500601", "0.54894954", "0.5476948", "0.5471581", "0.5471027", "0.5457032", "0.5456593", "0.5453502", "0.54477566", "0.54466814", "0.54407877", "0.5436204", "0.5434935", "0.5424523", "0.5416721", "0.540804", "0.54039854", "0.54007435", "0.5400413", "0.5391202", "0.53908354", "0.5383276", "0.53817147", "0.5377883", "0.5371845", "0.5369672", "0.5360185", "0.5345177", "0.53301775", "0.5317795", "0.53173226", "0.5312273", "0.5311916", "0.5307935", "0.53040355", "0.529696", "0.52944523", "0.52927744", "0.52795094", "0.52722883", "0.5270465", "0.52681524", "0.5262199", "0.52547586", "0.5251248", "0.52442944", "0.52362424", "0.5235579", "0.52348506", "0.5229295", "0.522783", "0.5223356", "0.5218056" ]
0.73225117
0
[Aliased] Retrieve the first nonempty value from an array, or a default value if none found. Example: \Midnite81\Core\Functions\first_value_from_array(['', null, 'Dave']); Result: Dave
function first_value_from_array(array $array, mixed $default = null): mixed { return \Midnite81\Core\Functions\first_value_from_array($array); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function first($array) {\n if (count($array) == 0) {\n return null;\n }\n $keys = array_keys($array);\n return $array[$keys[0]];\n }", "function array_first($array)\n{\n if( is_array($array) )\n {\n $keys = array_keys($array);\n if( isset($keys[0]) )\n return $array[$keys[0]];\n }\n return null;\n}", "public static function findFirstOrDefault($array, $default = null)\n\t{\n\t\tif (!is_array($array) || 0 == sizeof($array)) {\n\t\t\treturn $default;\n\t\t}\n\n\t\treturn array_shift($array);\n\t}", "function first(array $array): mixed\n{\n return $array ? reset($array) : null; // No falses.\n}", "function array_first($array, $callback, $default = null)\n {\n return Arr::first($array, $callback, $default);\n }", "public static function first($array) {\n\t\treturn $array[0];\n\t}", "function array_first($array, callable $callback = null, $default = null)\n {\n return Arr::first($array, $callback, $default);\n }", "public static function firstValue($array){\n\t\tforeach($array as $elt) return $elt;\n\t\treturn false;\n\t}", "function array_first($array, $callback, $default = null)\n\t{\n\t\tforeach ($array as $key => $value)\n\t\t{\n\t\t\tif (call_user_func($callback, $key, $value)) return $value;\n\t\t}\n\n\t\treturn value($default);\n\t}", "public static function first(array $array)\n {\n return !empty($array) ? reset($array) : null;\n }", "function array_first($array)\n {\n return arr::first($array);\n }", "function value(array $array, int|string $key = null, mixed $default = null): mixed\n{\n if (func_num_args() > 1) {\n return $array[$key] ?? $default;\n }\n return $array ? current($array) : null; // No falses.\n}", "public static function first($array, $callback = NULL, $default = NULL)\n {\n \n if (is_null($callback)) {\n \n if (empty($array)) {\n return $default;\n }\n \n foreach ($array as $entry) {\n return $entry;\n }\n \n }\n \n foreach ($array as $key => $value) {\n if (call_user_func($callback, $value, $key)) {\n return $value;\n }\n }\n \n \n return $default;\n }", "function tf_array_first_set()\r\n {\r\n $key_list = func_get_args();\r\n $array = array_shift($key_list);\r\n $default = array_pop($key_list);\r\n \r\n foreach ($key_list as $key)\r\n if (isset($array[$key]))\r\n return $array[$key];\r\n\r\n return $default;\r\n }", "public function array_first($array, callable $callback = null, $default = null)\n {\n return Arr::first($array, $callback, $default);\n }", "protected function get_first_array_item( $val ) {\n\t\tif ( $val && is_array( $val ) ) {\n\t\t\treturn $val[0];\n\t\t}\n\t\treturn $val;\n\t}", "public function array_first( $array, $get_key = false ) {\n\t\tif ( is_array( $array ) && ! empty( $array ) ) {\n\t\t\t$keys = array_keys( $array );\n\n\t\t\t// Get array key\n\t\t\tif ( $get_key ) {\n\t\t\t\treturn $keys[0];\n\t\t\t}\n\n\t\t\t// Get array value\n\t\t\treturn $array[ $keys[0] ];\n\t\t}\n\n\t\treturn null;\n\t}", "function first_value(): mixed\n {\n $args = func_get_args();\n\n return \\Midnite81\\Core\\Functions\\first_value(...$args);\n }", "public static function first( $array, $getKey = FALSE )\n\t{\n\t\tif ( $getKey ) {\n\t\t\t$array = array_keys( $array );\n\t\t}\n\t\treturn is_array( $array ) ? reset( $array ) : NULL;\n\t}", "public function firstOrDefault($default=null)\n {\n if($this->length()>0)\n {\n return $this->getAt(0);\n }\n return $default;\n }", "public function first() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function _first($ar){\n\treturn array_shift(array_values($ar));\t\n}", "public function singleOrDefault($default=null)\n {\n if($this->length()==1)\n {\n return $this->getAt(0);\n }\n return $default;\n }", "static function first(array $array, callable $callback, $default = null) {\n foreach ($array as $key => $value) {\n if ($callback($key, $value)) {\n return $value;\n }\n }\n\n return $default;\n }", "public static function first($array, callable $callback, $default = null)\n {\n foreach ($array as $key => $value) {\n if (call_user_func($callback, $key, $value)) {\n return $value;\n }\n }\n\n return value($default);\n }", "public static function first($array, callable $callback, $default = null)\n {\n foreach ($array as $key => $value)\n {\n if (call_user_func($callback, $key, $value)) return $value;\n }\n\n return $default;\n }", "public static function first($array, callable $callback, $default = null)\n {\n \n }", "function first($target)\n {\n // target must be an array\n if (!is_array($target)) {\n $target = (array)$target;\n }\n // target is required to have a value.\n if (count($target)) {\n return array_values($target)[0];\n } else {\n return false;\n }\n }", "public function first() {\n if (sizeof($this) < 1) return null;\n $keys = array_keys($this);\n return $this[$keys[0]];\n }", "function getFirstElement($array){\n\n /*\n * convert object to array first\n */\n\n if(is_object($array)){\n $array = (array) $array;\n }\n\n\n /*\n * check if this array is\n * php array\n */\n\n if(is_array($array)){\n return getElement($array);\n }\n\n /*\n * if json array\n * check if json is valid\n * and decode the array\n */\n\n $array = jsonDecode($array);\n\n /*\n * return with the first element\n */\n\n return getElement($array);\n\n}", "public function first(): mixed\n {\n return array_first($this->data);\n }", "public function getFirst()\n {\n $this->update();\n if (isset($this->data[0])) {\n return $this->updateValueIfNeeded($this->data, 0);\n }\n return null;\n }", "public function first()\n {\n try {\n return Optional::ofNullable($this->get(0));\n } catch (OutOfBoundsException $e) {\n return Optional::absent();\n }\n }", "public static function getOrDefault($array, $key, $default)\r\n {\r\n if (empty($array[$key])) {\r\n return $default;\r\n }\r\n return $array[$key];\r\n }", "private function oneFromArray($array, $key = 0) {\n if (ISSET($array[$key]))\n {\n return $array[$key];\n }\n }", "public function getFirst(): ?string;", "protected function realiseFirstElement(): ?string\n {\n $safeKey = null;\n\n if (count($this->array) == 0) {\n if ($this->lazyTail->valid()) {\n $safeKey = $this->realiseCurrentPair();\n } else {\n $this->clearIndexIfAllKeysValid();\n }\n } elseif ($this->lazyTail->valid()) {\n $safeKey = array_keys($this->array)[0];\n }\n\n return $safeKey;\n }", "public function testFirst()\r\n {\r\n self::assertEquals(1, Arr::first([1, 2, 3]));\r\n self::assertEquals('a', Arr::first(['a', 'b', 'c']));\r\n self::assertNotEquals('b', Arr::first(['a', 'b', 'c']));\r\n\r\n self::assertEquals(2, Arr::first([1, 2, 3], function ($value) {\r\n return $value === 2;\r\n }));\r\n self::assertEquals(null, Arr::first([1, 2, 3], function ($value) {\r\n return $value === 20;\r\n }));\r\n\r\n self::assertInternalType('int', Arr::first([1, 2, 3]));\r\n self::assertInternalType('string', Arr::first(['a', 'b', 'c']));\r\n }", "public static function arrayKeyFirst($array) {\n\t\tforeach ($array as $key => $unused) {\n\t\t\treturn $key;\n\t\t}\n\t\treturn NULL;\n\t}", "function array_get_value($arr, $key, $default = '')\n {\n if (is_array($arr)) {\n if (key_exists($key, $arr)) {\n return $arr[$key];\n }\n return $default; \n }\n return $arr;\n }", "function popfirst($arr)\n {\n if(!is_array($arr) || count($arr) ==0)\n {\n return null;\n }\n else\n {\n foreach($arr as $key=>$val)\n {\n //immediately return the key\n return $key;\n }\n }\n\n return null;\n }", "public function first(callable $callback = null, $default = null)\n {\n return Arr::first($this->items, $callback, $default);\n }", "function first ()\n {\n return $this->A ? $this->A[0] : null;\n }", "function array_val($array,$key,$default=null)\n{\n\tif( array_key_exists($key, $array) )\n\t\treturn $array[$key];\n\treturn $default;\n}", "function first_index_arr($arr)\n {\n foreach ($arr as $k => $v) return $k;\n }", "function array_key_or_default($key, $arr, $default) {\n if(array_key_exists($key, $arr))\n return $arr[$key];\n return $default;\n}", "public static function get($array, string $key, $default = NULL)\n {\n return $array[$key] ?? $default;\n }", "public function first(? callable $callback = null, $default = null)\n {\n if ($this->isEmpty()) {\n return $default;\n }\n\n foreach ($this->items as $key => $value) {\n if (is_null($callback) || $callback($value, $key)) {\n return $value;\n }\n }\n\n return $default;\n }", "public static function getFirstElementPointer(array &$arr)\n {\n $result = null;\n if (is_array($arr) && sizeof($arr)) {\n reset($arr);\n $result = &$arr[key($arr)];\n }\n\n return $result;\n }", "public function first() {\n if (count($this->items) > 0) {\n return $this->items[0];\n }\n else\n return null;\n }", "public static function firstBy(array $array, $by, $value = null)\n {\n foreach ($array as $item) {\n if (self::satisfies($item, $by, $value)) {\n return $item;\n }\n }\n\n return null;\n }", "function getArrayVar($array, $key, $default = null)\n{\n\t$array\t= (array) $array;\n\t\n//\tif (!is_array($array))\n//\t\treturn;\n\tif ( array_key_exists($key, $array) && $array[$key] != null)\n\t\treturn $array[$key];\n\telse\n\t\treturn $default;\n}", "function val(array $array, $key) {\r\n\treturn array_key_exists($key, $array) ? $array[$key] : null;\r\n}", "public function first()\n {\n $copy = $this->array;\n return reset($copy);\n }", "public function getFirst()\n {\n if (is_array($this->rows)) {\n $rows = &$this->rows;\n } else {\n $query = clone $this->query;\n $query->setLimit(1);\n $rows = $query->getResult();\n }\n\n return (isset($rows[0])) ? $rows[0] : null;\n }", "public static function get($key, $array, $default = null)\n {\n return (isset($array[$key]) && ! empty($array[$key])) ? $array[$key] : $default;\n }", "public function first()\n {\n return (count($this->list) > 0 ?\n $this->list[0] : null\n );\n }", "final public function getFirst() {\n\t\treturn null;\n\t}", "final public function first()\n {\n $items = $this->all();\n if (count($items) === 0) {\n return null;\n }\n return reset($items);\n }", "function tf_first_set()\r\n {\r\n $args = func_get_args();\r\n foreach ($args as $v) {\r\n if (isset($v)) {\r\n return $v;\r\n }\r\n }\r\n return null;\r\n }", "public function first(): mixed;", "public function first(): mixed;", "public function getVal($key = '', $default = null) {\n $array = $this->array;\n if($key == '') {\n return $array;\n }\n $keys = explode('/', $key);\n $count = count($keys);\n $i = 0;\n foreach($keys as $k => $val) {\n $i++;\n if($val == '') {\n continue;\n }\n if(isset($array[$val]) && !is_array($array[$val])) {\n if($array[$val] !== null && $i == $count) {\n return $array[$val];\n }\n return $default;\n }\n if(isset($array[$val])) {\n $array = $array[$val];\n } else {\n return $default;\n }\n if(is_array($array) && key($array) == '0') {\n $array = current($array);\n }\n }\n return $array;\n }", "public static function get(array $array, string $key, mixed $default = NULL): mixed\n {\n\n if (isset($array[$key])) {\n\n return $array[$key];\n\n }\n\n foreach (explode('.', $key) as $segment) {\n\n if (!is_array($array) || !array_key_exists($segment, $array)) {\n\n return $default;\n\n }\n\n $array = $array[$segment];\n\n }\n\n return $array;\n\n }", "public function firstKey(): int|string|null\n {\n return array_key_first($this->data);\n }", "public static function tryGetValue(array $array = null, $key, $default = null)\n {\n return is_array($array) && array_key_exists($key, $array)\n ? $array[$key]\n : $default;\n }", "public static function get( $array, $key, $default = NULL )\n\t{\n\t\treturn is_array( $array ) && array_key_exists( $key, $array ) ? $array[$key] : $default;\n\t}", "public function first()\n {\n return \\count($this->data) > 0 ? $this->data[0] : null;\n }", "public static function first($array)\n {\n $newArr = array_slice($array, 0, 1);\n\n return !empty($newArr[0]) ? $newArr[0] : false;\n }", "static function from(array $arr, $key, $default = null, $one = true) {\n if (array_key_exists($key, $array)) {\n return $array[$key];\n }\n\n $grep = preg_grep('/^('.preg_quote($key, '/').')$/i', array_keys($array));\n $ret = array_intersect_key($arr, array_flip($grep));\n\n return empty($ret) ? $default : ($one ? end($ret) : $ret);\n }", "function arrayGet($array, $key, $default = NULL)\n{\n return isset($array[$key]) ? $array[$key] : $default;\n}", "public function first() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_shift( $result );\n\t}", "protected function first()\n {\n foreach ($this->sortable as $key => $value) {\n if (is_numeric($key)) {\n return $value;\n }\n\n return $key;\n }\n\n return null;\n }", "public function findFirst() {\r\n\t\t$aux = $this->fetchAllPg(1);\r\n\t\tif($aux == null)\r\n\t\t\treturn null;\r\n\t\treturn $aux[0];\r\n\t}", "public function first() { \t\n \ttry{\n if (!is_array($this->Items)) return $this->Items ; \t\t\n if (!count($this->Items)) return null; \t\n \treset($this->Items); \t\t\n return $this->Items[key($this->Items)]; \n }catch(Exception $e){\n throw $e;\n } \t\n }", "function array_val($array, $key, $default = null) {\n\t// an array of keys can be used to look in a multidimensional array\n\tif( is_array($key) ){\n\t\t$k = array_shift($key);\n\t\t//if $key is now empty then were at the end\n\t\tif( empty($key) ){\n\t\t\treturn isset($array[$k]) ? $array[$k] : $default;\n\t\t}\n\t\t//resursive call\n\t\treturn isset($array[$k]) ? array_val($array[$k], $key, $default) : $default;\n\t}\n\t//key is not an array\n\treturn isset($array[$key]) ? $array[$key] : $default;\n}", "public function collectFirst(callable $callback = null, $default = null) {\n\t\tif($callback) {\n\t\t\tforeach ($this as $value) {\n\t\t\t\tif($callback($value)) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_null($default)) {\n\t\t\t\tthrow new \\InvalidArgumentException('No element matching the criteria was found.');\n\t\t\t}\n\t\t\treturn $default;\n\t\t}\n\n\t\t$collected = $this->take(1)->collect();\n\t\tif (empty($collected) && is_null($default)) {\n\t\t\tthrow new \\InvalidArgumentException('No elements available in this stream.');\n\t\t}\n\t\treturn array_shift($collected) ?? $default;\n\t}", "function coalesce() {\n $args = func_get_args();\n foreach ($args as $arg) {\n if (!empty($arg)) {\n return $arg;\n }\n }\n return $args[0];\n}", "public function getFirstItem()\n {\n if ($this->valid() === false) {\n return null;\n }\n return $this->rewind()->current();\n }", "function array_get($array, $key, $default = null)\n {\n return Arr::get($array, $key, $default);\n }", "function array_get($array, $key, $default = null)\n {\n return Arr::get($array, $key, $default);\n }", "function array_get($array, $key, $default = null)\n {\n return Arr::get($array, $key, $default);\n }", "function array_get(array $arr, $key, $default = null) {\n\treturn array_key_exists($key, $arr) ? $arr[$key] : $default;\n}", "function getFirst() ;", "function array_get(array $array, $key, $default = null) {\n if ($key === null) {\n return null;\n }\n\n if (isset($array[$key])) {\n return $array[$key];\n }\n\n foreach (explode('.', $key) as $segment) {\n if ( ! is_array($array) || ! array_key_exists($segment, $array)) {\n return $default;\n }\n\n $array = $array[$segment];\n }\n\n return $array;\n }", "public static function get_empty($array, $key, $default = NULL)\n\t{\n\t\treturn !empty($array[$key]) ? $array[$key] : $default;\n\t}", "function PremierElementTableau(array $tableau){\n if(empty($tableau)){\n return null;\n } \n else\n {\n return $tableau[0];\n }\n}", "static function head(array $array) {\n return reset($array);\n }", "function array_get(array $array, string $key, $default = null)\n {\n if (is_null($key)) {\n return $array;\n }\n\n if (isset($array[$key])) {\n return $array[$key];\n }\n\n foreach (explode('.', $key) as $segment) {\n if (! is_array($array) || ! array_key_exists($segment, $array)) {\n return value($default);\n }\n\n $array = $array[$segment];\n }\n\n return $array;\n }", "function array_get(array $a, $key, $default = null) {\n return isset($a[$key]) ? $a[$key] : $default;\n}", "function array_get($array, $key, $default = null)\n {\n return isset($array[$key]) ? $array[$key] : $default;\n }", "public function getFirst();", "public function getNonNull($content) {\n\t\tif (!is_array(current($content))) {\n\t\t\tthrow new Exception('Please use a multi-dimensional array'.\n\t\t\t\t'from '.$this->className.'->'.__FUNCTION__.'() line '.\n\t\t\t\t__LINE__\n\t\t\t);\n\t\t} else {\n\t\t\ttry {\t\t\t\n\t\t\t\t// loop through each array\n\t\t\t\t$count = count($content);\n\t\t\t\t\n\t\t\t\tfor ($i = 0; $i < $count; $i++) {\n\t\t\t\t\t$lastkey = array_pop(array_keys($content[$i]));\n\n\t\t\t\t\tforeach ($content[$i] as $subKey => $subValue) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (is_null($subValue)) {\n\t\t\t\t\t\t\tcontinue 2; // go to next array\n\t\t\t\t\t\t} \n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($subKey == $lastkey) {\n\t\t\t\t\t\t\treturn $content[$i];\n\t\t\t\t\t\t}\n\t\t\t\t\t} //<-- end foreach -->\n\t\t\t\t\t\n\t\t\t\t\treturn $content[0];\n\t\t\t\t} //<-- end foreach -->\n\t\t\t\t \n\t\t\t} catch (Exception $e) { \n\t\t\t\tthrow new Exception($e->getMessage().' from '.$this->className\n\t\t\t\t\t.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t\t);\n\t\t\t} //<-- end try -->\n\t\t} //<-- end if -->\n\t}", "public function first(): mixed\n {\n return Iterators::first($this->iterator);\n }", "public function first()\n {\n if($this->_results) {\n return $this->_results[0];\n }\n return null;\n }", "public function first(callable $callback = null, $default = null);", "public function first(callable $callback = null, $default = null);", "public static function getValueFromArray(\n array &$arr,\n $index = 0,\n $default = null\n ) {\n $value = $default;\n\n if (isset($arr[$index])) {\n $value = $arr[$index];\n }\n\n return $value;\n }", "function getArrayFirstIndex($arr) {\n\tforeach ($arr as $key => $value)\n\treturn $key;\n}", "public function first($callback = false, $default = null);" ]
[ "0.7817297", "0.77948207", "0.76273775", "0.7550804", "0.7521744", "0.749155", "0.7490529", "0.7436106", "0.7424328", "0.7348842", "0.72852427", "0.72143817", "0.71930516", "0.7180979", "0.718037", "0.7063383", "0.7063324", "0.705412", "0.70493627", "0.7038997", "0.70365834", "0.693404", "0.6919837", "0.68814445", "0.6849024", "0.6841781", "0.6809687", "0.6763092", "0.6748932", "0.6734691", "0.6689429", "0.6674332", "0.66261405", "0.6561659", "0.6549303", "0.65393186", "0.6531652", "0.6507999", "0.64948505", "0.64722455", "0.64668506", "0.6452738", "0.6435552", "0.6404311", "0.6382836", "0.6379124", "0.63569", "0.63387805", "0.6335319", "0.63274544", "0.6305495", "0.6300656", "0.6281239", "0.6260984", "0.6252606", "0.6237344", "0.62341076", "0.6225135", "0.6205371", "0.61979896", "0.61966735", "0.61966735", "0.6196641", "0.6194688", "0.61929727", "0.61892027", "0.61888677", "0.6180904", "0.6178927", "0.61729956", "0.6170995", "0.6168138", "0.6129966", "0.61290216", "0.61211777", "0.61205184", "0.61166286", "0.61112684", "0.6073908", "0.60714", "0.60714", "0.60714", "0.6068795", "0.6066567", "0.60628486", "0.60628057", "0.6062582", "0.60598767", "0.60584563", "0.60580426", "0.605786", "0.60448915", "0.6043325", "0.60427976", "0.6034667", "0.6031544", "0.6031544", "0.60308", "0.6030548", "0.6025951" ]
0.857743
0
[Aliased] Returns the value of a backed enum case If the $value is not a Backed Enum Case, a runtime error will be thrown Example usage: enum(\Midnite81\Core\Enums\ExpectedType::String) Result: string
function enum(mixed $value): mixed { return \Midnite81\Core\Functions\enum($value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetEnumValue(){\n\t\treturn db_enum_value($this->tables[0], $this->fields[0]);\n\t}", "private function filter_enum( $value ) {\n\t\tif ( empty( $this->enum ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tif ( in_array( $value, $this->enum, true ) ) {\n\t\t\treturn $value;\n\t\t}\n\n\t\tthrow new InvalidArgumentException( '😡 Enum value ' . $value . ' does not exist in the schema.' );\n\t}", "final public static function Label( $enumType, $enumValue )\n {\n $result = 'IllegalValue';\n\n if ( class_exists( $enumType, false ) )\n {\n $reflector = new ReflectionClass( $enumType );\n\n foreach( $reflector->getConstants() as $key => $val )\n {\n if ( $val == $enumValue )\n {\n $result = $key;\n break;\n }\n }\n }\n return $result;\n }", "public function transform($value)\n {\n if ($value === null) {\n return null;\n }\n\n if (!$value instanceof $this->enumClass) {\n throw new UnexpectedTypeException($value, $this->enumClass);\n }\n\n return $value->getFlags();\n }", "public function getEnumvalue()\n {\n return $this->enumvalue;\n }", "function check_enum_value_type($received_value, $table_name, $table_field, \\PDO $db) {\n $options = \\k1lib\\sql\\get_db_table_enum_values($db, $table_name, $table_field);\n $options_fliped = array_flip($options);\n\n if (!isset($options_fliped[$received_value])) {\n $error_type = print_r($options_fliped, TRUE) . \" value: '$received_value'\";\n// d($received_value, TRUE);\n } else {\n $error_type = FALSE;\n }\n return $error_type;\n}", "abstract protected function getSupportedEnumType() : string;", "final public static function ToString( $enumType, $enumValue )\n {\n $result = 'NotAnEnum::IllegalValue';\n\n if ( class_exists( $enumType, false ) )\n {\n $reflector = new ReflectionClass( $enumType );\n $result = $reflector->getName() . '::IllegalValue';\n foreach( $reflector->getConstants() as $key => $val )\n {\n if ( $val == $enumValue )\n {\n $result = str_replace( 'IllegalValue', $key, $result );\n break;\n }\n }\n }\n return $result;\n }", "protected function getCastableValue(mixed $value): mixed\n {\n $value = $this->enumClass::parseDatabase($value);\n\n if ($value === null) {\n return null;\n }\n\n // If the value exists in the enum (using strict type checking) return it\n if ($this->enumClass::hasValue($value)) {\n return $value;\n }\n\n // Find the value in the enum that the incoming value can be coerced to\n foreach ($this->enumClass::getValues() as $enumValue) {\n if ($value == $enumValue) {\n return $enumValue;\n }\n }\n\n // Fall back to trying to construct it directly (will result in an error since it doesn't exist)\n return $value;\n }", "public static function Parse($enumType, $value, $ignoreCase) {\r\n /*\r\n * ArgumentNullException\t\r\n enumType or value is null.\r\n * \r\n ArgumentException\r\n enumType is not an Enum.\r\n -or-\r\n value is either an empty string (\"\") or only contains white space.\r\n -or-\r\n value is a name, but not one of the named constants defined for the enumeration.\r\n * \r\n OverflowException\r\n value is outside the range of the underlying type of enumType.\r\n */\r\n return false;\r\n }", "public function testAcceptsAWellDefinedEnumTypeWithInternalValueDefinition()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => [\n 'FOO' => ['value' => 10],\n 'BAR' => ['value' => 20],\n ],\n ]);\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->assertEquals(10, $enumType->getValue('FOO')->getValue());\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->assertEquals(20, $enumType->getValue('BAR')->getValue());\n }", "final public static function fromValue($value): self\n {\n $key = array_search($value, self::getEnumConstants(), true);\n if ($key === false) {\n throw new \\InvalidArgumentException(sprintf(\n 'Constant value \"%s\" is not defined in the %s class.',\n $value,\n static::class\n ));\n }\n return self::valueOf($key);\n }", "final public function is($value)\n {\n return $value instanceof AbstractEnum ? $this->_enumMatch($value) : $this->getValue() === $value;\n }", "static public function isEnumValue ($value) {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:461: characters 3-31\n\t\treturn ($value instanceof HxEnum);\n\t}", "final public static function make($value): self\n {\n $key = array_search($value, static::getValues(), true);\n if ($key === false) {\n throw new InvalidArgumentException('Invalid Enum Value');\n }\n\n return self::init($key);\n }", "function EnumValue($string)\n{\n [$name, $substr] = Name($string);\n if ($name === null ||\n $name === 'true' ||\n $name === 'false' ||\n $name === 'null'\n ) {\n return [null, $string];\n }\n\n return [['type' => 'Enum', 'value' => $name], $substr];\n}", "public static function statuses($value = null) {\n $options = array(\n self::STATUS_ACTIVE => __('Active'),\n\t\t\tself::STATUS_DISCARDED => __('Inactive'),\n );\n return parent::enum($value, $options);\n }", "public static function statuses($value = null) {\n $options = array(\n self::STATUS_CLOSED => __('Closed'),\n self::STATUS_OPEN => __('Open'),\n );\n return parent::enum($value, $options);\n }", "public static function IsDefined($enumType, $value) {\r\n /*\r\n * ArgumentNullException\t\r\n enumType or value is null.\r\n * \r\n ArgumentException\r\n enumType is not an Enum.\r\n -or-\r\n The type of value is an enumeration, but it is not an enumeration of type enumType.\r\n -or-\r\n The type of value is not an underlying type of enumType.\r\n * \r\n InvalidOperationException\r\n value is not type SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, or UInt64, or String.\r\n */\r\n }", "public function testEnumDataType()\n {\n $tableName = 'ramp_enumTesting';\n $table = new Application_Model_DbTable_Table($tableName);\n $metaInfo = $table->info(Zend_Db_Table_Abstract::METADATA);\n $whichField = 'gender';\n\n $field = new Application_Model_Field($whichField, array(),\n $metaInfo[$whichField]);\n\n $this->assertTrue($field->isInTable());\n $this->assertTrue($field->isInDB());\n $this->assertTrue($field->isEnum());\n $this->assertSame(\"enum('Unknown','M','F')\", $field->getDataType());\n $this->assertSame(array('Unknown','M','F'),\n array_keys($field->getEnumValues()));\n $this->assertSame('Unknown', $field->getDefault());\n $this->_assertWholelyLocal($field);\n $this->_assertMetaInfoValues($tableName, $whichField, $field);\n }", "public function testRejectsAnEnumTypeWithIncorrectlyTypedValueDefinition()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => ['FOO' => 10],\n ]);\n\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'SomeEnum.FOO must refer to an object with a \"value\" key representing ' .\n 'an internal value but got: 10.'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType->getValues();\n\n $this->addToAssertionCount(1);\n }", "public function testEnumTypeWithDeprecatedValue()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumWithDeprecatedValue = newEnumType([\n 'name' => 'EnumWithDeprecatedValue',\n 'values' => ['foo' => ['deprecationReason' => 'Just because']],\n ]);\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumValue = $enumWithDeprecatedValue->getValues()[0];\n\n $this->assertSame('foo', $enumValue->getName());\n $this->assertTrue($enumValue->isDeprecated());\n $this->assertSame('Just because', $enumValue->getDeprecationReason());\n $this->assertSame('foo', $enumValue->getValue());\n }", "abstract protected function getCaseValue($value);", "public function runOk(): BackedEnum\n {\n $enumClass = StringBackedEnum::class;\n return self::assertEnumHas($enumClass, 'A', $this->error);\n }", "public function forValueWithoutValues()\n {\n assert(\n TestEnumWithoutValues::forValue('FOO'),\n isSameAs(TestEnumWithoutValues::$FOO)\n );\n }", "public function runKo(): BackedEnum\n {\n $enumClass = StringBackedEnum::class;\n return self::assertEnumHas($enumClass, 'Z', $this->error);\n }", "final public static function FromString( $string )\n {\n if ( strpos( $string, '::' ) < 1 )\n {\n throw new Exception( 'Enum::FromString( $string ) Input string is not in the expected format.' );\n }\n list( $class, $const ) = explode( '::', $string );\n\n if ( class_exists( $class, false ) )\n {\n $reflector = new ReflectionClass( $class );\n if ( $reflector->IsSubClassOf( 'Enum' ) )\n {\n if ( $reflector->hasConstant( $const ) )\n {\n return eval( sprintf( 'return %s;', $string ) );\n }\n }\n }\n throw new Excption( sprintf( '%s does not map to an Enum field', $string ) );\n }", "public static function getName($value, $strict = false)\n {\n $constants = static::getConstants();\n foreach ($constants as $k => $v)\n {\n if ($strict && $value === $v)\n {\n return (string) $k;\n }\n if (!$strict && $value == $v)\n {\n return (string) $k;\n }\n }\n throw new EnumException(\"Value $value not exist in \" . get_called_class());\n }", "public static function getValue(BackedEnum|string $name): int|string\n {\n $enum = is_string($name)\n ? static::fromName($name)\n : $name;\n\n return $enum->value;\n }", "public function testAcceptsAWellDefinedEnumTypeWithEmptyValueDefinition()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => [\n 'FOO' => [],\n 'BAR' => [],\n ],\n ]);\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->assertEquals('FOO', $enumType->getValue('FOO')->getValue());\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->assertEquals('BAR', $enumType->getValue('BAR')->getValue());\n }", "public function forValueWithValues()\n {\n assert(\n TestEnumWithValues::forValue(10),\n isSameAs(TestEnumWithValues::$FOO)\n );\n }", "public function computeEnumCastablePropertyValue($key, $value)\n {\n if (!isset($value)) {\n return;\n }\n $enumClass = $this->casts[$key] ?? null;\n if ($value instanceof $enumClass) {\n return $value->value;\n }\n\n return $enumClass::from($value)->value;\n }", "public function getXsiTypeName() {\n return \"EnumValuePair\";\n }", "public function enum($table = false, $field = false, $value = false, $mode = 'add', $pasive = false)\n {\n if (!$table || !$field || !$value) {\n return false;\n }\n\n $sql = \"SHOW COLUMNS FROM `\" . RL_DBPREFIX . $table . \"` LIKE '{$field}'\";\n $enum_row = $this->getRow($sql);\n preg_match('/([a-z]*)\\((.*)\\)/', $enum_row['Type'], $matches);\n\n if (!in_array(strtolower($matches[1]), array('enum', 'set'))) {\n die('ENUM add/edit method (table: ' . $table . '): <b>' . $field . '</b> field is not ENUM or SET type field');\n return false;\n }\n\n $enum_values = explode(',', $matches[2]);\n\n if ($mode == 'add') {\n if (false !== array_search(\"'{$value}'\", $enum_values)) {\n die('ENUM add/edit method (table: ' . $table . '): <b>' . $field . '</b> field already has <b>' . $value . '</b> value');\n return false;\n }\n\n array_push($enum_values, \"'{$value}'\");\n } elseif ($mode == 'remove') {\n $pos = array_search(\"'{$value}'\", $enum_values);\n\n if ($pos === false) {\n return false;\n }\n\n unset($enum_values[$pos]);\n\n if (empty($enum_values)) {\n die('ENUM add/edit method (table: ' . $table . '): <b>' . $field . '</b> field will not has any values after your remove');\n return false;\n }\n\n $enum_values = array_values($enum_values);\n }\n\n $sql = \"ALTER TABLE `\" . RL_DBPREFIX . $table . \"` CHANGE `{$field}` `{$field}` \" . strtoupper($matches[1]) . \"( \" . implode(',', $enum_values) . \" ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL\";\n if (strtolower($matches[1]) == 'enum') {\n $sql .= \" DEFAULT {$enum_values[0]}\";\n }\n\n $this->query($sql);\n\n return true;\n }", "public function create($value)\n {\n if (!is_scalar($value)) {\n throw new InvalidValueException('Invalid data to create enum value. Only scalar values allowed');\n }\n\n if (isset($this->options[$value])) {\n return $this->options[$value];\n }\n\n $value = (int)$value;\n if ($this->isValidValue($value)) {\n return $value;\n }\n\n throw new InvalidValueException('Option or value \"'.$value.'\" does not exist');\n }", "public function enumSetter($field, $value)\n {\n if ($this->hasEnumProperty($field)) {\n if (! $this->isValidEnum($field, $value)) {\n throw new InvalidEnumException('Invalid value for ' . static::class . \"::$field ($value)\");\n }\n\n if ($this->isKeyedEnum($field, $value)) {\n $value = $this->getKeyedEnum($field, $value);\n }\n }\n\n return $value;\n }", "public function testRejectsAnEnumTypeWithMissingValueDefinition()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => ['FOO' => null],\n ]);\n\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'SomeEnum.FOO must refer to an object with a \"value\" key representing ' .\n 'an internal value but got: null.'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType->getValues();\n\n $this->addToAssertionCount(1);\n }", "public function getStatus(): UnitEnum|string;", "public function getStatusClass($value)\n {\n switch ($value) {\n case 'A':\n return 'answered';\n case 'M':\n return 'missed';\n case 'O':\n return 'open';\n case 'U':\n return 'unknown';\n case 'W':\n return 'waiting';\n default:\n return 'empty';\n }\n }", "public function runOk(): BackedEnum\n {\n $enumClass = IntBackedEnum::class;\n return self::assertEnumHas($enumClass, 1, $this->error);\n }", "public static function getLabel( $enumString, $value ) {\n\t\t$assocArray = Enum::getAssocArrayIndexedByValues( $enumString );\n\t\t$valueAsInteger = (int)$value;\n\n\t\tif ( isset( $assocArray[$valueAsInteger] ) ) {\n\t\t\treturn $assocArray[$valueAsInteger];\n\t\t}\n\n\t\treturn Enum::getLabelForUnknownValue( $valueAsInteger );\n\t}", "public function testEnumField()\n {\n $field = $this->table->getField('yeahnay'); // An enum column\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Enumerated',\n $field);\n $enumValues = $field->getValues();\n $this->assertCount(2, $enumValues);\n $this->assertEquals('Yes', $enumValues[0]);\n $this->assertEquals('No', $enumValues[1]);\n }", "public static function asState($value)\r\n {\r\n $params = [];\r\n\r\n switch ($value) {\r\n case 0: return Yii::t('yii', 'Open', $params);\r\n case 1: return Yii::t('yii', 'Running', $params);\r\n case 2: return Yii::t('yii', 'Closed', $params);\r\n case 3: return Yii::t('yii', 'Submitted', $params);\r\n case 4: return Yii::t('yii', 'Unknown', $params);\r\n default: return $value;\r\n }\r\n }", "public static function ToObject($enumType, $value) {\r\n /*\r\n * ArgumentNullException\t\r\n enumType or value is null.\r\n * \r\n ArgumentException\r\n enumType is not an Enum.\r\n -or-\r\n value is not type SByte, Int16, Int32, Int64, Byte, UInt16, UInt32, or UInt64.\r\n */\r\n return null;\r\n }", "public function runKo(): BackedEnum\n {\n $enumClass = IntBackedEnum::class;\n return self::assertEnumHas($enumClass, 999, $this->error);\n }", "public function getEnumeration(): string\n {\n return $this->enumeration;\n }", "public static function getLocalizedLabel( $enumKey, $value ) {\n\t\textract(Message::aliases());\n\t\t$settings = Settings::all();\n\t\t$enumString = $settings->$enumKey;\n\t\t$localizedEnumString = $t($enumKey);\n\n\t\tif ( !Enum::hasValue( $enumString, $value ) ) {\n\t\t\treturn Enum::getLabelForUnknownValue( $value );\n\t\t}\n\n\t\treturn Enum::getLabel( $localizedEnumString, $value );\n\t}", "public function testRejectsAnEnumWithIncorrectlyTypedValues()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => [['FOO' => 10]],\n ]);\n\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage('SomeEnum values must be an associative array with value names as keys.');\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType->getValues();\n\n $this->addToAssertionCount(1);\n }", "final public function isEnum():bool\n {\n return $this->mode === 'enum';\n }", "protected function isValidEnum(string $field, $value)\n {\n return $this->isValueEnum($field, $value) ||\n $this->isKeyedEnum($field, $value);\n }", "public function getEnumeration($value)\n {\n if (is_string($value)) {\n $value = explode(self::ENUMERATION_SEPARATOR, $value);\n $value = array_map('trim', $value);\n }\n\n $value = (array) $value;\n\n $value = array_filter($value);\n\n return array_values($value);\n }", "public function setEnumvalue($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Protobuf\\EnumValue::class);\n $this->enumvalue = $arr;\n\n return $this;\n }", "public function convert($value)\n {\n switch ($value) {\n case 'I': return self::I;\n case 'V': return self::V;\n case 'X': return self::X;\n case 'L': return self::L;\n case 'C': return self::C;\n case 'D': return self::D;\n case 'M': return self::M;\n default: throw new InvalidValueException();\n }\n }", "public function testEnumTypeWithAValueOfNull()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumTypeWithNullValue = newEnumType([\n 'name' => 'EnumWithNullValue',\n 'values' => ['NULL' => ['value' => null]],\n ]);\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumValue = $enumTypeWithNullValue->getValues()[0];\n $this->assertSame('NULL', $enumValue->getName());\n $this->assertNull($enumValue->getDescription());\n $this->assertSame(false, $enumValue->isDeprecated());\n $this->assertNull($enumValue->getValue());\n $this->assertNull($enumValue->getAstNode());\n }", "public static function getValue($constName)\n {\n $const = static::getConstants();\n if (\\array_key_exists($constName, $const) === true)\n {\n return $const[$constName];\n }\n throw new EnumException(\n \\sprintf(\n 'Value \"%s\" doesn\\'t exist', $constName\n )\n );\n }", "public function get() {\n if (isset($this->enumeration[$this->value])) {\n return $this->value;\n } else {\n return \\reset($this->enumeration);\n }\n }", "function get_enum_values( $table, $field )\n{\n global $wpdb;\n $type = $wpdb->get_row(\"SHOW COLUMNS FROM {$table} WHERE Field = '{$field}'\" )->Type;\n preg_match(\"/^enum\\(\\'(.*)\\'\\)$/\", $type, $matches);\n $enum = explode(\"','\", $matches[1]);\n return $enum;\n}", "public static function is_valid_enum($enum, $value){\n foreach ($enum as $key => $enum_value) {\n if ($enum_value == $value){\n return true;\n }\n }\n return false;\n }", "public static function make($value): self\n {\n $enum = array_search($value, static::$values, true);\n if ($enum === false) {\n throw new UnexpectedValueException();\n }\n return static::$cache[$enum] ??= new static($enum);\n }", "function get_enum($db, $table, $column) {\n\t// get ENUM values as string to populate a dropdown select (not the what column has what enum assigned but the possible enums themself)\n\n\t//\t$sql = \"SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS\n\t//WHERE TABLE_SCHEMA = 'maTest' AND TABLE_NAME = 'ma_Posts' AND COLUMN_NAME = 'PostRating'\";\n\t$sql = \"SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS\n\tWHERE TABLE_SCHEMA = '{$db}' AND TABLE_NAME = '{$table}' AND COLUMN_NAME = '{$column}'\";\n\n\t$db = pdo(); # pdo() creates and returns a PDO object\n\t#run the query\n\n\t#$result stores data object in memory\n\ttry {$result = $db->query($sql);} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\n\t#run query\n\t$results = $db->query($sql);\n\n\t#process query\n\t$results = $results->fetchAll(PDO::FETCH_ASSOC);\n\n\t#convert array to string\n\t$results = $results[0]['COLUMN_TYPE'];\n\n\t#prep string data\n\t$results = substr($results, 5, -1);\n\n\t#make $result inot an array of data again\n\t$enum = str_getcsv($results, ',', \"'\");\n\n\treturn $enum;\n}", "public function testValueIsCorrect()\n {\n $init = 'test';\n $set = array('test');\n $str = new \\Pv\\PEnum($init, null, $set);\n }", "public function getEnum(): array\n {\n return $this->enum;\n }", "public static function getTypeFromValue($value)\n {\n switch (gettype($value)) {\n case 'boolean':\n return Type::getBool();\n\n case 'integer':\n return Type::getInt();\n\n case 'double':\n return Type::getFloat();\n\n case 'string':\n return Type::getString();\n\n case 'array':\n return Type::getArray();\n\n case 'NULL':\n return Type::getNull();\n\n default:\n return Type::getMixed();\n }\n }", "public function getEnumCastableAttributeValue($key, $value, ...$params)\n {\n if (null === $value) {\n return;\n }\n $castType = $this->casts[$key] ?? null;\n // If the $castType of the property is null we simply return the passed value\n if (null === $castType) {\n return $value;\n }\n if ($value instanceof $castType) {\n return $value;\n }\n\n return $castType::from($value, ...$params);\n }", "public function forNameWithNonExistingNameThrowsIllegalArgumentException()\n {\n TestEnumWithoutValues::forName('BAZ');\n }", "public function testInvalidEnum()\n {\n $this->expectException(UnexpectedValueException::class);\n\n $createPaymentAccountRequest = new CreatePaymentAccountRequest(\n 'Valid Description',\n 'INVALID_ENUM_VALUE'\n );\n }", "public function determine( $value ): string;", "public static function toConstant($value)\n {\n if (false !== ($_index = array_search($value, static::getDefinedConstants()))) {\n return $_index;\n }\n\n throw new \\InvalidArgumentException('The value \"' . $value . '\" has no associated constant.');\n }", "public function testDoesNotAllowIsDeprecatedWithoutDeprecationReasonOnEnum()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType = newEnumType([\n 'name' => 'SomeEnum',\n 'values' => ['FOO' => ['isDeprecated' => true]],\n ]);\n\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'SomeEnum.FOO should provide \"deprecationReason\" instead of \"isDeprecated\".'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $enumType->getValues();\n\n $this->addToAssertionCount(1);\n }", "function getEnumValues($table,$column, &$default) \n{\n\t\n\t$retval = NULL;\n\t\n\tglobal $dbHandle;\n\n\t/********\n\t$dbHandle = new mysqlj(MYSQL_SERVER, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE)\n\t\t or die(\"Could not connect to server: MYSQL_SERVER : Database MYSQL_DATABASE \" . mysqlj_error($this->dbHandle));\n **************/\n\t$queryString = \"SHOW COLUMNS FROM `\" . $table . \"` LIKE '\" . $column . \"'\";\n\t$query=mysql_query($queryString);\n\t\n\tif(mysql_num_rows($query) > 0)\n\t{\n\t\t$row=mysql_fetch_assoc($query);\n\t\t$retval=explode(\"','\",preg_replace(\"/(enum|set)\\('(.+?)'\\)/\",\"\\\\2\",$row['Type']));\n\t\t$default = $row['Default'];\t// Default is passed by reference offset 4 of the row array is the default value\n\t\t\t\t\t\t\t\t\t\t\t\t // of the enumerated field\n\t}\t\n\t\n\tmysql_freeresult($query);\n\n\t\n\treturn $retval;\n\t\t\n}", "public function testValueIsInvalid()\n {\n $init = 'foo';\n $set = array('test');\n $str = new \\Pv\\PEnum($init, null, $set);\n }", "public function message(): string|array\n {\n return trans()->has('validation.enum_value')\n ? __('validation.enum_value')\n : __('laravelEnum::messages.enum_value');\n }", "protected function getEnumProperty(string $field)\n {\n return 'enum' . Str::plural(Str::studly($field));\n }", "public function testIfWrongValueThrows() : void\n {\n\n $this->expectException(FieldValueInproperException::class);\n\n // Create Field.\n $field = new EnumField('test_name');\n $field->setModel(( new Model() )->setName('test'));\n $field->setValues('one', 'two', 'three');\n\n // Test.\n $this->assertFalse($field->isValueValid('four'));\n }", "public function getName()\n {\n return \"enum_translation_extension\";\n }", "public function getValueType($valueName);", "final public static function getOrdinalOf($value)\n {\n if (!self::isDefined($value)) {\n throw new \\InvalidArgumentException();\n }\n\n $values = self::getValues();\n\n return array_search($value, $values, true);\n }", "public function appendValue(\\Google\\Protobuf\\EnumValueDescriptorProto $value)\n {\n return $this->append(self::VALUE, $value);\n }", "function is_enum(mixed $var): bool\n{\n return is_object($var) && enum_exists($var::class, false);\n}", "public static function readableForName(string $value): string;", "public function getName()\n {\n return 'biplane_enum';\n }", "public static function get($item): string\n {\n if (!isset(static::$enum[$item])) {\n return \"Unknown type ($item)\";\n }\n\n return static::$enum[$item];\n }", "public function setValue($value)\n {\n if ($this->isValidEnumValue($value))\n $this->value = $value;\n else\n throw new Exception(\"Invalid type specified!\");\n }", "protected function isValueEnum(string $field, $value)\n {\n return in_array($value, static::getEnum($field));\n }", "public function isValidEnumValue($checkValue)\n {\n $reflector = new ReflectionClass(get_class($this));\n foreach ($reflector->getConstants() as $validValue)\n {\n if(is_string($checkValue) && is_string($validValue) \n && !strcasecmp($checkValue, $validValue)) {\n return true;\n }\n else if ($validValue == $checkValue) {\n return true;\n }\n } \n return false;\n }", "public function getValue()\n {\n return $this->value instanceof CustomFieldEnumValueBuilder ? $this->value->build() : $this->value;\n }", "abstract public function getValueType();", "public function testGetGetMethodType() {\n $type = new MethodEnum();\n $this->assertSame('GET', MethodEnum::GET);\n $this->assertSame('GET', $type(MethodEnum::GET));\n }", "public function get_enum_values($enum_name) {\n $qry = 'SELECT e.enumlabel as enum_value ' .\n 'FROM pg_type t ' .\n 'JOIN pg_enum e ON t.oid = e.enumtypid ' .\n 'JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace ' .\n \"WHERE t.typname = '%s' \" .\n 'ORDER BY enum_value';\n $qry = sprintf($qry, $enum_name);\n $rid = $this->do_query($qry);\n while ($row = $this->get_array($rid)) {\n $values[$row['enum_value']] = $row['enum_value'];\n }\n return $values;\n }", "final static private function getConstants()\n\t{\n $class = get_called_class();\n\t\tif(!isset(self::$_consts[$class])) {\n\t\t\tif($class == __CLASS__) {\n\t\t\t\tthrow new \\BadMethodCallException('You can\\'t access constants from Enum class');\n\t\t\t}\n\t\t\t$reflection = new \\ReflectionClass($class);\n\t\t\tself::$_consts[$class] = $reflection->getConstants();\n\t\t}\n\t\treturn self::$_consts[$class];\n\t}", "public function getMimicTypeAttribute($value)\n {\n return $this->getMimicType($value);\n }", "public function isEnumType()\n {\n return $this->getType() == PropelTypes::ENUM;\n }", "public function getEnumValues()\n {\n return array(\n 'get_ok' => self::get_ok,\n 'change_ok' => self::change_ok,\n 'fail' => self::fail,\n );\n }", "public static function get($string)\n {\n if (true === self::contains($string)) {\n return static::$keys[$string];\n }\n\n throw new \\LogicException('Could not find \"'.$string.'\" key in '.self::class.' enum.');\n }", "public function useEnumValues(): bool\n {\n return $this->useEnumValues;\n }", "public static function typeToValue(String $type){\n $type = strtoupper($type);\n if(!in_array($type, self::getUserTypes())){\n throw new \\Exception('Incorrect User Type');\n }\n return constant('self::'. $type);\n }", "function _mysql_enum_values($tableName,$fieldName){\n\n\t\t#$result = @mysql_query(\"DESCRIBE $tableName\");\n\n\t\t foreach($this->fields as $row){\n\n\t\t\tereg('^([^ (]+)(\\((.+)\\))?([ ](.+))?$',$row['Type'],$fieldTypeSplit);\n\n\t\t\t//split type up into array\n\t\t\t$fieldType = $fieldTypeSplit[1];\n\t\t\t$fieldLen = $fieldTypeSplit[3];\n\n\t\t\tif ( ($fieldType=='enum' || $fieldType=='set') && ($row['Field']==$fieldName) ){\n\t\t\t\t$fieldOptions = split(\"','\",substr($fieldLen,1,-1));\n\t\t\t\treturn $fieldOptions;\n\t\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "public static function getSelectEnum(string $field)\n {\n $values = static::getEnum($field);\n\n if (Arr::isAssoc($values)) {\n return $values;\n }\n\n return array_combine($values, $values);\n }", "public static function standardize(\n string|array|BackedEnum $value,\n bool $toArray = false\n ): string|array {\n if ($value instanceof BackedEnum) {\n return $toArray ? [$value->value] : $value->value;\n }\n\n if (is_array($value)) {\n return Collection::make($value)->map(function ($item) {\n return $item instanceof BackedEnum\n ? $item->value\n : $item;\n })->toArray();\n }\n\n if ((strpos($value, '|') === false) && ! $toArray) {\n return $value;\n }\n\n return explode('|', $value);\n }", "public static function validate($value, $allowedValues = []): void\n {\n if (!self::isValid($value, $allowedValues)) {\n throw new \\InvalidArgumentException(\"'\".$value.\"' \".self::INVALID_ENUM_VALUE, 1);\n }\n }" ]
[ "0.6631762", "0.6510606", "0.6488591", "0.64180213", "0.6397039", "0.6342705", "0.62285125", "0.6179947", "0.6164119", "0.6095813", "0.602425", "0.6017275", "0.5987912", "0.5928896", "0.5922059", "0.59207314", "0.5850575", "0.5818419", "0.58049077", "0.5781575", "0.5774005", "0.57164663", "0.566153", "0.5656044", "0.5635442", "0.55917287", "0.5582276", "0.5540766", "0.5518795", "0.5499323", "0.5495412", "0.5476444", "0.5442807", "0.5432611", "0.54134554", "0.5397976", "0.5388496", "0.5371515", "0.5369782", "0.5341734", "0.5327914", "0.53250265", "0.5322799", "0.5319361", "0.5271378", "0.5237436", "0.5236709", "0.52267677", "0.52204686", "0.5212704", "0.520931", "0.5201765", "0.5194367", "0.5188813", "0.5155177", "0.51540416", "0.5152425", "0.51242423", "0.51048154", "0.50983125", "0.5090014", "0.5080784", "0.50693583", "0.50688857", "0.50245243", "0.5003552", "0.49962905", "0.49797487", "0.4975036", "0.49731407", "0.49567226", "0.49542052", "0.49318933", "0.49169043", "0.490938", "0.4902766", "0.48697126", "0.4860619", "0.48568204", "0.48417708", "0.48397306", "0.48372412", "0.48174846", "0.4814104", "0.4804543", "0.4802781", "0.4802705", "0.47897762", "0.4784787", "0.47631735", "0.4753917", "0.47386628", "0.47354737", "0.47349143", "0.47302857", "0.47287226", "0.47130632", "0.47126746", "0.4711763", "0.47013897" ]
0.7699689
0
Returns a new instance of the TimeConverter
function tempus(): TimeConverter { return new TimeConverter(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function create(...$args): Time\n {\n return new Time(...$args);\n }", "protected function cloneToMutable() : Time\n {\n return clone $this;\n }", "public function time($value): self\n {\n $this->time = $value;\n \n return $this;\n }", "public static function createFromTime(?int $hour = null, ?int $minutes = null, ?int $seconds = null, $timezone = null, ?string $locale = null)\n {\n return static::create(null, null, null, $hour, $minutes, $seconds, $timezone, $locale);\n }", "#[Property('time')]\n\tprotected function getTime(): Time|string {\n\t\treturn new Time($this);\n\t}", "public function parseTime() {}", "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 setTimeTo(\\DateTime $timeTo)\n {\n $this->timeTo = $timeTo;\n return $this;\n }", "public function __construct()\n {\n $this->dateTime = new Time('now', 'Asia/Jakarta', 'id_ID');\n }", "public static function createFromDateTime(\\DateTimeInterface $dateTime) : Time\n {\n return new static($dateTime->format('Y-m-d H:i:s.u'), $dateTime->getTimezone());\n }", "public function timeFormat();", "public static function createFromDateTime(\\DateTime $dt): Time\n {\n return Time::create($dt->getTimestamp() * 1000);\n }", "public static function createFromTime($hour = 0, $minute = 0, $second = 0, $tz = null)\n {\n return static::create(null, null, null, $hour, $minute, $second, $tz);\n }", "public function __construct(Time $time)\n {\n parent::__construct();\n $this->time = $time;\n }", "public function validTimeRange()\n {\n return new ValidTimeRange(\n $this->input('start_time'), $this->input('end_time')\n );\n }", "public function setTime($time)\n {\n return new Date(strtotime(date(\"Y-m-d\", $this->timestamp) . \" $time\"), $this->timezone);\n }", "public function secondsToMinutes() {\n return $this;\n }", "private function newTimeField(stdClass $fieldDef): DBTable\\Field\n {\n $field = new Fld\\Time($fieldDef->column_name);\n $this->setProperties($field, $fieldDef);\n\n return $field;\n }", "public function setTime(\\DateTime $time)\n {\n $this->time = $time;\n return $this;\n }", "public static function createFromDate($date): Time\n {\n switch (get_class($date)) {\n case \\DateTime::class:\n return Time::createFromDateTime($date);\n\n case \\DateInterval::class:\n return Time::createFromDateInterval($date);\n }\n\n return Time::create();\n }", "public static function TIME()\n {\n return new PositionMode(self::TIME);\n }", "public static function transition($ts, $from, $to): self {\n return new self(\n gmdate('Ymd\\THis', $ts + $from - $to),\n sprintf('%s%02d:%02d', $from < 0 ? '-' : '+', abs($from / 3600), abs($from % 3600) / 60),\n sprintf('%s%02d:%02d', $to < 0 ? '-' : '+', abs($to / 3600), abs($to % 3600) / 60)\n );\n }", "public function getTimeFormatter();", "public function setTimeClass($class)\n {\n $this->timeClass = $class;\n # return Calendar instance\n return $this;\n }", "protected function getForm_Type_TimeService()\n {\n @trigger_error('The \"form.type.time\" service is deprecated since Symfony 3.1 and will be removed in 4.0.', E_USER_DEPRECATED);\n\n return $this->services['form.type.time'] = new \\Symfony\\Component\\Form\\Extension\\Core\\Type\\TimeType();\n }", "public static function prayerTimeInstance(){\n if(isset(self::$prayerTime)){\n return self::$prayerTime;\n } else{\n return self::$prayerTime = new PrayTime();\n }\n }", "public function setFromTime($value) {\n return $this->set(self::FROM_TIME, $value);\n }", "public static function _($time = null, $timezone = null) {\n\t\treturn new Customweb_Core_DateTime($time, $timezone);\n\t}", "static public function createTime ()\n {\n $result = time();\n static::addTimeZone($result);\n return $result;\n }", "public function timeFormat($value) {\n return $this->setProperty('timeFormat', $value);\n }", "function timeConversion($s) {\n return DATE(\"H:i:s\", STRTOTIME($s));\n\n}", "public function __construct($time = 'now', DateTimeZone $timezone = NULL)\n{\n\tif(is_int($time))$time=\"@$time\";if(is_array($time))$time=self::fromArray($time);if($timezone)parent::__construct($time, $timezone);else parent::__construct($time);\n}", "protected function getTimeTrackerInstance() {\n\t\treturn \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\TimeTracker\\\\TimeTracker');\n\t}", "public static function getTimeFormats()\n {\n return array( 'g:i A' => '7:30 PM', 'H:i' => '19:30' );\n }", "function timeConversion($originalTime) {\n\t$newTime;\n\n $hours = substr($originalTime, 0, 2);\n $minutes = substr($originalTime, 3, 2);\n\n if ($hours > 12) $newTime = ($hours - 12) . \":\" . $minutes . \" PM\";\n else if ($hours == 12) $newTime = $hours . \":\" . $minutes . \" PM\";\n else if ($hours == 0) $newTime = 12 . \":\" . $minutes . \" AM\";\n else $newTime = substr($hours, 1) . \":\" . $minutes . \" AM\";\n\n \treturn $newTime;\n}", "public function time(){\n return $this->morphOne('App\\Models\\Time','timable');\n }", "public static function factory($time = null, $timezone = null) {\n\t\treturn new DateTime($time, self::timezone($timezone));\n\t}", "public static function now() {\n return new LusiTime( mktime()); }", "public static function get(): Timer\n {\n return new self();\n }", "public static function new(): static\n {\n $data = API::ffi()->ts_parser_new();\n\n return new static(API::ffi(), $data);\n }", "function atime ( $arguments = \"\" ) {\n $arguments = func_get_args ();\n $rc = new ReflectionClass('ttime');\n return $rc->newInstanceArgs ( $arguments );\n}", "public static function factory( $id )\n {\n $time_scale = new GeologicalTimeScale;\n $time_scale->parameters->id = $id;\n return $time_scale;\n }", "public static function createInstance()\n {\n return new TimeField('ISerializable', 'ISerializable');\n }", "public function getFromTime() {\n return $this->get(self::FROM_TIME);\n }", "public function __construct($_tzFrom = null, $_tzTo = null){\n $this->_resultFormatNames = array_keys(self::$_resultFormats);\n $this->setInstanceTimezones($_tzFrom, $_tzTo);\n }", "public function modifyTime(int $hours, int $minutes = 0, int $seconds = 0, int $microseconds = 0) : Time /*PHP8:static*/\n {\n if ($this->frozen) {\n throw new \\RuntimeException(get_class($this) . ' is read-only, frozen.');\n }\n\n $modifiers = [];\n if ($hours) {\n $modifiers[] = ($hours > 0 ? '+' : '-') . abs($hours) . ' ' . (abs($hours) > 1 ? 'hours' : 'hour');\n }\n if ($minutes) {\n $modifiers[] = ($minutes > 0 ? '+' : '-') . abs($minutes) . ' ' . (abs($minutes) > 1 ? 'minutes' : 'minute');\n }\n if ($seconds) {\n $modifiers[] = ($seconds > 0 ? '+' : '-') . abs($seconds) . ' ' . (abs($seconds) > 1 ? 'seconds' : 'second');\n }\n if ($microseconds) {\n $modifiers[] = ($microseconds > 0 ? '+' : '-') . abs($microseconds)\n . ' ' . (abs($microseconds) > 1 ? 'microseconds' : 'microsecond');\n }\n if ($modifiers) {\n $this->modify(join(' ', $modifiers));\n }\n return $this;\n }", "public function toTimeString()\n {\n return $this->toLocalizedString('HH:mm:ss');\n }", "public function time($time)\n {\n if ($time instanceof DateTimeInterface) {\n return $this->time($time->getTimestamp());\n }\n\n if (is_numeric($time)) {\n $this->time = Carbon::createFromTimestamp($time);\n\n return $this;\n }\n\n throw CouldNotSendMobilyWsNotification::withErrorMessage(\n sprintf('Time must be a timestamp or an object implementing DateTimeInterface. %s is given', gettype($time))\n );\n }", "public function setTime($value)\n {\n return $this->set(self::TIME, $value);\n }", "public function setTime($value)\n {\n return $this->set(self::TIME, $value);\n }", "public function unsetEndTime(): self\n {\n $this->instance->unsetEndTime();\n return $this;\n }", "public function unsetEndTime(): self\n {\n $this->instance->unsetEndTime();\n return $this;\n }", "function byId($id) {\n return new Timesheet($this->connector, $this->connector->apiCall(\n \"time.api/get/$id\",\n function($result) { return $result['Time']; }\n ));\n }", "public function setTime($value)\n {\n return $this->set(self::_TIME, $value);\n }", "public function setTime($value)\n {\n return $this->set(self::_TIME, $value);\n }", "public function setTime($value)\n {\n return $this->set(self::_TIME, $value);\n }", "function convertTime($time){\n return date(\"H:i\", strtotime($time));\n}", "public function toTime($time, $options = array())\n {\n if( is_numeric($time) ) {\n $time = new Zend_Date($time);\n } else if( is_string($time) ) {\n $time = new Zend_Date(strtotime($time));\n } else if( !($time instanceof Zend_Date) ) {\n return false;\n }\n\n $time->setTimezone( Zend_Registry::get('timezone') );\n\n $options = array_merge(array(\n 'locale' => $this->getLocale(),\n 'size' => 'short',\n 'type' => 'time',\n ), $options);\n\n if( !($time instanceof Zend_Date) ) {\n throw new Exception('Not a valid date');\n }\n\n if( empty($options['format']) ) {\n $options['format'] = Zend_Locale_Data::getContent($options['locale'], $options['type'], $options['size']);\n }\n\n return $time->toString($options['format'], $this->getLocale());\n }", "public function time(int $time)\n {\n $this->time = $time;\n\n return $this;\n }", "public function setTime_start($time_start)\n {\n $this->time_start = $time_start;\n\n return $this;\n }", "public static function createDuration();", "public static function createFromDateInterval(\\DateInterval $interval): Time\n {\n return Time::create($interval->h, $interval->i, $interval->s, 0);\n }", "public function setTime($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->time !== $v) {\n $this->time = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_TIME] = true;\n }\n\n return $this;\n }", "public function getSignedDate(): Time\n {\n return new Time($this->rawData['signedDate']);\n }", "function Time($time){\r\n\r\n\t}", "public function snapToHour(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->hour()->startDate(),\n DatePoint::fromDate($this->endDate)->hour()->endDate(),\n $this->bounds\n );\n }", "function translate_time($t) {\n /* US only :)\n $a_times = array(\n '9:00' => '9am' , '9:45' => '9:45'\n , '10:00' => '10am', '10:15' =>'10:15', '10:30' =>'10:30', '10:45' => '10:45'\n , '11:00' => '11am', '11:15' =>'11:15', '11:30' =>'11:30', '11:45' => '11:45'\n , '12:00' => '12pm', '12:15' =>'12:15', '12:30' =>'12:30', '12:45' => '12:45'\n , '13:00' => '1pm', '13:15' => '1:15', '13:30' => '1:30', '13:45' => '1:45'\n , '14:00' => '2pm', '14:15' => '2:15', '14:30' => '2:30', '14:45' => '2:45'\n , '15:00' => '3pm', '15:15' => '3:15', '15:30' => '3:30', '15:45' => '3:45'\n , '16:00' => '4pm', '16:15' => '4:15', '16:30' => '4:30', '16:45' => '4:45'\n , '17:00' => '5pm', '17:15' => '5:15', '17:30' => '5:30', '17:45' => '5:45'\n , '18:00' => '6pm', '18:15' => '6:15'\n , '20:00' => '8pm', '22:00' => '10pm'\n );\n if (isset($a_times[$t])) return $a_times[$t];\n */\n return $t;\n }", "protected function initializeTimeTracker() {}", "public static function now(): self\n {\n return new static(new DateTime());\n }", "public function sortByStartTime(): self\n {\n /** @var array|TimeSlot[] $collection **/\n $collection = $this->collection;\n\n usort($collection, function (TimeSlot $slot1, TimeSlot $slot2) {\n if (DT::compareTime($slot1->getStartTime(), $slot2->getStartTime()) === 0\n && $slot1->getType() === TimeSlot::CANDIDATE_TYPE\n ) {\n return 1;\n }\n\n return (-1) * DT::compareTime($slot1->getStartTime(), $slot2->getStartTime());\n });\n\n return new static(...$collection);\n }", "public static function from(string|int|\\DateTimeInterface|null $time): static\n\t{\n\t\tif ($time instanceof \\DateTimeInterface) {\n\t\t\treturn new static($time->format('Y-m-d H:i:s.u'), $time->getTimezone());\n\n\t\t} elseif (is_numeric($time)) {\n\t\t\tif ($time <= self::YEAR) {\n\t\t\t\t$time += time();\n\t\t\t}\n\t\t\treturn (new static('@' . $time))->setTimezone(new DateTimeZone(date_default_timezone_get()));\n\n\t\t} else { // textual or null\n\t\t\treturn new static((string) $time);\n\t\t}\n\t}", "public function toTimeString()\n {\n return $this->format('H:i:s');\n }", "protected function getVictoireForm_Form_TypeExtension_VicTimeService()\n {\n return $this->services['victoire_form.form.type_extension.vic_time'] = new \\Victoire\\Bundle\\FormBundle\\Form\\Extension\\TimeTypeExtension();\n }", "public function setStartTime($millitime = NULL)\n {\n if (!$millitime) {\n $millitime = Time::millitime();\n }\n\n $this->millitime = $millitime;\n\n return $this;\n }", "function convert_time($time) {\n\t$date = date('g:i A', strtotime($time));\n\n\treturn $date;\n}", "public function clock(): Clock\n {\n return new Clock($this);\n }", "public function convertTimeFromTo($from, $to, $value){\n\t\t$defaultTime = $this->convertToDefaultTime($value, $from);\n\t\tswitch ($to) {\n\t\t\tcase \"mins\":\n\t\t\t\t$time = $defaultTime;\n\t\t\t\tbreak;\n\t\t\tcase \"hour\":\n\t\t\t\t$time = $defaultTime/60;\n\t\t\t\tbreak;\n\t\t\tcase \"days\":\n\t\t\t\t$time = $defaultTime/1440;\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\tthrow new Exception('convertTimeFromTo error: can not convert '.$from.' to mins');\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $time;\n\t\t\n\t}", "public function __construct()\n {\n $this->conversions = array(\n 'km' => 1.60934,\n 'm' => 1609.34,\n 'cm' => 160934,\n 'mm' => 1609340,\n 'yd' => 1760,\n 'ft' => 5280,\n 'in' => 63360,\n 'mi' => 1\n );\n }", "protected function getTimeWidget($attributes = array())\n {\n return new sfWidgetFormInputText($this->getOptionsFor('time'), $this->getAttributesFor('time', $attributes));\n }", "private function __construct(){\r\n $this->ttl_by_type = array(\r\n 'short' => 300 , // 5 minutes\r\n 'default' => 7200, // 2 hours\r\n 'halfday' => 43200, // 12 hours\r\n 'day' => 86400, // 24 hours\r\n 'week' => 604800, // 7 days\r\n 'month' => 2592000, // 30 days (1 month)\r\n 'longterm' => 15811200 // 183 days (6 months)\r\n );\r\n }", "protected function genTime($time=false){\n if (!$time){\n $time = time();\n } else if (is_numeric($time)) {\n $time = (int)$time;\n } else if (is_string($time)) {\n $time = strtotime($time);\n } else {\n throw new InvalidArgumentException('Invalid time input given');\n }\n return date('Y-m-d\\TH:i:sO',$time-120);\n }", "public static function newDateTimeMs(): \\DateTime\n {\n [$microseconds, $timestamp] = explode(' ', microtime());\n $msTimestamp = round((float) $timestamp + (float) $microseconds, 3, PHP_ROUND_HALF_UP) * 1000;\n\n return self::msTimestampToDateTime($msTimestamp);\n }", "public static function now()\n {\n return new plugin_datetime(date('Y-m-d H:i:s', time()));\n }", "public function on($timeCode)\n {\n list(\n $this->minute,\n $this->hour,\n $this->dayOfMonth,\n $this->month,\n $this->dayOfWeek\n ) = preg_split('/\\s+/', trim($timeCode));\n\n return $this;\n }", "public function setTime($hour, $minute = NULL, $second = NULL)\r\n {\r\n if ($hour && !$minute && !$second)\r\n {\r\n $explode = explode(':', $hour);\r\n $hour = $explode[0];\r\n $minute = isset($explode[1]) ? $explode[1] : 0;\r\n $second = isset($explode[2]) ? $explode[2] : 0;\r\n }\r\n\r\n $this->setHour($hour);\r\n $this->setMinute($minute);\r\n $this->setSecond($second);\r\n\r\n return $this;\r\n }", "public function setTime(int $hour, int $minute, int $second) : self\n {\n $this->h = $hour;\n $this->i = $minute;\n $this->s = $second;\n\n return $this;\n }", "public static function timeProvider() {\n\t\t$db = ConnectionManager::getDataSource('test');\n\t\t$now = $db->expression('NOW()');\n\t\treturn array(\n\t\t\t// blank\n\t\t\tarray(\n\t\t\t\tarray('hour' => '', 'min' => '', 'meridian' => ''),\n\t\t\t\t''\n\t\t\t),\n\t\t\t// missing hour\n\t\t\tarray(\n\t\t\t\tarray('hour' => '', 'min' => '00', 'meridian' => 'pm'),\n\t\t\t\t''\n\t\t\t),\n\t\t\t// all blank\n\t\t\tarray(\n\t\t\t\tarray('hour' => '', 'min' => '', 'sec' => ''),\n\t\t\t\t''\n\t\t\t),\n\t\t\t// set and empty merdian\n\t\t\tarray(\n\t\t\t\tarray('hour' => '1', 'min' => '00', 'meridian' => ''),\n\t\t\t\t''\n\t\t\t),\n\t\t\t// midnight\n\t\t\tarray(\n\t\t\t\tarray('hour' => '12', 'min' => '0', 'meridian' => 'am'),\n\t\t\t\t'00:00:00'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray('hour' => '00', 'min' => '00'),\n\t\t\t\t'00:00:00'\n\t\t\t),\n\t\t\t// 3am\n\t\t\tarray(\n\t\t\t\tarray('hour' => '03', 'min' => '04', 'sec' => '04'),\n\t\t\t\t'03:04:04'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray('hour' => '3', 'min' => '4', 'sec' => '4'),\n\t\t\t\t'03:04:04'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray('hour' => '03', 'min' => '4', 'sec' => '4'),\n\t\t\t\t'03:04:04'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t$now,\n\t\t\t\t$now\n\t\t\t)\n\t\t);\n\t}", "function setCreatedTime($arg0) {\n\t\t$this->created_time = $arg0;\n\t\t$this->addModifiedColumn('created_time');\n\t\treturn $this;\n\t}", "public function setCreateTime($create_time)\r\n {\r\n $this->create_time = $create_time;\r\n\r\n return $this;\r\n }", "public static function create($value): Timezone\n {\n return new static($value);\n }", "public function setCreateTime($create_time)\n {\n $this->create_time = $create_time;\n return $this;\n }", "public function setCreateTime($create_time)\n {\n $this->create_time = $create_time;\n return $this;\n }", "public function setCreateTime($create_time)\n {\n $this->create_time = $create_time;\n return $this;\n }", "public static function getInstance($_tzFrom = null, $_tzTo = null){\n if(self::$_instance){\n // Only set timezone data if it was explicitly passed\n if($_tzFrom || $_tzTo){\n self::$_instance->setInstanceTimezones($_tzFrom, $_tzTo);\n }\n return self::$_instance;\n }\n self::$_instance = new self($_tzFrom, $_tzTo);\n return self::$_instance;\n }", "public function setStartTime($start_time)\n {\n $this->start_time = $start_time;\n\n return $this;\n }", "public function setCreateTime($create_time)\n {\n $this->create_time = $create_time;\n\n return $this;\n }", "public function setCreateTime($create_time)\n {\n $this->create_time = $create_time;\n\n return $this;\n }" ]
[ "0.64293045", "0.5849148", "0.5672809", "0.5639726", "0.5592233", "0.5546329", "0.5496895", "0.5496895", "0.5496895", "0.5496895", "0.54168284", "0.5381449", "0.53772324", "0.53674394", "0.5362419", "0.5342623", "0.528984", "0.52472466", "0.5246801", "0.5243133", "0.51930374", "0.5168009", "0.5159744", "0.515945", "0.51554567", "0.5150857", "0.5141062", "0.5125912", "0.5101346", "0.50808215", "0.5073565", "0.5021321", "0.50185776", "0.50109047", "0.50032306", "0.49833536", "0.49815598", "0.49444798", "0.4924906", "0.49242872", "0.49191046", "0.4914529", "0.4913163", "0.49015445", "0.48892966", "0.4868824", "0.4856038", "0.48542246", "0.4852706", "0.4831457", "0.48242867", "0.4807026", "0.4807026", "0.479927", "0.479927", "0.47703367", "0.47660005", "0.47660005", "0.47660005", "0.47624457", "0.47530556", "0.47451743", "0.47299483", "0.47287518", "0.47206762", "0.47033834", "0.4702083", "0.46974468", "0.4679189", "0.4673357", "0.46668187", "0.46582258", "0.46410915", "0.46407595", "0.46349865", "0.46309048", "0.46285135", "0.46211192", "0.46056867", "0.4588928", "0.45846075", "0.45795733", "0.45736936", "0.4566728", "0.4561211", "0.4558725", "0.45548293", "0.45509675", "0.45450747", "0.45383185", "0.45373213", "0.4536914", "0.45243528", "0.4521272", "0.4521272", "0.4521272", "0.45192719", "0.4518674", "0.45139736", "0.45139736" ]
0.74868363
0
exclui imagem da galeria
public function excluirImagemGaleria(){ //deleta a imagem da pasta include_once("../funcoes/geral.php"); $sql = " SELECT thumb FROM programa_imagem "; if($this->idImagem) $sql .=" WHERE id = '$this->idImagem'"; $this->sql = $sql; $this->qr = self::execSql($this->sql); $qtRegistros = $this->getQuantidadeData($sql); // retorna a quantidade de registro if($qtRegistros > 0){ while($lista = self::resultsAll($this->qr)){ deletaImagem($lista["thumb"]);//deleto a imagem do arquivo } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function galeriasExcluir_action()\n\t{\n\t\t$bd = new GaleriasImagens_Model();\n\t\t$id = abs((int) $this->getParam(2));\n\t\t$resultado = $bd->read(\"id={$id} AND usuario={$this->_usuario}\");\n\t\tunlink('uploads/img_'.$resultado[0]['imagem']);\n\t\tunlink('uploads/tb_'.$resultado[0]['imagem']);\n\t\tunlink('uploads/destaque_'.$resultado[0]['imagem']);\n\t\t$bd->delete(\"id={$id} AND usuario={$this->_usuario}\");\n\t\tHTML::certo('Imagem exclu&iacute;da.');\n\t\t//POG Temporário\n\t\tHTML::Imprime('<script>Abrir(\"#abreImagemGaleria\",\"#imagens\");</script>');\n\t}", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "public function galeriaExcluir_action()\n\t{\n\t\t$bd = new GaleriasImagens_Model();\n\t\t$id = abs((int) $this->getParam(3));\n\t\t$resultado = $bd->read(\"galeria={$id} AND usuario={$this->_usuario}\");\n\t\tforeach($resultado as $dados){\n\t\t\tunlink('uploads/img_'.$dados['imagem']);\n\t\t\tunlink('uploads/tb_'.$dados['imagem']);\n\t\t\tunlink('uploads/destaque_'.$dados['imagem']);\n\t\t}\n\t\t$bd->delete(\"galeria={$id} AND usuario={$this->_usuario}\");\n\t\t\n\t\t$bd = new Galerias_Model();\n\t\t$bd->delete(\"id={$id} AND usuario={$this->_usuario}\");\n\t\t\n\t\tHTML::certo('Galeria exclu&iacute;da.');\n\t\t//POG Temporário\n\t\tHTML::Imprime('<script>Abrir(\"#abreGaleriasListar\",\"#galerias\");</script>');\n\t}", "public function removeImage()\n {\n // Suppression de l'image principale\n $fichier = $this->getAbsolutePath();\n\n if (file_exists($fichier))\n {\n unlink($fichier);\n }\n\n // Suppression des thumbnails\n foreach($this->thumbnails as $key => $thumbnail)\n {\n $thumb = $this->getUploadRootDir() . '/' . $key . '-' . $this->name;\n if (file_exists($thumb))\n {\n unlink($thumb);\n }\n }\n }", "function removeImage() {\n\t\t\n $image = $this->getImageByImageId();\n \n $file_image = $this->dir_path.$image['path_image'];\n\n $this->deleteImage(array('image_id' => $image['image_id'] ));\n\n if(file_exists($file_image)) {\n @unlink($file_image);\n }\n\t\t\n\t}", "function excluir_imagem_publicacao(){\n\t\t\n\t\t// tabela\n\t\t$tabela = TABELA_IMAGENS_ALBUM;\n\t\t\n\t\t// id\n\t\t$id = remove_html($_REQUEST['id']);\n\t\t\n\t\t// valida id e usuario administrador\n\t\tif($id == null or retorne_usuario_administrador() == false){\n\t\t\t\n\t\t\t// retorno nulo\n\t\t\treturn null;\n\t\t\t\n\t\t};\n\t\t\n\t\t// query\n\t\t$query[0] = \"select *from $tabela where id='$id';\";\n\t\t$query[1] = \"delete from $tabela where id='$id';\";\n\t\t\n\t\t// dados\n\t\t$dados = retorne_dados_query($query[0]);\n\t\t\n\t// pasta de usuario\n\t$pasta_usuario = retorne_pasta_usuario($dados['idusuario'], 2, true);\n\t\n\t// separa os dados\n\t$url_imagem = $pasta_usuario.basename($dados['url_imagem']);\n\t$url_imagem_miniatura = $pasta_usuario.basename($dados['url_imagem_miniatura']);\n\t\n\t// excluindo arquivo\n\texclui_arquivo_unico($url_imagem);\n\texclui_arquivo_unico($url_imagem_miniatura);\n\t\n\t// comando executa\n\tcomando_executa($query[1]);\n\t\n\t}", "public function supprimerImageMorphoAction()\n\t{\n\t\t$id_cons = $this->params()->fromPost('id_cons');\n\t\t$id = $this->params()->fromPost('id'); //numero de l'image dans le diapo\n\t\t$typeExamen = $this->params()->fromPost('typeExamen');\n\t\n\t\t/**\n\t\t * RECUPERATION DE TOUS LES RESULTATS DES EXAMENS MORPHOLOGIQUES\n\t\t*/\n\t\t $result = $this->demandeExamensTable()->recupererDonneesExamenMorpho($id_cons, $id, $typeExamen);\n\t\t/**\n\t\t * SUPPRESSION PHYSIQUE DE L'IMAGE\n\t\t*/\n\t\t unlink ( 'C:\\wamp\\www\\simens\\public\\images\\images\\\\' . $result['NomImage'] . '.jpg' );\n\t\t/**\n\t\t * SUPPRESSION DE L'IMAGE DANS LA BASE\n\t\t*/\n\t\t $this->demandeExamensTable()->supprimerImage($result['IdImage']);\n\t\n\t\t$this->getResponse()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html' );\n\t\treturn $this->getResponse ()->setContent(Json::encode ());\n\t}", "public function removeImage() {\n //check if we have an old image\n if ($this->image) {\n //store the old name to delete the image on the upadate\n $this->temp = $this->image;\n //delete the current image\n $this->setImage(NULL);\n }\n }", "function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}", "function imageAllDelete();", "public static function deleteImage(){}", "public function delete_unknown_images() {\n global $wpdb;\n $wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image` WHERE gallery_id=0');\n }", "private static function purgeImages() {\n self::purgeFiles(self::getInterimImageFolder(), self::$interim_image_expiry);\n }", "public function Remove()\n {\n $file = __DIR__ . \\Extensions\\PHPImageWorkshop\\ImageWorkshop::UPLOAD_PATH . \"/banners/\" . $this->getSrc();\n if (file_exists($file)) {\n unlink($file);\n }\n parent::Remove();\n }", "public function cleanImagesAction()\n {\n parent::cleanImagesAction();\n $this->clearRespizrImageCache();\n }", "public function DeleteNotasImagenes() {\n\t\t\t$this->objNotasImagenes->Delete();\n\t\t}", "public function removeImage($data)\n\t{\n\t\t$this->db->delete('tbl_gambar', $data);\n\t}", "public function deleteImage(){\n if(file_exists($this->getImage())){\n unlink($this->getImage());\n }\n $this->setImage(null);\n }", "public function deleteImage()\n {\n $this->checkImage($this->logo, $this);\n }", "public function delete_related_images($column_name = 'image',$folder) {\n\t\t$image_name = $this->getOriginal($column_name);\n\t\t// if we don't have previous image then no need to delete it.\n\t\tif ( ! is_null($image_name) && file_exists($this->upload_path .$folder.'/modified/'.$image_name)) {\n\t\t\t$image_path = $this->upload_path .$folder.'/modified/'.$image_name;\n\n\t\t\t$img = Image::make($image_path);\n\t\t\t$mask = $img->filename . '*.*';\n\n\t\t\tarray_map('delete_if_exists', glob(public_path('uploads/'.$folder.'/modified/' . $mask)));\n\t\t}\n\t}", "public function deleteldImage() {\n\n if (!empty($this->oldImg) && $this->oldImg != $this->avatar) {\n $file = Yii::app()->basePath . DIRECTORY_SEPARATOR . \"..\" . DIRECTORY_SEPARATOR;\n $file.= \"uploads\" . DIRECTORY_SEPARATOR . \"user_profile\" . DIRECTORY_SEPARATOR . $this->user->primaryKey . DIRECTORY_SEPARATOR . $this->oldImg;\n\n DTUploadedFile::deleteExistingFile($file);\n }\n }", "public function delImg($item_id, $imgfile)\n {\n $this->db->update(array('id'=>$item_id), array('$pull'=>array('imgs'=>$imgfile)));\n \n // if this img is defimg, remove it, and replace with next img if still exists\n if ( $this->db->getOne(array('id'=>$item_id, 'defimg'=>$imgfile)) )\n {\n $defimg = ( $imgs = $this->db->getOne(array('id'=>$item_id, array('imgs'))) ) ? $imgs[0] : null;\n $this->db->update(array('id'=>$item_id), array('defimg'=>null));\n }\n }", "public function deleteImages() {\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_FULLSIZE . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete image file.\", E_USER_ERROR );\n }\n \n // Delete all thumbnail images for this book\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_THUMB . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete thumbnail file.\", E_USER_ERROR );\n }\n \n // Remove the image filename extension from the object\n $this->imageExtension = \"\";\n }", "function remove_custom_image_header()\n {\n }", "function dynamik_skin_images_cleanup()\n{\n\t$dynamik_gen_skin_options = get_option( 'dynamik_gen_skin_options' );\n\t$dynamik_gen_active_skin_options = get_option( 'dynamik_gen_' . $dynamik_gen_skin_options['active_skin'] . '_skin' );\n\t$skin_images_list = is_array( $dynamik_gen_active_skin_options['skin_images_list'] ) ? $dynamik_gen_active_skin_options['skin_images_list'] : array();\n\n\t$handle = opendir( dynamik_get_stylesheet_location( 'path' ) . 'images' );\n\twhile( false !== ( $file = readdir( $handle ) ) )\n\t{\n\t\t$ext = strtolower( substr( strrchr( $file, '.' ), 1 ) );\n\t\tif( $ext == 'jpg' || $ext == 'jpeg' || $ext == 'gif' || $ext == 'png' )\n\t\t{\n\t\t\tif( in_array( $file, $skin_images_list ) )\n\t\t\t{\n\t\t\t\tif( file_exists( dynamik_get_stylesheet_location( 'path' ) . 'images' . '/' . $file ) )\n\t\t\t\t\tunlink( dynamik_get_stylesheet_location( 'path' ) . 'images' . '/' . $file );\n\n\t\t\t\tif( file_exists( dynamik_get_stylesheet_location( 'path' ) . 'images' . '/adminthumbnails/' . $file ) )\n\t\t\t\t\tunlink( dynamik_get_stylesheet_location( 'path' ) . 'images' . '/adminthumbnails/' . $file );\n\t\t\t}\n\t\t}\n\t}\n\tclosedir( $handle );\n}", "function delete_image($imageId) {\n\t\t\tglobal $wpdb;\n\t\t\t$sql = \"select `filename` from `\".$this->table_img_name.\"` where `id` = '\".$imageId.\"'\";\n\t\t\t$img = $wpdb->get_row($sql, ARRAY_A, 0);\n\n\t\t\t$sql = \"delete from `\".$this->table_img_name.\"` where `id` = '\".$imageId.\"'\";\n\t\t\t$wpdb->query($sql);\n\n\t\t\t$page = $this->plugin_path.$this->images_dir.\"/\".$img['filename'];\n\n\t\t\t@unlink( $page );\n\n\t\t\t$fileExt = split( \"\\.\", $img['filename'] );\n\t\t\tif( $fileExt[1] != \"swf\" ) \n\t\t\t\t{\n\t\t\t\t\t $thumb = $this->plugin_path.$this->images_dir.\"/thumb_\".$img['filename'];\n\t\t\t\t\t @unlink( $thumb );\n\t\t\t\t}\n\t\t}", "public function excluirAnuncio($id){\n global $pdo;\n $sql = $pdo->prepare(\"DELETE FROM anuncios_imagens WHERE id_anuncio = :id_anuncio\"); // vai remover o registro de imagens\n $sql->bindValue(\":id_anuncio\", $id);\n $sql->execute(); \n\n $sql = $pdo->prepare(\"DELETE FROM anuncios WHERE id = :id\"); \n $sql->bindValue(\":id\", $id);\n $sql->execute(); \n\n \n\n\n\n }", "public function borrarImagen($id)\n {\n DAOVideojuegos::getInstance()->borrarImagen($id);\n if($this->imagen!=$this->carpeta.\"default.jpg\")\n unlink(\"./\".$this->imagen);\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function removeCoverPhoto($id_product)\n {\n $sql = \"UPDATE \" . _DB_PREFIX_ . \"image SET cover=NULL WHERE id_product = \" . (int) $id_product;\n Db::getInstance()->query($sql);\n //lay tat ca cac anh cover\n $sql = 'SELECT * FROM ' . _DB_PREFIX_ . 'image WHERE id_product=' . (int) $id_product;\n if ($results = Db::getInstance()->ExecuteS($sql, true, false)) {\n foreach ($results as $row) {\n $id_image = $row[\"id_image\"];\n $sql = \"UPDATE \" . _DB_PREFIX_ . \"image_shop SET cover=NULL WHERE id_image = \" . (int) $id_image;\n Db::getInstance()->query($sql);\n }\n }\n }", "function cleanImages()\r\n {\r\n if (!count($this->imagesContent)) return true;\r\n $this->_echo('<br>Очистка не используемых файлов картинок...');\r\n foreach ($this->imagesContent as $file) {\r\n @unlink($this->rootPath.$file);\r\n }\r\n }", "public function borrar($imagen)\n {\n }", "function medula_remove_plugin_image_sizes() {\n\tremove_image_size('image-name');\n}", "private function delete_old_picture(){\n foreach ( glob( UPLOADS.$this->get_name_sanitized().'.*' ) as $picture ){\n if(is_writable($picture)){unlink($picture);}\n }\n }", "function remove_image($image_id)\n\t{\n\t\t// global variables from config/db_config.php\n\t\tglobal $idea_db;\n\t\tglobal $images_db_table;\n\t\tglobal $db_hostname;\n\t\tglobal $db_user;\n\t\tglobal $db_password;\n\n\t\t// get the image's name to remove from file system\n\t\t$image = get_image($image_id);\n\n\t\t// construct query\n\t\t$query = \"DELETE FROM images WHERE images . id='$image_id'\";\n\n\t\t//send query\n\t\tif (send_query($query,$db_hostname,$db_user,$db_password,$idea_db))\n\t\t{\n\t\t\t// remove from file system\n\t\t\tunlink($image);\n\t\t} else {\n\t\t\t// TODO: Error occured with removing image. Redirect Appropriately.\n\t\t\t// debug\n\t\t\techo \"<h1> Image Not Deleted </h1>\";\n\t\t}\n\t}", "public function deleteImage1()\n {\n Storage::delete($this->image1);\n }", "public function clearRespizrImageCache()\n {\n $mediaPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA);\n $resizedDirPath = $mediaPath . DS\n . Mage::getSingleton('respizr/config')->getRespizrDirName();\n\n if (is_dir($resizedDirPath)) {\n $io = new Varien_Io_File();\n $io->rmdir($resizedDirPath, true);\n }\n }", "public final function remove_header_image()\n {\n }", "private static function toDelete(){\n $filesNotToDelete = [];\n $dir = public_path().'/images/';\n $filesInPublicFolder = scandir($dir);\n\n // izbacivanje assets foldera, .. i .\n $ignoreFiles = ['assets', '.', '..', 'pig.png', 'placeholder.png', 'logo.png', 'index.php'];\n foreach ($ignoreFiles as $toIgnore) {\n if (($key = array_search($toIgnore, $filesInPublicFolder)) !== false) {\n unset($filesInPublicFolder[$key]);\n }\n }\n // dd($filesInPublicFolder);\n $images = [];\n $collectionsOfObjectsWithImages = [Product::all(), ProductGroup::all(), Manufacturer::all(),\n Suggestion::all(), ImageSuggestion::all(), MainAd::all(),SecondAd::all()];\n\n foreach ($collectionsOfObjectsWithImages as $collection) {\n foreach ($collection as $object) {\n if($object->images->count()){\n foreach ($object->images as $image) {\n $images[] = $image->name;\n }\n }\n }\n }\n\n // dd($images);\n // dd(array_diff($filesInPublicFolder, $images));\n // dd($filesNotToDelete, $filesInPublicFolder);\n return $toDelete = array_diff($filesInPublicFolder, $images); //za fju array_dif vazan je redoslijed argumenata\n\n }", "Function unload(){\n\t\t$this->removeBackup();\n\t\tif($this->info && isset($this->info['im'])){\n\t\t\t@imagedestroy($this->info['im']);\n\t\t}\n\t\t$this->info = false;\n\t}", "function deleteImage()\n {\n $this->dbInit();\n\n $this->Database->array_query( $result, \"SELECT ImageID FROM eZLink_Link WHERE ID='$this->ID'\" );\n\n foreach ( $result as $item )\n {\n $image = new eZImage( $item[\"ImageID\"] );\n $image->delete();\n }\n \n $this->Database->query( \"UPDATE eZLink_Link set ImageID='0' WHERE ID='$this->ID'\" );\n }", "public function removeCoverAction(){\r\n\t\t$chanel_id = $this->_getParam('chanel_id', '0');\r\n\t\tif ($chanel_id == 0)\r\n\t\t\treturn;\r\n\t\t$chanel = Engine_Api::_()->getItem('sesvideo_chanel', $chanel_id);\t\t\r\n\t\tif(!$chanel)\r\n\t\t\treturn;\r\n\t\tif(isset($chanel->cover_id) && $chanel->cover_id>0){\r\n\t\t\t$im = Engine_Api::_()->getItem('storage_file', $chanel->cover_id);\r\n\t\t\t$chanel->cover_id = 0;\r\n\t\t\t$chanel->save();\r\n\t\t\t$im->delete();\r\n\t\t}\r\n\t\techo \"true\";die;\r\n\t}", "function deleteImage() \n\t{\n\t\t$filename = $this->fieldValue(\"theme_backimage\",\"\",\" and user_id=\".$this->user_id);\n\t\tif (trim($filename)!=\"\" && file_exists(THEME_BACK_IMAGE.$filename))\n\t\t\tunlink(THEME_BACK_IMAGE.$filename);\n\t\t\n\t\t$strquery=\"UPDATE \".DB_PREFIX.\"theme SET theme_backimage='', updated_date='\".$this->updated_date.\"', updated_by='\".$this->updated_by.\"' WHERE user_id=\".$this->user_id;\n\t\treturn mysql_query($strquery) or die(mysql_error());\n\t}", "public function actionDelImg(){\n $img_id = Yii::$app->request->post('img_id');\n $model_id = Yii::$app->request->post('model_id');\n\n $docModel = Product::find()\n ->where([\n 'id' => $model_id\n ])\n ->limit(1)\n ->one();\n $img = $docModel->getImageById($img_id);\n $docModel->removeImageNoDel($img);\n }", "public function deleteImg(Upload $delImage) \n {\n $req = $this->_log->prepare('DELETE `accommodation_images`, `images` FROM `accommodation_images` INNER JOIN `images` ON accommodation_images.idImage = images.idImage WHERE idAccommodation = :idAccommodation');\n $req->bindValue(':idAccommodation', $delImage->getIdAccommodation(), PDO::PARAM_INT);\n $req->execute();\n }", "function newsItem_DeleteImage( $tbl_news, $id ){\n\t$sql = mysql_query(\"UPDATE $tbl_news SET \n\t\tgambarkecil = '', \n\t\tgambarbesar ='' , \n\t\tdirektorigambar = '' \n\t\tWHERE id = '$id'\n\t\");\n\treturn $sql;\n}", "function hapus($id)\n{\n $conn = koneksi();\n\n // menghapus gambar di foldder img\n $p = query(\"SELECT * FROM products WHERE id = $id\")[0];\n if ($p['picture'] != 'nophoto.png') {\n unlink('../assets/img/' . $p['picture']);\n // die;\n } \n\n mysqli_query($conn, \"DELETE FROM products WHERE id = $id\") or die(mysqli_error($conn));\n return mysqli_affected_rows($conn);\n}", "function eliminarImagenSusQ($campo, $tabla, $idAsignacion)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/fotoSustanciasQuimicas/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function execRegenerateImgs(){\n\t\t$cnt=0;\n\t\t$dir = Environment::getVariable(\"dataDir\") . '/img/';\n\t\t$files = Finder::findFiles($this->id . \"-*.png\")->from($dir);\n\n\t\tforeach ($files as $file => $info) {\n\t\t\tunlink($file);\n\t\t\t$cnt++;\n\t\t}\n\n\t\t$this->execNumberOfPages();\n\t\t$this->execBookmarks();\n\t\t$this->execIndexFulltext();\n\t\t$this->execConvertImages();\n\n\t\treturn $cnt;\n\t}", "public function deleteImages()\n {\n if ($images = $this->getImages()->all()) {\n foreach ($images as $image) {\n /* @var $image AdImages */\n $image->delete();\n }\n }\n }", "public function __destruct() {\r\n\t\t//header(\"Content-type: image/png\");\r\n\r\n\t\t/* show our work ... */\r\n\t\t//imagepng( $this->cutted_image );\r\n\r\n\t\t/* we have to cleaned up the mass before left ... */\r\n\t\timagedestroy( $this->original_image );\r\n\t\timagedestroy( $this->cutted_image );\r\n\r\n\t\t/* so ... how do you think about this ...? */\r\n\t}", "function _delete_custom_logo_on_remove_site_logo()\n {\n }", "function delete_commun($id_img)\r\n\t{\r\n\t\tglobal $nuked, $user, $language, $rep_comun, $niveau_upload, $galerie_adm, $nb_quotas;\r\n\r\n\t\t$sql = mysql_query(\"SELECT fichier FROM \".ESPACE_MEMBRE_COMMUN_TABLE.\" WHERE id = '\" . $id_img . \"' \");\r\n\t\tlist($fichier) = mysql_fetch_array($sql);\r\n\r\n\t\t$img = $rep_comun.$fichier;\r\n\techo $id_img;\r\n\t\t$del=mysql_query(\"DELETE FROM \".ESPACE_MEMBRE_COMMUN_TABLE.\" WHERE id='\".$id_img.\"' \");\r\n\t\t@unlink($img);\r\n\t\techo\"\t<div style=\\\"text-align: center;\\\"><br /><br /><b>\"._IMGDELETE.\"</b><br /><br /></div>\";\r\n\r\n\t\tredirect(\"index.php?file=Espace_membre\",3);\r\n\t}", "public function remove_image($item)\n\t{\n\t\tthrow new Exception('Not implemented yet.');\n\t}", "public function imageconfiguratorAction()\r\n {\r\n $this->_view->unsetMain();\r\n }", "function bethel_remove_filter_from_gallery_images ($edit) {\n remove_filter ('wp_get_attachment_image_attributes', 'bethel_filter_image_attributes_for_gallery', 10, 2);\n remove_filter ('wp_get_attachment_link', 'bethel_filter_attachment_link_for_gallery', 10, 6);\n return $edit;\n}", "public function cleanLogo(Partenaire $partenaire): void\n {\n $em = $this->getEntityManager();\n foreach ($partenaire->getLogo() as $tag) {\n $partenaire->removeTag($tag);\n }\n\n $em->flush();\n }", "public function deleteAboutImg(){\n\t\t\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($this->db->query(\"update tblschool_about_school set photo='' where location_id=\".$location_id.\"\"))\n\t\t\t{\t\n\t\t\t\t/*$dir=pathinfo(BASEPATH);\n\t\t\t\t//echo $dir; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img); */\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}", "public function deleteImage($event)\n {\n $this->unlinkFiles($event->sender->{$this->attribute});\n }", "public function remove_pic($by_admin,$desc)\n {\n if(!$this->img_path || !file_exists($this->img_path)){ return; }\n unlink($this->img_path);\n $this->img_path = null;\n if($by_admin) {\n $this->img_takedown_msg = $desc;\n }\n $this->save();\n }", "abstract public function deregisterImage($image_id);", "function imageAllReset();", "function local_avatars_delete_image($user_id){\n\tlocal_avatars_get_plugin()->file_handler->delete_image($user_id);\n}", "public function file_cleanup(){\n\t\t$query = $this->db->get('carousels');\n\t\t$map = directory_map('./carousel/', 1);\n\t\t$g = \"x\";\n\t\tforeach($map as $file)\n\t\t{\n\t\t\t\t\t\t\t\n\t\t\t//return $query->result();\n\t\t\t$g = $g . \"--\";\n\t\t\t$x = 0;\n\t\t\t$soundfile=\"\";\n\t\t\tforeach($query->result() as $row){\n\t\t\t\t//return $row;\n\t\t\t\t$picture = $row->image;\n\t\t\t\t$g = $g . \"<\" . $soundfile . \"-\" . $file . \">\";\n\t\t\t\tif ($file==$picture)\t{\n\t\t\t\t\t$g = $g . \"files are the same\";\n\t\t\t\t\t$x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($x==0 )\n\t\t\t{\n\t\t\t \t$g = $g . \"we're in the loop\";\n\t\t\t\tunlink(\"./carousel/\" . $file);\n\t\t\t\t\t$g = $g . \" removed: \" . \"./carousel/\" . $file . \" - \";\n\t\t\t\t\n\t\t\t}\n\t\t\tif (strlen($g) > 700)\n \t\t\t\t$g = substr($g, 0, 700);\n\t\t}\n\t\t//return $g;\n\t\t//$this->session->set_flashdata('carousel_saved', $file . \"--\" . $soundfile );\n\t}", "function delete_gallery_image($image_id)\n\t{\n\t\tglobal $db, $cid;\n\n\t\t$this->delete_image($image_id);\n\t\n\t\t$data = $this->select_vehicle_data($cid);\n\t\n\t\tif ( $data['image_id'] == $image_id)\n\t\t{\n\t\t\t$this->update_single_field(GARAGE_TABLE,'image_id','NULL','image_id',$image_id);\n\t\t}\n\n\t\t// Remove From Gallery DB Table\n\t\t$this->delete_rows(GARAGE_GALLERY_TABLE, 'image_id', $image_id);\n\n\t\treturn;\n\t}", "public function removeImages($object)\n {\n return $this->createQuery('i')\n ->delete()\n ->where('i.imaged_model_id = ?', $object['id'])\n ->andWhere('i.imaged_model = ?', get_class($object))\n ->execute();\n }", "function magazinevibe_child_remove_first_image( $content ) {\n\t$dom = new DOMDocument();\n\t$dom->loadHTML( $content );\n\t$images = $dom->getElementsByTagName( 'img' );\n\n\tforeach ( $images as $image ) {\n\t\t$parent = $image->parentNode;\n\t\tif ( $parent->nodeName ) {\n\t\t\t$parent->parentNode->removeChild( $parent );\n\t\t\t$content = $dom->saveHTML();\n\t\t\t$content = str_replace('&Acirc;', '', $content);\n\t\t\treturn $content;\n\t\t}\n\t}\n\n\t$content = str_replace('&Acirc;', '', $content);\n\n\treturn $content;\n}", "public function delete_image_file()\n {\n if(Image::remove_image($this->image_url))\n {\n $this->image_url = '';\n return true;\n }\n return true; \n }", "function unsetImage($uid,$table,$data,$path) {\n\t\n\t $this->db->select($data);\n $this->db->from($table);\n\t\t$this->db->where('uid',$uid);\n $query=$this->db->get();\t\t\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t $query=$query->result();\n\t\t $img=$query[0]->$data;\n @unlink($path.$img);\n\t\t}\t\n return true;\t\t\n\t}", "function uninstall(bool $deleteimages = false)\n{\n $meta = file_exists(DEFAULT_METAFILE) ? textFileToArray(DEFAULT_METAFILE) : null;\n $files = glob(VAR_FOLDER . DS . '{,.}[!.,!..]*', GLOB_MARK|GLOB_BRACE);\n foreach ($files as $file) {\n unlink($file);\n }\n\n if (true === $deleteimages) {\n $imagesdir = $meta && count($meta) && array_key_exists('imagesfolder', $meta) ? ROOT_FOLDER . DS . $meta['imagesfolder'] : DEFAULT_IMAGEFOLDER;\n\n $files = glob($imagesdir . DS . '{,.}[!.,!..]*', GLOB_MARK|GLOB_BRACE);\n foreach ($files as $file) {\n unlink($file);\n }\n }\n\n if ($meta) {\n unlink(DEFAULT_METAFILE);\n }\n}", "public function handleDeleteImage(){\n\n $session = $this->hlp->sess(\"images\");\n $img = $session->toDelete;\n $listingID = $this->hlp->sess(\"listing\")->listingID;\n $imgs = $this->listings->getListingImages($listingID);\n \n unset($imgs[$img]);\n\n //reindexed array after unset\n $newArray = array();\n \n foreach ($imgs as $image){\n array_push($newArray, $image);\n }\n \n unset($imgs);\n \n //final array - updated - without deleted images to store in db\n $images = serialize($newArray);\n \n $this->listings->updateListingImages($listingID, $images);\n $this->redirect(\"Listings:editListing\", $listingID);\n }", "public function delAllImages($idAnuncio){\n\t\t$query = \"DELETE FROM final_imagen WHERE idAnuncio = '\".$idAnuncio.\"'\";\n\t\treturn $this->con->action($query);\n\t}", "public function product_image_remove($data)\n {\n \n\n $imageid = $data['imagekey'];\n $image_path = $data['image_path'];\n $product_id = $data['product_id'];\n\n $query = \"DELETE\n FROM \" . $this->db_table_prefix . \"images WHERE id = $imageid\";\n \n $result = $this->commonDatabaseAction($query);\n\n\n\n// if (@mysql_affected_rows($result) > 0)\n if ($result > 0)\n {\n\n $query2 = \"SELECT image_path FROM \" . $this->db_table_prefix. \"products where id = '\" . $product_id . \"'\";\n $result2 = $this->commonDatabaseAction($query2);\n $prArray = $this->resultArray($result2);\n \n if(trim($prArray[0]['image_path']) == trim($image_path))\n {\n\n $query3 = \"SELECT image_path FROM \" . $this->db_table_prefix. \"images where product_id = '\" . $product_id . \"' order by id DESC\";\n $result3 = $this->commonDatabaseAction($query3);\n $imgArray = $this->resultArray($result3);\n /*print_r(count($imgArray[0])); \n exit;*/\n if(count($imgArray[0])==1)\n { \n $query4= \"UPDATE \" . $this->db_table_prefix . \"products set image_path = '\".$imgArray[0]['image_path'].\"'WHERE id = $product_id\";\n $result4 = $this->commonDatabaseAction($query4);\n }\n else\n {\n $query5= \"UPDATE \" . $this->db_table_prefix . \"products set image_path = '' WHERE id = $product_id\";\n $result5 = $this->commonDatabaseAction($query5);\n }\n\n }\n\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "private function removeImages($entryid){\n\t\t$query = Queries::removeimages($entryid);\n\t\treturn $this->query($query);\n\t}", "public function destroyimage($id) {\n $delete = ProductsGallary::find($id);\n if(!empty($delete->media) and file_exists(public_path().'/upload/products/'.$delete->media))\n {\n unlink(public_path().'/upload/products/'.$delete->media);\n }\n $delete->delete();\n session()->flash('success',trans('admin.deleted'));\n return back();\n }", "function borrarImagen($idImagen, $ruta){\n $conn=connexioBD();\n $sql=\"DELETE FROM imatges WHERE id='$idImagen'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n unlink($ruta);\n $conn->close();\n}", "public function removeExtra()\n {\n if ($this->extraFilename !== null) {\n $finder = new Finder();\n $fs = new Filesystem();\n $imagePath = FRONTEND_FILES_PATH . '/festival/artists/files/extra';\n\n foreach ($finder->directories()->in($imagePath) as $directory) {\n $file = $directory . '/' . $this->extraFilename;\n\n if (is_file($file)) {\n $fs->remove($file);\n }\n }\n\n $this->extraFilename = null;\n\n return true;\n }\n\n return false;\n }", "function deletePicture() {\n\t\tglobal $DB_LINK, $db_table_recipes, $g_rb_database_type, $LangUI;\n\t\t$sql = \"UPDATE $db_table_recipes SET recipe_picture='', recipe_picture_type='' WHERE recipe_id=\" . $DB_LINK->addq($this->id, get_magic_quotes_gpc());\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, NULL, $LangUI->_('There was an error removing the picture'), $sql);\n\n\t\t// Do the postgres cleanup\n\t\tif ($this->picture_oid && $g_rb_database_type==\"postgres\") {\n\t\t\t$rc = $DB_LINK->BlobDelete($this->picture_oid);\n\t\t\t$this->picture_oid=NULL;\n\t\t\tDBUtils::checkResult($rc, NULL, $LangUI->_('There was an error removing the picture'), $sql);\n\t\t}\n\t\treturn TRUE;\n\t}", "public function deleteVideoSectionImg(){\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($this->db->query(\"update tbl_school_video_section set photo='' where location_id=\".$location_id.\"\"))\n\t\t\t{\t\n\t\t\t\t/*$dir=pathinfo(BASEPATH);\n\t\t\t\t//echo $dir; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img); */\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "public function remove()\n {\n $file = $this->security->xss_clean($this->input->post(\"file\"));\n $id = $this->security->xss_clean($this->input->post(\"id\"));\n if ($file && file_exists($file)) {\n unlink($file);\n $this->db->where(array('url_image'=>$file,'idProduct'=>$id));\n $this->db->delete('imageProduct');\n }\n }", "function deleteImage($image = \"\")\n {\n if (!$image)\n $image = $this->image;\n unlink ($image);\n }", "function delete($id_img)\r\n\t{\r\n\t\tglobal $nuked, $user, $language, $repertoire, $niveau_upload, $galerie_adm, $nb_quotas;\r\n\r\n\t\tif($user[1] >= $niveau_upload)\r\n\t\t{\r\n\t\t\t$sql=mysql_query(\"SELECT fichier FROM \".ESPACE_MEMBRE_TABLE.\" WHERE id = '\".$id_img.\"' \");\r\n\t\t\tlist($fichier) = mysql_fetch_array($sql);\r\n\r\n\t\t\t$img = $repertoire.\"/\".$user[0].\"/\".$fichier;\r\n\r\n\t\t\t$del=mysql_query(\"DELETE FROM \".ESPACE_MEMBRE_TABLE.\" WHERE id='\".$id_img.\"' \");\r\n\t\t\t@unlink($img);\r\n\t\t\techo\"\t<div style=\\\"text-align: center;\\\"><br /><br /><b>\"._IMGDELETE.\"</b><br /><br /></div>\";\r\n\r\n\t\t\tredirect(\"index.php?file=Espace_membre&op=compte\",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 execPurgeImgCache() {\n\t\t$cnt=0;\n\t\t$dir = Environment::getVariable(\"dataDir\") . '/thumbs/';\n\t\t$files = Finder::findFiles($this->id . \"-*.png\")->from($dir);\n\n\t\tforeach ($files as $file => $info) {\n\t\t\tunlink($file);\n\t\t\t$cnt++;\n\t\t}\n\n\t\treturn $cnt;\n\t}", "function _ddb_cover_upload_cleanup() {\n $data = _ddb_cover_upload_session('ddb_cover_upload_submitted');\n\n // Mark image as upload to prevent more uploads of the same data.\n _ddb_cover_upload_session('ddb_cover_upload_submitted', '');\n\n // Remove local copy of the image.\n file_unmanaged_delete($data['image_uri']);\n}", "function _delete_site_logo_on_remove_theme_mods()\n {\n }", "function excluir($id) {\n\t\n\t\t$nomeModel = $this->nomeModel;\n\t\t$this->load->model('administracao/'.$this->nomeModel);\n\t\t\n\t\tif($this->temFoto){\n\t\t\t//busca as fotos da tabela para deletar da pasta\n\t\t\t$this->db->where($this->idFoto, $id);\n\t\t\t$query = $this->db->get($this->tabelaFoto);\n\t\t\t\n\t\t\t$dados['foto'] = $query->result();\n\t\t\t\n\t\t\tif($dados['foto']){\n\t\t\tforeach($dados['foto'] as $foto): // percorre todas as fotos com o id_produto\n\t\t\t\tunlink('imgs/' . $foto->nome);\n\t\t\tendforeach;\n\t\t\t}\n\t\t\t\n\t\t if (!$this->$nomeModel->fotoexcluir($id)){ // deleta foto do banco\n\t\t\t\techo \"Erro ao excluir Foto do produto\";\n\t\t\t}\n\t\t}\n \n if ($this->$nomeModel->excluir($id)) { // deleta arquivo do banco\n \n redirect('administracao/'.$this->nomeController.'/listar/', 'refresh');\n } else {\n echo \"erro ao excluir o Produto.\";\n }\n }", "protected function combineImages() {}", "public function subirImagen($idBache){\n\t\t$this->load->model(\"Multimedia\");\n\t\t$this->Multimedia->subirImagen($idBache);\n\t}", "function tfuse_delete_resized_images( $post_id ) {\r\n $metadata = wp_get_attachment_metadata( $post_id );\r\n if ( !$metadata )\r\n return;\r\n\r\n // Do some bailing if we cannot continue\r\n if ( !isset( $metadata['file'] ) || !isset( $metadata['image_meta']['resized_images'] ) )\r\n return;\r\n $pathinfo = pathinfo( $metadata['file'] );\r\n $resized_images = $metadata['image_meta']['resized_images'];\r\n\r\n // Get Wordpress uploads directory (and bail if it doesn't exist)\r\n $wp_upload_dir = wp_upload_dir();\r\n $upload_dir = $wp_upload_dir['basedir'];\r\n if ( !is_dir( $upload_dir ) )\r\n return;\r\n\r\n // Delete the resized images\r\n foreach ( $resized_images as $dims ) {\r\n\r\n // Get the resized images filename\r\n $file = $upload_dir .'/'. $pathinfo['dirname'] .'/'. $pathinfo['filename'] .'-'. $dims .'.'. $pathinfo['extension'];\r\n\r\n // Delete the resized image\r\n @unlink( $file );\r\n\r\n }\r\n\r\n $remote_uploaded_by_tfuse = get_option('tfuse_remote_images', array());\r\n $image_uri = wp_get_attachment_url($post_id);\r\n $key = array_search($image_uri, $remote_uploaded_by_tfuse);\r\n if($key)\r\n {\r\n unset($remote_uploaded_by_tfuse[$key]);\r\n update_option('tfuse_remote_images', $remote_uploaded_by_tfuse);\r\n }\r\n\r\n\r\n }", "function eliminarImagenCarpeta($campo, $tabla, $idAsignacion, $carpeta)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$carpeta/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function delete() {\n\t\t$canvas = $this->original->getCanvas();\n\t\timagefilledrectangle($this->original->getImage(), $this->x, $this->y, $this->x+$this->getWidth()-1, $this->y+$this->getHeight()-1, imagecolorallocate($this->original->getImage(), $canvas['r'], $canvas['g'], $canvas['b']));\n\t}", "public function unlink($logo_name){\r\n global $db,$upload_path;\r\n\r\n $sql = \"SELECT logo FROM hrms_gsettings\";\r\n $query=mysqli_query($db,$sql);\r\n $row=mysqli_fetch_assoc($query);\r\n $logo = $row['logo'];\r\n\r\n if($logo != $logo_name){\r\n unlink($upload_path.\"/logo/\".$logo);\r\n }\r\n\r\n\r\n}", "public function deleteTextSectionBoxImg(){\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($this->db->query(\"update tbl_school_text_sections set left_photo='' where location_id=\".$location_id.\"\"))\n\t\t\t{\t\n\t\t\t\t/*$dir=pathinfo(BASEPATH);\n\t\t\t\t//echo $dir; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img); */\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "function deleteImage($filename, $target_file)\n{\n // remove from list\n $list = read_file_list();\n $pivot = array_search($filename, $list);\n $left = array_slice($list, 0, $pivot);\n $right = array_slice($list, $pivot+1);\n $list = array_merge($left, $right);\n\n // remove file and output modified list\n unlink($target_file);\n write_file_list($list);\n\n echo $target_file . \" deleted successfully.<br>\";\n}", "public function removeUpload()\n {\n $this->picture = null;\n }", "private function deleteRecords(){\r\n\t\r\n\t\t$fileNames = explode(',', $this->collection['images']);\r\n\t\t// remove imagerecords which are not used anymore\r\n\t\tforeach($this->images as $filename => $image){\r\n\t\t\tif(array_search($filename, $fileNames) === false){\r\n\t\t\r\n\t\t\t\t$this->db->exec_DELETEquery('tx_gorillary_images', \"image='$filename' AND collection='\".$this->collection['uid'].\"'\");\r\n\t\t\t\t//unset ($this->images[$filename]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function destroy(Add_image $add_image)\n {\n //\n }", "public function deletePicture($id){\n $picName = null;\n $images = new Images();\n $dataPic = $images->get_image($id);\n foreach ($dataPic as $key => $value) {\n $picName = $value->img_url;\n }\n $checkFile = file_exists(public_path() . '/' . $picName);\n if ($checkFile){\n unlink(public_path() . '/' . $picName);\n }\n }", "function delImage($filename)\n\t{\n\t\t// TODO: Retrieve different pictures from root model\t\t\n\t\tif(is_file(WWW_ROOT . \"img/thumbnails/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/thumbnails/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/medium/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/medium/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/large/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/large/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/original/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/original/\" . $filename);\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.77987385", "0.75452226", "0.72969425", "0.7012681", "0.68958", "0.68656147", "0.6802206", "0.6671544", "0.66102487", "0.66050875", "0.6526831", "0.6475862", "0.64475036", "0.64101636", "0.6385188", "0.6383677", "0.6382743", "0.6327972", "0.62656134", "0.6237606", "0.6223048", "0.61897284", "0.61844236", "0.61649805", "0.6157946", "0.61161774", "0.61151075", "0.605295", "0.60037804", "0.59969187", "0.5978891", "0.5977625", "0.5977395", "0.5973794", "0.5949892", "0.59375745", "0.5932081", "0.5900973", "0.5899827", "0.5899076", "0.5897489", "0.58694005", "0.58671004", "0.58629817", "0.5855307", "0.58513993", "0.58347774", "0.5830696", "0.5830637", "0.5828516", "0.5822839", "0.58210695", "0.5806734", "0.5805734", "0.5789828", "0.5789819", "0.57815754", "0.57791543", "0.5769979", "0.57697153", "0.5766186", "0.5760875", "0.57478535", "0.57437646", "0.5740017", "0.57224137", "0.57165253", "0.5712866", "0.57092714", "0.5708731", "0.5705549", "0.57049775", "0.5704108", "0.5693013", "0.56898105", "0.56854975", "0.56762725", "0.5668241", "0.566809", "0.5667501", "0.56669265", "0.56641847", "0.56580305", "0.56546235", "0.56533194", "0.56480676", "0.5639766", "0.5635579", "0.56294894", "0.56284374", "0.56206465", "0.56186676", "0.56162304", "0.5613507", "0.5612932", "0.56032324", "0.5594039", "0.55903286", "0.5588208", "0.55874455" ]
0.8378347
0
Run the database seeds.
public function run() { ModelsUser::create([ 'name' => 'petra', 'email' => '[email protected]', 'password' => '1234', 'image' => 'kosong' ]); ModelsUser::create([ 'name' => 'abduh', 'email' => '[email protected]', 'password' => '1234', 'image' => 'kosong' ]); ModelsUser::create([ 'name' => 'ramb', 'email' => '[email protected]', 'password' => '1234', 'image' => 'kosong' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Create a new command instance.
public function __construct(CategoryService $categoryService) { parent::__construct(); $this->categoryService = $categoryService; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { $this->categoryService->delete($this->argument('category_id')); $this->info("Category deleted!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Create a new job instance.
public function __construct($payload) { $this->payload = $payload; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "abstract public function makeJob();", "abstract public function makeJob();", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "public function createJobExecution(JobInstance $job)\n {\n return new JobExecution();\n }", "public function setJobName(string $jobName): JobInstanceInterface;", "public function __construct(Job $job)\n {\n $this->job = $job;\n }", "public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function create(JobRequest $jobRequest)\n {\n $job = new Job();\n\n $job->business_person = $jobRequest->business_person;\n $job->principal_phone = $jobRequest->principal_phone;\n $job->optional_phone = $jobRequest->optional_phone;\n $job->init_date = $jobRequest->init_date;\n $job->finish_date = $jobRequest->finish_date;\n $job->city = $jobRequest->city;\n\n $job->save();\n\n return compact('job');\n }", "public function createNewJob($jobBody, $queue)\n {\n $job = new Job($jobBody, $queue);\n\n if ($this->jobHasBeenAddedFromOutside($job)) {\n $this->addMissingJobTimeData($job);\n }\n\n return $job;\n }", "protected function createJobFromPayload($payload = [])\n {\n return new Job([\n 'title' => $payload['jobTitle'],\n 'name' => $payload['jobTitle'],\n 'description' => $payload['descriptionFragment'],\n 'url' => $payload['jobViewUrl'],\n 'sourceId' => $payload['jobListingId'],\n 'location' => $payload['location'],\n 'industry' => $payload['jobCategory']\n ]);\n }", "public function created(Job $job)\n {\n //\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "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}", "static public function factory($job, $conn, $handle, $initParams=array())\n {\n if (empty($initParams['path'])) {\n $paths = explode(',', NET_GEARMAN_JOB_PATH);\n $file = null;\n\n foreach ($paths as $path) {\n $tmpFile = $path . '/' . $job . '.php';\n\n if (file_exists(realpath($tmpFile))) {\n $file = $tmpFile;\n break;\n }\n }\n }\n else {\n $file = $initParams['path'];\n }\n\n if ( ! file_exists($file) ) {\n throw new Net_Gearman_Job_Exception('Invalid Job class file: ' . (empty($file) ? '<empty>' : $file));\n }\n\n include_once $file;\n\n if (empty($initParams['class_name'])) {\n $class = NET_GEARMAN_JOB_CLASS_PREFIX . $job;\n }\n else {\n $class = $initParams['class_name'];\n }\n\n if (!class_exists($class)) {\n throw new Net_Gearman_Job_Exception('Invalid Job class: ' . (empty($class) ? '<empty>' : $class) . ' in ' . (empty($file) ? '<empty>' : $file) );\n }\n\n $instance = new $class($conn, $handle, $initParams);\n if (!$instance instanceof Net_Gearman_Job_Common) {\n throw new Net_Gearman_Job_Exception('Job is of invalid type: ' . get_class($instance));\n }\n\n return $instance;\n }", "public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }", "private function createJob (string $cronTab) : CronJobInterface\n {\n return new class ($cronTab) implements CronJobInterface\n {\n /** @var string */\n private $cronTab;\n\n\n /**\n */\n public function __construct (string $cronTab)\n {\n $this->cronTab = $cronTab;\n }\n\n\n /**\n */\n public function getCronTab () : string\n {\n return $this->cronTab;\n }\n\n\n /**\n */\n public function getName () : string\n {\n return \"My Job\";\n }\n\n\n /**\n */\n public function execute (BufferedSymfonyStyle $io) : CronStatus\n {\n return new CronStatus(true);\n }\n };\n }", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "public function getNewJob() {\n # we can grab a locked job if we own the lock\n $rs = $this->runQuery(\"\n SELECT id\n FROM \" . self::$jobsTable . \"\n WHERE queue = ?\n AND (run_at IS NULL OR NOW() >= run_at)\n AND (locked_at IS NULL OR locked_by = ?)\n AND failed_at IS NULL\n AND attempts < ?\n ORDER BY created_at DESC\n LIMIT 10\n \", array($this->queue, $this->name, $this->max_attempts));\n\n // randomly order the 10 to prevent lock contention among workers\n shuffle($rs);\n\n foreach ($rs as $r) {\n $job = new DJJob($this->name, $r[\"id\"], array(\n \"max_attempts\" => $this->max_attempts,\n \"fail_on_output\" => $this->fail_on_output\n ));\n if ($job->acquireLock()) return $job;\n }\n\n return false;\n }", "public function store(Request $request): JobResource\n {\n $jobTypes = Factory::listTypes();\n $validValues = $this->validate(\n $request,\n [\n 'sample_code' => ['filled', 'string', 'alpha_dash'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'string', Rule::in($jobTypes->pluck('id'))],\n 'parameters' => ['filled', 'array'],\n ]\n );\n $parametersValidation = $this->_prepareNestedValidation(\n Factory::validationSpec($validValues['type'], $request)\n );\n $validParameters = $this->validate($request, $parametersValidation);\n $type = $validValues['type'];\n $validParameters = $validParameters['parameters'] ?? [];\n $job = Job::create(\n [\n 'sample_code' => $validValues['sample_code'] ?? null,\n 'name' => $validValues['name'],\n 'job_type' => $type,\n 'status' => Job::READY,\n 'job_parameters' => [],\n 'job_output' => [],\n 'log' => '',\n 'user_id' => \\Auth::guard('api')->id(),\n ]\n );\n $job->setParameters(Arr::dot($validParameters));\n $job->save();\n $job->getJobDirectory();\n\n return new JobResource($job);\n }", "public function __construct(JobPoster $job)\n {\n $this->job = $job;\n }", "public function create()\n {\n // Display form to create a new job\n return view('jobs.create');\n }", "public function __construct(Job $job)\n {\n parent::__construct();\n\n $this->job = $job;\n }", "protected function getJobInstance(): JobInstance\n {\n if (!isset($this->jobInstance)) {\n $id = $this->argument('instanceId');\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n $this->jobInstance = JobInstance::findOrFail(intval($id));\n }\n\n return $this->jobInstance;\n }", "public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "public function create() {}", "public function __construct()\n {\n $this->jobService = new JobService();\n }", "public function create()\n {\n $job=new Job;\n return view('jobs.create',[\n 'job'=>$job,]);\n //\n }", "public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }", "public function create()\n {\n return view('admin.job.create');\n }", "public function createAction(Request $request)\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(){}", "public function create(Request $request) {\n $jobPost = new Job();\n $jobPost->user_id = Auth::user()->id;\n\n // Substract one credit from user's subscription\n $userPlans = Auth::user()->plans;\n\n foreach ($userPlans as $plan) {\n if ($plan->credits > 0) {\n $plan->credits = $plan->credits - 1;\n $plan->save();\n }\n }\n\n $jobPostData = $request::input('jobPost');\n foreach ($jobPostData as $key => $value) {\n $jobPost[$key] = $value;\n }\n\n $jobPost->save();\n\n return $jobPost;\n }", "public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }", "public function create()\n {\n return view('profile.job.create');\n }", "public function create()\n {\n return view('job.add_job');\n }", "public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create()\n {}", "public function createTask()\n {\n return factory($this->model)->create();\n }", "public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createJob(array $settings, $metaData = [], $priority = 0)\n {\n return $this->client->createJob([\n 'Role' => config('media-converter.iam_arn'),\n 'Settings' => $settings,\n 'Queue' => config('media-converter.queue_arn'),\n 'UserMetadata' => $metaData,\n 'StatusUpdateInterval' => $this->getStatusUpdateInterval(),\n 'Priority' => $priority,\n ]);\n }", "public function addNewJobOpo()\n {\n }", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public static function createJob($mysqli,$name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate){\n $insert = \"INSERT INTO job (job_name,job_desc,cust_email,trade_name,area,preferred_cost,date_needed,offer_end_date) VALUES (?,?,?,?,?,?,?,?)\";\n $stmt = $mysqli->prepare($insert);\n $stmt->bind_param('sssssiss', $name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate); \n $stmt->execute();\n $stmt->close();\n $job = new Job(['JobName'],['JobDesc'],['Email'],['Trade'],['Area'],['JobCost'],['JobDate'],['EstDate']);\n return $job;\n }", "public function store(Request $request)\n {\n $job = new Job();\n $job->title = $request->title;\n $job->description = $request->description;\n $job->company_name = $request->company_name;\n $this->repo->save($job);\n return new JobsResources($job);\n }", "public function create()\n {\n $fields = Field::all();\n $jobTypes = config('user.job_type');\n\n return view('job.create', [\n 'fields' => $fields,\n 'jobTypes' => $jobTypes,\n ]);\n }", "public static function create($queue, $class, array $data = null, $run_at = 0)\n {\n $id = static::createId($queue, $class, $data, $run_at);\n\n $job = new static($queue, $id, $class, $data);\n\n if ($run_at > 0) {\n if (!$job->delay($run_at)) {\n return false;\n }\n } elseif (!$job->queue()) {\n return false;\n }\n\n Stats::incr('total', 1);\n Stats::incr('total', 1, Queue::redisKey($queue, 'stats'));\n\n return $job;\n }", "public function create()\n {\n return $this->objectManager->create($this->className);\n }", "public function create() {\r\n }", "public function create()\n {\n //TODO\n }", "public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }", "public function __construct(int $status, Job $job)\n {\n $this->status = $status;\n $this->job = $job;\n\n $this->updateTask($this->status, $this->job);\n }", "public function create()\n {\n return new $this->class;\n }", "public function create() {\n }", "public function create() {\n }", "public function create() {\n\t \n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create()\n {\n return view('admin.jobs.create');\n }", "public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }", "public function run()\n {\n Job::factory()->count(100)->create();\n \n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n {\n return view('admin.jobs.create');\n\n }", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}", "public function createJobWithSalesPrices(array $inputData): Job;", "public function create(Job $job)\n {\n $states = $job->prepareStates();\n $countries = $job->prepareCountries();\n $hours = $job->prepareHours();\n $minutes = $job->prepareMinutes();\n $ampm = $job->prepareAmpm();\n $open = $job->prepareOpen();\n return view('companies.create', compact(['states','countries','hours','minutes','ampm','open']));\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }" ]
[ "0.6920272", "0.6905722", "0.6905722", "0.6869542", "0.6808916", "0.65271425", "0.65184414", "0.64918077", "0.6489135", "0.6468623", "0.6425879", "0.64058304", "0.63938236", "0.63899404", "0.63753885", "0.6304669", "0.6256802", "0.6241474", "0.620155", "0.61789167", "0.60741454", "0.60695714", "0.6047274", "0.60462874", "0.6028435", "0.6027225", "0.6021894", "0.60214204", "0.59231514", "0.58802027", "0.5874528", "0.58576655", "0.58098435", "0.5805053", "0.58005697", "0.5789109", "0.57851434", "0.57767034", "0.5775661", "0.5755982", "0.5702295", "0.5683395", "0.5683395", "0.5683395", "0.5683376", "0.5679739", "0.5678496", "0.5659406", "0.56529284", "0.56470996", "0.5634536", "0.5632702", "0.5632702", "0.5628215", "0.5625956", "0.5621957", "0.56141514", "0.56048644", "0.5604791", "0.5601149", "0.5601067", "0.5599652", "0.5595376", "0.55932534", "0.55932534", "0.55932015", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55362236", "0.5534658", "0.5531583", "0.55224913", "0.5522197", "0.5517534", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.5514842", "0.549955", "0.5497938", "0.54876786", "0.54876786", "0.54876786" ]
0.0
-1
directory for file caching CONSTRUCTOR
public function __construct($type=NULL) { if (empty($type) AND !empty($GLOBALS['config']['cachetype'])) {$type = $GLOBALS['config']['cachetype'];} if (empty($type) OR !in_array($type,self::$cachetypes)) { $type = 'session'; } $this->type = $type; if ($this->type == 'file' AND !is_dir(self::$cachedir)) { mkdir(self::$cachedir); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCacheDirectory() {}", "public function getCacheDir();", "function __construct($cache_file_name, $cache_file_time, $cache_file_extension, $cache_file_path){\n\n\t\tif($cache_file_extension == '')\t\n\t\t\t$cache_file_extension = '.cache';\n\t\t\n\t\tif(!is_dir($cache_file_path)){\n\t\t\t$oldumask = umask(0);\n\t\t\tmkdir($cache_file_path,0777,true);\n\t\t\tumask($oldumask);\t\n\t\t}\t\t\n\n\t\tCache::$path = $cache_file_path.'/'.$cache_file_name.$cache_file_extension;\n\t\tCache::$time = $cache_file_time;\n\t\t//echo Cache::$path;\n\t\t//exit;\n\t}", "public function get_cache_directory() {\n\t\treturn $this->cache_directory;\n\t}", "private static function _createCacheFile() {\r\n $paths = array();\r\n $paths['apps'] = File::getDirectoriesNames(ZEEYE_APPS_PATH);\r\n $paths['libs'] = File::getDirectoriesNames(ZEEYE_LIBS_PATH);\r\n File::write(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH, '<?php ' . PHP_EOL . '$paths = ' . var_export($paths, true) . ';');\r\n self::$_hasCacheFile = true;\r\n }", "function Cache_Container_file($options = '')\n {\n if (is_array($options)) {\n $this->setOptions($options, array_merge($this->allowed_options, array('cache_dir', 'filename_prefix', 'max_userdata_linelength')));\n }\n clearstatcache();\n if ($this->cache_dir) {\n // make relative paths absolute for use in deconstructor.\n // it looks like the deconstructor has problems with relative paths\n if (OS_UNIX && '/' != $this->cache_dir{0} )\n $this->cache_dir = realpath( getcwd() . '/' . $this->cache_dir) . '/';\n\n // check if a trailing slash is in cache_dir\n if ($this->cache_dir{strlen($this->cache_dir)-1} != DIRECTORY_SEPARATOR)\n $this->cache_dir .= '/';\n\n if (!file_exists($this->cache_dir) || !is_dir($this->cache_dir))\n mkdir($this->cache_dir, 0755);\n }\n $this->entries = array();\n $this->group_dirs = array();\n \n } // end func contructor\n\n function fetch($id, $group)\n {\n $file = $this->getFilename($id, $group);\n if (PEAR::isError($file)) {\n return $file;\n }\n\n if (!file_exists($file)) {\n return array(null, null, null);\n }\n // retrive the content\n if (!($fh = @fopen($file, 'rb'))) {\n return new Cache_Error(\"Can't access cache file '$file'. Check access rights and path.\", __FILE__, __LINE__);\n }\n // File locking (shared lock)\n if ($this->fileLocking) {\n flock($fh, LOCK_SH);\n }\n // file format:\n // 1st line: expiration date\n // 2nd line: user data\n // 3rd+ lines: cache data\n $expire = trim(fgets($fh, 12));\n if ($this->max_userdata_linelength == 0 ) {\n $userdata = trim(fgets($fh));\n } else {\n $userdata = trim(fgets($fh, $this->max_userdata_linelength));\n }\n $buffer = '';\n while (!feof($fh)) {\n \t$buffer .= fread($fh, 8192);\n }\n $cachedata = $this->decode($buffer);\n\n // Unlocking\n if ($this->fileLocking) {\n flock($fh, LOCK_UN);\n }\n fclose($fh);\n\n // last usage date used by the gc - maxlifetime\n // touch without second param produced stupid entries...\n touch($file,time());\n clearstatcache();\n\n return array($expire, $cachedata, $userdata);\n } // end func fetch\n\n /**\n * Stores a dataset.\n *\n * WARNING: If you supply userdata it must not contain any linebreaks,\n * otherwise it will break the filestructure.\n */\n function save($id, $cachedata, $expires, $group, $userdata)\n {\n $this->flushPreload($id, $group);\n\n $file = $this->getFilename($id, $group);\n if (!($fh = @fopen($file, 'wb'))) {\n return new Cache_Error(\"Can't access '$file' to store cache data. Check access rights and path.\", __FILE__, __LINE__);\n }\n\n // File locking (exclusive lock)\n if ($this->fileLocking) {\n flock($fh, LOCK_EX);\n }\n // file format:\n // 1st line: expiration date\n // 2nd line: user data\n // 3rd+ lines: cache data\n $expires = $this->getExpiresAbsolute($expires);\n fwrite($fh, $expires . \"\\n\");\n fwrite($fh, $userdata . \"\\n\");\n fwrite($fh, $this->encode($cachedata));\n\n // File unlocking\n if ($this->fileLocking) {\n flock($fh, LOCK_UN);\n }\n fclose($fh);\n\n // I'm not sure if we need this\n\t// i don't think we need this (chregu)\n // touch($file);\n\n return true;\n } // end func save\n\n function remove($id, $group)\n {\n $this->flushPreload($id, $group);\n\n $file = $this->getFilename($id, $group);\n if (PEAR::isError($file)) {\n return $file;\n }\n\n if (file_exists($file)) {\n $ok = unlink($file);\n clearstatcache();\n\n return $ok;\n }\n\n return false;\n } // end func remove\n\n function flush($group)\n {\n $this->flushPreload();\n $dir = ($group) ? $this->cache_dir . $group . '/' : $this->cache_dir;\n\n $num_removed = $this->deleteDir($dir);\n unset($this->group_dirs[$group]);\n clearstatcache();\n\n return $num_removed;\n } // end func flush\n\n function idExists($id, $group)\n {\n return file_exists($this->getFilename($id, $group));\n } // end func idExists\n\n /**\n * Deletes all expired files.\n *\n * Garbage collection for files is a rather \"expensive\", \"long time\"\n * operation. All files in the cache directory have to be examined which\n * means that they must be opened for reading, the expiration date has to be\n * read from them and if neccessary they have to be unlinked (removed).\n * If you have a user comment for a good default gc probability please add it to\n * to the inline docs.\n *\n * @param integer Maximum lifetime in seconds of an no longer used/touched entry\n * @throws Cache_Error\n */\n function garbageCollection($maxlifetime)\n {\n $this->flushPreload();\n clearstatcache();\n\n $ok = $this->doGarbageCollection($maxlifetime, $this->cache_dir);\n\n // check the space used by the cache entries \n if ($this->total_size > $this->highwater) {\n \n krsort($this->entries);\n reset($this->entries);\n \n while ($this->total_size > $this->lowwater && list($lastmod, $entry) = each($this->entries)) {\n if (@unlink($entry['file'])) {\n $this->total_size -= $entry['size'];\n } else {\n new CacheError(\"Can't delete {$entry['file']}. Check the permissions.\");\n }\n }\n \n }\n \n $this->entries = array();\n $this->total_size = 0;\n \n return $ok;\n } // end func garbageCollection\n \n /**\n * Does the recursive gc procedure, protected.\n *\n * @param integer Maximum lifetime in seconds of an no longer used/touched entry\n * @param string directory to examine - don't sets this parameter, it's used for a\n * recursive function call!\n * @throws Cache_Error\n */\n function doGarbageCollection($maxlifetime, $dir)\n {\n if (!is_writable($dir) || !is_readable($dir) || !($dh = opendir($dir))) {\n return new Cache_Error(\"Can't remove directory '$dir'. Check permissions and path.\", __FILE__, __LINE__);\n }\n\n while ($file = readdir($dh)) {\n if ('.' == $file || '..' == $file)\n continue;\n\n $file = $dir . $file;\n if (is_dir($file)) {\n $this->doGarbageCollection($maxlifetime,$file . '/');\n continue;\n }\n\n // skip trouble makers but inform the user\n if (!($fh = @fopen($file, 'rb'))) {\n new Cache_Error(\"Can't access cache file '$file', skipping it. Check permissions and path.\", __FILE__, __LINE__);\n continue;\n }\n\n $expire = fgets($fh, 11);\n fclose($fh);\n $lastused = filemtime($file);\n \n $this->entries[$lastused] = array('file' => $file, 'size' => filesize($file));\n $this->total_size += filesize($file);\n \n // remove if expired\n if (( ($expire && $expire <= time()) || ($lastused <= (time() - $maxlifetime)) ) && !unlink($file)) {\n new Cache_Error(\"Can't unlink cache file '$file', skipping. Check permissions and path.\", __FILE__, __LINE__);\n }\n }\n\n closedir($dh);\n\n // flush the disk state cache\n clearstatcache();\n\n } // end func doGarbageCollection\n\n /**\n * Returns the filename for the specified id.\n *\n * @param string dataset ID\n * @param string cache group\n * @return string full filename with the path\n * @access public\n */\n function getFilename($id, $group)\n {\n if (isset($this->group_dirs[$group])) {\n return $this->group_dirs[$group] . $this->filename_prefix . $id;\n }\n\n $dir = $this->cache_dir . $group . '/';\n if (is_writeable($this->cache_dir)) {\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n clearstatcache();\n }\n } else {\n return new Cache_Error(\"Can't make directory '$dir'. Check permissions and path.\", __FILE__, __LINE__);\n }\n $this->group_dirs[$group] = $dir;\n\n return $dir . $this->filename_prefix . $id;\n } // end func getFilename\n\n /**\n * Deletes a directory and all files in it.\n *\n * @param string directory\n * @return integer number of removed files\n * @throws Cache_Error\n */\n function deleteDir($dir)\n {\n if (!is_writable($dir) || !is_readable($dir) || !($dh = opendir($dir))) {\n return new Cache_Error(\"Can't remove directory '$dir'. Check permissions and path.\", __FILE__, __LINE__);\n }\n\n $num_removed = 0;\n\n while (false !== $file = readdir($dh)) {\n if ('.' == $file || '..' == $file)\n continue;\n\n $file = $dir . $file;\n if (is_dir($file)) {\n $file .= '/';\n $num = $this->deleteDir($file . '/');\n if (is_int($num))\n $num_removed += $num;\n } else {\n if (unlink($file))\n $num_removed++;\n }\n }\n // according to php-manual the following is needed for windows installations.\n closedir($dh);\n unset( $dh);\n if ($dir != $this->cache_dir) { //delete the sub-dir entries itself also, but not the cache-dir.\n rmDir($dir);\n $num_removed++;\n }\n\n return $num_removed;\n } // end func deleteDir\n \n}", "protected function __construct() {\n if (!file_exists(self::getCachePath())) {\n mkdir(self::getCachePath(), 0777, true);\n }\n }", "function elgg_get_filepath_cache() {\n\tglobal $CONFIG;\n\tstatic $FILE_PATH_CACHE;\n\tif (!$FILE_PATH_CACHE) {\n\t\t$FILE_PATH_CACHE = new ElggFileCache($CONFIG->dataroot);\n\t}\n\n\treturn $FILE_PATH_CACHE;\n}", "public function init() {\n\t\t$this->cacheDir = $this->chatBot->vars[\"cachefolder\"];\n\n\t\t//Making sure that the cache folder exists\n\t\tif (!dir($this->cacheDir)) {\n\t\t\tmkdir($this->cacheDir, 0777);\n\t\t}\n\t}", "private function _getCachePath() {\n return DIR_PUBLIC_CACHE_SEARCHES . $this->_id . '.json';\n }", "protected function getCacheFile(){\n\t\treturn $this->getPath() . $this->getCacheName();\n\t}", "public function getCacheFile()\n\t{\n\t\treturn $this->tempDir . '/' . $this->filename;\n\t}", "public function getCachePath()\r\n\t{\r\n\t\t$path = AD.$this->getConfig()->getChildren(\"cache\")->getString(\"path\");\r\n\t\tif(!is_dir($path))\r\n\t\t{\r\n\t\t\tmkdir($path, 0777, true);\r\n\t\t}\r\n\t\treturn $path;\r\n\t}", "public function cacheSetup()\n\t{\n\t\t// Generate the name\n\t\t$time = $this->modified;\n\t\t$extension = $this->type;\n\t\t$fileName = pathinfo($this->name, PATHINFO_FILENAME) . \".\" . md5($this->name . '.' . $time);\n\t\t$name = $fileName . \".\" . $extension;\n\n\t\t// Generate the cache file path\n\t\t$this->cacheFilePath = realpath(public_path() . '/' . $this->app['assets::config']['cache_path']) . '/' . $name;\n\n\t\t// Generate the cache file URL\n\t\t$this->cacheFileUrl = $this->app['assets::config']['cache_url'] . $name;\n\n\t\treturn $this->cacheFile = $name;\n\t}", "public function setCacheDir(string $path);", "private function getCacheFile() {\n return new File($this->rootPath, self::CACHE_FILE);\n }", "private function _dirCache()\n {\n return $this->_config['dir_cache'] . (!empty($this->_config['store_prefix']) ? $this->_config['store_prefix'] . '/' : '');\n }", "function __construct($cacheDir = self::DEFAULT_CACHE_DIR) {\n\n\t\t/* If an empty string was passed, then set to the default directory */\n\t\tif (empty($cacheDir)) {\n\t\t\t$cacheDir = self::DEFAULT_CACHE_DIR;\n\t\t}\n\n\t\t/* Determine if the cache directory exists */\n\t\tif (!file_exists($cacheDir) || !is_dir($cacheDir)) {\n\t\t\t/* If it doesn't exist, or isn't a directory, create it */\n\t\t\tmkdir($cacheDir, 0740, true);\n\t\t}\n\n\t\t/* Get the full path if a relative path is passed (e.g. \"../cachedir\") */\n\t\t$this->dir = realpath($cacheDir);\n\t\n\t\t$this->keyfilename = $this->dir . DIRECTORY_SEPARATOR . self::KEY_FILENAME;\n\n\t\tif (self::DEBUG) {\n\t\t\techo \"Cache directory: \", $this->dir, \"\\n\";\n\t\t\techo \"Key file: \", $this->keyfilename, \"\\n\";\n\t\t}\n\n\t\tdate_default_timezone_set(\"UTC\");\n\t\t\n\t\t/* If the key file doesn't exist, create it */\n\t\tif (!file_exists($this->keyfilename)) {\n\t\t\t$this->eraseData();\n\t\t\t$this->writeKeyFile();\n\t\t}\n\n\t\t/* Read in the key file */\n\t\t$this->readKeyFile();\n\t}", "public function __construct($file_path = '')\n {\n if (empty($file_path)) {\n $file_path = ROOT . '/private/cache/';\n }\n\n $this->setCacheDir($file_path);\n }", "public function __construct( $directory = 'cache' ) {\n\t\t$this->set_cache_directory( $this->prefix . $directory );\n\t}", "private function cacheFolder(){\n $cachePath = ROOT . \"/\" . $this->_config['cachePath'];\n if (!is_dir( $cachePath )) { // no\n if (!mkdir( $cachePath, 0755, true)) { // so make it\n if (!is_dir( $cachePath )) { // check again to protect against race conditions\n\n // uh-oh, failed to make that directory\n $this->sendErrorImage(\"Failed to create cache directory at: $cachePath\");\n }\n }\n }\n }", "protected function _create_mimic_cache_dir()\n {\n // Get the dir from the source file\n //$mimic_dir = $this->config['cache_dir'] . pathinfo($this->source_file, PATHINFO_DIRNAME);\n $mimic_dir = $this->cache_dir . pathinfo($this->source_file, PATHINFO_DIRNAME);\n\n // Try to create if it does not exist\n if( ! file_exists($mimic_dir))\n {\n try\n {\n mkdir($mimic_dir, 0755, TRUE);\n }\n catch(Exception $e)\n {\n throw new Kohana_Exception($e);\n }\n }\n\n // Set the cache dir, with trailling slash\n $this->cache_dir = $mimic_dir.'/';\n }", "public function configurationCacheFilePath();", "public function getCacheDir(){\r\n return $this->_cache->getDir();\r\n }", "function getCacheDirectory()\n {\n global $serendipity;\n if ($this->cache_dir === null) {\n $this->cache_dir = $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE . '/serendipity_event_avatar';\n }\n return $this->cache_dir;\n }", "function _createCacheDirectory() {\n // Create cache directory if it doesnt exist\n if (!file_exists($this->thumbnail_dir)) {\n @mkdir($this->thumbnail_dir, 0777, true);\n } else {\n // Try to make the directory writable\n @chmod($this->thumbnail_dir, 0777);\n }\n }", "private static function _readCacheFile() {\r\n if (!self::$_hasCacheFile) {\r\n self::_createCacheFile();\r\n }\r\n\r\n $paths = array();\r\n require(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH);\r\n self::$_paths = $paths;\r\n }", "public function getCacheFolder()\n {\n\n return dirname(__FILE__) . '/../../store/cache/';\n }", "function get_cache($key) {\n return $this->get_cache_dir() . $key . '.cache';\n }", "public static function getCacheDir()\n {\n return self::getRoot() . DIRECTORY_SEPARATOR . 'cache';\n }", "protected function getCacheDirectory()\n {\n return $this->cache_dir;\n }", "protected function getCacheDirectory()\n {\n return $this->cache_dir;\n }", "public function getCacheDirectory() {\n\t\treturn $this->cacheDirectory;\n\t}", "protected\n function setCachePath()\n {\n $cachePath = public_path() . config('album.paths.cache');\n\n if (!file_exists($cachePath)) mkdir($cachePath, 0777, true);\n\n return $cachePath;\n }", "protected function get_cache_dir()\n\t{\n\t\treturn $this->cache_dir ?: $this->phpbb_root_path . 'cache/' . $this->get_environment() . '/';\n\t}", "protected function initializeFs()\n {\n return CacheFs::initialize();\n }", "function set_cache_folder($folder) {\n $this->_cache_folder = $folder; \n }", "public function __construct()\n {\n parent::__construct();\n\n /** @var FileCache $oFileCache */\n $oFileCache = Factory::service('FileCache');\n $this->cacheDir = $oFileCache->getDir();\n }", "public function storeCache() {\n\t\tif ($this->cacheFilePath) {\n\t\t\tfile_put_contents($this->cacheFilePath, serialize($this->classFileIndex));\n\t\t}\n\t}", "public function cacheFolder() {\n\t\t$full_path = trim(str_replace(MODX_BASE_PATH, '', trim($this->config['cacheFolder'])), DIRECTORY_SEPARATOR);\n\n\t\tif (!file_exists(MODX_BASE_PATH . $full_path)) {\n\t\t\t$tmp = explode(DIRECTORY_SEPARATOR, $full_path);\n\t\t\t$path = MODX_BASE_PATH;\n\t\t\tforeach ($tmp as $v) {\n\t\t\t\tif (!empty($v)) {\n\t\t\t\t\t$path .= $v . DIRECTORY_SEPARATOR;\n\t\t\t\t\tif (!file_exists($path)) {\n\t\t\t\t\t\tmkdir($path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (substr($full_path, -1) !== DIRECTORY_SEPARATOR) {\n\t\t\t$full_path .= DIRECTORY_SEPARATOR;\n\t\t}\n\n\t\t// Could not create cache directory\n\t\tif (!file_exists(MODX_BASE_PATH . $full_path)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the latest cache files\n\t\t$this->config['cacheFolder'] = $cacheFolder = MODX_BASE_PATH . $full_path;\n\t\t$regexp = '('.$this->config['jsFilename'].'|'.$this->config['cssFilename'].')';\n\t\t$regexp .= '_(\\d{10})';\n\t\t$regexp .= '('.$this->config['jsExt'].'|'.$this->config['cssExt'].')';\n\n\t\t$files = scandir($cacheFolder);\n\t\tforeach ($files as $file) {\n\t\t\tif ($file == '.' || $file == '..') {continue;}\n\n\t\t\tif (preg_match(\"/^$regexp$/iu\", $file, $matches)) {\n\t\t\t\tif ($matches[3] == $this->config['jsExt']) {\n\t\t\t\t\t$this->current['js'][] = array(\n\t\t\t\t\t\t'file' => $matches[0],\n\t\t\t\t\t\t'time' => filemtime($cacheFolder . $file),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->current['css'][] = array(\n\t\t\t\t\t\t'file' => $matches[0],\n\t\t\t\t\t\t'time' => filemtime($cacheFolder . $file),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public static function getCache() {}", "private static function prep() {\n\t\tif (!isset(F3::$global['CACHE'])) {\n\t\t\t// Extensions usable as cache back-ends\n\t\t\t$_exts=array_intersect(\n\t\t\t\texplode('|','apc|xcache'),get_loaded_extensions()\n\t\t\t);\n\t\t\tforeach (array_keys($_exts,'') as $_null)\n\t\t\t\tunset($_exts[$_null]);\n\t\t\t$_exts=array_merge($_exts,array());\n\t\t\tF3::$global['CACHE']=$_exts[0]?:\n\t\t\t\t('folder='.F3::$global['BASE'].'cache/');\n\t\t}\n\t\tif (preg_match(\n\t\t\t'/^(?:(folder)\\=(.+\\/)|(apc)|(memcache)=(.+))|(xcache)/i',\n\t\t\tF3::$global['CACHE'],$_match)) {\n\t\t\tif ($_match[1]) {\n\t\t\t\tif (!file_exists($_match[2])) {\n\t\t\t\t\tif (!is_writable(dirname($_match[2])) &&\n\t\t\t\t\t\tfunction_exists('posix_getpwuid')) {\n\t\t\t\t\t\t\t$_uid=posix_getpwuid(posix_geteuid());\n\t\t\t\t\t\t\tF3::$global['CONTEXT']=array(\n\t\t\t\t\t\t\t\t$_uid['name'],realpath(dirname($_match[2]))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\ttrigger_error(F3::TEXT_Write);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Create the framework's cache folder\n\t\t\t\t\tmkdir($_match[2],0755);\n\t\t\t\t}\n\t\t\t\t// File system\n\t\t\t\tself::$l1cache=array('type'=>'folder','id'=>$_match[2]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_ext=strtolower($_match[3]?:($_match[4]?:$_match[6]));\n\t\t\t\tif (!extension_loaded($_ext)) {\n\t\t\t\t\tF3::$global['CONTEXT']=$_ext;\n\t\t\t\t\ttrigger_error(F3::TEXT_PHPExt);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ($_match[4]) {\n\t\t\t\t\t// Open persistent MemCache connection(s)\n\t\t\t\t\t// Multiple servers separated by semi-colon\n\t\t\t\t\t$_pool=explode(';',$_match[5]);\n\t\t\t\t\t$_mcache=NULL;\n\t\t\t\t\tforeach ($_pool as $_server) {\n\t\t\t\t\t\t// Hostname:port\n\t\t\t\t\t\tlist($_host,$_port)=explode(':',$_server);\n\t\t\t\t\t\tif (is_null($_port))\n\t\t\t\t\t\t\t// Use default port\n\t\t\t\t\t\t\t$_port=11211;\n\t\t\t\t\t\t// Connect to each server\n\t\t\t\t\t\tif (is_null($_mcache))\n\t\t\t\t\t\t\t$_mcache=memcache_pconnect($_host,$_port);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmemcache_add_server($_mcache,$_host,$_port);\n\t\t\t\t\t}\n\t\t\t\t\t// MemCache\n\t\t\t\t\tself::$l1cache=array('type'=>$_ext,'id'=>$_mcache);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t// APC and XCache\n\t\t\t\t\tself::$l1cache=array('type'=>$_ext);\n\t\t\t}\n\t\t\tself::$l1cache['current']=FALSE;\n\t\t\treturn TRUE;\n\t\t}\n\t\t// Unknown back-end\n\t\ttrigger_error(self::TEXT_Backend);\n\t\treturn FALSE;\n\t}", "protected static function createBaseTcaCacheFile() {}", "function get_cache_dir() {\n $cacheDir = 'pug_cache/';\n if (array_key_exists('cacheDir', $this->options)) {\n $cacheDir = $this->options['cacheDir'];\n }\n return $cacheDir;\n }", "function cachefile($url = false) {\n\t\tif(!$url) {\n\t\t\t$url = uniqid();\n\t\t}\n\t\t\n\t\t$request_hash = sha1($url);\n\t\t\n\t\t$tmp_path = sys_get_temp_dir();\n\t\t\n\t\t$cache_name = 'wmjapi-' . $this->token_hash . '-' \n\t\t\t. sha1($url) . '.json';\n\t\t\n\t\tif(substr($tmp_path, -1) !== '/') {\n\t\t\t$tmp_path = $tmp_path . '/';\n\t\t}\n\t\t\n\t\t$cache_file = $tmp_path . $cache_name;\n\t\t\n\t\treturn $cache_file;\n\t}", "public function get_files_directory() {\n return '../data/files/' . hash_secure($this->name);\n }", "private function setCache()\n\t{\n\t\t$this->_cache = new Cache('./', array('prefix' => 'pageReader'));\n\t}", "public function getCacheDirectory() {\n \n return $this->cacheDirectory;\n \n }", "public function set_cache_dir( $dir )\r\n {\r\n $$this->cachedir = $dir;\r\n }", "protected function getCacheDirectory()\n {\n return $this->cacheDirectory;\n }", "public function __construct(Filesystem $files, $cachePath)\n {\n }", "function getFile() {\n return IMMOTOOL_BASE_PATH . 'cache/order.' . $this->getName();\n }", "private function getFileCache()\n {\n $shopIdCalculatorMock = $this->getMock(ShopIdCalculator::class, array('getShopId'), array(), '', false);\n $shopIdCalculatorMock->method('getShopId')->willReturn(1);\n\n return oxNew(SubShopSpecificFileCache::class, $shopIdCalculatorMock);\n }", "function __construct($file_path, $template_file) {\r\n $this->cachefile = './app/_cache/'.$this->base64_url($file_path);\r\n # collect an md5 of all files\r\n $this->hash = $this->create_hash();\r\n # determine our file type so we know how (and if) to comment \r\n $this->filetype = $this->set_filetype($template_file);\r\n $this->comment_tags = $this->set_comment_tags();\r\n }", "public function getCacheDir()\n {\n return $this->cacheDir;\n }", "public function getCacheDir()\n {\n return $this->cacheDir;\n }", "public function getCacheDir()\n {\n return $this->cacheDir;\n }", "public function getCacheDir()\n {\n return $this->cacheDir;\n }", "private function __construct()\n {\n \t$this->storage_dir = $_SERVER[\"DOCUMENT_ROOT\"] . '/storage';\n }", "function __construct(string $dossier_cache = 'default', $sous_dossier = 'default') // Possibilité de catégoriser les pages ...\n {\n $this->dossier_cache = get_dossier_data('cache', 'cache') . \"$dossier_cache/\";\n if (! file_exists($this->dossier_cache)) {\n @mkdir($this->dossier_cache);\n }\n $this->microtime_1 = $this->dossier_cache . 'microtime';\n $this->sous_dossier = $sous_dossier;\n // Deuxième niveau de cache\n $this->dossier_cache .= $sous_dossier . '/';\n if (! file_exists($this->dossier_cache)) {\n @mkdir($this->dossier_cache);\n }\n $this->microtime_2 = $this->dossier_cache . 'microtime';\n }", "protected function setCachePath(): void\n {\n $filename = basename($this->pathFile);\n\n $this->pathCache = $this->cacheDir.'/'.$filename;\n }", "public function getCacheDir()\n {\n return __DIR__ . '/../var/cache/' . $this->getEnvironment();\n }", "function getCacheFilename() {\n\t\treturn 'cache/fc-categories.php';\n\t}", "function begin_cache($file) {\r\n clearstatcache();\r\n $cachename = \"cache_\" . basename($file) . \".html\";\r\n $spit = '/';\r\n if (strpos($file, '/') == false)\r\n $spit = '\\\\';\r\n $cachename_all = dirname($file) . $spit . $cachename;\r\n if (file_exists($cachename_all)) {\r\n // redirection policy\r\n redirection($cachename);\r\n }\r\n ob_start();\r\n}", "public function getCachePath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_CACHE);\r\n\t}", "public function __construct()\n {\n $this->init_config();//init cache config set the driver and path/key;\n if($this->driver==\"redis\") {\n $this->redis = new \\Redis();\n $this->redis->connect(\"127.0.0.1\", 6379);\n }\n if($this->driver==\"file\"){\n $this->file=new file();\n $this->path=dirname(dirname(dirname(__FILE__))).\"/$this->path/\";//set file store path\n }\n }", "protected function getObjectsDirectory()\n {\n return $this->cacheDirectory . self::DIR_OBJECTS . \"/\";\n }", "public function getCacheDir()\n {\n return __DIR__.'/../var/cache/'.$this->getEnvironment();\n }", "public function getCache()\r\n {\r\n if ($this->exists('cache')) {\r\n return ROOT . $this->get('cache');\r\n }\r\n else\r\n return ROOT . '/cache';\r\n }", "private static function create_cache_dir() {\n if ( ! is_writable(self::$_cache_dir)) {\n if ( ! file_exists(self::$_cache_dir)) {\n if ( ! @mkdir(self::$_cache_dir, 0755, TRUE))\n throw new Exception('failed to create cache directory: '\n . self::$_cache_dir);\n } else \n throw new Exception(self::$_cache_dir . ' is not writable');\n }\n }", "function __construct(\\qio\\Directory\\Cache $cache) {\n $this->cache = $cache;\n }", "protected function _getCacheDir()\n\t{\n\t\treturn $this->_cacheDir;\n\t}", "public function files() {\n if(isset($this->cache['files'])) return $this->cache['files'];\n return $this->cache['files'] = new Files($this);\n }", "function _prepare_cache_path($cur_cache_name = \"\") { \n\t\t// Get name of the cache file\n\t\tif (empty($cur_cache_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Memcached code\n\t\tif ($this->USE_MEMCACHED) {\n\t\t\treturn $cur_cache_name;\n\t\t}\n\t\t// Base cache dir\n\t\t$cache_dir = $this->CACHE_DIR;\n\t\t// Create subdir (a/b/c)\n\t\t$cache_sub_dir = $cur_cache_name[0].\"/\".$cur_cache_name[1].\"/\".$cur_cache_name[2].\"/\";\n\t\t$cache_dir .= $cache_sub_dir;\n\t\t_mkdir_m($cache_dir, 0777);\n\t\treturn $cache_dir. $this->_file_prefix. $cur_cache_name. $this->_file_ext;\n\t}", "public function clearCachefiles () {\r\n\t\r\n\t}", "public function getCacheDir()\n {\n return $this->rootDir . '/../cache/'.$this->getEnvironment();\n }", "public static function getCacheFile()\r\n {\r\n return self::$_cacheFile;\r\n }", "protected function prepareCache()\n {\n $oldUmask = umask(0);\n mkdir($this->cacheDirectory, 0777);\n mkdir($this->getObjectsDirectory(), 0777);\n\n $this->cacheInfo = array(\"objects\" => array());\n file_put_contents($this->cacheDirectory . self::CACHE_INFO_FILENAME, json_encode(array(\"cache\" => $this->cacheInfo)));\n @chmod($this->cacheDirectory . self::CACHE_INFO_FILENAME, 0666);\n umask($oldUmask);\n }", "public function getCachePath()\n {\n return $this->getSettingArray()[\"cache_path\"];\n }", "public function getCacheDir()\n {\n $fileSystem = new Filesystem();\n $path = 'var/cache/assets/'.$this->name.'/';\n \n if (!$fileSystem->exists($path)) {\n $fileSystem->mkdir($path);\n }\n \n return $path;\n }", "protected function initCaches() {}", "function cache_path()\n {\n $paths = getPaths();\n\n /**\n * Return false if the cache folder is NOT writable\n */\n if( ! is_writable($paths['cache']) )\n {\n return false;\n }\n\n return $paths['cache'];\n }", "public function getCacheDir()\n {\n return __DIR__ . '/Fixtures/app/cache';\n }", "function cacheFile($dir, $file, $data)\n{\n if (!Config::Caching)\n return;\n\n debug('Cache', \"Saving $file to $dir local storage\");\n\n $path = pathJoin([$dir, $file]);\n file_put_contents($path, $data);\n chmod($path, 0666);\n}", "public function __construct($root, $postfix=\"\", $cacheParams=[]) {\n\t\tparent::__construct($root, $postfix);\n\t\t$this->_fileMode=(isset($cacheParams[\"fileMode\"])) ? $cacheParams[\"fileMode\"] : 0777;\n\t\tif (!is_dir($root))\n\t\t\t\\mkdir($root, $this->_fileMode, true);\n\t}", "protected function createCacheFile()\n {\n $this->createCacheDir();\n\n $cacheFilePath = $this->getCacheFile();\n\n if ( ! file_exists($cacheFilePath)) {\n touch($cacheFilePath);\n }\n }", "public static function save_cache() {\n if (self::$_cache_invalid) {\n if (@file_put_contents(self::$_path_cache_file\n , serialize(self::$_abs_file_paths))) {\n error_log('failed to write absolute file path cache to: ' . self::$_path_cache_file);\n }\n }\n }", "public function __construct($dir, Cache $cache, $ignoreModifications = false)\n {\n $this -> dir = $dir;\n $this -> cache = $cache;\n $this -> ignoreModifications = $ignoreModifications;\n }", "public static function getCacheDir()\n {\n return self::getDir('getCacheHome');\n }", "function &createCache() {}", "private function checkCacheDir(): void\n {\n $this->sCacheDir = empty($this->sCacheDir) ? PH7_PATH_CACHE . static::CACHE_DIR : $this->sCacheDir;\n }", "private function write_cache() {\n if (!file_exists(CACHE_DIR))\n mkdir(CACHE_DIR, 0755, TRUE);\n\n if (is_dir(CACHE_DIR) && is_writable(CACHE_DIR)) {\n if (function_exists(\"sem_get\") && ($mutex = @sem_get(2013, 1, 0644 | IPC_CREAT, 1)) && @sem_acquire($mutex))\n file_put_contents($this->cache_file, $this->html . $this->debug) . sem_release($mutex);\n /**/\n else if (($mutex = @fopen($this->cachefile, \"w\")) && @flock($mutex, LOCK_EX))\n file_put_contents($this->cache_file, $this->html . $this->debug) . flock($mutex, LOCK_UN);\n /**/\n }\n }", "function get_file_path($key)\n\t{\n\t\t$key = md5($key);\n\t\t$file_name = $key.'.cache';\n\t\t$file_path = CACHE_DIR.$file_name;\n\n\t\treturn $file_path;\n\t}", "public function loadCacheFile( $filepath, $classname );", "public function getCache();", "function add_to_cache($className, $path)\n{\n global $cache_map, $cache_file;\n\n if(!empty($className))\n {\n if(!$cache_map)\n $cache_map = array();\n\n $cache_map[$className] = $path;\n\n file_put_contents($cache_file, '<?php ' . \"\\n\" . '$cache_map = ' .\"\\n\" . var_export($cache_map, true) . ';' );\n\n }\n}", "public static function getCacheFilepath() {\n\t\tdie('<br>ERROR: the file /override/classes/controller/FrontController.php <b>must be patched for PageCache</b>.\n\t\t\t<br><br><b>SOLUTION</b>: Comment or delete this line in <b>/override/classes/controller/FrontController.php</b><pre style=\"border:1px solid gray;background-color:#cdcdcd;padding:5px\">$cache_file = PageCache::getCacheFilepath();</pre>\n\t\t\tand replace <pre style=\"border:1px solid gray;background-color:#cdcdcd;padding:5px\">file_put_contents($cache_file, $html);</pre> by <pre style=\"border:1px solid gray;background-color:#cdcdcd;padding:5px\">PageCache::cacheThis($html);</pre>\n\t\t');\n\t}", "public function cache() {\n\t\tif (count($this->args) === 1) {\n\t\t\tif ($this->args[0] === 'webroot') {\n\t\t\t\t$this->args = array('css', 'js');\n\t\t\t} elseif ($this->args[0] === 'app') {\n\t\t\t\t$this->args = array_values($this->caches);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->args as $key => $val) {\n\t\t\tif (array_key_exists($val, $this->caches)) {\n\t\t\t\t$this->args[$key] = $this->caches[$val];\n\t\t\t}\n\t\t}\n\n\t\t$this->out('Deleting cache files:');\n\n\t\tif (empty($this->args)) {\n\t\t\t$this->_empty(CACHE);\n\t\t\t$this->out('Complete cache dir emptied');\n\t\t\treturn;\n\t\t}\n\t\tforeach ($this->args as $arg) {\n\t\t\tif (in_array($arg, array('css', 'js'))) {\n\t\t\t\t$this->{$arg}();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!is_dir(CACHE . $arg)) {\n\t\t\t\t$this->err('No cache dir \\'' . $arg . '\\'');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->_empty(CACHE . $arg);\n\t\t\t$this->out('Cache \\'' . $arg . '\\' deleted');\n\t\t}\n\n\t\tif (empty($this->args)) {\n\t\t\t$this->engines();\n\t\t}\n\t}", "public function setCacheDir($file_path)\n {\n if (\\substr($file_path, -1, 1) != '/') {\n $file_path .= '/';\n }\n\n $this->file_path = $file_path;\n }", "public function cachePath($name)\n\t\t\t{\n\t\t\t global $CFG;\n\t\t\t $cacheFolder = $CFG['site']['project_path'].$CFG['feature']['data_cache']['folder'];\n\t\t\t if(!$cacheFolder) $cacheFolder = trim($_SERVER['DOCUMENT_ROOT'],'/').'/cache/';\n\t\t\t return $cacheFolder . md5(strtolower(trim($name))) . '.cache';\n\t\t \t}", "public function getCacheDirectoryPath()\n {\n return $this->cacheDirectoryPath;\n }" ]
[ "0.7788206", "0.7619012", "0.7429395", "0.7242724", "0.7208065", "0.71026933", "0.7092043", "0.70384395", "0.7028229", "0.70098674", "0.694938", "0.6919277", "0.69001794", "0.6896177", "0.68958527", "0.6852048", "0.68491834", "0.6840578", "0.68060863", "0.67836326", "0.6746824", "0.67392516", "0.67289585", "0.6722883", "0.67201567", "0.67178637", "0.666532", "0.6630178", "0.6622592", "0.6614836", "0.6549912", "0.6549912", "0.65372103", "0.65332204", "0.6484887", "0.64822114", "0.64670056", "0.6464707", "0.6457067", "0.6456491", "0.6455133", "0.6441673", "0.64230645", "0.63987154", "0.6391242", "0.6390434", "0.6379748", "0.6372684", "0.6371433", "0.63698775", "0.6366601", "0.6366153", "0.6364477", "0.6360012", "0.63585013", "0.63585013", "0.63585013", "0.63585013", "0.6358096", "0.63416165", "0.6338218", "0.6335415", "0.6326045", "0.63079816", "0.6291831", "0.62700516", "0.6267474", "0.6261199", "0.6260923", "0.62597567", "0.62560135", "0.62536573", "0.62483335", "0.62476176", "0.6246097", "0.6241374", "0.6239308", "0.6220369", "0.619646", "0.6196232", "0.6184502", "0.6183664", "0.61830676", "0.6170846", "0.6164057", "0.61622036", "0.61597526", "0.615893", "0.61565447", "0.6150076", "0.61492634", "0.6148885", "0.61425316", "0.6138177", "0.6136957", "0.6135645", "0.61348844", "0.61346203", "0.6130517", "0.6114077", "0.61140627" ]
0.0
-1
Constructor of the class Model Add models that are defined in $config['model']. Set $this>_db to nex PDO instance. Call child::initilize()
public function __construct($param = null) { global $config; // add 'id' $this->addModels(array('id' => null)); // add from $config $this->addModels($config['model']); // open PDO try { $this->_db = new PDO( $config['pdo']['dsn'], $config['pdo']['username'], $config['pdo']['password'], array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES latin1' )); $this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); $this->_db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ); } catch (\PDOException $e) { trigger_error("Cannot connect to database"); } // call initialize() if exists if ($param === null) { call_user_func(array($this, 'initialize')); } else { call_user_func(array($this, 'initialize'), $param); } // if }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\n \n global $db;\n\n //assign PDO object to make available for all model classes\n $this->db = $db;\n }", "public function __construct()\n\t{\n\t\tif (!$this->model_name)\n\t\t{\n\t\t\t$this->model_name = str_replace('Model_', '', get_class($this));\n\t\t}\n\t\t$this->model_name = strtolower($this->model_name);\n\t\t\n\t\t$this->_initialize_db();\n\t}", "function __construct()\n\t\t{\n\t\t\t// Call the Model constructor\n\t\t\tparent::__construct();\n\t\t $this->load->database();\t\n\t\t}", "function __construct()\n {\n $this->openDatabaseConnection();\n $this->loadModel();\n }", "public function __construct() {\n//to make connection db \n//when you make object from class baseModel Or any child(extends) Class\n\n parent::__construct();\n $this->connecToDB();\n }", "public function initialize()\n {\n parent::initialize();\n\n // Create config strings\n $this->config = [\n 'models' => [\n 'Files' => __d('elabs', 'File'),\n 'Notes' => __d('elabs', 'Note'),\n 'Posts' => __d('elabs', 'Article'),\n 'Projects' => __d('elabs', 'Project'),\n 'Albums' => __d('elabs', 'Album'),\n ]\n ];\n\n // Load models\n foreach (array_keys($this->config['models']) as $model) {\n $this->$model = TableRegistry::get($model);\n }\n }", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "public function __construct() {\n $this->openConnection();\n $this->model();\n }", "function __construct()\n {\n // 呼叫模型(Model)的建構函數\n parent::__construct();\n \n }", "public function init()\n {\n\t\t$this->user_model = new Application_Model_Users;\n\t\t$this->request_model = new Application_Model_Requests;\n\t\t$this->material_model = new Application_Model_Materials;\n\t\t$this->course_model = new Application_Model_Courses;\n\t\t$this->comment_model = new Application_Model_Comments;\n\t\t$this->category_model = new Application_Model_Categories;\n \t$this->assoc_rules_model = new Application_Model_Assocrules;\n }", "public function __construct()\n {\n\n $this->loginModel = new LoginModel();\n $this->pinjamModel = new PinjamModel();\n $this->db = db_connect();\n\n // $this->kategoriModel = new KategoriModel();\n }", "public function __construct()\n {\n $this->model = new BaseModel;\n }", "function __construct(){\n\t\tparent::__construct();\n\t\t\t$this->set_model();\n\t}", "function __construct() {\r\n parent::Model();\r\n }", "function __construct(){\r\n\t\t$this->database = new Model;\r\n\t}", "public function model() {\n require_once \"../app/models/model.php\";\n $this->model = new Model($this->db);\n }", "function __construct()\r\n {\r\n parent::Model();\r\n }", "public function __construct() {\n parent::__construct();\n $this->load->database();\n $this->load->model(\"base_model\");\n }", "public function __construct()\n\t{\n\t\t$this->config = Config::getInstance();\n\t\tself::setupDb();\n\t}", "function __construct()\n {\n // Call the Model constructor\n parent::Model();\n $this->load->database('default'); \n }", "function __construct()\n {\n // Call the Model constructor\n parent::Model();\n $this->load->database('default'); \n }", "function __construct()\n {\n // Call the Model constructor\n parent::Model();\n $this->load->database('default'); \n }", "public function __construct(){\n parent::__construct();\n //load database libray manually\n $this->load->database();\n //load Model\n $this->load->model('Pessoa_model');\n }", "function\t__construct()\t{\n\t\t\t\t/* contrutor da classe pai */\n\t\t\t\tparent::__construct();\n\t\t\t\t/* abaixo deverão ser carregados helpers, libraries e models utilizados\n\t\t\t\t\t por este model */\n\t\t}", "function __construct()\n {\n parent::Model();\n }", "public function __construct()\n {\n\n $this->SubCategory = new SubCategoriesModel;\n $this->Functions = new ModelFunctions();\n }", "function init()\n {\n /**\n * The database table to store the model.\n * The table name will be prefixed with the prefix define\n * in the global configuration.\n */\n $this->_a['table'] = 'todo_lists';\n \n /**\n * The definition of the model.\n * Each key of the associative array\n * corresponds to a \"column\" and the definition of the column is\n * given in the corresponding array.\n */\n $this->_a['cols'] = array(\n // It is mandatory to have an \"id\" column.\n 'id' => array(\n 'type' => 'Pluf_DB_Field_Sequence',\n // It is automatically added.\n 'blank' => true\n ),\n 'name' => array(\n 'type' => 'Pluf_DB_Field_Varchar',\n 'blank' => false,\n 'size' => 100,\n // The verbose name is all lower case\n 'verbose' => 'name'\n )\n );\n /**\n * You can define the indexes.\n * Indexes are you to sort and find elements. Here we define\n * an index on the completed column to easily select the list\n * of completed or not completed elements.\n */\n $this->_a['idx'] = array();\n $this->_a['views'] = array();\n }", "public function __construct(){\n\t\t//connect to PDO here.\n\t\t$this->db = new \\helpers\\database();\n\n\t}", "function __construct() {\n parent::__construct();\n \n //INIT CONSTANTS\n $this->CONT_ROOT=$this->LIB_CONT_ROOT.'paper/';\n //load all models for this controller\n $this->load->model(array());\n //load all models for this controller\n $models = array();\n //load all models in above array\n foreach($models as $mdl=>$tbl){\n $this->load->model('common_m',$mdl);\n $this->$mdl->init(array('table'=>$tbl));\n }\n \n }", "public function __construct()\n\t{\n\t\t$this->modelProducts = new ProductsModel();\n\t\t/* ********** fin initialisation Model ********** */\n\t}", "public function __construct() {\n parent::__construct();\n\n $this->load->database(); //pegandose a la base\n $this->load->model('Anecdota_model'); //cargando el modelo Plan Semanal\n $this->load->model('User_model'); //cargando el modelo User\n }", "public function __construct()\n {\n parent::__construct();\n //自动加载相对应的数据模型\n if ($this->auto_load_model) {\n $model_name = $this->model_name ? $this->model_name . '_model' : $this->router->fetch_class() . '_model';\n $this->load->model($model_name, 'model');\n }\n $this->_set_user();\n $this->_check_resource();\n }", "function __construct(){\n\t\t\t$this->model = new model(); //variabel model merupakan objek baru yang dibuat dari class model\n\t\t\t$this->model->table=\"tb_dosen\";\n\t\t}", "public function __construct () {\n $this->model = 'App\\\\' . $this->model;\n $this->model = new $this->model();\n\n // Get the column listing for a given table\n $this->table_columns = Schema::getColumnListing( $this->table );\n }", "public function __construct() {\n\t\t// Initialize some variables\n\t\tif($this->table===false) {\n\t\t\t// Confguration\n\t\t\t$this->table = $this->make_plural(strtolower(get_class($this)));\n\t\t}\n\n\t\t// Database connection\n\t\t$conf = Conf::$databases[$this->conf];\n\t\tif(isset(Model::$connections[$this->conf])){\n\t\t\t$this->db = Model::$connections[$this->conf];\n\t\t\treturn true;\n\t\t}\n\t\ttry{\n\t\t\t$pdo = new PDO('mysql:host='.$conf['host'].';dbname='.$conf['database'].';', \n\t\t\t\t$conf['login'], \n\t\t\t\t$conf['password'], \n\t\t\t\tarray(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')\n\t\t\t);\n\t\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);\n\n\t\t\tModel::$connections[$this->conf] = $pdo;\n\t\t\t$this->db = $pdo;\n\t\t}catch(PDOException $e){\n\t\t\tif(Conf::$debug>=1) {\n\t\t\t\tdie($e->getMessage());\n\t\t\t}else {\n\t\t\t\tdie('Can not connect to the database');\t\n\t\t\t}\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model('Main_model');\n $this->load->database();\n }", "public function __construct()\n {\n // All of my models are like this\n parent::__construct(get_class($this));\n // Calling methods to get the relevant data\n $this->generateNewsData();\n $this->generateAnalyticsData();\n $this->generatePostsData();\n }", "public function __construct()\r\n\t{\r\n\tparent::__construct();\r\n\t\r\n\t//load database libray manually\r\n\t$this->load->database();\r\n\t\r\n\t//load Model\r\n\t$this->load->model('Hello_Model');\r\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->load->model('Model');\n\t}", "public function __construct(){\n\t\t$mysql = MySQL::getInstance(array('localhost', 'root', '', 'amdb'));\n\t\t$this->bewertungsmodel = new Model($mysql, 'bewertung');\n\t\t$this->videomodel = new Model($mysql, 'lied');\n\t}", "public function __construct()\n {\n parent::Model();\n\n }", "public function __construct()\n {\n parent::__construct();\n\n //load database libray manually\n $this->load->database();\n\n //load Model\n $this->load->model('Senddata_model');\n }", "public function __construct()\n {\n $this->ModelUser = new LoginRegisterModel();\n $this->modelCategorie = new CategoriesModel();\n\t\t/* ********** fin initialisation Model ********** */\n }", "public function __construct(){\n\t\t$this->db = new \\Model\\dal();\n\t}", "function __construct() {\n // Call the Model constructor \n parent::__construct();\n }", "public function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->load->database();\n \t}", "public function __construct() {\n // Call the Model constructor\n parent::__construct();\n }", "public static function init() {\n\t\tcore::loadClass(\"database\");\n\n\t\t/* Child tables */\n\t\tcore::loadClass(\"doorkey_model\");\n\t\tcore::loadClass(\"key_history_model\");\n\t}", "public function __construct()\n {\n $this->imageModel = new ImageModel();\n $this->userModel = new User();\n $this->psychologySupervisorModel = new PsychologySupervisor();\n $this->registerSupervisionModel = new RegisterSupervision();\n $this->updateSupervisionModel = new UpdateSupervisionModel();\n }", "function __construc()\r\n\t{\r\n\t\tparent::Model();\r\n\t}", "public function __construct () {\n\t\tparent::__construct ();\n\t\t\n\t\tif ($this->models)\n\t\tforeach ($this->models as $model) {\n\t\t\tunset ($this->models[$model]);\n\t\t\t$this->models[$model] = $this->session->getModel ($model,$this);\n\t\t\t$this->$model = $this->models[$model];\n\t\t}\n\t}", "private function __construct() {\n $connections = array(\n array(\n \"language\"=>\"de\",\n \"host\"=>\"\",\n \"db\"=>\"\",\n \"username\"=>\"\",\n \"password\"=>\"\"\n ),\n array(\n \"language\"=>\"en\",\n \"host\"=>\"\",\n \"db\"=>\"\",\n \"username\"=>\"\",\n \"password\"=>\"\"\n )\n );\n // Define Default Connection\n ORM::configure('mysql:host='.$connections[0][\"host\"].';dbname='.$connections[0][\"db\"]);\n ORM::configure('username', $connections[0][\"username\"]);\n ORM::configure('password', $connections[0][\"password\"]);\n ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));\n\n // Define Connections for Languages\n foreach($connections as $connection) {\n ORM::configure('mysql:host='.$connection[\"host\"].';dbname='.$connection[\"db\"], null, $connection[\"language\"]);\n ORM::configure('username', $connection[\"username\"], $connection[\"language\"]);\n ORM::configure('password', $connection[\"password\"], $connection[\"language\"]);\n ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), $connection[\"language\"]);\n }\n }", "protected function initialize(){\r\n //需要调用`Model`的`initialize`方法\r\n parent::initialize();\r\n \r\n $param_db_id = Request::instance()->param('db_id');\r\n if(!empty($param_db_id)){\r\n \t//前端api传值获取db_id\r\n \tself::$db_id = $param_db_id;\r\n }else{\r\n \t//后台根据登录信息获取db_id\r\n \tself::$db_id = cmf_get_current_db_id();\r\n }\r\n //根据数据库id连接数据库\r\n\t if(self::$db_id == 1){\r\n\t \t$this->connection = 'db_config1';\r\n\t }elseif(self::$db_id == 2){\r\n\t \t$this->connection = 'db_config2';\r\n\t }\r\n }", "public function __construct($config) {\n $this->tableName = $config['table'];\n\n // Connect to the DB\n parent::__construct($config);\n }", "public function __construct() {\n parent::__construct();\n \n $this->load->database(); //pegandose a la base\n $this->load->model('PlanSemanal_model'); //cargando el modelo Plan Semanal\n $this->load->model('User_model'); //cargando el modelo User\n \n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "function __construct()\n {\n // Call the Model constructor\n parent::__construct();\n }", "public function __construct()\n {\n parent::__construct();\n $this->db = \\App::getInstance()->getDatabase();\n }", "function __construct() {\n\t\tparent::__construct();\n\t\t$this->load->database();\n }", "public function __construct()\n {\n $this->table = 'tag';\n\t\t$this->model = $db = DB::table($this->table);\n }", "public function __construct(){\n $this->db = new Base;\n }", "function __construct() {\n\t\tparent::__construct();\n\t\t$this->load->database();\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model('User_model'); //load database model.\n $this->load->model('Form_data_model'); //load database model.\n }", "public function __construct()\n {\n parent::__construct();\n $this->path = __DIR__.'/../';\n\n $this->Model = '';\n $this->model = '';\n $this->Models = '';\n $this->models = '';\n\n $this->schema = '';\n $this->field_names = '';\n $this->table_header = '';\n $this->table_data = '';\n $this->details = '';\n $this->seeder_data = '';\n }", "public function __construct()\n {\n parent::__construct();\n $this->app->loadClass('date');\n $this->loadModel('task');\n $this->loadModel('order', 'crm');\n $this->loadModel('customer');\n }", "public function __construct() {\n\t\t\n\t\tparent::__construct();\n\n\t\t$this->load->database();\n\t}", "public function __construct() {\n $this->porcentajesCursoModel = $this->model('PorcentajesCursoModel');\n $this->tipoModuloModel = $this->model('TipoModuloModel');\n $this->cursoModel = $this->model('CursoModel');\n }", "public function __construct() {\n\n\t\tparent::__construct();\n\n\t\t$this->load->database();\n\n\t}", "public function __construct()\n {\n parent::__construct();\n\t\t$this->load->database();\n\t\t\n }", "public function __construct(){\n $this->__updatecache = array();\n $this->__conn = mysql_connect(DB_HOST.\":\".DB_PORT,DB_USER,DB_PSWD);\n $this->__table = strtolower(get_called_class());\t//assumes the table name same as the model name\n if(!($this->__conn)){\n $this->modelError(\"Error in connecting..\");\n }\n $this->__db_flag = mysql_select_db(DB_NAME,$this->__conn);\n if(!($this->__db_flag)){\n $this->modelError(\"Error on selecting db..\");\n }\n }", "public function __construct(){\n require_once 'EntidadBase.php'; // Incluye el archivo EntidadBase\n require_once 'BaseModel.php'; // Incluye el archivo BaseModel\n foreach(glob('Model/*.php') as $file){ // Recorre todos los archivos de la carpeta Model con la extensión PHP.\n require_once($file); // Incluye el archivo\n }\n }", "public function __construct(){\n parent::__construct();\n $this->load->model(\"Cl_model\");\n $this->load->model(\"Statement_model\");\n\n\n\n }", "public function __construct()\n {\n $this -> database = new DbConfig();\n $this -> pdo = $this -> database->dbConnect();\n\n }", "function __construct()\n {\n parent::__construct();\n $this->load->database();\n $this->load_model('book', $this->auth);\n $this->load_model('user', $this->auth);\n $this->load_model('participant', $this->auth);\n $this->load_model('question', $this->auth);\n }", "public function __construct() {\n\t\t//load database in autoload libraries \n\t\tparent::__construct(); \n\t\t$this->load->model('SetUpModel'); \n\t\t$this->load->helper('url');\n\t}", "public function __construct()\n {\n parent::__construct();\n\n\t\t$this->load->model(\"options_model\");\n\t\t$this->load->model(\"selections_model\");\n\t\t$this->load->model(\"info_model\");\n\t\t$this->load->model(\"dealer_model\");\n\t\t$this->load->library(\"encrypt\");\n\t\t$this->load->model(\"promocode_model\");\n\t}", "private function initActiveRecord() {\n \n require_once (Quantum::QUANTUM_ROOT.'system/lib/activerecord/ActiveRecord.php');\n \n ActiveRecord\\Config::initialize(function($cfg)\n {\n $cfg->set_model_directory(Quantum::QUANTUM_ROOT.'system/models');\n $cfg->set_connections(array('development' => 'mysql://'.Quantum::DATABASE_USER.':'.Quantum::DATABASE_PASS.'@'.Quantum::DATABASE_HOST.'/'.Quantum::DATABASE_NAME.''));\n });\n \n \n }", "function __construct()\n {\n parent::__construct();\n\t\t\n\t\t$this->load->database();\n }", "function __construct() {\n parent::__construct();\n $this->load->database();\n }", "public function __construct()\n\t\t{\n\t\t\t// $this->_database_connection = 'special_connection';\n\n\t\t\t// you can disable the use of timestamps. This way, MY_Model won't try to set a created_at and updated_at value on create methods. Also, if you pass it an array as calue, it tells MY_Model, that the first element is a created_at field type, the second element is a updated_at field type (and the third element is a deleted_at field type if $this->soft_deletes is set to TRUE)\n\t\t\t$this->timestamps = FALSE;\n\n\t\t\t// you can enable (TRUE) or disable (FALSE) the \"soft delete\" on records. Default is FALSE, which means that when you delete a row, that one is gone forever\n\t $this->soft_deletes = FALSE;\n\n\t // you can set how the model returns you the result: as 'array' or as 'object'. the default value is 'object'\n\t\t\t$this->return_as = 'object' | 'array';\n\n\n\t\t\t// you can set relationships between tables\n\t\t\t// $this->has_one['room_list'] = array('room_list','rl_id','rl_id');\n\t\t\t// $this->has_one['Sched_day'] = array('sched_day','sd_id','sd_id');\n\t\t\t// $this->has_one['subject'] = array('subjects','subj_id','subj_id');\n\n\t\t\n\t\t\t// you can also use caching. If you want to use the set_cache('...') method, but you want to change the way the caching is made you can use the following properties:\n\n\t\t\t$this->cache_driver = 'file';\n\t\t\t//By default, MY_Model uses the files (CodeIgniter's file driver) to cache result. If you want to change the way it stores the cache, you can change the $cache_driver property to whatever CodeIgniter cache driver you want to use.\n\n\t\t\t$this->cache_prefix = 'currv';\n\t\t\t//With $cache_prefix, you can prefix the name of the caches. By default any cache made by MY_Model starts with 'mm' + _ + \"name chosen for cache\"\n\n\t\t\tparent::__construct();\n\t\t}", "public function __construct() {\n //require_once __DIR__ . '/PDO.class.php';\n require_once(dirname(__FILE__).\"/PDO.class.php\");\n $this->db = new Db(CONFIG['db_host'], CONFIG['db_name'], CONFIG['db_user'], CONFIG['db_pass']);\n }", "public function __construct() {\n\t\t$this->db = DB::getInstance();\n\t}", "public function init() {\n $bootstrap = $this->getInvokeArg(\"bootstrap\");\n $this->aConfig = $bootstrap->getOptions();\n $this->view->aConfig = $this->aConfig;\n $this->model= new Model_InfoBusiness();\n $this->modelMapper= new Model_InfoBusinessMapper();\n $this->modelProvince = new Model_MasterProvince();\n $this->modelProvinceMapper = new Model_MasterProvinceMapper();\n $this->modelDistrict = new Model_MasterDistrict();\n $this->modelDistrictMapper = new Model_MasterDistrictMapper();\n $this->modelWard = new Model_MasterWard();\n $this->modelWardMapper = new Model_MasterWardMapper();\n }", "function __construct() {\r\n parent::__construct();\r\n $this->load->library('OracleModel');\r\n $this->DBObject = new OracleModel();\r\n }", "public function initialize()\n {\n parent::initialize();\n $this->loadModel('Projects');\n $this->loadModel('ProjectsInjections');\n $this->loadModel('Colonies');\n }", "public function __construct() {\n // load our model\n $this->userModel = $this->model('User'); // will check models folder for User.php\n }", "public function __construct() {\n\t parent::__construct();\n\t\t\n\t // Set default db\n\t $this->db = $this->load->database('default', true);\t\t\n\t // Set default table\n\t $this->table = $this->db->dbprefix($this->table);\t\t\t\n\t}", "public function __construct() {\n parent::__construct();\n $this->load->model(array('dt_diag_klsf_model','dt_obat_model','dt_pasien_model','dt_pemeriksaan_model','dt_proses_model','dt_thpan_model'));\n }", "public function __construct() {\n\t\t\t$this->modelName = 'concreeeeeete';\n\t\t}", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->database();\n\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model(['m_voting', 'm_master', 'm_prospects', 'm_factors']);\n }", "function __construct() {\n\t\t// debug::disable();\n\t\t// debug::start($logfilepath, \"w\");\n\n\t\t$DB_CONFIG = DB_CONFIG[$GLOBALS['MAINDB']];\n\t\t$DB_CONFIG['param'] = DB_CONFIG_PARAM[$GLOBALS['MAINDBTYPE']];\t\t\n\t\t$this->db = new \\PDO(\n\t\t\t\t\t$DB_CONFIG['DSN'], \n\t\t\t\t\t$DB_CONFIG['user'], \n\t\t\t\t\t$DB_CONFIG['pass'], \n\t\t\t\t\t$DB_CONFIG['param']\n\t\t);\n\n\t\t\n\t}", "public function __construct() {\n parent::__construct();\n $this->load->model(\"modelo_base\");\n \n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->database();\n\t}", "public function __construct($config=null) {\n if($config == 'pdo'){\n //use pdo class to connect and manage the database\n //parent::__construct(mysql:host = localhost;dbname = sswap,root,\"\");\n try {\n @parent :: __construct(DB_TYPE . \":host=\" . HOST_NAME . \";dbname=\" . DB_NAME, DB_USER, DB_PASS);\n } catch (PDOException $error) {\n\n die('Oops we seem to be experiencing some technical difficulties, please forgive us and try again later <br/> '. $error->getMessage() . '<br/>');\n }\n }else if($config == 'orm' ){\n //use orm to connect and manage the database\n R::setup(DB_TYPE . \":host=\" . HOST_NAME . \";dbname=\" . DB_NAME, DB_USER, DB_PASS);\n }\n\n\n }", "function __construct() {\n parent::__construct();\n\t\t// Cargamos la base de datos\n\t\t$this -> load -> database();\n }" ]
[ "0.7768048", "0.7734346", "0.7633476", "0.7535551", "0.74112004", "0.73367083", "0.7333681", "0.73034", "0.72455907", "0.7193576", "0.7163021", "0.7159667", "0.71505153", "0.70998585", "0.70953995", "0.70813733", "0.7072213", "0.7053972", "0.7043342", "0.7020615", "0.70125055", "0.70125055", "0.70125055", "0.7004143", "0.69771713", "0.6970221", "0.69639766", "0.69379884", "0.6935206", "0.6930672", "0.69292206", "0.6927056", "0.692442", "0.6913474", "0.69074523", "0.69034386", "0.6902155", "0.6900443", "0.689371", "0.68868893", "0.68868893", "0.68837553", "0.6883406", "0.6868622", "0.6856713", "0.6852641", "0.6832115", "0.6832027", "0.68259674", "0.68236864", "0.68112737", "0.6808081", "0.68043643", "0.6800726", "0.67944807", "0.6788507", "0.6788497", "0.67836195", "0.67836195", "0.67836195", "0.67836195", "0.6779994", "0.67644835", "0.67641205", "0.67627466", "0.6760883", "0.67463523", "0.67437255", "0.6741813", "0.6740335", "0.6739492", "0.67366165", "0.6735739", "0.67247814", "0.672264", "0.67185813", "0.6714065", "0.67134625", "0.6708709", "0.6705178", "0.670304", "0.6701538", "0.6700777", "0.6700763", "0.6697237", "0.66913307", "0.6688011", "0.6686376", "0.6682585", "0.6682043", "0.6676918", "0.6675212", "0.6673218", "0.6670777", "0.66699094", "0.6664797", "0.6664587", "0.66591096", "0.6654355", "0.66541463" ]
0.6881065
43
function __construct / Table name management set Table name
public function setTable($table) { debugInfo(get_class($this)."->setTable($table)"); $this->_table = $table; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function setTableName();", "protected function setTable()\n {\n $class = explode('\\\\', get_called_class());\n $this->table = lcfirst(end($class)).'s';\n }", "private function setTableName()\n {\n // Get table name from name of entity if not defined\n if (!$this->tableName) {\n $path = explode('\\\\', get_class($entity));\n $this->tableName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', array_pop($path))).'s';\n }\n\n // Set table to be used\n $this->adapter->setTable($this->tableName);\n }", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(USER_RSS); \n }", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(COMMENT); \n }", "private function setTable()\n {\n if (is_null($this->table)) {\n $this->table = $this->getTableName();\n }\n }", "protected function setTable() : void {\n\t\t$annotation = $this->annotationReader->getClassAnnotation($this->reflectionClass, 'Henri\\Framework\\Annotations\\Annotation\\DB');\n\t\tif ($annotation && isset($annotation->table)) {\n\t\t\t$this->tableName = $annotation->table;\n\t\t\t$this->tableNamePrefixed = $this->database->getPrefix() . $this->tableName;\n\t\t}\n\t}", "function __construct($table_name) {\n\t\t$this->table_name = $table_name;\n\t}", "abstract protected function getTableName();", "abstract protected function getTableName();", "final public function setTableName($name)\n\t\t{\n\t\t\t$this->_tableName = $name;\n\t\t}", "abstract public function getTableName();", "abstract public function getTableName();", "abstract public function getTableName();", "protected function _setupTableName()\n\t{\n\t\t$className = $this->getClassName();\n\t\t$suffix = substr($className, strrpos($className, '_') + 1);\n\t\t$prefix = substr($className, 0, strpos($className, '_'));\n\t\t$this->_name = $this->getFilter()->filter($prefix) . '_' . $this->getFilter()->filter($suffix);\n\t\treturn $this;\n\t}", "public function set_table($table_name = '') {\n $this->table = $table_name;\n }", "public function setTable($tablename){\r\n$this->tablename=$tablename;\r\n}", "private function set_table_name($name) {\n $this->table_name = $name;\n }", "public function getTableName() ;", "public function setTableName($tablename)\n {\n $this->dbTable = $tablename;\n }", "public function getTableName() {}", "public function getTableName() {}", "private function getTableNames()\n {\n $this->tableNames = [\n 'eav_attribute' => $this->resource->getTableName('eav_attribute'),\n 'EnitureModules' => $this->resource->getTableName('EnitureModules'),\n ];\n }", "public function setTable(string $table);", "abstract public static function getTableName();", "abstract public static function getTableName();", "public static function setTable($name = ''){\n\t\tif(! self::$db){\n\t\t\tself::setDbName();\n\t\t}\n\t\tif($name){\n\t\t\treturn self::$collection = self::$db->$name;\n\t\t}else{\n\t\t\treturn self::$collection = self::$db->$table;\n\t\t}\n\t}", "function setTableName($tableName) {\n $this->tableName = $tableName;\n }", "protected function setTablePrefix()\n {\n }", "public function setTableName($tableName){\n $this->tableName = $this->tableName;\n }", "public function setTableName($name) {\n\t\t$this->tableName = (string) $name;\n\t\treturn $this;\n\t}", "public function setTableNames() {\n $caseFormat = $this->settingsAll['Model'][self::$meta_model]['tablecaseformat'];\n $aliasFormat = $this->settingsAll['Model'][self::$meta_model]['tablealiasformat'];\n foreach ($this->settingsAll as $k => $v) {\n # do not process __meta\n if (in_array($k, array(self::$meta))) {\n continue;\n }\n $tableName = $this->getRealTableName($caseFormat, $k);\n # settingsAll.k.this->meta.tablename\n # - genTable responsible for having tableName set\n $custom_set = null;\n if (isset($this->settingsAll[$k][self::$meta]['tablename'])) {\n $custom_set = $this->settingsAll[$k][self::$meta]['tablename'];\n }\n $this->log(\"setTableNames / style: {$caseFormat} / k: {$k} / tableName: {$tableName} / custom-set: \" . $custom_set);\n # set correct tablename as defined in schema, but do not override individual defaults\n if (!isset($this->settingsAll[$k][self::$meta]['tablename'])) {\n $this->settingsAll[$k][self::$meta]['tablename'] = $tableName;\n }\n # ALIAS\n $this->settingsAll[$k][self::$meta]['alias'] = $this->getTableAlias($aliasFormat, $k);\n }\n }", "abstract public function tableName();", "abstract public function tableName();", "public function prepareTableName()\n {\n $this->tableName = $this->getOption('tableName');\n\n if (empty($this->tableName)) {\n $this->tableName = $this->modelNames['snake_plural'];\n }\n }", "public function __construct($table_name = null)\r\n\t{\r\n\t\tif ($table_name != null) {\r\n\t\t\t$this->table_name = $table_name;\r\n\t\t}\r\n\t\t$this->table_label = $table_name;\r\n\t}", "public function __construct($tblPrefix = \"\");", "function __construct()\n {\n if (empty($this->table)) {\n $this->table = get_called_class();\n }\n }", "public function getTableName();", "public function getTableName();", "abstract function tableName();", "function table($table)\n {\n $table = preg_replace('/\\s+/', ' ', trim($table));\n $arr = explode(' ', $table);\n $this->table_name = $arr[0];\n $this->table_alias = isset($arr[1]) ? $arr[1] : $this->table_alias;\n unset($arr);\n return $this;\n }", "private function _set_table()\n\t{\n\t\t$dossier = $this->config->item('dossier');\n\t\tif($dossier === false)\n\t\t{\n\t\t\tlog_message('info', '\"Dossier\" params is not set');\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_dossier = $dossier;\n\t\t\t$this->_table = $this->_dossier . '.' . $this->_table;\n\t\t}\n\t}", "function __construct()\n {\n parent::__construct();\n $this->_tablename = $this->db->dbprefix('dealer');\n }", "private function _fetch_table()\n {\n if ($this->table_name == null) {\n $this->table_name = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this)));\n }\n }", "private function _fetch_table()\n {\n if ($this->table_name == null) {\n $this->table_name = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this)));\n }\n }", "function set_table(){\n $this->table = 'network_posts';\n }", "public function setTable($table);", "public static function getTableName(){\n\t\treturn self::$table_name;\n\t}", "function setTable($table) {\r\r\n\t\t$this->table = $table;\r\r\n\t}", "static function set_table_prefix($tp) {\n\t\tself::$table_prefix = $tp;\n\t}", "protected static function init()\n\t{\n\t\tif( static::$table === null )\n\t\t{\n\t\t\t// set the table name by Model name\n\t\t\t// Ex: UserModel -> users\n\t\t\tstatic::$table = strtolower( preg_replace('/Model$/', '', get_called_class()) ) . \"s\";\n\t\t}\n\t}", "function table ( $name ) {\n $this->table = $name;\n $this->alias = $name;\n return $this;\n }", "public static function table($table)\n {\n }", "public function table_name($name=NULL){\n $table_name = $this->config->item('db_table_prefix').$this->table_name;\n if(NULL!=$name){\n $table_name = $this->config->item('db_table_prefix').$name;\n }\n return $table_name;\n }", "public function __construct( $tableName ) {\n\t\t$this->tableName = $tableName;\n\t}", "public function get_table_name(){\n return $this->table_name();\n }", "public function __construct()\n {\n //parent::__construct();\n //$this->table_name = $this->TABLE;\n }", "function init(){\n\t\t/*\n\t\t * Redefine this object, call parent then use addField to specify which fields\n\t\t * you are going to use\n\t\t */\n\t\tparent::init();\n\t\t$this->table_name = get_class($this);\n\t}", "public function setTableName($table)\n {\n // 1. 尝试解析为 [数据库名.表名]\n if(strpos($table, '.') !== false) {\n list($database, $table) = explode('.', $table);\n if ($database) {\n $this->options['database'] = $database;\n $this->options['real_table_name'] = $table;\n }\n }\n // 2. 尝试分离出命名空间和表名\n else {\n $table = StringHelper::toClassLastName($table, 'model');\n }\n \n $table = StringHelper::toUnderscoreVariable($table);\n if (substr($table, 0, 1) === '#') {\n $this->options['real_table_name'] = $this->options['table_name'] = str_replace('#', '', $table);\n } else {\n $this->options['table_name'] = preg_replace('/^' . static::getTablePrefix() . '/i', '', $table);\n }\n \n return $this;\n }", "public function setTableName( string $table_name )\n {\n $this->table_name = $table_name;\n }", "function __construct()\r\n {\r\n $this->tablename = 'msm_table';\r\n }", "public function __construct($tableName='table',$nickName='') {\r\n $a = explode('--', preg_replace('/\\s+/', '--', trim($tableName)));\r\n $this->name = $tableName;\r\n $this->tableName = $a[0];\r\n if(count($a)>1){\r\n $this->nickName = $a[count($a)-1];\r\n }\r\n if(preg_match('/^[A-z]{1}[A-z0-9_]+$/',$nickName)){\r\n $this->nickName = $nickName;\r\n }\r\n $p = db::getPrefix();\r\n $fields = array();\r\n $types = array();\r\n $stmt = db::query(\"DESCRIBE {$p}{$a[0]}\");\r\n if($tableFields = $stmt->fetchAll(PDO::FETCH_ASSOC)){\r\n foreach($tableFields as $column){\r\n $f = $column['Field'];\r\n if($column['Key']=='PRI'){\r\n $this->idField = $f;\r\n }\r\n $fields[] = $f;\r\n $b = explode('(', $column['Type']);\r\n $types[$f] = $b[0];\r\n }\r\n }\r\n $this->fields = $fields;\r\n $this->fieldTypes = $types;\r\n }", "function __construct()\n {\n parent::__construct();\n $this->table = 'ms_pengguna';\n }", "protected function getTableName(): string {\n return self::TABLE_NAME;\n }", "public function __construct($table) {\n if(strcmp($table, \"user\") == 0){\n $this->_dbTable = new Application_Model_DbTable_User();\n }\n else{\n $this->_dbTable = new Application_Model_DbTable_Organization();\n }\n \n }", "function get_table_name()\n {\n global $table_prefix;\n global $wpdb;\n $prefix = $table_prefix;\n if ($wpdb != null && $wpdb->prefix != null) {\n $prefix = $wpdb->prefix;\n }\n return apply_filters('ngg_datamapper_table_name', $prefix . $this->_object_name, $this->_object_name);\n }", "function getTableName(): string;", "public function setUserTableName($tableName) {\n $tableName = preg_replace(\"/[^A-Za-z0-9]/\", '', $tableName);\n $this->_dbTable=$tableName;\n }", "public function setTableName($tableName){\n // do nothing!\n }", "public function __construct(string $table)\n {\n $this->table = $table;\n }", "public function get_table_name()\n {\n return $this->prefix . $this->table;\n }", "public function setTableName($tableName)\n {\n $this->tableName = $tableName;\n }", "public static function tablename() {\n return self::TABLE;\n }", "public function table_name()\n\t{\n\t\treturn $this->table_name;\n\t}", "public function __construct($table)\n {\n $this->table=$table;\n }", "public function getTableName():string;", "abstract public static function tableName() : string;", "public function table($table);", "public function table($table);", "public function getTableName(): string;", "public function getTableName(): string;", "public function uses_table($table_name)\n\t{\n\t\tif (!is_string($table_name))\n\t\t\tprintf(__('Invalid table name to use with this option key (%s)'), $this->option_key);\n\t\t$this->table = $table_name;\n\t}", "function __construct() {\n // Initialize the dbms pointer.\n parent::__construct();\n\n // Initialize table name.\n $this->tableName = \"admin\";\n }", "protected function TableName() {\n\tthrow new exception('2017-01-05 Is this being called?');\n }", "public function __construct($table)\n {\n $this->table = $table;\n }", "public function __construct(){\n $this->table=\"usuarios\";\n parent::__construct($this->table);\n }", "private function getTableName()\n {\n $class = get_class($this);\n\n $mem = new Cache();\n if ($tableName = $mem->get($class . '-table-name')) {\n return $tableName;\n }\n\n $break = explode('\\\\', $class);\n $ObjectName = end($break);\n $className = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $ObjectName));\n $tableName = Inflect::pluralize($className);\n\n $mem->add($class . '-table-name', $tableName, 1440);\n\n return $tableName;\n }", "public function __construct()\n {\n parent::__construct();\n\n if (!$this->table) {\n $this->table = strtolower(str_replace('_model','',get_class($this))); //fungsi untuk menentukan nama tabel berdasarkan nama model\n }\n }", "protected static function get_table_name() {\n return null;\n }", "public function test_the_fm_facade_table_sets_the_table_name()\n {\n $builder = FM::table('pet');\n\n $this->assertEquals('pet', $builder->from);\n }", "function __construct() {\n\t\t\t$this->db_name = DATABASE;\n\t\t\t//$this->table1 = TKR_TBL; \n\t\t\t//$this->table2 = DATA_TBL;\n\t\t\t\n\t\t\t}", "abstract protected function getTable();", "public function getTableName(){\r\n\t\treturn strtolower(get_class($this));\r\n\t}", "public function __construct($table_name = '') {\n $this->table = $table_name;\n $this->connection = new MySQLI(self::DOMAIN, self::USER,\n self::PASSWORD, self::DATABASE);\n }", "public function __construct($tabName) {\n $this->con = mysql_connect(\"localhost\", \"root\", \"\"); // Local\n if (!$this->con) {\n die(\"Couldn't connect to database!!!\");\n }\n // mysql_select_db(\"ezeepixw_beta\", $this->con);// Server\n mysql_select_db(\"ezeepix\", $this->con);// Local\n $this->tableName = $tabName;\n }", "public function setTable( $table ) {\n\t\t$this->_table = $table;\n\t}", "public function __construct($table_name)\r\n {\r\n // Main entries table\r\n parent::__construct($table_name);\r\n \r\n // Align record model name\r\n // Define the record class name, rather for it to when crazy\r\n $this->record_class = $table_name.\"_record\";\r\n \r\n // 1. For benchmark (profiler) to keep track total execute time\r\n // Able to disable through \"application/config/MY_config.php\"\r\n // 2. For Error switching purpose\r\n //$this->CI =& get_instance();\r\n //$this->CI->config->load(\"MY_config\");\r\n $this->config->load(\"MY_config\");\r\n }", "private static function get_table_name() {\n\n $class = get_called_class();\n\n return strtolower($class);\n\n }", "public static function getTable() : string {\n\t\t$namespacedClassParts = explode(\"\\\\\", get_called_class());\n\t\t$table = array_pop($namespacedClassParts);\n\t\t$table = preg_replace(\"/([a-z0-9])([A-Z0-9])/\", '$1_$2', $table);\n\t\t$table = strtolower($table);\n\t\treturn $table;\n\t}", "public static function getTableName()\n {\n return _DB_PREFIX_ . self::$definition['table'];\n }" ]
[ "0.85356915", "0.85183537", "0.8291887", "0.81927794", "0.8141812", "0.79658234", "0.7954695", "0.78453475", "0.77814645", "0.77814645", "0.77223575", "0.7694683", "0.7694683", "0.7694683", "0.76723367", "0.76707065", "0.7626351", "0.7604023", "0.75811476", "0.75577384", "0.75282437", "0.75282437", "0.7521113", "0.75172454", "0.75152755", "0.75152755", "0.74969894", "0.74968326", "0.7483734", "0.747605", "0.746185", "0.74552107", "0.7437797", "0.7437797", "0.7427547", "0.74258596", "0.7409227", "0.7407779", "0.74039763", "0.74039763", "0.7376551", "0.735308", "0.73393947", "0.733507", "0.7335067", "0.7335067", "0.7332605", "0.73238474", "0.7265171", "0.7261709", "0.72604036", "0.7256673", "0.72475123", "0.72428936", "0.72382355", "0.7228308", "0.72099435", "0.72082746", "0.7180908", "0.7180102", "0.7170647", "0.71485746", "0.7144152", "0.7138097", "0.71323454", "0.70987666", "0.7093176", "0.70931005", "0.70880973", "0.70838374", "0.7067367", "0.7066052", "0.7047987", "0.7045538", "0.70361304", "0.7034772", "0.7029244", "0.7023442", "0.70218194", "0.70218194", "0.70194876", "0.70194876", "0.70171267", "0.70161134", "0.7004466", "0.6999991", "0.6992809", "0.6991295", "0.69905907", "0.69812375", "0.6969212", "0.6967476", "0.6958178", "0.6954533", "0.69511783", "0.6946875", "0.6943802", "0.6939699", "0.69297135", "0.6926609", "0.69265115" ]
0.0
-1
function setTable / Models management Add models definition to $this>_models
public function addModels($models) { // add from parameters:$models foreach($models as $key => $value) { $this->_models[$key] = $value; } // foreach }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function tableModel()\n {\n }", "protected function setup_models()\n\t{\n\t}", "protected function setTable()\n {\n $class = explode('\\\\', get_called_class());\n $this->table = lcfirst(end($class)).'s';\n }", "public function setTable($tableName)\n {\n // Set initial configuration for Model\n $Model = new Model();\n $Model = $Model->build($tableName);\n if ($Model) {\n // Set Model\n $this->setModel($Model);\n }\n }", "public function generateModels () {\r\n $modelParam = \\app\\lib\\router::getModel();\r\n $ModelPath = \\app\\lib\\router::getPath();\r\n $ModelName = \"app\\model\\\\\" . end($ModelPath);\r\n $this->model =new $ModelName;\r\n }", "abstract protected function prepareModels();", "protected static function init()\n\t{\n\t\tif( static::$table === null )\n\t\t{\n\t\t\t// set the table name by Model name\n\t\t\t// Ex: UserModel -> users\n\t\t\tstatic::$table = strtolower( preg_replace('/Model$/', '', get_called_class()) ) . \"s\";\n\t\t}\n\t}", "public function __construct () {\n $this->model = 'App\\\\' . $this->model;\n $this->model = new $this->model();\n\n // Get the column listing for a given table\n $this->table_columns = Schema::getColumnListing( $this->table );\n }", "protected function setModel()\n {\n $class = 'Src\\Modules\\\\' . $this->module_name . '\\Models\\\\' . $this->class . 'Model';\n $this->model = new $class;\n $this->model->setModuleName( $this->module_name );\n $this->model->run();\n }", "public function setupModel() {\n\t\tswitch ($this->dbType()) {\n\t\tcase self::DB_TYPE_MYSQL: default:\n\t\t\ttry {\n\t\t\t\t$theSql = $this->getTableDefSql(self::TABLE_Permissions);\n\t\t\t\t$this->execDML($theSql);\n\t\t\t\t$this->debugLog($this->getRes('install/msg_create_table_x_success/'.$this->tnPermissions));\n\t\t\t} catch (PDOException $pdoe){\n\t\t\t\tthrow new DbException($pdoe,$theSql);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "public function model() {\n require_once \"../app/models/model.php\";\n $this->model = new Model($this->db);\n }", "public function setTableNames() {\n $caseFormat = $this->settingsAll['Model'][self::$meta_model]['tablecaseformat'];\n $aliasFormat = $this->settingsAll['Model'][self::$meta_model]['tablealiasformat'];\n foreach ($this->settingsAll as $k => $v) {\n # do not process __meta\n if (in_array($k, array(self::$meta))) {\n continue;\n }\n $tableName = $this->getRealTableName($caseFormat, $k);\n # settingsAll.k.this->meta.tablename\n # - genTable responsible for having tableName set\n $custom_set = null;\n if (isset($this->settingsAll[$k][self::$meta]['tablename'])) {\n $custom_set = $this->settingsAll[$k][self::$meta]['tablename'];\n }\n $this->log(\"setTableNames / style: {$caseFormat} / k: {$k} / tableName: {$tableName} / custom-set: \" . $custom_set);\n # set correct tablename as defined in schema, but do not override individual defaults\n if (!isset($this->settingsAll[$k][self::$meta]['tablename'])) {\n $this->settingsAll[$k][self::$meta]['tablename'] = $tableName;\n }\n # ALIAS\n $this->settingsAll[$k][self::$meta]['alias'] = $this->getTableAlias($aliasFormat, $k);\n }\n }", "abstract public function setTableName();", "function setModels($models) {\n\t\t$_models = array();\n\n\t\t// First clean array of models, applying implicit database ids when required\n\t\tforeach ($models as $model) {\n\t\t\tif (strpos($model, '/') !== false) {\n\t\t\t\tlist($id, $table) = explode('/', $model);\n\t\t\t} else {\n\t\t\t\t$id = urlize($this->_implicit, '_');\n\t\t\t\t$table = $model;\n\t\t\t}\n\n\n\t\t\tif (!ake($id, $_models)) {\n\t\t\t\t$_models[$id] = array();\n\t\t\t}\n\n\t\t\t$_models[$id][] = $table;\n\t\t}\n\n\t\t// Then actually load models\n\t\tforeach ($_models as $database => $models) {\n\t\t\t$tables = array();\n\n\t\t\tforeach ($models as $model) {\n\t\t\t\t$tables[camelize($model, '_')] = $this->_loadModel($database, $model);\n\t\t\t}\n\t\t\t$this->_models[camelize($database, '_')] = new GetableCollection($tables);\n\t\t}\n\n\t\tif (!ake($this->_implicit, $this->_models)) {\n\t\t\t$this->_models[$this->_implicit] = new GetableCollection(array());\n\t\t}\n\t}", "function init()\n {\n foreach ($GLOBALS['_PX_models'] as $model=>$val) {\n if (isset($val['relate_to'])) {\n foreach ($val['relate_to'] as $related) {\n if ($this->_model == $related) {\n // The current model is related to $model\n // through one or more foreign key. We load\n // the $model to check on which fields the\n // foreign keys are set, as it is possible in\n // one model to have several foreign keys to\n // the same other model.\n if ($model != $this->_model) {\n $_m = new $model();\n $_fkeys = $_m->getForeignKeysToModel($this->_model);\n } else {\n $_fkeys = $this->getForeignKeysToModel($this->_model);\n }\n foreach ($_fkeys as $_fkey=>$_fkeyval) {\n //For each foreign key, we add the\n //get_xx_list method that can have a\n //custom name through the relate_name\n //value.\n if (isset($_fkeyval['relate_name'])) {\n $mname = $_fkeyval['relate_name'];\n } else {\n $mname = strtolower($model);\n }\n $this->_methods_list['get_'.$mname.'_list'] = array($model, $_fkey);\n }\n break;\n }\n }\n }\n if (isset($val['relate_to_many']) && \n in_array($this->_model, $val['relate_to_many'])) {\n $this->_methods_list['get_'.strtolower($model).'_list'] = $model;\n $this->_manytomany[$model] = 'manytomany';\n }\n }\n foreach ($this->_cols as $col=>$val) {\n $field = new $val['type']($col);\n if ($field->type == 'foreignkey') {\n $this->_methods_get['get_'.strtolower($col)] = array($val['model'], $col);\n $this->_fk[$col] = 'foreignkey';\n }\n if ($field->type == 'manytomany') {\n $this->_methods_list['get_'.strtolower($col).'_list'] = $val['model'];\n $this->_manytomany[$val['model']] = 'manytomany';\n }\n foreach ($field->add_methods as $method) {\n $this->_methods_extra[$method[0]] = array(strtolower($col), $method[1]);\n }\n }\n }", "public function setTableDefinition()\n {\n $name = $this->_options['table']->getComponentName();\n\n // Building columns\n $columns = $this->_options['table']->getColumns();\n\n // remove all sequence, autoincrement and unique constraint definitions and add to the behavior model\n foreach ($columns as $column => $definition) {\n if (in_array($column, $this->_options['excludeFields'])) {\n continue;\n }\n unset($definition['autoincrement']);\n unset($definition['sequence']);\n unset($definition['unique']);\n\n $fieldName = $this->_options['table']->getFieldName($column);\n if ($fieldName != $column) {\n $name = $column . ' as ' . $fieldName;\n } else {\n $name = $fieldName;\n }\n\n $this->hasColumn($name, $definition['type'], $definition['length'], $definition);\n }\n\n // the version column should be part of the primary key definition\n $this->hasColumn(\n\t $this->_options['version']['name'],\n $this->_options['version']['type'],\n $this->_options['version']['length'],\n $this->_options['version']['options']);\n }", "public function set_table_vars() {\n\t\tglobal $wpdb;\n\n\t\t$this->table = $wpdb->prefix . self::TABLE_NAME;\n\t\t$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;\n\n\t\t/* Register the snippet table names with WordPress */\n\t\t$wpdb->snippets = $this->table;\n\t\t$wpdb->ms_snippets = $this->ms_table;\n\n\t\t$wpdb->tables[] = self::TABLE_NAME;\n\t\t$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;\n\t}", "protected function setModel(): void\n {\n $this->model = SchedulerCellLock::class;\n }", "public function populateModels()\n {\n }", "public function setModels($models)\n {\n $this->_models = $models;\n }", "public function setModels($models)\n {\n $this->_models = $models;\n }", "public function initTables(): void\n {\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.Surveys');\n $this->Surveys = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyResults');\n $this->SurveyResults = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyEntries');\n $this->SurveyEntries = $table;\n\n $table = TableRegistry::getTableLocator()->get('Qobo/Survey.SurveyEntryQuestions');\n $this->SurveyEntryQuestions = $table;\n }", "protected function setModel(): void\n {\n $this->model = PurchaseOrder::class;\n }", "private function getTables() {\n\t\t$this->_vm_product = $this->getTable('vm_product');\n\t}", "public function setModel(Model $model){\n\n $this->model = $model;\n $this->from = $model->getTable();\n \n }", "private function setTable()\n {\n if (is_null($this->table)) {\n $this->table = $this->getTableName();\n }\n }", "public function models();", "protected function setTable() : void {\n\t\t$annotation = $this->annotationReader->getClassAnnotation($this->reflectionClass, 'Henri\\Framework\\Annotations\\Annotation\\DB');\n\t\tif ($annotation && isset($annotation->table)) {\n\t\t\t$this->tableName = $annotation->table;\n\t\t\t$this->tableNamePrefixed = $this->database->getPrefix() . $this->tableName;\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n\n if (!$this->table) {\n $this->table = strtolower(str_replace('_model','',get_class($this))); //fungsi untuk menentukan nama tabel berdasarkan nama model\n }\n }", "function setup(&$model) {\r\n\t\tif (!array_key_exists($model->name, $this->models)) {\r\n\t\t\t$this->models[$model->name] =& $model;\r\n\t\t}\r\n\t}", "private function setTableName()\n {\n // Get table name from name of entity if not defined\n if (!$this->tableName) {\n $path = explode('\\\\', get_class($entity));\n $this->tableName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', array_pop($path))).'s';\n }\n\n // Set table to be used\n $this->adapter->setTable($this->tableName);\n }", "function createTableModel()\r\n {\r\n?>\r\n // table model\r\n var <?php echo $this->Name; ?>_tableModel = new qx.ui.table.SimpleTableModel();\r\n <?php\r\n if ($this->owner!=null)\r\n {\r\n ?>\r\n <?php echo $this->owner->Name.\".\".$this->Name; ?>_tableModel=<?php echo $this->Name; ?>_tableModel;\r\n <?php\r\n }\r\n ?>\r\n<?php\r\n }", "private function shareModelTableToView(): void\n {\n /** @var \\Illuminate\\Database\\Eloquent\\Model $model */\n $model = static::${'modelClass'};\n\n View::share('modelTable', (new $model())->getTable());\n }", "private function _fetch_table()\n {\n if ($this->table_name == null) {\n $this->table_name = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this)));\n }\n }", "private function _fetch_table()\n {\n if ($this->table_name == null) {\n $this->table_name = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this)));\n }\n }", "private static function _loadModels(){\n if (self::$_models == null){\n $sql = 'SELECT id, uuid, name, description, version_id, created FROM v_model WHERE 1';\n $models = Mysql::query($sql);\n if ($models){\n $_models = array();\n foreach($models as $model){\n $sql = \"SELECT id, model_id, uuid, name, description, type, list, instance_model_id, version_id, created FROM v_property WHERE model_id = '{$model->id}'\";\n $properties = Mysql::query($sql);\n if ($properties){\n $model->properties = $properties;\n $_models[] = $model;\n }\n }\n self::$_models = $_models;\n }\n }\n }", "public function setModel(Model $model);", "public function set_model(){\t\t\t\t\t\t//set model name as model\n\t\t\t$this->load->model('Messagemodel','model');\n\t}", "public function createModels() {\n // On itère sur notre tableau de K,V\n // Où la K = nom de la marque\n // Où la V = tableau de K,V entre nom du modèle et de la catégorie\n foreach ($this->getModels() as $brandName=> $arrayInfosModels) {\n // On itère sur notre tableau de K,V\n // Où la K = nom du modèle\n // Où la V = nom de la catégorie\n foreach ($arrayInfosModels as $modelName => $categoryName) {\n // On peut donc récupérer en BDD nos catégories et nos marques respestives en fonction\n // des données de notre tableau\n $category = $this->categRepository->findOneBy(['name' => $categoryName]);\n $brand = $this->brandRepository->findOneBy(['name' => $brandName]);\n // Afin de pouvoir créer nos Model\n $model = (new Model())\n ->setName($modelName)\n ->setBrand($brand)\n ->setCategory($category)\n ;\n $this->em->persist($model);\n }\n }\n $this->em->flush();\n }", "public function setTableDefinition() {\n\t\tparent::setTableDefinition();\n\t\t\n\t\t// set the table\n\t\t$this->setTableName('company');\n\t\t$this->hasColumn('type', 'integer', null, array('notblank' => true, 'default' => '1')); // 1 Partner, 2 to be continue\n\t\t$this->hasColumn('name', 'string', 255, array('notblank' => true));\n\t\t$this->hasColumn('description', 'string', 500);\n\t\t$this->hasColumn('contactperson', 'string', 255);\n\t\t$this->hasColumn('phone', 'string', 15);\n\t\t$this->hasColumn('email', 'string', 255);\n\t\t$this->hasColumn('country', 'string', 2, array('default' => 'UG'));\n\t\t$this->hasColumn('locationid', 'integer', null);\n\t\t$this->hasColumn('status', 'integer', null, array('default' => '1'));\n\t\t$this->hasColumn('farmistype', 'integer', null, array('default' => '1'));\n\t\t// 0=>'None', 1=>'All Farmers', 2=>'One Region', 3=>'Multiple Regions', 4=>'One District', 5=>'Multiple Districts', 6=>'One DNA', 7=>'Multiple DNAs'\n\t\t$this->hasColumn('regionid', 'integer', null);\n\t\t$this->hasColumn('regionids', 'string', 50);\n\t\t$this->hasColumn('districtid', 'integer', null);\n\t\t$this->hasColumn('districtids', 'string', 50);\n\t\t$this->hasColumn('dnaid', 'integer', null);\n\t\t$this->hasColumn('dnaids', 'string', 50);\n\t\t$this->hasColumn('showind', 'integer', null, array('default' => '1')); // 1=Enabled, 0=Disabled\n\t}", "public function initTable(){\n\t\t\t\n\t\t}", "private function loadModels()\n {\n $this->use = ( ! isset($this->use)) ? [$this->class] : $this->use;\n\n if ($this->use) {\n foreach ($this->use as $model) {\n self::load('model', $model);\n }\n }\n }", "function setup(&$Model, $settings) {\n\t\t$this->__initSettings($Model, $settings);\n\t\t$this->__initTransSchema();\n\t\t$this->__createBoostTable();\n\t\t$this->__initObjects();\n\t}", "private static function model()\n {\n $files = ['ORM_', 'CRUD', 'ORM', 'Collection', 'ModelArray'];\n $folder = static::$root.'MVC/Model'.'/';\n\n self::call($files, $folder);\n\n $files = ['ForeingKeyMethodException', 'ColumnNotEmptyException', 'ManyPrimaryKeysException', 'TableNotFoundException', 'ModelNotFoundException', 'PrimaryKeyNotFoundException'];\n $folder = static::$root.'MVC/Model/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function setTable($tablename){\r\n$this->tablename=$tablename;\r\n}", "private function _load_models()\r\n {\r\n foreach ($this->models as $model)\r\n {\r\n $this->load->model($this->_model_name($model), $model);\r\n }\r\n }", "public function setTableDefinition() {\n\t\t$this -> hasColumn('Transaction_Type', 'varchar', 10);\n\t\t$this -> hasColumn('User', 'varchar', 10);\n\t\t$this -> hasColumn('Timestamp', 'varchar', 32);\n\t\t$this -> hasColumn('Status', 'varchar', 5);\n\t\t$this -> hasColumn('Validated_By', 'varchar', 10);\n\t}", "public function setTableDefinition()\n {\n $this->setTableName('textosLayout');\n $this->hasColumn('id', 'integer', 4, array(\n 'type' => 'integer',\n 'length' => 4,\n 'fixed' => false,\n 'unsigned' => false,\n 'primary' => true,\n 'autoincrement' => true,\n ));\n $this->hasColumn('id_texto', 'integer', 4, array(\n 'type' => 'integer',\n 'length' => 4,\n 'fixed' => false,\n 'unsigned' => false,\n 'primary' => false,\n 'notnull' => true,\n 'autoincrement' => false,\n ));\n $this->hasColumn('id_idioma', 'integer', 4, array(\n 'type' => 'integer',\n 'length' => 4,\n 'fixed' => false,\n 'unsigned' => false,\n 'primary' => false,\n 'notnull' => true,\n 'autoincrement' => false,\n ));\n $this->hasColumn('texto', 'string', 255, array(\n 'type' => 'string',\n 'length' => 255,\n 'fixed' => false,\n 'unsigned' => false,\n 'primary' => false,\n 'notnull' => true,\n 'autoincrement' => false,\n ));\n }", "function __construct(){\n\t\t\t$this->model = new model(); //variabel model merupakan objek baru yang dibuat dari class model\n\t\t\t$this->model->table=\"tb_dosen\";\n\t\t}", "public function init()\n {\n $this->_helper->db->setDefaultModelName('BatchUpload_MappingSet');\n }", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(USER_RSS); \n }", "public function init()\n {\n\t\t$this->user_model = new Application_Model_Users;\n\t\t$this->request_model = new Application_Model_Requests;\n\t\t$this->material_model = new Application_Model_Materials;\n\t\t$this->course_model = new Application_Model_Courses;\n\t\t$this->comment_model = new Application_Model_Comments;\n\t\t$this->category_model = new Application_Model_Categories;\n \t$this->assoc_rules_model = new Application_Model_Assocrules;\n }", "public function setUpDatabaseTables()\n {\n $table = new DModuleTable();\n $table -> setName(\"currencies\");\n $table -> addBigIncrements( \"id\" , true );\n $table -> addString( \"base\" , true);\n $table -> addLongText( 'rates' , true);\n $table -> addDateTime( 'added' , true );\n $table -> addBoolean( 'status' , true);\n $table -> addString( \"extra\" , false);\n $table -> addString( \"extra2\" , false);\n $this -> addTable( $table );\n }", "public function install() {\r\n\tforeach ($this->getModel() AS $model) {\r\n\t $this->getEntity($model->getName())->createTable();\r\n\t}\r\n }", "private function _load_models()\n {\n foreach ($this->models as $model)\n {\n $this->load->model($this->_model_name($model), $model);\n }\n }", "protected function saveModelForTable()\n {\n $table = $this;\n $dates = [];\n $fields = $table->getFields();\n // TODO Work with the namespace again. The FQN does not work since switching to the generator.s\n $modelContent = (new ModelContent($table->getModelName()))->setTable($table->getName());\n\n if (array_key_exists($field = 'deleted_at', $fields)) {\n unset($fields[$field]);\n\n $dates[] = $field;\n $modelContent->setTraits(['\\Illuminate\\Database\\Eloquent\\SoftDeletes']);\n } // if\n\n if (array_key_exists($field = 'created_at', $fields)) {\n unset($fields[$field]);\n\n $dates[] = $field;\n } // if\n\n if (array_key_exists($field = 'updated_at', $fields)) {\n unset($fields[$field]);\n\n $dates[] = $field;\n } // if\n\n if ($dates) {\n $modelContent->setDates($dates);\n } // if\n\n unset($fields['id']);\n $modelContent->setFillable(array_diff(array_keys($fields), $table->getBlacklist()));\n $modelContent->setCasts($table->getCastedFields());\n\n if ($genericCalls = $table->getGenericCalls()) {\n foreach ($genericCalls as $call) {\n if ($call instanceof ForeignKey) {\n $modelContent->addForeignKey($call);\n } // if\n } // foreach\n } // if\n\n if ($sources = $table->getRelationSources()) {\n foreach ($sources as $call) {\n if ($call instanceof ForeignKey) {\n $modelContent->addForeignKey($call);\n } // if\n } // foreach\n } // if\n\n $modelContent->save();\n\n return $this;\n }", "protected function migrateTable()\n {\n DB::schema()->create('models', function ($table) {\n $table->id();\n $table->string('default');\n $table->text('input');\n });\n\n Model::create(['default' => 'model', 'input' => ['en' => 'translation', 'nl' => 'vertaling']]);\n }", "public function setModel(Model $model)\n\t{\n\t\t$this->model = $model;\n\n\t\t$this->from($model->getTable());\n\t}", "public function initialize()\n {\n parent::initialize();\n\n // Create config strings\n $this->config = [\n 'models' => [\n 'Files' => __d('elabs', 'File'),\n 'Notes' => __d('elabs', 'Note'),\n 'Posts' => __d('elabs', 'Article'),\n 'Projects' => __d('elabs', 'Project'),\n 'Albums' => __d('elabs', 'Album'),\n ]\n ];\n\n // Load models\n foreach (array_keys($this->config['models']) as $model) {\n $this->$model = TableRegistry::get($model);\n }\n }", "private function _fetch_table()\n {\n if ($this->_table == NULL)\n {\n $this->_table = plural(preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))));\n }\n }", "protected function setReturnModels($models){\r\n array_push($this->models,$models);\r\n }", "public function setModel(Model $model) : void\n {\n $this->model = $model;\n\n $this->fm = FunctionMap::loadFunctionMap();\n }", "private function getTableNames()\n {\n $this->tableNames = [\n 'eav_attribute' => $this->resource->getTableName('eav_attribute'),\n 'EnitureModules' => $this->resource->getTableName('EnitureModules'),\n ];\n }", "protected function _setupTableName()\n {\n parent::_setupTableName();\t\t\n\t\t $this->_name = $this->getTableName(COMMENT); \n }", "public function setModel($Model)\n {\n // Set Model\n $this->Model = clone $Model;\n // Set table\n $this->table = $this->Model->getTable();\n // Set default columns\n $this->setDefaultColumns();\n }", "protected function init()\n {\n if (!isset($this['fields'])) {\n $model = $base = [];\n if (isset($this->options['base_model']) && $this->options['base_model']) {\n $base = static::getTableInfo($this->options['base_model']) ? : [];\n }\n if (isset($this->options['table_name']) && (!$base || $this->options['table_name'] != $base['table_name'])) {\n $model = $this->getTableInfo($this->options['table_name']) ? : [];\n }\n \n if ($model && $base) {\n $model['ext_table'] = $model['table_name'];\n $model['ext_fields'] = isset($model['master_fields']) ? $model['master_fields'] : array_keys($model['fields']);\n \n $model['master_table'] = $base['table_name'];\n $model['master_fields'] = isset($base['master_fields']) ? $base['master_fields'] : array_keys($base['fields']);\n }\n \n // merge\n $model = ArrayHelper::merge($base, $model);\n $this->setOption($model);\n }\n }", "function init(){\n\t\t/*\n\t\t * Redefine this object, call parent then use addField to specify which fields\n\t\t * you are going to use\n\t\t */\n\t\tparent::init();\n\t\t$this->table_name = get_class($this);\n\t}", "public function init()\n {\n $this->yatimsModel = new Admin_Model_DbTable_GestYatims();\n $this->dateImpl = new Default_Model_DateImpl();\n }", "private function _generateModel($table)\n {\n $this->_getLogger()->debug(\n 'Generating model class for table \"' . $table . '\"'\n );\n \t\n if (!isset($this->_schema[$table])) {\n throw new ZendExt_Exception(\n 'The table doesn\\'t exist'\n );\n }\n\n $this->_modelName = $this->_getPascalCase($table);\n\n $className = $this->_getClassName(\n $this->_opts->namespace,\n $this->_modelName\n );\n\n $class = new Zend_CodeGenerator_Php_Class(\n array(\n 'name' => $className\n )\n );\n\n foreach ($this->_schema[$table] as $k => $column) {\n $varName = $this->_getCamelCased(\n $this->_removeColumnPrefix($k, $this->_opts->prefix)\n );\n $class->setProperty(\n array(\n 'name' \t\t => '_' . $varName,\n 'visibility' => 'protected'\n )\n );\n }\n\n $class->setDocblock(\n $this->_generateClassDocblock(\n $this->_modelName . ' model.',\n $className,\n true\n )\n );\n $methods = array();\n $methods[] = $this->_generateConstruct($table, $className);\n\n foreach ($this->_schema[$table] as $k => $column) {\n $paramName = $this->_getCamelCased(\n $this->_removeColumnPrefix($k, $this->_opts->prefix)\n );\n\n $getMethod = $this->_generateGetter($paramName, $column);\n\n $setMethod = null;\n\n if ($this->_opts->setters) {\n $setMethod = $this->_generateSetter($paramName, $column);\n }\n\n $methods[] = $getMethod;\n\n if (null !== $setMethod) {\n $methods[] = $setMethod;\n }\n }\n\n $class->setMethods($methods);\n\n $file = new Zend_CodeGenerator_Php_File();\n\n $file->setDocblock(\n $this->_generateFileDocblock(\n $this->_modelName . ' model.',\n $className\n )\n );\n\n $file->setClass($class);\n $this->_saveFile($file->generate(), $className);\n }", "public function __construct($model_name = null, $table_name = null)\n {\n if ($model_name) {\n $this->model_name = $model_name;\n $this->from($table_name);\n }\n }", "private function _set_table()\n\t{\n\t\t$dossier = $this->config->item('dossier');\n\t\tif($dossier === false)\n\t\t{\n\t\t\tlog_message('info', '\"Dossier\" params is not set');\n\t\t\treturn;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_dossier = $dossier;\n\t\t\t$this->_table = $this->_dossier . '.' . $this->_table;\n\t\t}\n\t}", "function _ci_assign_to_models()\n {\n if (count($this->_ci_models) == 0)\n {\n return;\n }\n\n $CI =& get_instance();\n foreach ($this->_ci_models as $model)\n {\n $CI->$model->_assign_libraries();\n }\n }", "function addModel(){\n\t\n\t}", "function set_table(){\n $this->table = 'network_posts';\n }", "private function createModel($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . '.php';\n \n // Prepare the Class scheme inside the model\n $contents = '<?php echo \"Hello World\"; ?>';\n\n // Return a boolean to process completed\n return Storage::disk('models')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function setTablesEditArray() {\r\n if(!isset($this->extendedTables)) {\r\n $this->extendedTables = ['mc_cartpay','mc_cartpay_buyer', 'mc_catalog_product', 'mc_catalog_product_content'];\r\n $this->loadModules();\r\n if(!empty($this->mods)) {\r\n foreach ($this->mods as $mod){\r\n if(method_exists($mod,'extendTablesEditArray')) {\r\n $this->extendedTables = array_merge($this->extendedTables,$mod->extendTablesEditArray());\r\n }\r\n }\r\n }\r\n }\r\n }", "public function setTable($table);", "public function setTableDefinition()\n {\n foreach ($this->_columns as $column) {\n $this->hasColumn($column['name'], $column['type'], $column['length'], $column['options']);\n }\n }", "private function myTables(){\n }", "protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }", "public function initModel(Application $app)\n {\n $this->vetementModel = new VetementModel($app);\n $this->typeModel = new TypeModel($app);\n }", "abstract public function model();", "abstract public function model();", "abstract public function model();", "abstract public function model();", "public function getModelsDefinition();", "protected function _initsTable() {}", "public function configureModel()\n {\n /** @var PluginController $controller */\n $controller = $this->getController();\n\n /** @var Table $Users */\n $Users = $controller->loadModel($this->getConfig('userModel'));\n $Users->addBehavior($this->getConfig('behavior.className'), $this->getConfig('behavior.options'));\n }", "public function prepareTableName()\n {\n $this->tableName = $this->getOption('tableName');\n\n if (empty($this->tableName)) {\n $this->tableName = $this->modelNames['snake_plural'];\n }\n }", "public function __construct(){\n \n $this->create_tables();\n \n }", "protected function buildModel()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n $foreigns = $this->module->tables->where('is_foreign', true);\n\n $this->model = [\n 'name' => $this->class,\n '--table' => $this->table,\n '--columns' => $columns,\n '--pk' => $this->primaryKey,\n '--module' => $this->module->id,\n ];\n\n if ($foreigns->count()) {\n $this->model['--relationships'] = $foreigns->transform(function ($foreign) {\n return $foreign->column.':'.$foreign->table_foreign;\n })->implode('|');\n }\n }", "public function initTables()\n {\n return $this->createCompanyConfigTable();\n }", "public static function preModel(){\n\t\t\n\t}", "protected function get_table_classes()\n {\n }", "public function loadModel( $modelName ) {\n\t\t$app = App::getInstance();\n\t\t$this->{$modelName} = $app->getTable( $modelName );\n\t}", "function init()\n {\n /**\n * The database table to store the model.\n * The table name will be prefixed with the prefix define\n * in the global configuration.\n */\n $this->_a['table'] = 'todo_lists';\n \n /**\n * The definition of the model.\n * Each key of the associative array\n * corresponds to a \"column\" and the definition of the column is\n * given in the corresponding array.\n */\n $this->_a['cols'] = array(\n // It is mandatory to have an \"id\" column.\n 'id' => array(\n 'type' => 'Pluf_DB_Field_Sequence',\n // It is automatically added.\n 'blank' => true\n ),\n 'name' => array(\n 'type' => 'Pluf_DB_Field_Varchar',\n 'blank' => false,\n 'size' => 100,\n // The verbose name is all lower case\n 'verbose' => 'name'\n )\n );\n /**\n * You can define the indexes.\n * Indexes are you to sort and find elements. Here we define\n * an index on the completed column to easily select the list\n * of completed or not completed elements.\n */\n $this->_a['idx'] = array();\n $this->_a['views'] = array();\n }", "protected function addModelConfigs()\n {\n // TODO: add model configs\n }", "protected abstract function model();", "public function setModel($model)\r\n {\r\n //Complete this function and assign model to Class Property $model\r\n $this->model = $model;\r\n }", "public function model ($data = array())\n\t{\n\n\t\t$name = $data['model_name'];\n\n\t\tif (is_file(APPPATH.'models/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Model_s_is_existed'), APPPATH.'models/'.$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\tif (isset($data['table_name'])) {\n\n\t\t\t$table = $data['table_name'];\n\n\t\t}\n\t\telse{\n\n\t\t\t$table = null;\n\n\t\t}\n\n\t\tif (isset($data['base_query'])) {\n\n\t\t\t$base_query = true;\n\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t$base_query = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'models');\n\t\t\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], 'MY_Model', 'MY_Model');\n\n\t\t$data .= $this->_crud_methods_model($table, $base_query);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'models/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\tif (is_file(APPPATH.'models/'.\"config_model.ini\")) {\n\n\t\t\t$ini_array = parse_ini_file(APPPATH.'models/'.\"config_model.ini\");\n\n\t\t\tif (count(@$ini_array) > 0) {\n\n\t\t\t\t$ini_array[$name] = $table;\n\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$ini_array = array(\n\n\t\t\t\t\t$name => $table\n\n\t\t\t\t);\n\n\t\t\t}\n\t\t\t\n\t\t\t$this->write_php_ini($ini_array, APPPATH.'models/'.\"config_model.ini\");\n\n\t\t}\n\t\telse {\n\n\t\t\t$data = array(\n\n\t\t\t\t$name => $table\n\n\t\t\t);\n\n\t\t\t$this->write_php_ini($data, APPPATH.'models/'.\"config_model.ini\");\n\n\t\t}\n\n\t\t$this->msg[] = 'Created model ' . $path;\n\n\t\t// //echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function setModel(): void\n {\n $this->model = Location::class;\n }" ]
[ "0.7075179", "0.7045162", "0.6786308", "0.6765159", "0.6758826", "0.6669273", "0.6600089", "0.65749973", "0.65567106", "0.65528774", "0.6546158", "0.65121806", "0.64977515", "0.64907676", "0.6430233", "0.6427358", "0.6412675", "0.6384087", "0.6334028", "0.63135284", "0.63135284", "0.6307975", "0.6307057", "0.62869984", "0.6282393", "0.626723", "0.62661207", "0.62489825", "0.6241042", "0.62326837", "0.62311983", "0.6220094", "0.6214994", "0.62047017", "0.62047017", "0.61777157", "0.61771417", "0.6174993", "0.6170487", "0.61686724", "0.6165634", "0.61509824", "0.61481386", "0.61329466", "0.6118441", "0.6117264", "0.6108116", "0.6104685", "0.60979414", "0.6095357", "0.6095301", "0.60923314", "0.6068779", "0.6067235", "0.6066876", "0.60485417", "0.6034499", "0.6034407", "0.6031086", "0.60304654", "0.6028236", "0.6017066", "0.60165095", "0.6007415", "0.60071564", "0.6006356", "0.60012305", "0.5992384", "0.5992362", "0.5984459", "0.59761184", "0.5972599", "0.5959432", "0.5951573", "0.5951042", "0.5950424", "0.59477407", "0.5904564", "0.58974266", "0.58916575", "0.5871268", "0.5867855", "0.5867855", "0.5867855", "0.5867855", "0.586253", "0.585647", "0.5855398", "0.5853206", "0.58497244", "0.58465165", "0.5833183", "0.5826268", "0.58105755", "0.5810122", "0.5807252", "0.58024794", "0.5801018", "0.57986283", "0.57971966", "0.57943356" ]
0.0
-1
function addModels / CRUD : Create Read Update Delete Create a new row in Data Base INSERT INTO table (col1, col2) VALUES ('val1', 'val2');
public function create() { debugInfo(get_class($this)."->create()"); global $config; // Add set from $config['model'] {'_status', '_comment'} $this->set($config['model']); // INSERT $this->_query = $this->_insert(); // execute SQL request without Result (false) if ($this->_execute(false) === false) { $return = false; } else { $return = $this->_db->lastInsertId(); } // clear private variables $this->_clear(); debug('->create(), $return', $return); return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insert_model($data)\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"INSERT INTO \". GARAGE_MODELS_TABLE .\" (make_id, model)\n\t\t\tVALUES ('\".$data['make_id'].\"', '\".$data['model'].\"')\";\n\n\t\tif(!$result = $db->sql_query($sql))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Insert New Make', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\treturn;\n\t}", "function addModel(){\n\t\n\t}", "public function add_new_model($tbl_name,$db_name)\n\t{\n\t\t$this->db->query(\"use $db_name\");\n\n\t\t// define table fields\n\t\t$fields = array(\n\t\t 'id' => array(\n\t\t 'type' => 'INT',\n\t\t 'constraint' => '',\n\t\t 'unsigned' => TRUE,\n\t\t 'auto_increment' => TRUE\n\t\t ),\n\t\t 'brand_id' => array(\n\t\t 'type' => 'INT',\n\t\t 'constraint' => 11\n\t\t ),\n\t\t 'model_type' => array(\n\t\t 'type' => 'INT',\n\t\t 'constraint' => 11\n\t\t ),\n\t\t 'model_name' => array(\n\t\t 'type' => 'VARCHAR',\n\t\t 'constraint' => 255\n\t\t ),\n\t\t 'model_description' => array(\n\t\t 'type' => 'text',\n\t\t ),\n\t\t 'model_display_image' => array(\n\t\t 'type' => 'text',\n\t\t ),\n\t\t 'status' => array(\n\t\t 'type' => 'VARCHAR',\n\t\t 'asBool' => TRUE,\n\t\t 'constraint' => 1\n\t\t ),\n\t\t 'slug' => array(\n\t\t 'type' => 'VARCHAR',\n\t\t 'constraint' => 255\n\t\t ),\n\t\t 'setord' => array(\n\t\t 'type' => 'INT',\n\t\t 'constraint' => 10\n\t\t ),\n\t\t 'meta_title' => array(\n\t\t \t'type' => 'text'\n\t\t ),\n\t\t 'meta_descryption' => array(\n\t\t \t'type' => 'text'\n\t\t ),\n\t\t 'meta_keywords' => array(\n\t\t \t'type' => 'text'\n\t\t ),\n\t\t'u_create_date datetime default current_timestamp',\n\t\t);\n\n\t\t$this->dbforge->add_field($fields);\n\n\t\t// define primary key\n\t\t$this->dbforge->add_key('id', TRUE);\n\n\t\t// create table\n\t\treturn $this->dbforge->create_table($tbl_name, TRUE);\n\t}", "function insert(){\n //Declarar variables para recibir los datos del formuario nuevo\n $nombre=$_POST['nombre'];\n $apellido=$_POST['apellido'];\n $telefono=$_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n $this->index();\n }", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "protected function create() {\n $this->db->insertRow($this->table_name, $this->update);\n storeDbMsg($this->db,\"New \" . $this->form_ID . \" successfully created!\");\n }", "function dbInsert($edit)\r\n\t{\r\n\r\n\t}", "function add_model($text)\n {\n $query=$this->db2->query(\"INSERT INTO buses_model VALUES ('','$text')\");\n if($query)\n return 1;\n else\n return 0;\n }", "public function create() //添加\n {\n\t\t//\n }", "public function add($model) {\n $model['nombre'] = mysql_escape_string(htmlentities(strip_tags($model['nombre'])));\n $model['descripcion'] = mysql_escape_string(htmlentities(strip_tags($model['descripcion'])));\n $model['direccion']= mysql_escape_string(htmlentities(strip_tags($model['direccion'])));\n $model['telefono1']= mysql_escape_string(htmlentities(strip_tags($model['telefono1'])));\n $model['telefono2']= mysql_escape_string(htmlentities(strip_tags($model['telefono2'])));\n $model['correo']= mysql_escape_string(htmlentities(strip_tags($model['correo'])));\n \n $query = \"INSERT INTO {$this->con->prefTable}empresas(NOMBRE,DESCRIPCION,DIRECCION,TELEFONO1,TELEFONO2,CORREO) \".\n \"VALUES('{$model['nombre']}','{$model['descripcion']}','{$model['direccion']}','{$model['telefono1']}','{$model['telefono2']}','{$model['correo']}')\";\n $result = mysql_query($query,$this->con->link);\n if(!$result){\n Utils::logQryError($query, mysql_error($this->con->link),__FUNCTION__,__CLASS__);\n return false;\n }\n if (mysql_affected_rows($this->con->link) == 0) return false;\n else return true;\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "public function index_post()\n {\n $input = $this->input->post();\n $this->write_db->insert($_table,$input);\n \n $this->response(['Item created successfully.'], REST_Controller::HTTP_OK);\n }", "public function actionInsert()\n\t{\n\t\t$model=new Knowledgecatalogue();\n\t\t$model->fCatalogueNo=GuidUtil::getUuid();\n\t\t$model->fFatherCatalogueNo=$_POST['no'];\n\t\t$model->fCatalogueName=$_POST['name'];\n\t\t$model->fStatus=$_POST['statu'];\n\t\t$model->fIsDownLoad=$_POST['down'];\n\t\t$model->fCreateUser=Yii::app()->params->loginuser->fUserName;\n\t\t$model->fCreateDate=time();\n\t\t$model->fUpdateUser=Yii::app()->params->loginuser->fUserName;\n\t\t$model->fUpdateDate=time();\n\t\tif($model->save())\n\t\t{\n\t\t\t$this->renderPartial('update',array(\n\t\t\t\t\t'data'=>UFSBaseUtil::printJson(array(\n\t\t\t\t\t\t\t'fCatalogueNo'=>CHtml::encode($model->fCatalogueNo),\n\t\t\t\t\t\t\t'fIsDownLoad'=>CHtml::encode($model->fIsDownLoad),\n\t\t\t\t\t\t\t'fCatalogueName'=>CHtml::encode($model->fCatalogueName),\n\t\t\t\t\t\t\t'fFatherNo'=>$model->fFatherCatalogueNo,\n\t\t\t\t\t\t\t'fStatus'=>CHtml::encode($model->fStatus),\n\t\t\t\t\t\t\t'fCreateDate'=>CHtml::encode(empty($model->fCreateDate)?'':date('Y-m-d',$model->fCreateDate)),\n\t\t\t\t\t\t\t'fCreateUser'=>CHtml::encode($model->fCreateUser),\n\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'fUpdateUser'=>CHtml::encode($model->fUpdateUser),\n\t\t\t\t\t\t\t'msg'=>$this->FrameInfo(Yii::app()->params['layouttype']['top'],Yii::t('message','Add Success'),Yii::app()->params['notytype']['success']),\n\t\t\t\t\t))\n\t\t\t));\n\t\t}\n\t}", "function insert(){\r\n $this->model->randomInsert();\r\n $this->index();\r\n }", "public function Do_insert_Example1(){\n\n\t}", "function add_car_detail($params)\n {\n try{\n $this->db->insert('car_detail',$params);\n return $this->db->insert_id();\n } catch (Exception $ex) {\n throw new Exception('Car_detail_model model : Error in add_car_detail function - ' . $ex);\n } \n }", "public function add(){\n $tab = DB::table('student');\n $res = $tab -> insert(['name' => '小黑', 'age' => '18']);\n }", "public function insert()\n\t{\n\t\t$crud = $this->crud->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->insert();\n\t\t$this->redirect('crud');\n\t}", "function create($model)\n {\n }", "public function crud() {\n\t\t\n\t\t$this->load->model('Produttori_model','produttori');\n\t\t$data=array(\"produttore\" => \"franco\");\n\t\t$this->produttori->create($data);\n\t\t$this->produttori->update(array(),1);\n\t\t$this->produttori->delete(3);\n\t\tvar_dump ($this->produttori->read());\n\t\t$this->load->view('welcome_message');\n\t}", "function insert()\n\t{\n\t\t$this->edit(true);\n\t}", "function insert(){\n $nombre= $_POST['nombre'];\n $apellido= $_POST['apellido'];\n $telefono= $_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre , 'apellido'=>$apellido,'telefono'=>$telefono]);\n $url= constant('URL').\"alumno\";\n header(\"Location: $url\");\n // $this->index();\n }", "public function insert(){\n\n }", "public function create($params)\r\n\t{\r\n\r\n\t\tif ($this->exist_unike_keys($params)) {\r\n\t\t\techo '<script>console.log(\"modelo: ya existe la clave unica\")</script>';\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$sqlInsert = \"INSERT INTO \" . $this->table_name . \" (\";\r\n\r\n\t\t$sqlValues = \"VALUES (\";\r\n\t\t$db_params = array();\r\n\t\t$first = true;\r\n\r\n\t\tforeach ($this->table_fields as $table_field) {\r\n\t\t\t$name = $table_field->get_name();\r\n\r\n\t\t\tif($table_field->get_type()==Column::$COLUMN_TYPE_FILE || \r\n\t\t\t\t$table_field->get_type()==Column::$COLUMN_TYPE_PHOTO){\r\n\t\t\t\tif(!empty($_FILES[$name][\"name\"])){\r\n\t\t\t\t\tif(!empty($_FILES[$name][\"type\"])){\r\n\t\t\t\t\t\t$fileName = time().'_'.$_FILES[$name]['name'];\r\n\t\t\t\t\t\t$sourcePath = $_FILES[$name]['tmp_name'];\r\n\t\t\t\t\t\t$targetPath = UPLOADS_DIR.$fileName;\r\n\t\t\t\t\t\t\tif(move_uploaded_file($sourcePath,$targetPath)){\r\n\t\t\t\t\t\t\t\t$params[$name] = $fileName;\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}\r\n\t\t}\r\n\r\n\t\t\tif (!empty($params[$name]) && $table_field->get_column_in_db() == true && strlen($params[$name]) > 0 ) {\r\n\t\t\t\t$sqlInsert .= ($first == false ? \" , `\" : \"`\") . $name .\"`\";\r\n\t\t\t\t$sqlValues .= ($first == false ? \" , \" : \"\") . \":\" . $name;\r\n\t\t\t\t$db_params[$name] = $params[$name];\r\n\t\t\t\t$first = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sqlInsert .= \") \";\r\n\t\t$sqlValues .= \") \";\r\n\t\t$req = Database::getBdd()->prepare($sqlInsert.$sqlValues);\r\n\t\t$result= $req->execute($db_params);\r\n\t\t\t\r\n\t\ttry{\r\n\t\t\t$err = $req->errorInfo();\r\n\t\t\t/* $err[0] = sqlstate; $err[1] = error code; $err[2] = error message */\r\n\t\t\tif($err && isset($err[2])){\r\n\t\t\t \techo 'Database Error: '.$err[2].\r\n\t\t\t \t\t'<br/>sql :'.$sqlInsert.$sqlValues.\r\n\t\t\t \t\t'</br>params: ';\r\n\t\t\t}\r\n\t\t}catch(Exception $e){\r\n\t\t\techo 'Exception: '.$e->getMessage();\r\n\t\t}\r\n\r\n\t\treturn $result;\r\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}", "public function creating($model)\n\t{\n\t}", "public function createModel()\n {\n }", "public function modelDoAdd(){\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"insert into phongban set tenphongban=:ten\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban));\n\t\t}", "protected function saveInsert()\n {\n }", "public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "public function create($modelData);", "public function index_post()\n {\n $input = $this->input->post();\n $this->db->insert('items',$input);\n \n $this->response(['Item created successfully.'], REST_Controller::HTTP_OK);\n }", "public function actionCreate()\n\t{\n $this->actionUpdate();\n\t}", "public function create() {\n\t\t$columns = implode(', ', array_keys($this->params));\n\t\t$bindings = substr(str_repeat(', ?', count($this->params)), 2);\n\t\t$sql = 'INSERT INTO ' . static::$table . ' (' . $columns . ') VALUES (' . $bindings . ');';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "function insert_record()\n\t{\n\t $dbname=$this->dbname;\n\t $DB1=$this->__connect($dbname,$this->table_name);\n $fields_data=$this->__list_fields_data($dbname,$this->table_name);\n // echo_array($fields_data);\n $index=$this->_get_primary($fields_data);\n //echo $index;\n //echo_array($_POST);\n \n \n //since we are coming from a form there\n //are $_POST values\n foreach ($fields_data->name as $key=>$value)\n {\n $data[$value['name']]=$_POST[$value['name']];\n }\n\n //needs checking if a FOREIGN FIELD\n //insert into database \n $this->db->insert($this->table_name, $data);\n\n $keys=(array_keys($data));\n $values=(array_values($data));\n\n //prepare some data for the form controls\n //in this case the Tdataset control\n \n $i=0;\n $num_fields=count($keys);\n for ($i=0;$i<$num_fields;$i++){\n $this->table->add_row($keys[$i],$values[$i]);\n }\n $this->table->set_heading('field','Value');\n $this->table->set_caption('Insert');\n $this->table->set_template($this->tmpl);\n $s=$this->table->generate();\n $s.='<a href=\"http://localhost/CodeIgniter/admin/dbutil/browse/'.$dbname.'/'.$this->table_name.'\">Click to Edit More</a>';\n return $s;\n\t}", "function create(){\n $query = \"INSERT INTO \" . $this->table_name . \" SET \n name=:name, rating=:rating, description=:description\";\n \n // prepare query\n $stmt = $this->conn->prepare($query);\n \n // sanitize\n $this->name=htmlspecialchars(strip_tags($this->name));\n $this->name=htmlspecialchars(strip_tags($this->rating));\n $this->model=htmlspecialchars(strip_tags($this->description));\n \n // bind values\n $stmt->bindParam(\":name\", $this->name);\n $stmt->bindParam(\":rating\", $this->rating);\n $stmt->bindParam(\":description\", $this->description);\n \n // execute query\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "public function actionCreate()\n {\n $model = new Data();\n $oldModel = $model->attributes;\n\n $model->discount = 0;\n $model->activation_date = date('Y-m-d');\n\n if ($model->load(Yii::$app->request->post()) /*&& $model->save()*/) {\n\n $check = self::check($model);\n\n if($check && $model->save()){\n $newModel = $model->attributes;\n (new History())->setRow(Yii::$app->controller, $oldModel, $newModel, 'Создан клиент '.$newModel['user_name']);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n else{\n // сформируем номер новой карты клиента\n $next_card = Data::find()->max('card') + 1;\n $model->card = $next_card;\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function doRestCreate($data) {\n\t\t$models = $this->saveModel($this->getModel(), $data);\n //$this->renderJson(array('success'=>true, 'message'=>'Record(s) Created', 'data'=>array($models)));\n $this->outputHelper(\n 'Record(s) Created',\n $models,\n count($models)\n );\n\t}", "public function addModel($id,$datetime_record,$value)\n\t{\n $models = PointsMainTb::model()->findAll(array('condition'=>'point_id=\"'.$id.'\"'));\n //get value type\n $point_type = $models[0]->point_type_id;\n $models = PointValueTb::model()->findAll(array('condition'=>'point_id=\"'.$id.'\" AND datetime_record=\"'.$datetime_record.'\"'));\n\n\t\tif($value!=\"\")\n\t\t\tif(empty($models))\n\t\t\t{\n\t\t\t\t\t\t\t\t//insert data\n\t\t\t\t\t\t\t\t$model = new PointValueTb;\n\t\t\t\t\t\t\t\t$model->point_id = $id;\n\t\t\t\t\t\t\t\t$model->datetime_record = $datetime_record;\n\t\t\t\t\t\t\t\t$model->user_id = \"import\";\n\t\t\t\t\t\t\t\t$today = date(\"Y-m-d H:i:s\"); \n\t\t\t\t\t\t\t\t$model->created_date = $today;\n\n\t\t\t\t\t\t\t\tif($point_type==\"POINT-TYPE-001\")\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$model->point_float_value = $value;\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$model->point_text_value = $value;\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\tif(!$model->save()) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo \"<pre>\";print_r($model); echo \"</pre>\";\n\t\t\t\t\t\t\t\t\tprint_r($model->getErrors()); \n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t\t\t\t//update]\n\t\t\t\t\t\t\t\t//print_r($models); \n\t\t\t\t\t\t\t\t// $models[0]->user_id = \"import\";\n\t\t\t\t\t\t\t\t// $today = date(\"Y-m-d H:i:s\"); \n\t\t\t\t\t\t\t\t// $models[0]->created_date = $today; \n\n\t\t\t\t\t\t\t\t// if($point_type==\"POINT-TYPE-001\")\n\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t// $models[0]->point_float_value = $value;\n\t\t\t\t\t\t\t\t// } \n\t\t\t\t\t\t\t\t// else{\n\t\t\t\t\t\t\t\t// $models[0]->point_text_value = $value;\n\t\t\t\t\t\t\t\t// } \n\n\t\t\t\t\t\t\t\t// if(!$models[0]->save())\n\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t// \techo \"<pre>\";print_r($models[0]); echo \"</pre>\";\n\t\t\t\t\t\t\t\t// \tprint_r($models[0]->getErrors()); \n\t\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\n\t}", "public function run()\n {\n $rec=[\n [ 'id'=>1,'name'=>'test-1','status'=>1],\n [ 'id'=>2,'name'=>'test-2','status'=>1],\n [ 'id'=>3,'name'=>'test-3','status'=>1],\n [ 'id'=>4,'name'=>'test-5','status'=>1],\n [ 'id'=>5,'name'=>'test-6','status'=>1],\n ];\n Brand::insert($rec);\n }", "public function actionCreate() {\n $this->actionUpdate();\n }", "public function index_post()\n {\n $input = $this->input->post();\n $this->db->insert('mst_raw_material',$input);\n \n $this->response(['Item created successfully.','201'], REST_Controller::HTTP_OK);\n }", "public function addModel($data){\r\n\t\tif($this->db->insert('uqc',$data)){\r\n\t\t\treturn $this->db->insert_id();\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "public function actionCreate() {\n $model = new TabelleRelease();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n\n return $this->redirect(['update', 'id' => $model->id, 'mySuccess' => 2]);\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function add() {\r\n\r\n\r\n $item_data = array(\r\n \"master_warehouse_id\" => $this->input->post('master_warehouse_id'),\r\n \"master_items_id\" => $this->input->post('master_items_id'),\r\n \"stock_on_hand\" => $this->input->post('stock_on_hand'),\r\n \"date_adjusment\" => $this->input->post('date_adjusment'),\r\n \"description\" => $this->input->post('description'),\r\n \"created_by\" => $this->session->userdata('user_name'),\r\n \"created_at\" => get_current_utc_time(),\r\n \"updated_by\" => $this->session->userdata('user_name'),\r\n \"updated_at\" => get_current_utc_time(),\r\n \"deleted\" =>0\r\n );\r\n\r\n $data = $this->Master_Stock_model->save($item_data);\r\n if ($data) {\r\n $item_info = $this->Master_Stock_model->get_details()->row();\r\n echo json_encode(array(\"success\" => true, \"id\" => $item_info->id, \"data\" => $this->_make_item_row($item_info), 'message' => lang('record_saved')));\r\n } else {\r\n echo json_encode(array(\"success\" => false, 'message' => lang('error_occurred')));\r\n }\r\n }", "function add_contrato($params)\n {\n $this->db->insert('contrato',$params);\n return $this->db->insert_id();\n }", "public function create()//what will happen when we press submit\r\n\t\t{\r\n\t\t\t$my_Array=array(\r\n\t\t\t\t\t\t\t\"firstname\" =>$this->input->post(\"firstName\"), \r\n\t\t\t\t\t\t\t\"email\"=>$this->input->post(\"email\")\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\r\n\t\t\t$this->model5->add_records($my_Array);\r\n\t\t\t$this->index();\r\n\t\t\t\t\t\r\n\t\t}", "public function add($data){\n\t\t\t// echo 'LINE 11:: model';\n\t\t\t// print_r($data);die;\n\n\t\t\tif($this->db->insert('tbl_books', $data)){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function insert()\n {\n # code...\n }", "function postAdd($request){\r\n global $context;\r\n $data= new $this->model;\r\n foreach($data->fields as $key=>$field){\r\n if($field['type']!='One2many' && $field['type']!='Many2many' ){\r\n $data->data[$key]=$request->post[$key];\r\n }\r\n }\r\n\r\n if(!$data->insert()){\r\n if($request->isAjax()) return json_error($data->error);\r\n throw new \\Exception($data->error);\r\n }\r\n if($request->isAjax()) return json_success(\"Save Success !!\".$data->error,$data);\r\n\r\n\r\n redirectTo($context->controller_path.\"/all\");\r\n }", "private function create() {\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (!empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toCreat();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to create!\");\n\t\t\treturn;\n\t\t}\n\t\t// Execute insert.\n\t\t$this->objAccessCrud->setDateInsert(date(\"Y-m-d H:i:s\"));\n\t\t$id = $this->objAccessCrud->create ();\n\t\t// Check result.\n\t\tif ($id == 0) {\n \t\t\t$this->msg->setError ('There were issues on creating ther record!');\n\t\t\t\treturn;\n\t\t}\n\t\t// Save the id in the session to be used in the update.\n\t\t$_SESSION ['PK']['ACCESSCRUD'] = $id;\n\t\t\t\n\t\t$this->msg->setSuccess ( 'Created the record with success!' );\n\t\treturn;\n\t}", "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "private function newModel(){\n\t\t$this->assign('title', 'New Model');\n\t\t$this->assign('types', $this->getModelTypes());\n\t\t$this->display('model/new.tpl');\n\t}", "public function actionCreate()\n {\n $model = new CategoryTable();\n $model->category_table_create_by = Yii::$app->user->id;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n echo \"{'status':'success'}\";\n } else {\n echo \"{'status':'fail'}\";\n// return $this->render('create', [\n// 'model' => $model,\n// ]);\n }\n }", "public function insertDatabase();", "protected function _create()\n {\n $entry = $this->_db->createRow();\n foreach ($this->getFields() as $key => $value) {\n $entry->{$key} = $value;\n }\n return $entry->save();\n }", "public function newEntryModel();", "public function create($data,$model=null){\n if($this->model==null){\n $this->model=$model;\n }\n if(is_array($data) && count($data)){\n $data=(array_key_exists(0,$data)) ? $data[0] : $data;\n return $this->querySqlFormatter->getInsertQueryFormatter($data,['model'=>$this->model->subClassOf,'bool'=>$this->bool,'transaction'=>$this->transaction,'transactionName'=>$this->transactionName]);\n }\n\n }", "public function categories_add($param = null)\r\n {\r\n if (isset($_POST[\"cat_descr\"]) && !empty($_POST[\"cat_descr\"])) {\r\n $action = $_POST[\"cat_descr\"];\r\n $datas = Category::updateOrCreate([\r\n 'cat_descr' => $action,\r\n ]);\r\n // Return last insert row:\r\n echo $datas;\r\n } else {\r\n echo json_encode([\"message\" => \"ERROR!\"]);\r\n }\r\n }", "function add_rombel($params)\n {\n // $this->db->insert('rombel',$params);\n // return $this->db->insert_id();\n return $this->db->insert_batch('rombel', $params);\n\n }", "function saveAction()\n {\n\t\t$params = $this->_request->getParams();\n \t$id=(int)$params[\"id\"];\n\t\t$name = $params[\"txtName\"];\n\t\t$address = $params[\"txtAddress\"];\n\t\t$email = $params[\"txtEmail\"];\n\t\t$phone = $params[\"txtPhone\"];\n\n\t\t$customers = new CustomersModel();\n\t\tif($id > 0)\n\t\t{\n\t\t\t$customers->updateCustomersById($id, $name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t} else {\n\t\t\t$customers->insertCustomers($name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t}\n }", "function insert() { \t\n \tif(!isset($_POST['submit'])){\n \t\techo json_encode(\"failed\");\n \t\texit();\n \t}\n \t$data = array();\n \t$data['name'] = $_POST['name'];\n \t$data['start_date'] = $_POST['start_date'];\n \t$data['description'] = $_POST['description'];\n \t$data['owner_id'] = $_POST['owner_id'];\n \t$data['address'] = $_POST['address'];\n \tif(count($data)==0){\n \t\techo json_encode(\"failed\");\n \t\texit();\t\n \t}\n \t$arrTemp = array();\n foreach($data as $key=>$value){\n $arrTemp[$key] =$key.\"=\".\"'$value'\"; \n } \n \tif($this->model->insert($data)){\n \t\techo json_encode(array(\"success\",$data['id']));\n \t}else{\n \t\techo json_encode(\"failed\");\n \t} \n\n }", "public function actionCreate() {\n $model = new TabellePlattform();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n// $this->success = 2; // 2->insert erfolgreich\n \n// $model = $this->findModel($model->id);\n// $model->setIsNewRecord(false);\n \n return $this->redirect(['update','id'=>$model->id,'mySuccess' => 2]);\n// return $this->render('update', [\n// 'model' => $model,\n// ]);\n// $this->redirect(\\Yii::$app->urlManager->createUrl(\"test/show\"));\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$this->actionRegister();\n\t\t/*\n\t\tif (isset($_GET['newModel']) && isset(Yii::app()->session[$this->createBackup.'_Time']) && $_GET['newModel']>Yii::app()->session[$this->createBackup.'_Time']){\n\t\t\t\tunset(Yii::app()->session[$this->createBackup]);\n\t\t\t\tunset(Yii::app()->session[$this->createBackup.'_Time']);\n\t\t\t\tunset($_GET['newModel']);\n\t\t}\n\t\t$this->prepareCreateOrUpdate(null, 'create');\n\t\t*/\n\t}", "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 }", "public function actionCreate() {}", "public function actionCreate() {}", "public function post()\n {\n if ($this->request->is('post')) {\n\n $this->Row->create();\n $this->request->data['Row']['feed_id'] = (int)$this->request->data['Row']['feed_id'];\n\n $this->Row->save(\n array(\n 'Row' => $this->request->data['Row']\n )\n );\n\n $this->log(\n 'created row by datatables, ' . '(' . __CLASS__ . ':' . __FUNCTION__ . '=' . $this->Row->id . ')',\n LOG_DEBUG\n );\n\n }\n die($this->Row->id); //datatables wants this\n }", "public function create(){\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' => 1\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$this->db->insert('apps', $arr);\r\n\t\treturn $this->db->insert_id();\r\n\t }", "function add() {\n if (isset($_POST) && count($_POST) > 0) {\n $params = array(\n 'workname' => $this->input->post('workname'),\n 'description' => $this->input->post('description'),\n );\n\n $jcline_id = $this->Jcline_model->add_jcline($params);\n redirect('jcline/index');\n } else {\n $data['_view'] = 'jcline/add';\n $this->load->view('layouts/main', $data);\n }\n }", "public function add_data(){\n// $product->cate_id = \"1\";\n// $product->name = \"喜德盛\";\n// $product->price = \"800\";\n// $product->save();\n Product::create([\n 'cate_id'=>'1',\n 'name'=>'钱江极',\n 'price'=>49999,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new TBantuanData;\n\n\t\t$data = json_decode(stripslashes($_POST['data']));\n\n foreach ($data as $key => $val) {\n $model->$key = $val;\n }\n\t\t\t\t\n if ($model->save()) {\n echo json_encode(array(\n \"success\" => true,\n \"data\" => array(\n \"id\" => $model->id,\n )\n ));\n }\n\t}", "function getSaveStatement($model,&$args,$columns_to_update=false);", "public function createOne()\r\n {\r\n $parameterList = '';\r\n foreach ($this->modelClassFieldNames as $fieldName) {\r\n if ($fieldName->getName() == 'id') {\r\n $parameterList .= '@pId, ';\r\n } else {\r\n $parameterName = ucfirst($fieldName->getName());\r\n $parameterList = $parameterList . \":p{$parameterName}, \";\r\n }\r\n }\r\n $parameterList = rtrim($parameterList, ', ');\r\n // build prepared statement sql statement\r\n $sqlString = \"CALL {$this->modelShortClassName}Insert({$parameterList})\";\r\n\r\n $result = false;\r\n if (!$this->model->isValid()) {\r\n $this->model->getModelState()->modelInvalidated($this);\r\n } else {\r\n if (!$this->provider->isConnected()) {\r\n $this->provider->open();\r\n }\r\n if ($this->provider->isConnected()) {\r\n try {\r\n // Prepare stored procedure call\r\n $preparedStatement = $this->provider->getPdo()->prepare($sqlString);\r\n // so we cannot use bindParam that requires a variable by value\r\n // if you want to use a variable, use then bindParam\r\n foreach ($this->modelClassFieldNames as $fieldName) {\r\n if (!($fieldName->getName() == 'id')) {\r\n $getMethodName = ucfirst($fieldName->getName());\r\n $reflectionMethod = new \\ReflectionMethod($this->modelClassName, \"get{$getMethodName}\");\r\n $value = $reflectionMethod->invoke($this->model);\r\n switch (gettype($value)) {\r\n case 'boolean' :\r\n $paramType = \\PDO::PARAM_BOOL;\r\n break;\r\n case 'integer' :\r\n $paramType = \\PDO::PARAM_INT;\r\n break;\r\n case 'NULL' :\r\n $paramType = \\PDO::PARAM_STR;\r\n $value = '';\r\n break;\r\n default :\r\n $paramType = \\PDO::PARAM_STR;\r\n break;\r\n }\r\n $preparedStatement->bindValue(\":p{$getMethodName}\",\r\n $value, $paramType);\r\n // echo $reflectionMethod->invoke($this->model);\r\n }\r\n }\r\n // Returns true on success or false on failure\r\n $result = $preparedStatement->execute();\r\n $this->rowCount = $preparedStatement->rowCount();\r\n if ($result) {\r\n // fetch the output\r\n $this->model->setId($this->provider->getPdo()->query('select @pId')->fetchColumn());\r\n $this->model->getModelState()->crudNotice('CreateOne', true, $this,\r\n null, $preparedStatement->errorInfo());\r\n $result = true;\r\n } else {\r\n $this->model->getModelState()->crudNotice('CreateOne', false, $this,\r\n null, $preparedStatement->errorInfo());\r\n }\r\n } catch (\\PDOException $e) {\r\n $this->model->getModelState()->crudNotice('CreateOne', false, $this, $e, null);\r\n }\r\n } else {\r\n $this->model->getModelState()->disconnected($this->provider);\r\n }\r\n }\r\n return $result;\r\n }", "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 }", "public function run()\n {\n //\n $column = new column();\n $column->nama_column = \"id\";\n $column->id_table = 1;\n $column->length = 10;\n $column->status_increment = 1;\n $column->status_null = 0;\n $column->status_unique = 1;\n $column->tipe_data = 'integer';\n\n $column->id_user = 1;\n $column->tanggal = \"2016-02-02\";\n $column->keterangan = \"Contoh Keterangan\";\n $column->save();\n\n //\n $column1 = new column();\n $column1->nama_column = \"username\";\n $column1->id_table = 1;\n $column1->length = 100;\n $column1->status_increment = 0;\n $column1->status_null = 1;\n $column1->status_unique = 1;\n $column1->tipe_data = 'varchar';\n\n $column1->id_user = 1;\n $column1->tanggal = \"2016-02-02\";\n $column1->keterangan = \"Contoh Keterangan\";\n $column1->save();\n }", "private function _create() {\n\n $this->db->insert(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->set(\"id\", $this->db->insert_id());\n\n }", "function add_modelo_medidor($params)\n {\n $this->db->insert('modelo_medidor',$params);\n return $this->db->insert_id();\n }", "function add_Batch($params){\n $this->company_db = $this->load->database('company_db', TRUE);\n // print_r($params);exit();\n $this->company_db->set('data_created', 'NOW()', FALSE);\n $this->company_db->insert('tbl_mdist_batch', $params);\n // echo $this->company_db->last_query();exit;\n return $this->company_db->insert_id();\n }", "private function make_db() {\n ee()->load->dbforge();\n $fields = array(\n 'id' => array('type' => 'varchar', 'constraint' => '32'),\n 'access' => array('type' => 'integer', 'constraint' => '10', 'unsigned' => true),\n 'data' => array('type' => 'text')\n );\n ee()->dbforge->add_field($fields);\n ee()->dbforge->add_key('id', true);\n ee()->dbforge->create_table($this->table_name);\n\n return true;\n }", "public static function getCodeForAddingData($model_name, $cols){\n\n\n\n $resultString ='//method for adding data'.\"\\n\";\n $resultString.='public function addData(Request $request){'.\"\\n\";\n $resultString.=' '.\"\\n\";\n\n $resultString .='$'.$model_name.' = new '.$model_name.'();'.\"\\n\";\n foreach ($cols as $key => $value) {\n $resultString.='$createApply->'.$value.' =$request->input(\\''.$value.'\\');'.\"\\n\";\n }\n $resultString.=''.\"\\n\";\n $resultString.='$createApply->save();'.\"\\n\";\n\n $resultString.='}'.\"\\n\";\n\n return $resultString;\n\n }", "public function Crud(){\n $pvd = new alumno();\n\n //Se obtienen los datos del alumno a editar.\n if(isset($_REQUEST['persona_id'])){\n $pvd = $this->model->Obtener($_REQUEST['persona_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Alumno/editar-alumnos.php';\n\t}", "function show_new_record() {\r\n if ($this->allow_new) {\r\n #~ echo \"<p><a href='{$_SERVER['PHP_SELF']}?m={$this->module}&amp;act=new&amp;go=\".urlencode($GLOBALS['full_self_url']).\"'>Insert new row</a>\";\r\n echo '<form method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n echo '<input type=hidden name=\"m\" value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=\"act\" value=\"new\">';\r\n echo '<input type=hidden name=\"go\" value=\"'.htmlentities($GLOBALS['full_self_url']).'\">'; # url to go after successful submitation\r\n # if i'm a detail, get master-detail field's value and pass it to new-form\r\n if ($this->logical_parent) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->parentkey) { # foreign key always int\r\n echo '<input type=hidden name=\"sugg_field['.$colvar.']\" value=\"'.htmlentities($col->parentkey_value).'\">';\r\n }\r\n }\r\n }\r\n echo '<p>'.lang('Add').' <input type=text name=\"num_row\" size=2 value=\"1\"> '.lang($this->unit).' <input type=submit value=\"'.lang('Go').'\">';\r\n echo '</form>';\r\n }\r\n }", "function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}", "public function Crud(){\r\n \r\n // if(isset($_REQUEST['Seq_Registro'])){\r\n // $alm = $this->model->Obtener($_REQUEST['Seq_Registro']);\r\n // }\r\n \r\n // require_once 'view/header.php';\r\n // require_once 'view/Registro/Nuevo_registro.php';\r\n // require_once 'view/footer.php';\r\n require_once 'view/medics/create.php';\r\n }", "public function actionCreate()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /*\r\n * Get an instance of the respective model\r\n */\r\n case 'posts': \r\n $model = new Post; \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Mode <b>create</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /*\r\n * Assign POST values to attributes \r\n */ \r\n foreach($_POST as $var=>$value) {\r\n /*\r\n * Check if the model have this attribute\r\n */ \r\n if($model->hasAttribute($var)) {\r\n $model->$var = $value;\r\n } else {\r\n /* Error : model don't have this attribute */\r\n $this->_sendResponse(500, sprintf('Parameter <b>%s</b> is not allowed for model <b>%s</b>', $var, $_GET['model']) );\r\n }\r\n }\r\n /*\r\n * save the model\r\n */ \r\n if($model->save()) { \r\n $this->_sendResponse(200, $this->_getEncodedData($_GET['model'], $model->attributes) );\r\n } else {\r\n /*\r\n * Errors occurred\r\n */\r\n $message = \"<h1>Error</h1>\";\r\n $message .= sprintf(\"Couldn't create model <b>%s</b>\", $_GET['model']);\r\n $message .= \"<ul>\";\r\n foreach($model->errors as $attribute=>$attribute_errors) {\r\n $message .= \"<li>Attribute: $attribute</li>\";\r\n $message .= \"<ul>\";\r\n foreach($attribute_errors as $attr_error) {\r\n $message .= \"<li>$attr_error</li>\";\r\n } \r\n $message .= \"</ul>\";\r\n }\r\n $message .= \"</ul>\";\r\n $this->_sendResponse(500, $message );\r\n }\r\n\r\n var_dump($_REQUEST);\r\n }", "public function create(){\n\n $id=0;\n $attributes = $this->prepared_attributes_insert();\n\t\t\n\t $sql = \"INSERT INTO \".static::$table_name.\" (\";\n\t $sql .= join(\",\",array_keys($attributes));\n\t $sql .= \") VALUES (\"; \n $sql .= join(\",\",array_values($attributes));\t\t \n $sql .= \") \";\n \n $idf = static::$id_field;\n \n $this->{static::$id_field} = static::db()->insert($sql);\n static::db()->free_statement();\n if (static::$idf !== -1)\n {\n\t return true;\n\t } else {\n\t return false;\n\t }\n }", "public function save(){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Find the columns from the model\n\t\t$columns = static::$columns;\n\n\t\t//because ID is AI we dont want to put a value in it\n\t\tunset($columns[array_search('id', $columns)]);\n\t\t//Same with timestamp\n\t\tunset($columns[array_search('timestamp', $columns)]);\n\n\t\t//Create an insert query which gets linked to the database\n\t\t$query = \"INSERT INTO \" . static::$tableName . \" (\". implode(\",\", $columns) . \") VALUES (\";\n\n\t\t//create a variable called insesrtcols. This is where we put the values\n\t\t$insertcols = [];\n\t\t//For each of the columns in the columns array, add that column into the insert cols array, and seperate it with a :\n\t\tforeach ($columns as $column) {\n\t\t\tarray_push($insertcols, \":\" . $column);\n\t\t}\n\t\t//turn the insertcols array into 1 string and put a , between each entry\n\t\t$query .= implode(\",\", $insertcols);\n\t\t//close the query\n\t\t$query .= \")\";\n\n\t\t//Prepare the query\n\t\t$statement = $db->prepare($query);\n\n\t\t//Foreach of the columns run this function\n\t\tforeach ($columns as $column) {\n\t\t\t//Attach the value to each of the columns\n\t\t\t//Hash the password\n\t\t\tif($column === 'password'){\n\t\t\t\t$this->$column = password_hash($this->$column, PASSWORD_DEFAULT);\n\t\t\t}\n\t\t\t$statement->bindValue(\":\" . $column , $this->$column);\n\t\t}\n\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Get the id of the query which was just added\n\t\t$this->id = $db->lastInsertID();\n\t}", "public function actionAdd(){\r\n \r\n }", "public function addData_post(){\n//\t\t$this->data = json_decode(file_get_contents(\"php://input\"), true);\n $this->api_model->setData(json_decode(file_get_contents(\"php://input\"), true));\n if (!empty($this->api_model->getData()) && $this->api_model->getData()) {\n\n if (!($_SESSION[\"first\"])) {\n if ($this->api_model->invokeCreateTable()) {\n $_SESSION[\"first\"] = true;\n echo \"\\ntableName: \".$_SESSION[\"tableName\"];\n echo \"\\ntable created\";\n $this->api_model->insertData();\n }\n }\n else {\n if ($this->api_model->deleteTable($_SESSION[\"tableName\"])) {\n echo \"\\ntable deleted\";\n $_SESSION[\"tableName\"] = \"\";\n $this->columnName = empty($this->columnName);\n if ($this->api_model->invokeCreateTable()) {\n echo \"\\ntableName: \".$_SESSION[\"tableName\"];\n echo \"\\ntable created\";\n $this->api_model->insertData();\n }\n }\n }\n echo \"\\nDimension: \";\n var_dump($_SESSION[\"dimension\"]);\n echo \"\\nMeasure: \";\n var_dump($_SESSION[\"measure\"]);\n }\n\t}", "public function add()\n\t{\n\t\t$this->template('crud/add');\t\n\t}", "function add($name,$endpoint){\n \n // create row in workspace table.\n $data = array(\n 'name' => strtolower($name),\n 'endpoint' => $endpoint,\n );\n $this->team->db->insert('workspaces', $data);\n \n include_once(\"public/arc2/ARC2.php\");\n\n // Config mysql\n $config_Mysql = array(\n // db \n 'db_host' => $this->team->db->hostname, // default: localhost\n 'db_name' => $this->team->db->database,\n 'db_user' => $this->team->db->username,\n 'db_pwd' => $this->team->db->password,\n // store \n 'store_name' => $name,\n );\n\n $store_Mysql = ARC2::getStore($config_Mysql);\n \n /* create MySQL tables \n *\n * _g2t\n * _id2val\n * _o2val\n * _s2val\n * _setting\n * _triple\n */\n $store_Mysql->setUp(); \n \n //echo \"END FUNCTION add(name,endpoint) Workspaces_model.php<br />\";\n }", "function saveNew() {\n\t\t$this->prepareForDb(); \n\t\t$query = \"INSERT INTO `\".sql_table('plug_miniforum_templates').\"` \".\n\t\t\t $this->prepareQuery();\t\t\n\t\t\t\t\t\n\t\tsql_query($query);\n }", "public function actionCreate() {\n $model = new $this->defaultModel;\n\n $isPjax = Yii::$app->request->isPjax;\n if (!$isPjax) {\n $this->performAjaxValidation($model);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($isPjax) {\n return $this->actionAjaxModalNameList(['selected_id' => $model->id]);\n } else {\n return $this->redirect('index');\n } \n } else {\n if (Yii::$app->request->isAjax) {\n return $this->renderAjax('create', [\n 'model' => $model,\n 'isModal' => true,\n ]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'isModal' => false,\n ]);\n }\n }\n }", "public function create_record() {\n $class = get_called_class();\n\n if ($this->does_exist()) {\n return false;\n }\n\n $db = DB::connect();\n\n $attributes = '';\n $values = '';\n\n // Loop through all the attributes to get the attributes and values\n foreach (get_object_vars($this) as $key => $value) {\n // We dont add the id of the object, as it is autoincremented\n if ($value == null) {\n continue;\n }\n\n $attributes = $attributes . \" $key,\";\n\n // We cannot add an object to sql statemnt. if the value is an object, get the id of it\n if (gettype($value) == 'object') {\n $value = $value->id;\n } elseif (gettype($value) === 'string') {\n $value = \"'\" . $value . \"'\";\n }\n\n $values = $values . \" $value,\";\n\n }\n\n // Delete the last comma\n $attributes = substr_replace($attributes, \" \", -1);\n $values = substr_replace($values, \" \", -1);\n\n $sql = $db->prepare(\"INSERT INTO \" . $class . \" (\" . $attributes . \") VALUES (\" . $values . \")\");\n $sql->execute();\n\n return true;\n }", "public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }", "public function add(){\r\n\t\t//$this->auth->set_access('add');\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 actionCreate()\n\t{\n\t\tif (isset($_GET['newModel']) && isset(Yii::app()->session[$this->createBackup.'_Time']) && $_GET['newModel']>Yii::app()->session[$this->createBackup.'_Time']){\n\t\t\t\tunset(Yii::app()->session[$this->createBackup]);\n\t\t\t\tunset(Yii::app()->session[$this->createBackup.'_Time']);\n\t\t\t\tunset($_GET['newModel']);\n\t\t}\n\t\t$this->prepareCreateOrUpdate(null, 'create');\n\t}", "public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function run()\n {\n \t\tDB::table('models')->insert($models);\n }" ]
[ "0.6842515", "0.68207645", "0.6782058", "0.66117334", "0.6604003", "0.6517269", "0.65031475", "0.64627904", "0.6448752", "0.64450777", "0.6436098", "0.6430199", "0.6413193", "0.6352001", "0.6327885", "0.6324515", "0.6318823", "0.6317103", "0.631147", "0.6293889", "0.6293676", "0.62878305", "0.6282642", "0.6280738", "0.6274999", "0.626882", "0.6255487", "0.62245154", "0.6208422", "0.6202011", "0.6188892", "0.61806965", "0.6178457", "0.6177581", "0.6164945", "0.6147361", "0.6139043", "0.6112301", "0.6110116", "0.6099525", "0.6086662", "0.60846335", "0.60821545", "0.60803604", "0.60794294", "0.60733813", "0.6069423", "0.6067457", "0.60667735", "0.6063843", "0.60610026", "0.6059351", "0.6044667", "0.6029408", "0.6026197", "0.60246515", "0.60194635", "0.6016299", "0.60099286", "0.6007813", "0.60054636", "0.599731", "0.5994419", "0.59847194", "0.598258", "0.596969", "0.59672546", "0.59672546", "0.5959724", "0.5958323", "0.59555745", "0.59496975", "0.5942977", "0.59417146", "0.5936028", "0.59348667", "0.592917", "0.59253293", "0.59245956", "0.5924292", "0.5918056", "0.5917269", "0.59023434", "0.59019595", "0.5900393", "0.58938015", "0.588882", "0.588534", "0.58845735", "0.58829826", "0.5878365", "0.5877011", "0.587477", "0.5873203", "0.58705723", "0.5870089", "0.5869181", "0.5868837", "0.5865323", "0.586034", "0.58572537" ]
0.0
-1
create() Read datas in Data Base SELECT columns FROM table WHERE condition
public function read($columns = array('*')) { debugInfo(get_class($this).'->read($colmuns)'); debug('$columns', $columns); if (gettype($columns) == 'array') { // add where _status not DELETED $this->where('_status', '<', 255); // SELECT $this->_query = $this->_select($columns); // execute SQL request $return = $this->_execute(); } else { if (($this->_isCleared()) && ($this->_result !== null)) { // search for 'id' in _result $imax = count($this->_result); for($i=0; $i<$imax; $i++) { if ($this->_result[$i]['id'] == $columns) { // return the record... return $this->_result[$i]; } // if } // for } else { $this->_clear(); $this->where('id', '=', $columns)->limit(1); // SELECT $this->_query = $this->_select(array('*')); // execute SQL request $return = $this->_execute()[0]; } // if } // if debug('->read(), $return', $return); return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function read(){\n \n //select all data\n $query = \"SELECT\n id, id, num_compte, cle_rib, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n created\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public function readAll(){\n //select all data\n $query = \"SELECT\n id, num_compte, cle_rib, num_agence, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n num_compte\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "function read_all(){\n \n // select all query\n $query = \"SELECT\n *\n FROM\n \" . $this->table_name . \"\n ORDER BY\n date DESC\";\n //SELECT id, username, date, content, IF(private, 'true', 'false') private\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "public function read(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "public function read(){\n $query = \"SELECT * FROM {$this->table}\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt;\n }", "function prepare_read($filter = '', $sort = ''){\n $tables_sql = $this->create_table_list();\n $where_sql = '';\n if($filter != ''){\n $where_sql = \"WHERE 1 = 1 AND \" . $this->substitute_symbols($filter);\n }\n $sort_sql = '';\n if($sort != ''){\n $sort_sql = \"ORDER BY \" . $this->substitute_symbols($sort);\n }elseif(isset($this->sort)){\n $sort_sql = $this->sort;\n }\n $column_sql = implode(', ', $this->column_list);\n $ret_val = \"SELECT $column_sql FROM $tables_sql $where_sql $sort_sql;\";\n return $ret_val;\n }", "function readAll(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name .\"\";\n\t\t$stmt = $this->conn->prepare($query);\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}", "private function getData(){\n\t\tdb::getAdapter();\n\t\t\n\t\t$counter=0;\n\t\t$arrayFieldQuery=array();\n\t\tforeach($this->fields as $field){\n\t\t\t$arrayFieldQuery[$field]=$this->types[$counter];\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\t$counter=0;\n\t\t$arrayFilters=array();\n\t\tforeach($this->filters as $filter){\n\t\t\t$arrayFilters[$this->fields[$filter[0]]]=array(\"type\"=>$this->types[$filter[0]],\"value\"=>$filter[1]);\n\t\t}\n\t\t\n\t\tif(db::getFields($this->table,$arrayFieldQuery,$arrayFilters,$this->orderQuery,$this->limit,true)){\n\t\t\t$this->pages=ceil(((int)db::getCalculatedRows())/((int)$this->maxRowsPerPage));\n\t\t\t$this->maxRows=(int)db::getCalculatedRows();\n\t\t\twhile($row=db::fetch(db::$FETCH_TYPE_ASSOC)){\n\t\t\t\t$this->addRow($row);\n\t\t\t}\n\t\t}\n\t}", "function read(){\n $query = \"SELECT * FROM \" . $this->table_name;\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt;\n }", "function db_read($con,$table,$where = 1){\n\n\tif(is_array($where)){\n\t\t$fild_value = array();\n\t\tforeach ($where as $field => $value) {\n\t\t\t$fild_value[] = \"`\".$field.\"` = '\".$value.\"'\";\n\t\t}\n\t\t$where_string = implode(\" and \", $fild_value);\n\t}else{\n\t\t$where_string = $where;\n\t}\n\n\n\t$sql = \"SELECT * FROM `$table` WHERE \".$where_string;\n\t\n\t$query = mysqli_query($con,$sql);\n\tif($query){\n\t\t$datas = array();\n\t\twhile($data = mysqli_fetch_assoc($query)){\n\t\t\t$datas[] = (object)$data;\n\t\t}\n\t\treturn $datas;\n\t}else{\n\t\treturn mysqli_error($con);\n\t}\n\treturn $sql;\n}", "function read(){\n //select all data\n $query = \"SELECT * FROM \" . $this->table_name . \" ORDER BY id\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "public function read ()\n {\n\n $query = \"SELECT type_id, type FROM \" . $this->table_namee .\" \". \"ORDER BY type_id\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n\n }", "function read(){\n \n // select all query\n $query = \"SELECT * from \" . $this->table_name . \"\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "public function readData($table,$wheres = 1){\r\n\t\t$query = \"Select * from {$table} as t join meta_data as m where $wheres and t.meta_data_id = m.meta_data_id and m.is_deleted = 0\";\r\n\t\t// echo $query;\r\n\t\treturn $this->execteQuery($query);\r\n\t}", "function getDataRowWhere($table,$fields = null,$where = null,$order = null) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadObject();\r\n\t}", "public function read() {\n // Create query\n $query = 'SELECT * FROM ' . $this->table . ' p ORDER BY Day ASC';\n \n // Prepare statement\n $stmt = $this->conn->prepare($query);\n // Execute query\n $stmt->execute();\n return $stmt;\n }", "function selectData($table, $where)\n {\n $sql = \"\";\n $record = array();\n $condition = \"\";\n foreach ($where as $key => $value) {\n $condition .= $key . \"= ? and \";\n }\n $condition = substr($condition, 0, -5);\n $sql .= \"select * from $table where $condition\";\n $result = $this->conn->prepare($sql);\n $result->execute(array_values($where));\n if ($result->rowCount() > 0) {\n $row = $result->fetch(PDO::FETCH_ASSOC);\n return $row;\n } else {\n return false;\n }\n $this->conn = null;\n }", "function readAll() {\n $query = \"SELECT \n id, name, description\n FROM\n \" . $this->table_name . \" \n ORDER BY\n name\";\n\n $stmt = $this->conn->prepare($query);\n\n //execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function read()\n {\n // select all data\n $query = \"SELECT `id`,`name` from `\" . $this->table_name . \"` order by `name`;\";\n // $stmt = $this->conn->prepare($query);\n // var_dump($stmt);\n $q= 'select * from `categories`;';\n $stmt = ($this->conn)->query($q);\n \n $stmt->execute();\n \n return $stmt;\n }", "public function read() {\n // Create query\n $query = \"SELECT * FROM \" . $this->table;\n\n // Prepare the statement\n $stmt = $this->conn->prepare($query);\n\n // Execute the prepared statement and check for errors in running it\n if ($this->runPrepStmtChkErr($stmt) === false) {\n return false;\n }\n\n // Return all rows of the table\n // Note: 'PDO::FETC_ASSOC' means only the associative, \n // and not positional (numerically indexed) array will be returned\n return $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function read(){\n //Create query\n $query = 'SELECT *\n FROM ' . $this->table . '\n ORDER BY created_at DESC';\n\n //Prepare statement\n $stmt = $this->conn->prepare();\n\n //Execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function read() {\n //Create query\n $query = 'SELECT vendor_id, latitude, longitude, time, type FROM ' . $this->table_name;\n\n //Prepare statement\n $stmt = $this->conn->prepare($query);\n\n //Execute query\n $stmt->execute();\n\n return $stmt;\n }", "function prepare_read_one($id){\n if(!isset($id)){\n return '';\n }\n $tables_sql = $this->create_table_list();\n $where_sql = $this->create_where($id);\n $column_sql = implode(', ', $this->column_list);\n return \"SELECT $column_sql FROM $tables_sql $where_sql;\";\n }", "public function read() \n {\n // Create query\n $sql = \"\n SELECT \n id,\n name,\n created_at\n FROM\n $this->table\n ORDER BY \n created_at DESC\n ;\";\n\n // Prepare statement\n $stmt = $this->conn->prepare($sql);\n\n // Execute statement\n $stmt->execute();\n \n return $stmt;\n }", "function getConditionalData($select_atrib,$conditions){\n $query = \"SELECT \";\n $comma_counter = 1;\n foreach ($select_atrib as $val){\n $query .= \"{$val}\";\n if($comma_counter < sizeof($select_atrib)){\n $query .= \",\";\n $comma_counter += 1;\n }\n\n }\n $query .= \" FROM $this->table_name WHERE \".$conditions;\n\n $result = $this->db_connect->query($query);\n if (!$result) {\n die(\"Data Retrieve failed: \" . $this->db_connect->error);\n } else {\n if ($result->num_rows > 0) {\n $data = array();\n while ($row = $result->fetch_assoc()) {\n array_push($data,$row);\n }\n return $data;\n }else{\n return null;\n }\n }\n }", "public function readTable()\n {\n $sql = \"SELECT Cubans.Id, FirstName, LastName, Gender, YearOfBirth, \n `Name`, IsInGroup FROM Cubans\n JOIN Genre ON Cubans.IdGenre=Genre.id\";\n $statement = $this->connect->prepare($sql);\n $statement->execute();\n return $statement->fetchAll();\n }", "function getData($fields, $table, $condition = null, $params = array()){\n\t\ttry {\n\t\t\tif(!$fields || empty($fields)) {\n\t\t\t\t$fields = \"*\";\n\t\t\t}\n\n\t\t\t$sql = \"SELECT $fields FROM $table\";\n\t\t\tif($condition && !empty($condition)) {\n\t\t\t\t$sql .=\" WHERE $condition\";\n\t\t\t}\n\t\t\t$query = $this->executeQuery($sql, $params);\n\t\t\t$list = $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($sql, $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $list;\n\t}", "protected function _readTable() {}", "protected function _readTable() {}", "public function filtrar(){\n\n \t\t$sql=\"select * from __________ where ;\";\n \t return $this->ejecutar($sql); \n\n }", "function read(){\n \n // select all query\n $query = \"SELECT inv.`id`, inv.`local_id`, loc.`nombre` as local_nom, inv.`producto_id`, \n pro.`codigo`, pro.`nombre`, inv.`cantidad`, inv.`minimo_stock`\n FROM `inventario_local` as inv\n JOIN `locales` as loc ON (loc.`id` = inv.`local_id`)\n JOIN `productos` as pro ON (pro.`id` = inv.`producto_id`)\n WHERE loc.`empresa_id` = 1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "protected function loadData(){\n\t\t//SELECT from \".self::TABLE_NAME.\"_data WHERE \".self::TABLE_NAME.\"_id=\".$this->id.\"\n\t\t\n\t\t//return the data\n\t\treturn array();\n\t}", "public function readTaskc(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore \n INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine WHERE stato = 2\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "public function read()\n {\n // Create query\n $query = '\n SELECT *\n FROM ' . $this->table . ' \n WHERE user_id = ?';\n \n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Bind ID\n $stmt->bindParam(1, $this->user_id);\n\n // Execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function read(){\n\n //Consulta anidada FK y PK\n $query=\"SELECT c.name as category_name, p.id, p.name, p.description, p.price, p.category_id, p.created FROM \".$this->tabla.\" p LEFT JOIN categories c ON p.category_id=c.id ORDER BY p.created DESC\";\n\n $consulta = $this->conn->prepare($query);\n $consulta->execute();\n\n return $consulta;\n\n }", "public function readTask(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore \n INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine \n WHERE stato = 1\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "public function readDatabase() {\n\t\t$q = $this->pdo->query(\"SELECT count(*) FROM `Articles`\");\n\t\t$count = $q->fetch(PDO::FETCH_ASSOC)[\"count(*)\"];\n\t\t$numFetched = 0;\n\t\t$start = 0;\n\t\t// Fetch only 50 articles at a time to limit the memory impact\n\t\twhile($numFetched < $count){\n\t\t\t$q = $this->pdo->query(\"SELECT \".$this->columns.\" FROM `Articles` LIMIT $start,100\");\n\t\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t\t$this->articles[] = $this->makeArticleFromDB($a);\n\t\t\t\t$numFetched += 1;\n\t\t\t}\n\t\t\t$start += 100;\n\t\t}\n\t}", "abstract function getSQL();", "public function ReadAll() {\r\n\t\t$sql = \"\r\n\t\tSELECT\r\n\t\tt1.id,\r\n\t\tt1.,\r\n\t\tt1.cpf,\r\n\t\tt1.email,\r\n\t\tt1.status\r\n\t\tFROM\r\n\t\tredefinicao_senha AS t1\r\n\t\t\r\n\r\n\t\t\";\r\n\t\t\r\n\t\t\r\n\t\t$DB = new DB();\r\n\t\t$DB->open();\r\n\t\t$Data = $DB->fetchData($sql);\r\n\t\t$realData;\r\n\t\tif($Data ==NULL){\r\n\t\t\t$realData = $Data;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t\r\n\t\t\tforeach($Data as $itemData){\r\n\t\t\t\tif(is_bool($itemData)) continue;\r\n\t\t\t\telse{\r\n\t\t\t\t\t$realData[] = $itemData;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$DB->close();\r\n\t\treturn $realData; \r\n\t}", "function select($where = false){\n $query=\"SELECT * FROM \". $this->tableName ;\n $separator=\" WHERE \";\n if ($where){\n foreach ( $where as $key => $value){\n\t$query .= $separator . $key . \" = '\" . $value . \"'\";\n\t$separator = \" AND \";\n }\n }\n $query .= \";\";\n \n $results = array();\n $res = $this->dbh->query($query);\n while ($row = $res->fetch_assoc()){\n array_push($results, $row);\n }\n return $results;\n }", "function read(){\n //select all data\n $query = \"SELECT\n id, name, status\n FROM\n \" . $this->table_name . \"\n ORDER BY\n id DESC\"; \n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public function read_one(){\n $query = \"SELECT * FROM {$this->table} WHERE {$this->table}.cat_id = {$this->cat_id}\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt;\n }", "public function getData()\n {\n// print_r($this->where);exit;\n $records = DB::table($this->dbTable)\n ->where($this->where)\n ->get();\n if (count($records) == 0) {\n return null;\n }\n\n return $records;\n }", "function readAll(){\n \n $query = \"SELECT * FROM \".$this->table_name.\" ORDER BY id_alternatif ASC\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n\n return $stmt;\n }", "public function select($tableName, $conditions = \"\", array $datasCond = array(), array $fieldsList = array()){\r\n //We try to perform the task\r\n try{\r\n //We check if any database is opened\r\n if (!$this->checkOpenDB()) {\r\n throw new Exception(\"There isn't any opened DataBase !\");\r\n }\r\n \r\n //Process fields to select\r\n if(count($fieldsList) == 0)\r\n $fields = \"*\";\r\n else {\r\n $fields = implode(\", \", $fieldsList);\r\n }\r\n\r\n //Generating SQL\r\n $sql = \"SELECT \".$fields.\" FROM \".$tableName.\" \".$conditions;\r\n $selectOBJ = $this->db->prepare($sql);\r\n $selectOBJ->execute($datasCond);\r\n \r\n //Preparing return\r\n $return = array();\r\n foreach($selectOBJ as $process){\r\n $result = array();\r\n \r\n //Processing datas\r\n foreach($process as $name => $data){\r\n //We save the data only if it is not an integer\r\n if (!is_int($name)) {\r\n $result[$name] = $data;\r\n }\r\n }\r\n \r\n //Saving result\r\n $return[] = $result;\r\n }\r\n \r\n //Returning result\r\n return $return;\r\n }\r\n catch(Exception $e){\r\n exit($this->echoException($e));\r\n }\r\n catch(PDOException $e){\r\n exit($this->echoPDOException($e));\r\n }\r\n }", "private function getDbData()\n\t{\n\t\t//make sure we have an id....\n\t\tif ($this->id)\n\t\t{\n\t\t\t$result = db()->getRow(\"\n\t\t\t\tSELECT *\n\t\t\t\tFROM $this->tableName\n\t\t\t\tWHERE id = '$this->id'\n\t\t\t\");\n\n\t\t\tif (is_array($result))\n\t\t\t\treturn $result;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function fetchAll(){\n $adapter = $this->adapter;\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from('flota');\n $selectString = $sql->getSqlStringForSqlObject($select);\n $data = $adapter->query($selectString, $adapter::QUERY_MODE_EXECUTE);\n \n return $data;\n }", "public static function read($where = '', $values = array()) {\n\t\t\t$sql = 'SELECT * FROM ' . static::getTableName();\n\t\t\tif ($where != '') {\n\t\t\t\t$sql = $sql . ' WHERE ' . $where;\n\t\t\t}\n\n\t\t\t$query = Bdd::$pdo->prepare($sql);\n\t\t\t$query->execute($values);\n\t\t\treturn $query->fetchAll(PDO::FETCH_CLASS, static::getClassName());\n\t\t}", "function getDataTable_Values($table_name, $where_id = \"\", $debug = FALSE)\n{\n $where_id = \"\" ? \"\" : \" where 1=1 AND \" . $where_id;\n $sql = \"SELECT * FROM {$table_name} \" . $where_id;\n if ($debug) {\n echo \"<br>\" . $sql . \"<br>\";\n }\n $res = sql($sql, $eo);\n return db_fetch_assoc($res);\n}", "function read(){\n $dbh = $this->connect();\n $sentencia = \"SELECT * FROM doctor\";\n $stmt = $dbh->prepare($sentencia);\n $stmt->execute();\n $rows = $stmt->fetchAll();\n return $rows;\n }", "function my_browse_data( $table_name , $datas ){\r\n\t\r\n\tglobal $connection;\r\n\t\r\n\t$primary_field = my_get_field_list($table_name);\r\n\tforeach($datas as $field => $value){\r\n\t\t$fieldname = $field ;\r\n\t\t$fieldvalue = $value;\r\n\t}\r\n\t\r\n\t$query = \" SELECT `\".$primary_field. \"` FROM `\".$table_name.\"` WHERE `\".$fieldname.\"` = \". $fieldvalue ;\r\n\t \r\n\t$result = my_query( $query );\r\n\tif( my_num_rows($result) > 0 ){\r\n\t\t\r\n\t\t$data = array();\r\n\t\t\r\n\t\twhile(\t$row = my_fetch_array($result) ){\r\n\t\t\t$data[] = $row[$primary_field];\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t\r\n\t}\r\n\t\r\n\treturn false;\r\n\t\r\n}", "public function read ($clauses) {\n $whereClauses = array();\n\n if (!is_array($clauses)) {\n reset($this->__fields);\n $pk = key($this->__fields);\n $clauses = array(array($pk, '=', $clauses));\n }\n\n foreach ($clauses as $clause) {\n $whereClauses[] = sprintf('%s %s :%s', $clause[0], $clause[1], $clause[0]);\n }\n\n $sql = sprintf(\n 'SELECT * FROM %s WHERE %s'\n , $this->getTableName()\n , implode(' AND ', $whereClauses)\n );\n\n $stmt = $this->__db->prepare($sql);\n\n foreach ($clauses as $clause) {\n $stmt->bindValue($clause[0], $clause[2]);\n }\n\n $stmt->execute();\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n\n foreach ($this->__fields as $k => $v) {\n $this->$k = $results[$k];\n }\n\n return $this;\n }", "public function get_data()\n {\n return $this->retrieve('SELECT * FROM isys_import LIMIT 1000;');\n }", "function createQuery() ;", "public function read()\n {\n \n // select all query\n $query = \"SELECT * FROM \" . $this->table_name . \" ORDER BY date_offer DESC\";\n \n // prepare query statement\n $stmt = $this->pdo->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "function read(){\n \n // select all query\n $query = \"SELECT * FROM `tipos_tarjetas`\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "public function ReadAll() {\n\t\t\t$sql = \"\n\t\t\t\tSELECT\n\t\t\t\t\t t1.id,\n\t\t\t\t\t t1.tipo_funcionario,\n\t\t\t\t\t t1.nome,\n\t\t\t\t\t t1.idade,\n\t\t\t\t\t t1.genero,\n\t\t\t\t\t t1.email,\n\t\t\t\t\t t1.cpf,\n\t\t\t\t\t t1.celular,\n\t\t\t\t\t t1.senha\n\t\t\t\tFROM\n\t\t\t\t\tfuncionarios AS t1\n\n\n\t\t\t\";\n\n\n\t\t\t$DB = new DB();\n\t\t\t$DB->open();\n\t\t\t$Data = $DB->fetchData($sql);\n\t\t\t$realData;\n\t\t\tif($Data ==NULL){\n\t\t\t\t$realData = $Data;\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\tforeach($Data as $itemData){\n\t\t\t\t\tif(is_bool($itemData)) continue;\n\t\t\t\t\telse{\n\t\t\t\t\t\t$realData[] = $itemData;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$DB->close();\n\t\t\treturn $realData;\n\t\t}", "public function readAll ()\n {\n\n $query = \"SELECT\n book_id,type_id,name,isbn,author,publisher,price\n FROM \". \" $this->table_name \";\n\n\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n// $row = $stmt->fetch(PDO::FETCH_ASSOC);\n return $stmt;\n }", "public function select($tablename,$condition='*'){\n if (!$this->select_db($this->_currentDB))\n return FALSE;\n \tif(!$this->_table_exists($this->_currentDB,$tablename)){\n $errmsg= sprintf(self::$_error_code_list[23],$this->_currentDB.'.'.$tablename);\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n if($condition=='*'){\n $result=$this->_select_all_in_table($this->_currentDB,$tablename);\n return $result;\n }\n if(!is_array($condition) || count($condition)!=1 ){\n $errmsg=self::$_error_code_list[19];\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n $field=key($condition);\n \tif ( ($key=$this->_field_exists($this->_currentDB,$tablename,$field)) === FALSE){\n $errmsg= sprintf(self::$_error_code_list[20], $field,$this->_currentDB.'.'.$tablename);\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n \t$datf=$this->_table_path($this->_currentDB,$tablename).$this->_data_ext;\n \t$data=$this->_select_by_field($datf,$key,$condition[$field]);\n \tif($data===FALSE){\n $errmsg=sprintf(self::$_error_code_list[21], $tablename);\n $this->_trigger_error($errmsg);\n return FALSE;\n \t}\n if($data==array()){\n return array();\n }\n $data=$this->_unescape_data($data);\n $frame_data=$this->_read_frame($this->_currentDB,$tablename);\n $data=$this->_array_combine($frame_data,$data);\n \treturn $data;\n }", "function get($_sTable, $_mWhere = NULL, $_bConnectWhereArrayWithOrInsteadOfAnd = FALSE, $_bReturnSql = FALSE) {\n $_sTable = addslashes(trim($_sTable));\n $aWhere = [];\n if(is_int($_mWhere)) {\n $aWhere[] = sprintf('`%s` = %u', extractPrimaryKey($_sTable), $_mWhere);\n } elseif($_mWhere !== NULL) {\n if(is_array($_mWhere)) {\n if($_bConnectWhereArrayWithOrInsteadOfAnd) {\n $aWhereOrParts = [];\n foreach($_mWhere as $sWhere) {\n $aWhereOrParts[] = '`'.$_sTable.'`.'.trim($sWhere);\n }\n $aWhere[] = implode(' OR ', $aWhereOrParts);\n } else {\n foreach($_mWhere as $sWhere) {\n $aWhere[] = '`'.$_sTable.'`.'.trim($sWhere);\n }\n }\n } else {\n $aWhere[] = '`'.$_sTable.'`.'.trim((string)$_mWhere);\n }\n }\n $sSql = sprintf('SELECT * FROM `%s` %s %s ORDER BY `dCreate` DESC', $_sTable, count($aWhere) > 0 ? 'WHERE' : '', implode(' AND ', $aWhere));\n if($_bReturnSql) {\n return $sSql;\n } else {\n if(($oResult = query($sSql))) {\n if($oResult->num_rows > 0) {\n $aReturn = [];\n while(($aRow = $oResult->fetch_assoc())) {\n $aReturn[] = $aRow;\n }\n return $aReturn;\n }\n }\n return [];\n }\n}", "protected function export_rows() {\n\t\t\t// Check if table exists to prevent SQL injection.\n\t\t\t$wpda_dictionary_exists = new WPDA_Dictionary_Exist( $this->schema_name, $this->table_list );\n\t\t\tif ( ! $wpda_dictionary_exists->table_exists() ) {\n\t\t\t\twp_die();\n\t\t\t}\n\n\t\t\t// Get table columns and data types.\n\t\t\t$wpda_list_columns = WPDA_List_Columns_Cache::get_list_columns( $this->schema_name, $this->table_list );\n\t\t\t$table_columns = $wpda_list_columns->get_table_columns();\n\n\t\t\t// Create array for fast column_name based access.\n\t\t\t$column_data_types = $this->column_data_types( $table_columns );\n\n\t\t\t// Get primary key columns.\n\t\t\t$table_primary_key = $wpda_list_columns->get_table_primary_key();\n\n\t\t\t// Check validity request. All primary key columns must be supplied. Return error if\n\t\t\t// primary key columns are missing.\n\t\t\tforeach ( $table_primary_key as $key ) {\n\t\t\t\tif ( ! isset( $key ) ) {\n\t\t\t\t\t$this->wrong_arguments();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tglobal $wpdb;\n\n\t\t\t// Build where clause based on primary key.\n\t\t\t$where = '';\n\n\t\t\t// Use first column of the primary key to loop through arguments. Add additional arguments in the loop.\n\t\t\t// A mismatch in the number of argument is possible as long as the columns match based on the first column\n\t\t\t// of the primary key. Other mismatches won't be taken into account.\n\t\t\t$count_pk = count( $_REQUEST[ $table_primary_key[0] ] );\n\t\t\tfor ( $i = 0; $i < $count_pk; $i ++ ) {\n\t\t\t\t$and = '';\n\t\t\t\tforeach ( $table_primary_key as $key ) {\n\t\t\t\t\t$and .= '' === $and ? '(' : ' and ';\n\t\t\t\t\tif ( $this->is_numeric( $column_data_types[ $key ] ) ) {\n\t\t\t\t\t\t$and .= $wpdb->prepare( \"`$key` = %d\", $_REQUEST[ $key ][ $i ] ); // WPCS: unprepared SQL OK.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$and .= $wpdb->prepare( \"`$key` = %s\", stripslashes( $_REQUEST[ $key ][ $i ] ) ); // WPCS: unprepared SQL OK.\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$and .= '' === $and ? '' : ')';\n\n\t\t\t\t$where .= '' === $where ? ' where ' : ' or ';\n\t\t\t\t$where .= $and;\n\t\t\t}\n\n\t\t\t$this->header( $this->table_list );\n\t\t\t$this->db_begin();\n\t\t\t$this->insert_rows( $this->table_list, $where );\n\t\t\t$this->db_end();\n\t\t}", "public function createDataRow()\n\t{\n\t\t$row = array() ;\n\t\tforeach( $this->values as $field=>$value )\n\t\t{\n\t\t\t$row[$field] = $this->$field ;\n\t\t}\n\t\treturn $row ;\n\t}", "function GrabData($table, $column, $where_column, $where)\r\n{\r\n $input = $where;\r\n $pdo = connect();\r\n $sql= 'SELECT ' . $column . ' FROM ' . $table . ' where ' . $where_column . ' = :attribute';\r\n $prepare = oci_parse($pdo,$sql);\r\n oci_bind_by_name($prepare, ':attribute', $input);\r\n if(oci_execute($prepare))\r\n {\r\n $res = oci_fetch_array($prepare, OCI_ASSOC+OCI_RETURN_NULLS);\r\n if ($res != null)\r\n {\r\n return $res;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n $e = oci_error($prepare); \r\n echo $e['message']; \r\n }\r\n \r\n}", "public function get(){\n $this->query = \"SELECT \".$this->select.\" FROM $this->table WHERE \";\n $wheres = $this->mergeWhere().\" OR \".$this->mergeOrWhere();\n $query = $this->query.$wheres;\n $statement = $this->prepare($query);\n $statement->execute($this->bindings);\n return $statement->fetchAll();\n }", "static function get_data($table) {\r\n $rekete = \"SELECT * FROM \" . $table . \" ORDER BY created DESC\";\r\n $result = Functions::commit_sql($rekete, \"\");\r\n if (Functions::is_void($result))\r\n return false;\r\n else\r\n return $result;\r\n }", "function Get_data_byid($table,$where = '') {\n\t\treturn $this->db->query(\"SELECT * from $table $where;\");\t\n\t}", "function read(){\n $query = \"SELECT\n pantry_item_id, item_name, user_id\n FROM\n \" . $this->table_name . \";\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "function get_table_content($db, $table, $handler, $what) {\n\tglobal $RAD_dbi;\n\n $num_fields=0;\n $fld_results = sql_list_fields($table, $RAD_dbi);\n while($row=sql_fetch_array($fld_results, $RAD_dbi)) {\n\tif ($row[0]==$A_fields[($num_fields-1)]) continue;\n\tif ($row[\"COLUMN_NAME\"]!=\"\") $A_fields[$num_fields]=$row[\"COLUMN_NAME\"];\n\t$A_fields[$num_fields]=$row[\"Field\"];\n\tif ($row[\"DATA_TYPE\"]!=\"\") $A_field_type[$num_fields]=$row[\"DATA_TYPE\"];\n\telse $A_field_type[$num_fields]=$row[\"Type\"];\n\tif ($row[\"DATA_LENGTH\"]!=\"\") $A_field_len[$num_fields]=$row[\"DATA_LENGTH\"];\n\telse $A_field_len[$num_fields]=$row[\"Length\"];\n\tif ($row[\"DATA_DEFAULT\"]!=\"\") $A_field_default=$row[\"DATA_DEFAULT\"];\n\telse $A_field_default=$row[\"Default\"];\n\t$num_fields++;\n }\n\n $result = sql_query(\"SELECT * FROM $table\", $RAD_dbi);\n $i = 0;\n while($row = sql_fetch_array($result, $RAD_dbi)) {\n\tif ($what==\"data1\" && $i>0) return (true);\n set_time_limit(60); // HaRa\n $table_list = \"(\";\n for($j=0; $j<$num_fields;$j++)\n $table_list .= $A_fields[$j].\", \";\n $table_list = substr($table_list,0,-2);\n $table_list .= \")\";\n if(isset($GLOBALS[\"showcolumns\"]))\n $schema_insert = \"INSERT INTO $table $table_list VALUES (\";\n else\n $schema_insert = \"INSERT INTO $table VALUES (\";\n for($j=0; $j<$num_fields;$j++) {\n if(!isset($row[$j]))\n $schema_insert .= \" NULL,\";\n elseif($row[$j] != \"\")\n $schema_insert .= \" '\".addslashes($row[$j]).\"',\";\n else\n $schema_insert .= \" '',\";\n }\n $schema_insert = ereg_replace(\",$\", \"\", $schema_insert);\n $schema_insert .= \")\";\n $handler(trim($schema_insert));\n $i++;\n }\n return (true);\n}", "function readReal(){ \n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=1 LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "protected function _createColumnQuery()\n\t{\n\t\n\t}", "public function getCustomTableData()\n {\n $connection = $this->resourceConnection->getConnection();\n $select = $connection->select();\n $select->from(self::TABLE_NAME, ['table_id', 'name', 'content']);\n $result = $connection->fetchAll($select);\n\n return $result;\n }", "abstract public function prepareSelect();", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "public static function getAll(){\n\t\t$sql = \"select * from \".self::$tablename;\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "public function Select($cond)\r\n\t\r\n {\r\n\t\tglobal $db;\r\n if($cond==\"\")\r\n {\r\n $sql = \"SELECT * FROM \".$this->TableName;\r\n } else\r\n {\t\r\n\t\t \t\r\n\t\t $sql = \"SELECT * FROM \". $this->TableName.\" \".$cond;\r\n }\r\n try{\r\n $query = $db->prepare($sql);\r\n $query->execute();\r\n $arr['rows'] = $query->fetchAll(PDO::FETCH_ASSOC);\r\n $arr['err'] = false;\r\n } catch(PDOException $e){\r\n $arr['err'] = true;\r\n $arr['msg'] = $e->getMessage(); \r\n } \r\n return $arr;\r\n }", "public function readAll(){\n $rq = \"SELECT * FROM Objets\";\n $stmt = $this->pdo->prepare($rq);\n $data = array();\n if(!$stmt->execute($data)){\n throw new Exception($pdo->errorInfo());\n }\n return $result = $stmt->fetchAll();\n }", "function getDataListWhere($table,$fields = null,$where = null,$order = null,$limit_start,$limit_limit) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order,$limit_start,$limit_limit);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadAssocList();\r\n\t}", "public function read() {\n $query = 'SELECT \n g.name as groupName,\n i.id, \n i.firstName,\n i.lastName,\n i.group_id\n FROM\n ' . $this->table . ' i\n LEFT JOIN\n groups g ON i.group_id = g.id\n ORDER BY \n i.firstName ASC' ;\n\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt;\n }", "private function fetchDataFromDB($sql){\r\n $dbOps = new DBOperations();\r\n $dataFromDB = $dbOps->fetchData($sql);\r\n return $dataFromDB; \r\n }", "public function read(){\n try {\n // query to get all users\n $this->_query = \"SELECT * FROM \" . $this->_dbtable;\n\n //preparing query\n $statement = $this->_conn->prepare($this->_query);\n\n // executing query\n $statement->execute();\n\n return $statement;\n }\n catch(PDOException $ex){\n echo \"Error\" . $ex->getMessage();\n }\n }", "public function readTabla() {\r\n $query = 'SELECT * FROM ' . $this->tabla;\r\n\r\n\r\n \r\n\r\n $sentencia = $this->con->prepare($query);\r\n\r\n $sentencia->execute();\r\n\r\n return $sentencia;\r\n }", "function ReadAll(){\n\n\t\t//Instanciamos y nos conectamos a la bd\n\t\t$Conexion = floopets_BD::Connect();\n\t\t$Conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t//Crear el query que vamos a realizar\n\t\t$consulta = \"SELECT tipo_denuncia.*,denuncia.* FROM denuncia INNER JOIN tipo_denuncia ON denuncia.td_cod_tipo_denuncia=tipo_denuncia.td_cod_tipo_denuncia WHERE denuncia.de_estado='Pendiente'\";\n\t\t$query = $Conexion->prepare($consulta);\n\t\t$query->execute();\n\t\t//Devolvemos el resultado en un arreglo\n\t\t//Fetch: es el resultado que arroja la consulta en forma de un vector o matriz segun sea el caso\n\t\t//Para consultar donde arroja mas de un dato el fatch debe ir acompañado con la palabra ALL\n\t\t$resultado = $query->fetchALL(PDO::FETCH_BOTH);\n\t\treturn $resultado;\n\t\tfloopets_BD::Disconnect();\n\t}", "public function readValoraciones(){\n $sql='SELECT valoracion, producto.nombre as producto, cliente.nombre as cliente FROM cliente, producto, valoraciones WHERE producto.idProducto=valoraciones.idProducto AND cliente.idCliente=valoraciones.idCliente and producto.idProducto = ?';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n }", "public function prepareData($params){\r\n\t\t$available_data = \\DB::table($this->table);\r\n\t\t$recordsTotal = $available_data->count();\r\n\r\n\t\t// seleted columns\r\n\t\t// $select = array('u.*', 'g.name AS gender', 'r.name AS role_name', 'r.id AS role_id');\r\n\t\t// if(@$params['selected_columns'] != ''){\r\n\t\t// \t$select = explode(',', $params['selected_columns']);\r\n\t\t// }\r\n\r\n\t\t// join here\r\n\t\t// $available_data = $available_data->select($select);\r\n\r\n\t\t// condition here\r\n\t\t$filters = $params['filter'];\r\n\t\tforeach($filters as $column => $items){\r\n\t\t\tforeach($items as $item){\r\n\t\t\t\tif(is_array($item)){\r\n\t\t\t\t\tif(!empty($item['value'])){\r\n\t\t\t\t\t\t$available_data = $available_data->where($column, $item['op'], $item['value']);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\tif(!empty($items['value'])){\r\n\t\t\t\t\tif(strtolower($items['op']) == 'like'){\r\n\t\t\t\t\t\t$items['value'] = '%' . $items['value'] . '%';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(strtolower($items['op']) != 'in'){\r\n\t\t\t\t\t\t$available_data = $available_data->where($column, $items['op'], $items['value']);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$available_data = $available_data->whereIn($column, $items['value']);\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\treturn array(\r\n\t\t\t'recordsTotal' => $recordsTotal,\r\n\t\t\t'data' => $available_data,\r\n\t\t);\r\n\t}", "public function getData(){\n $sql = \"SELECT*FROM $this->tablename\";\n\n $result = mysqli_query($this->conn, $sql);\n if(mysqli_num_rows($result)>0){\n return $result;\n }\n\n }", "public function readAll()\n {\n $sql = 'SELECT id_producto, nombre_producto, descripcion_producto, precio_producto, imagen_producto, stock, nombre_marca, estado_producto \n FROM productos INNER JOIN marca USING(id_marca) \n ORDER BY nombre_producto';\n $params = null;\n return Database::getRows($sql, $params);\n }", "abstract public function get_rows();", "abstract public static function columnData();", "public function database_read($table, $requestArray)\n\t{\n\t\t$returnArray\t\t\t\t\t\t\t\t= array();\n\t\t$returnArray['result']\t\t\t\t\t= false;\n\n\t\tif (isset($requestArray['ID']))\n\t\t\t$tableQuery \t\t\t= \"SELECT * FROM \".$table.\" WHERE ID=\".$requestArray['ID'];\n\t\telse\n\t\t\t$tableQuery \t\t\t= \"SELECT * FROM \".$table.\" WHERE \".$requestArray['FIELDNAME'].\"='\".$requestArray['FIELDCRITERIA'].\"'\";\n\n\t\tunset($requestArray['FIELDNAME']);\n\t\tunset($requestArray['FIELDCRITERIA']);\n\n\t\t$selectQuery\t= $this->db_user->Execute($tableQuery);\n\t\tif ($selectQuery->RecordCount() > 0)\n\t\t{\n\t\t\t$returnArray['result']\t\t\t\t\t= true;\n\t\t\tfor ($i=0; $i < $selectQuery->FieldCount(); $i++)\n\t\t\t\t$returnArray['field'.$i] = $selectQuery->fields[$i];\n\t\t}\n\n\t\treturn $returnArray;\n\t}", "public function readAll(){\r\n $query = \"SELECT * FROM docente;\";\r\n $statement = $this->cdb->prepare($query);\r\n $statement->execute();\r\n $rows = $statement->fetchAll(\\PDO::FETCH_OBJ);\r\n return $rows; \r\n }", "function read($keys,$extra_cols='',$join='')\n\t{\n\t\tif (!parent::read($keys,$extra_cols,$join))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (($id = (int)$this->data[$this->db_key_cols[$this->autoinc_id]]) && $this->customfields &&\n\t\t\t($cfs = $this->read_customfields($id)))\n\t\t{\n\t\t\t$this->data = array_merge($this->data,$cfs[$id]);\n\t\t}\n\t\treturn $this->data;\n\t}", "public function read () {\n $pdo = $this->_backend->getPDO();\n\n /* TODO: selection criteria.\n // New FileMaker find command.\n if (count($this->_findCriteria) > 0) {\n // This search query will contain criterion.\n $findCommand = $FM->newFindCommand($this->_layout);\n foreach ($this->_findCriteria as $fieldName => $testValue) {\n $findCommand->addFindCriterion($fieldName, $testValue);\n }\n } else {\n // No criteria, so 'find all'.\n $findCommand = $FM->newFindAllCommand($this->_layout);\n }\n\n // Script calling.\n if ($this->_postOpScript !== NULL) {\n $findCommand->setScript($this->_postOpScript, $this->_postOpScriptParameter);\n }\n if ($this->_preOpScript != NULL) {\n $findCommand->setPreCommandScript($this->_preOpScript, $this->_preOpScriptParameter);\n }\n */\n\n $findSkip = $this->_readOffset;\n $findMax = $this->_readCount;\n\n // Find the number of records in this table.\n // This may not be a cheap operation, may be ok in some databases.\n $statement = $pdo->prepare('SELECT COUNT(*) FROM `'. $this->_validatedTable);\n try {\n $statement->execute();\n } catch (\\PDOException $e) {\n throw new PdoResponseException($e);\n }\n $result = $statement->fetch(\\PDO::FETCH_NUM);\n $tableRecordCount = $result[0];\n $statement->closeCursor();\n\n if ($findSkip == -1) {\n // If we are to skip to the end ...\n $findSkip = $tableRecordCount - $findMax;\n $findSkip = max(0, $findSkip); // Ensure not less than zero.\n }\n\n // Query.\n $statement = $pdo->prepare('SELECT * FROM `'. $this->_validatedTable . '` LIMIT ? OFFSET ?');\n $statement->bindParam(1, intval($findMax), \\PDO::PARAM_INT);\n $statement->bindParam(2, intval($findSkip), \\PDO::PARAM_INT);\n try {\n $statement->execute();\n } catch (\\PDOException $e) {\n throw new PdoResponseException($e);\n }\n\n $restfmMessage = new \\RESTfm\\Message\\Message();\n\n $this->_parseMetaField($restfmMessage, $statement);\n\n $fetchCount = 0;\n foreach ($statement->fetchAll() as $record) {\n if ($this->_uniqueKey === NULL) {\n $recordID = NULL;\n } else {\n $recordID = $this->_uniqueKey . '===' . $record[$this->_uniqueKey];\n }\n\n $restfmMessage->addRecord(new \\RESTfm\\Message\\Record(\n $recordID,\n NULL,\n $record\n ));\n $fetchCount++;\n }\n\n $statement->closeCursor();\n\n // Info.\n $restfmMessage->setInfo('tableRecordCount', $tableRecordCount);\n $restfmMessage->setInfo('foundSetCount', $tableRecordCount);\n $restfmMessage->setInfo('fetchCount', $fetchCount);\n\n return $restfmMessage;\n }", "public function getDataWithTypeDb() {}", "function retriveDataRow(){\r\n\t\t$coal_name = $this->getName();\r\n\t\tmysql_query(\"SET NAMES 'latin2'\");\r\n\t\tif(gettype($this->data) == 'boolean' && !is_null($coal_name)){\r\n\t\t\t$query = \"SELECT * FROM \". TBL_COALITION .\r\n \" WHERE nazwa = '$coal_name'\";\r\n\t\t\tif($result = mysql_query($query)){\r\n\t\t\t\tif(mysql_num_rows($result) == 0){\r\n\t\t\t\t\t$this->data = NULL;\r\n\t\t\t\t\t$this->coalition = NULL;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\r\n\t\t\t\t\t$this->data = $row;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$this->data = NULL;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private function Select()\n {\n $return = false;\n $action = $this->Action();\n $columns = $this->Columns();\n $table = $this->Table();\n $where = (Checker::isArray($this->Where(), false))?$this->Where():array(Where::QUERY => \"\", Where::VALUES => array());\n $order = (Checker::isString($this->Order()))?$this->Order():\"\";\n $limit = (Checker::isInt($this->Limit()))?\" LIMIT \".$this->Limit():\"\";\n if($columns && $table && Checker::isArray($where, false))\n {\n $return[Where::QUERY] = \"$action $columns FROM $table\".$where[Where::QUERY].\"$order$limit\";\n\n if(Checker::isArray($where, false) && isset($where[Where::VALUES])) $return[Where::VALUES] = $where[Where::VALUES];\n else $return[Where::VALUES] = array();\n }\n return $return;\n }", "abstract function get_sql_filter($data);", "protected function prepareSelectStatement() {}", "function tableData(){\n\t\t$entity_type = in(\"entity_type\");\t\t\n\t\t$table = $entity_type()->getTable();\n\t\t$test = in('test');\n\n\t\t// Table's primary key\n\t\t$primaryKey = 'id';\n\n\t\t// Array of database columns which should be read and sent back to DataTables.\n\t\t// The `db` parameter represents the column name in the database, while the `dt`\n\t\t// parameter represents the DataTables column identifier. In this case simple\n\t\t// indexes\n\t\t$columns = array(\n\t\t\tarray( \t'db' => 'id',\n\t\t\t\t\t'dt' => 0 \n\t\t\t\t ),\n\t\t\tarray( \t'db' => 'created', \n\t\t\t\t\t'dt' => 1, \n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t),\n\t\t\tarray( \t'db' => 'updated',\n\t\t\t\t\t'dt' => 2,\n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t ),\n\t\t);\n\t\t\n\t\t$additional_columns = self::getAdditionalFields( $entity_type );\n\t\t\n\t\t$columns = array_merge( $columns, $additional_columns );\n\n\t\t// SQL server connection information\n\t\t$sql_details = array(\n\t\t\t'user' => 'root',\n\t\t\t'pass' => '7777',\n\t\t\t'db' => 'ci3',\n\t\t\t'host' => 'localhost'\n\t\t);\n\t\n\t\trequire( 'theme/admin/scripts/ssp.class.php' );\t\t\n\t\t$date_from = in(\"date_from\");\n\t\t$date_to = in(\"date_to\");\n\t\t$extra_query = null;\n\t\tif( !empty( $date_from ) ){\n\t\t\t$stamp_from = strtotime( $date_from );\n\t\t\t$extra_query .= \"created > $stamp_from\";\n\t\t}\n\t\tif( !empty( $date_to ) ){\n\t\t\t$stamp_to = strtotime( $date_to.\" +1 day\" ) - 1;\n\t\t\tif( !empty( $extra_query ) ) $extra_query .= \" AND \";\n\t\t\t$extra_query .= \"created < $stamp_to\";\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\techo json_encode(\n\t\t\tSSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns, $extra_query )\n\t\t);\n\t}", "public function getSingleData($param, $table_name, $cond){\n return $this->getStatement(\"select {$param} from {$table_name} {$cond}\");\n }", "function FetchByID()\n\t{\n\t\tglobal $dal_info;\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\n\t\t$dal_where = \"\";\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\t$command = 'if(isset($this->'.$fld['varname'].')) { ';\n\t\t\t$command.= '$this->Value[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\t$command.= ' }';\n\t\t\t\n\t\t\teval($command);\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$dal_where.= $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// cleanup\n\t\t$this->Reset();\n\t\t// construct and run SQL\n\t\tif ($dal_where)\n\t\t\t$dal_where = \" where \".substr($dal_where, 0, -5);\n\t\t\t\n\t\t$dalSQL = \"select * from \".$this->_connection->addTableWrappers( $this->m_TableName ).$dal_where;\n\t\treturn $this->_connection->query( $dalSQL );\n\t}", "public function select($table, $fields, $where, $order, $start);" ]
[ "0.68350196", "0.6540928", "0.64811474", "0.64436364", "0.64034134", "0.63169956", "0.62722605", "0.625203", "0.62485695", "0.62191164", "0.6210949", "0.6207055", "0.61821973", "0.61774945", "0.6151999", "0.614735", "0.6140958", "0.61199963", "0.61183214", "0.6094648", "0.60923594", "0.6075578", "0.6072964", "0.6066998", "0.60519487", "0.6017986", "0.59954", "0.5925438", "0.5924159", "0.5878447", "0.5873041", "0.5871024", "0.5854903", "0.5818157", "0.58130646", "0.5796498", "0.578395", "0.57804346", "0.5777549", "0.5769849", "0.57674176", "0.57622176", "0.5756282", "0.57483965", "0.5748198", "0.57395977", "0.57323784", "0.57304776", "0.57292986", "0.5720507", "0.57168543", "0.5706362", "0.57037365", "0.5701393", "0.56969756", "0.5695036", "0.56922907", "0.569075", "0.56807214", "0.56707805", "0.56488264", "0.5642794", "0.5626763", "0.56165946", "0.5603676", "0.5603322", "0.5595797", "0.55920565", "0.5589871", "0.558762", "0.5585195", "0.55810213", "0.5565595", "0.55635023", "0.5556179", "0.55517226", "0.5550852", "0.5545225", "0.55433106", "0.55384135", "0.55247986", "0.5519079", "0.551858", "0.55168396", "0.5516119", "0.55130035", "0.55030614", "0.55029476", "0.55026114", "0.5500047", "0.54865706", "0.5485166", "0.547569", "0.54747605", "0.54682606", "0.54635805", "0.54593414", "0.545859", "0.5456161", "0.5454339", "0.54533076" ]
0.0
-1
read() Update datas in Data Base UPDATE table SET col1='val1', col2='val2' WHERE condition
public function update($id) { debugInfo(get_class($this)."->read($id)"); // add where _status not DELETED $this->where('id', '=', $id); // SELECT $this->_query = $this->_update(); $return = $this->_execute(false); debug('->update(), $return', $return); return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "public function update(){\n $set_param_cols_vals = $this->iniParamvalues($this->data, \",\");\n // check for extra set_column\n $extra_set = ($this->custom !== NULL) ? $this->custom : NULL ;\n if($this->custom !== NULL){\n if($this->data !== NULL){\n if(!empty($this->where)){\n $this->custom = \",$this->custom\"; \n }\n else{\n $this->custom = 'WHERE '.$this->custom; \n }\n }\n else{\n if(empty($this->where)){\n $this->custom = 'WHERE '.$this->custom; \n }\n else{\n $this->custom = $this->custom; \n }\n } \n }\n // set where cols param values\n $set_param_where = $this->update_iniParamvalues($this->where, \"and\", \"WHERE\");\n\n $sql = \"UPDATE \".self::$table.\" SET $set_param_cols_vals $this->custom $set_param_where\";\n\n // prepare sql statement\n $this->query = $this->conn->prepare($sql);\n\n // bind cols_vals param values\n $this->update_cusBindparam($this->data);\n \n // bind where param values\n if(!empty($this->data)){\n $this->cusBindparam($this->where,count($this->data)+1); \n }\n else if(!empty($this->where)){\n $this->cusBindparam($this->where); \n }\n // execute query\n $execute = $this->query->execute();\n\n if(!$execute){\n return false;\n }\n else{\n return true;\n }\n }", "public function update() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"UPDATE \".$this->getTableName().\"\n\t\t\t\t SET \";\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 .= (($fl) ? \"\" : \", \").$column.\" = \".((is_bool($val)) ? (($val) ? \"TRUE\" : \"FALSE\") : ((is_null($val)||($val === \"\")) ? \"null\" : \"'\".$val.\"'\"));\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\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 update() {\n $Sql = \"UPDATE \" . $this->tableName[0] . \" SET \";\n foreach ($this->fieldListArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_', \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 2);\n $Sql = $Sql . \" WHERE \";\n foreach ($this->conditionArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_' AND \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 4);\n //echo $Sql;\n return mysqli_query($this->dataBaseConnect->getConnection(), $Sql);\n }", "function update_data($table,$col,$id,$data,$cn){\n $str=\"update `$table` set \";\n $cnt=1;\n foreach($data as $key=>$value){\n $str.=\"`$key`='\".addslashes($value).\"'\";\n if($cnt++<count($data))\n $str.=\",\";\n }\n $str.=\" where {$col}=$id\";\n $cn->query($str);\n\n }", "function adv_update($table, array $data, array $where);", "public function update($conn, $data, $where){\n\t\t$sql_update=\"\";\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$field_info=$this->fields[$field];\n\t\t\tif ($sql_update!=\"\"){\n\t\t\t\t$sql_update = $sql_update . \", \";\n\t\t\t}\n\t\t\t$sql_update = $sql_update . \"`\" . $field . \"` = \";\n $sql_update = $sql_update . $this->quote($conn, $val, $field_info[\"type\"]);\t\t\t\n\t\t}\n\t\t\n\t\t$sql_where=$this->getWhereClause($conn, $where);\n\t\t$sql=\"UPDATE `\" . $this->table_name . \"` SET \" . $sql_update;\n\t\tif ($sql_where!=\"\"){\n\t\t\t$sql = $sql . \" WHERE \" . $sql_where;\n\t\t} \n\t\treturn $conn->exec($sql);\n\t}", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "public function SQL_UPDATE() {\r\n\t}", "function updateData($table, $where, $fields)\n {\n $sql = \"\";\n $condition = \"\";\n $val = \"\";\n foreach ($where as $key => $value) {\n $condition .= \"$key = ?\";\n }\n foreach ($fields as $key => $value) {\n $val .= \"$key = ? , \";\n }\n $val = substr($val, 0, -2);\n $sql .= \"update $table set $val where $condition\";\n // print_r($sql);\n // exit;\n $result = $this->conn->prepare($sql);\n $temp = array_merge(array_values($fields), array_values($where));\n if ($result->execute($temp)) {\n return true;\n } else {\n return false;\n }\n $this->conn = null;\n }", "function my_update_record( $table_name , $primary_key , $data_id , $datas ){\r\n\r\n\tglobal $connection;\r\n\r\n\t$build_query = \" UPDATE `\".$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$query = rtrim( trim($build_query) , \",\" );\r\n\t\r\n\t$update_query = $query .\" WHERE `\".$primary_key.\"` = \". $data_id ; \r\n \r\n\t$result = my_query( $update_query );\r\n\t \r\n\treturn $connection->affected_rows ; \r\n\r\n}", "public function updateData()\n {\n try {\n// echo \"<pre>\";\n// print_r($this->where);\n// print_r($this->insertUpdateArray);\n// exit;\n DB::table($this->dbTable)\n ->where($this->where)\n ->update($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n }", "public final function update() {\n\t\t$properties = self::getProperties($this);\n\t\t$columns = array_keys($properties);\n\t\t$values = array_values($properties);\n\n\t\t$setArray = array();\n\t\tfor ($i = 0; $i < count($properties); $i++) {\n\t\t\t$column = $columns[$i];\n\t\t\tif (strcmp($column, $this->primaryField) == 0 ||\n\t\t\t\tin_array($column, $this->uniqueFields)\n\t\t\t) {\n\t\t\t\t// Remove the value for binding\n\t\t\t\tunset($values[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setArray[] = $column . \" = ?\";\n\t\t}\n\n\t\t$sql = \"\n\tUPDATE\n\t\t\" . $this->table . \"\n\tSET\n\t\t\" . implode(\", \", $setArray) . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\t\t// Adds the primary key binding\n\t\t$values[] = $this->{$this->primaryField};\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute($values);\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "public function update() {\n global $db;\n $this->_preupdate();\n $sql_set = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_set .= \"`\".addslashes($key).\"`=\";\n $sql_set .= \"?,\";\n $data[] = $value;\n }\n $sql_set = substr($sql_set, 0, -1);\n\n $query = \"UPDATE {$this->table} SET $sql_set WHERE \".$this->id_field.\"=?;\";\n $data[] = $this->{'get'.$this->id_field}();\n\n $result = $db->query($query,$data);\n $this->_postupdate($result);\n return $result;\n }", "public function update( $sql, $params=array());", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "function update_data($where,$data,$table){\n\t\t$this->db->where($where);\n\t\t$this->db->update($table,$data);\n\t}", "public function db_update() {}", "function update_data($where,$data,$table){\n $this->db->where($where);\n $this->db->update($table,$data);\n }", "public function update($table, $data){//,$id\n $q=\"UPDATE `$table` SET \";\n\n $r=\"\";\n foreach($data as $key=>$val){\n $r.=\"`\".$key.\"`\".\"='$val',\";\n }\n $r=rtrim($r,\", \");\n //echo $r;\n $q1 = $q .$r. ' WHERE '.\"1\";\n\n \n if($q1)\n {\n $this->database_query($q1);\n }\n}", "public function update($tblname, array $set_val_cols, $cod_val_cols){\n\t\t\n\t\t//append set_val_cols associative array elements \n\t\t$i=0;\n\t\tforeach($set_val_cols as $key=>$value) {\n\t\t\t$set[$i] = $key.\" = '\".$value.\"'\";\n\t\t $i++;\n\t\t}\n\n\t\t$Stset = implode(\", \",$set);\n\n/*\t\t//append cod_val_cols associative array elements\n\t\t$i=0;\n\t\tforeach($cod_val_cols as $key=>$value) {\n\t\t\t$cod[$i] = $key.\" = '\".$value.\"'\";\n\t\t $i++;\n\t\t}\n\n\t\t$Stcod = implode(\" AND \",$cod);\n*/\n\t\t//Update operation\n\t\tif($this->connection->query(\"UPDATE $tblname SET $Stset WHERE $cod_val_cols\") === TRUE){\n\t\t\tif(mysqli_affected_rows($this->connection)){\n\t\t\t\t#echo \"Record updated successfully<br>\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t#echo \"The Record you want to updated is no loger exists<br>\";\n\t\t\t}\n\t\t}else{\n\t\t\t#echo \"Error to update\".$this->connection->error;\n\t\t}\n\t}", "function update($table, $id, $data){\n global $conn;\n$sql = \"UPDATE $table SET \";\n\n$i = 0;\n foreach ($data as $key => $value){\n if($i === 0){\n $sql = $sql . \" $key=?\"; \n } else{\n $sql = $sql . \", $key=?\";\n }\n$i++;\n}\n\n$sql = $sql . \" WHERE id=?\";\n$data['id'] = $id;\n$stmt = executeQuery($sql, $data);\nreturn $stmt->affected_rows;\n}", "public function queryUpdate($table, $data, $where) : int;", "public function update(array $param = array('table'=>'','data'=>[],'condition'=>[])) {\n\n // (REQUIRED) name of table\n $tableName = isset($param['table']) ? $param['table'] : '';\n // (REQUIRED) associated array of columns and data e.g. ['column'=>'value','column'=>'value',...]\n $arrData = isset($param['data']) ? $param['data'] : [];\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 if( count( $arrData ) < 1 ) {\n echo \"data missing\";\n die;\n }\n\n $insert_values = [];\n $strColumns = \"\";\n $strWhere = \"\";\n\n if( count( $arrData ) > 0 ) {\n foreach($arrData as $key => $val){\n $strColumns .= \" `\".$key.\"` = ?, \";\n array_push($insert_values,$val);\n }\n $strColumns = substr($strColumns, 0, -2);\n }\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, -4);\n }\n \n\n $strQry = \"UPDATE `\".$tableName.\"` SET \" . $strColumns . $strWhere . \";\";\n\n // print_r( $strQry ); \n // print_r( $insert_values ); die;\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 updated with same value you will get zero\n // if( $count > 0 ) {\n // echo $count . ' record(s) updated successfully.';\n return [\n 'success' => true,\n 'message' => 'Record(s) updated successfully.',\n 'data' => null,\n 'code' => '001'\n ];\n // } else {\n // return [\n // 'success' => false,\n // 'message' => 'fails to get record(s)',\n // 'data' => null,\n // 'code' => '002'\n // ];\n // }\n } else {\n return [\n 'success' => false,\n 'message' => 'fails to get record(s)',\n 'data' => null,\n 'code' => '003'\n ];\n }\n $this->stmt = null;\n }", "function dbRowUpdate($table_name, $form_data, $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 key word\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // start the actual SQL statement\n $sql = \"UPDATE \".$table_name.\" SET \";\n\n // loop and build the column /\n $sets = array();\n foreach($form_data as $column => $value)\n {\n $sets[] = \"`\".$column.\"` = '\".$value.\"'\";\n }\n $sql .= implode(', ', $sets);\n\n // append the where statement\n $sql .= $whereSQL;\n\n // run and return the query result\n $q = $this->conn->prepare($sql);\n \n return $q->execute() or die(print_r($q->errorInfo()));\n}", "public function update($data, $table, $where) {\n $link = mysqli_connect($this->db_host, $this->db_user, $this->db_pass,$this->db_name);\n foreach ($data as $column => $value) {\n $sql = \"UPDATE $table SET $column = $value WHERE $where\";\n mysqli_query($link, $sql) or die(mysqli_error($link));\n }\n return true;\n }", "public function updateRow($data)\r\n\t{\r\n\t\t$data = (array)$data;\r\n\t\t$data = $this->cleanupFieldNames($data);\r\n\t\t\r\n\t\t// Build SQL\r\n\t\t$sql = 'UPDATE `'.$this->name.'` SET ';\r\n\t\t$values = array();\r\n\t\t$pkFound = false;\r\n\t\tforeach($data as $key => $val)\r\n\t\t{\r\n\t\t\t// Ignore if field is not in table\r\n\t\t\tif (!$this->hasField($key))\r\n\t\t\t{\r\n\t\t\t\tunset($data[$key]);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Include value, but not if primary key and table has auto-incr PK\r\n\t\t\t$include = true;\r\n\t\t\tif ($key == $this->primaryKey)\r\n\t\t\t{\r\n\t\t\t\tif ($this->primaryKeyIsAutoIncrement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$include = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Found non-empty primary key\r\n\t\t\t\tif (!empty($val))\r\n\t\t\t\t{\r\n\t\t\t\t\t$pkFound = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Include and process special value\r\n\t\t\tif ($include)\r\n\t\t\t{\r\n\t\t\t\tif ($val === 'NULL')\r\n\t\t\t\t{\r\n\t\t\t\t\t$values[] = \"`$key` = NULL\";\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$values[] = \"`$key` = :$key\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t// Quit if has no primary key\r\n\t\tif (!$pkFound)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Cannot update: The supplied data does not contain a primary key');\r\n\t\t}\r\n\t\r\n\t\t// No fields were found - update makes no sense\r\n\t\tif (count($values) == 0)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('No fields were added to the UPDATE query');\r\n\t\t}\r\n\t\t\t\r\n\t\t// Add values to query\r\n\t\t$sql .= implode(', ', $values);\r\n\t\r\n\t\t// Add where\r\n\t\t$sql .= ' WHERE `'.$this->primaryKey.'` = :' . $this->primaryKey;\r\n\r\n\t\t// Execute\r\n\t\t$result = $this->db->runQuery($sql, $data);\r\n\t\t\r\n\t\treturn $this->db->getAffectedRows();\r\n\t}", "public function update(){\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $fieldsList = \" SET \";\n foreach ($this->attributes as $column => $value) {\n $fieldsList.=$column.\"=\".'\\''.$value.'\\''.\", \";\n }\n $fieldsList = str_last_replace(\", \", \"\", $fieldsList);\n $sqlQuery = \"UPDATE \".$this->table.$fieldsList.\" WHERE \".$this->idName.\"=\".$this->attributes[$this->idName];\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n }\n }", "public function updateRecord ($sqlString);", "protected function _sql_update ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = 'UPDATE ';\n /*\n Which table ?\n */\n $sql .= $this->aTables[0] . \"\\nSET \";\n /*\n Fields and values.\n */\n foreach ($this->aFields as $k => $f)\n {\n $sql .= $f . ' = ' . $this->aValues[$k] . ', ';\n }\n $sql = rtrim($sql, ', ');\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 abstract function getUpdateSQL($table, $data, $where, $values, $order, $limit);", "function dbUpdate($table, array $data, $where = null, $insertId = false){\n foreach ($data as $key => $value){ //Percorre os campos lendo o índice e o valor do array data\n $fields[] = \"{$key} = '{$value}'\"; //Atribui os índices e seus respectivos valor para um array\n }\n $fields = implode(', ', $fields); //Separa cada campo com vírgula\n //$table = DB_PREFIX.'_'.$table; //para pegar o prefixo da tabela caso use \n $where = ($where) ? \" WHERE {$where}\" : null; //Serve apenas para definir se haverá espaço entre fields e where\n $query = \"UPDATE $table SET {$fields}{$where}\"; //por isso, aqui não vai espaço\n return qExecute($query, $insertId);\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",email1=\\\"$this->email1\\\",address1=\\\"$this->address1\\\",lastname=\\\"$this->lastname\\\",phone1=\\\"$this->phone1\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function update($bd,$where,$data){\n$data_one = \"\";\n$contador = count($data);\n$i = 1;\nforeach ($data as $key => $value) {\n\n\t\tif($i < $contador){\n\t\t\t$data_one .= $key.\"=:\".$key.\",\";\n\t\t}else{\n\t\t\t$data_one .= $key.\"=:\".$key;\n\t\t}\n\t\t$i++;\n}\nforeach ($where as $key => $value) {\n\t$campo_where = $key;\n\t$value_where = $value;\n}\n $sql = \"UPDATE \".$bd.\" SET \".$data_one.\" WHERE \".$campo_where.\"=\".$value_where.\"\";\n $conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute($data);\n$stmt = null;\nreturn $dato;\n}", "public function update() {\n\t\tif (isset($this->params['updated'])) {\n\t\t\t$this->params['updated'] = null;\n\t\t} // 'updated' is an auto timestamp\n\n\t\t$columns = array();\n\t\tforeach (array_keys($this->params) as $key) {\n\t\t\tarray_push($columns, $key . ' = ?');\n\t\t}\n\t\t$bindings = implode(', ', $columns);\n\t\t$sql = 'UPDATE ' . static::$table . ' SET ' . $bindings . ' WHERE id = ' . $this->get('id') . ' ;';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "function test_update($urabe, $body)\n{\n $values = $body->update_params;\n $column_name = $body->column_name;\n $column_value = $body->column_value;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->update($table_name, $values, \"$column_name = $column_value\");\n}", "function dbupdate($table, $fields, $where = [1=>0], $funcs = null ) {\r\n\tglobal $msq;\r\n\t$parts = [];\r\n\tforeach ($fields as $k => $v)\r\n\t\t$parts []= $k.' = \"'.mysqli_real_escape_string($msq, $v).'\"';\r\n\tif ($funcs != null) {\r\n\t\tforeach ($funcs as $k => $v) {\r\n\t\t\t$parts []= $k.' = '.$v;\r\n\t\t}\r\n\t}\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\t$q = \"update \".$table.\" set \".implode(\", \",$parts).\" where \".implode(\" and \",$whparts);\r\n\treturn dbcommit($q);\r\n}", "public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }", "public function update_data($where,$data,$table){\r\n $this->db->where($where);\r\n $this->db->update($table,$data);\r\n }", "protected function _update()\n\t{\n\t\t// UPDATE 'table' SET\n\t\t$this->_query = 'UPDATE '.$this->_table.' SET ';\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$this->_query .= \"$key = '$value'\";\n\n\t\t\t$first = false;\n\t\t} // foreach\n\n\t\t// WHERE foo = 'bar'\n\t\t$this->_query .= ' WHERE ';\n\t\t$imax = count($this->_where);\n\t\t$first = true;\n\t\tfor($i=0; $i<$imax; $i++) {\n\t\t\t$this->_query .= ($first) ? ('') : (' AND '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $this->_where[$i]['row'].' ';\n\t\t\t$this->_query .= $this->_where[$i]['condition'].' \\'';\n\t\t\t$this->_query .= $this->_where[$i]['value'].'\\'';\n\t\t} // foreach\n\n\t\t// end ;\n\t\t$this->_query .= ';';\n\n\t\treturn $this->_query;\n\t}", "private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }", "function update($table,$data,$where){\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$list.=\"`$key`='\".$value.\"'\";\n\t\t\t} else {\n\t\t\t\t$list.=\"`$key`='\".$value.\"', \";\n\t\t\t}\n\t\t}\n\t\t$r=mysql_query(\"\n\t\t\tUPDATE `$table` SET\n\t\t\t$list \n\t\t\tWHERE $where\n\t\t\tLIMIT 1\n\t\t\");\n\t\treturn $r;\n\t}", "public function update(array $data){\n //dynamically query generate\n $query = \"UPDATE \".$this->table[0].\" SET\";\n $comma = \" \";\n foreach ($data as $key => $value) {\n if( ! empty($value)) {\n $query .= $comma . $key . \" = '\" .trim($value) . \"'\";\n $comma = \", \";\n }\n }\n //finaly query generated as per your form fields name and value\n \n $sql= $query. \" WHERE sid = '\".$data[\"sid\"].\"'\";\n //run the query\n return mysqli_query($this->conn,$sql);\n }", "function update_data($where,$data,$table){\n $this->db->where($where);\n $this->db->update($table,$data);\n }", "public function update(array $data) {\r\n if(count($this->filter) == 0) {\r\n throw new exception('EXCEPTION_MODEL_SCHEMATIC_SQL_UPDATE_NO_FILTERS_DEFINED', exception::$ERRORLEVEL_FATAL);\r\n }\r\n $query = 'UPDATE ' . $this->getTableIdentifier() .' SET ';\r\n $parts = [];\r\n\r\n $param = array();\r\n foreach ($this->config->get('field') as $field) {\r\n if(in_array($field, array($this->getPrimarykey(), $this->table . \"_modified\", $this->table . \"_created\"))) {\r\n continue;\r\n }\r\n\r\n // If it exists, set the field\r\n if(array_key_exists($field, $data)) {\r\n\r\n if (is_object($data[$field]) || is_array($data[$field])) {\r\n $data[$field] = $this->jsonEncode($data[$field]);\r\n }\r\n\r\n $var = $this->getStatementVariable(array_keys($param), $field);\r\n\r\n // performance hack: store modelfield instance!\r\n if(!isset($this->modelfieldInstance[$field])) {\r\n $this->modelfieldInstance[$field] = \\codename\\core\\value\\text\\modelfield::getInstance($field);\r\n }\r\n $fieldInstance = $this->modelfieldInstance[$field];\r\n\r\n $param[$var] = $this->getParametrizedValue($this->delimit($fieldInstance, $data[$field]), $this->getFieldtype($fieldInstance));\r\n $parts[] = $field . ' = ' . ':'.$var;\r\n }\r\n }\r\n\r\n if($this->saveUpdateSetModifiedTimestamp) {\r\n $parts[] = $this->table . \"_modified = \".$this->getServicingSqlInstance()->getSaveUpdateSetModifiedTimestampStatement($this);\r\n }\r\n $query .= implode(',', $parts);\r\n\r\n // $params = array();\r\n $filterQuery = $this->getFilterQuery($param);\r\n\r\n //\r\n // query the datasets's pkey identifiers that are to-be-updated\r\n // and submit each to timemachine\r\n //\r\n if($this->useTimemachine()) {\r\n $timemachineQuery = \"SELECT {$this->getPrimaryKey()} FROM \" . $this->getTableIdentifier() . ' ';\r\n // NOTE: we have to use a separate array for this\r\n // as we're also storing bound params of the update data in $param above\r\n $timemachineFilterQueryParams = [];\r\n $timemachineFilterQuery = $this->getFilterQuery($timemachineFilterQueryParams);\r\n $timemachineQuery .= $timemachineFilterQuery;\r\n $timemachineQueryResponse = $this->internalQuery($timemachineQuery, $timemachineFilterQueryParams);\r\n $timemachineResult = $this->db->getResult();\r\n $pkeyValues = array_column($timemachineResult, $this->getPrimaryKey());\r\n\r\n $tm = \\codename\\core\\timemachine::getInstance($this->getIdentifier());\r\n foreach($pkeyValues as $id) {\r\n $tm->saveState($id, $data); // supply data to be changed for each entry\r\n }\r\n }\r\n\r\n $query .= $filterQuery;\r\n $this->doQuery($query, $param);\r\n\r\n return $this;\r\n }", "public function update(){\n $sql = \"update \".self::$tablename.\" set correlativo=\\\"$this->correlativo\\\",nombre_instalador=\\\"$this->nombre_instalador\\\",nombre_proyecto=\\\"$this->nombre_proyecto\\\",localizacion=\\\"$this->localizacion\\\",contrato_orden_trabajo=\\\"$this->contrato_orden_trabajo\\\",sector_trabajo=\\\"$this->sector_trabajo\\\",area_aceptada=\\\"$this->area_aceptada\\\",fecha_proyecto=\\\"$this->fecha_proyecto\\\" where id_usuario=$this->id_usuario\";\n Executor::doit($sql);\n }", "public function update(array $data, array $where);", "public function testSaveDataTableUpdateRows() {\r\n\t\t// Prepare the database table via SQL\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n\t\t// Create a datatable where only one column should be updated\r\n\t\t$datatable = new avorium_core_data_DataTable(3, 2);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'STRING_VALUE');\r\n\t\t// Store a new record without any null values\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$datatable->setCellValue($i, 0, $records[$i]['UUID']);\r\n\t\t\t$datatable->setCellValue($i, 1, 'New value '.$i);\r\n\t\t}\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t\t// Read out the database, all other columns must have the old values\r\n\t\t$result = $this->executeQuery('select UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE from POTEST order by UUID');\r\n\t\t$this->assertEquals(3, count($result), 'Wrong row count');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$this->assertEquals($records[$i]['UUID'], $result[$i]['UUID'], 'UUID from database is not as expected in row '.$i.'.');\r\n\t\t\t$this->assertEquals($records[$i]['bool']?1:0, $result[$i]['BOOLEAN_VALUE'], 'Boolean value from database is not as expected in row '.$i.'.');\r\n\t\t\t$this->assertEquals($records[$i]['int'], $result[$i]['INT_VALUE'], 'Integer value from database is not as expected in row '.$i.'.');\r\n\t\t\t$this->assertEquals('New value '.$i, $result[$i]['STRING_VALUE'], 'String value from database is not as expected in row '.$i.'.');\r\n\t\t}\r\n\t}", "public function update() {\n // Get the values that are currently in the database\n $curr_vals = $this->read_single();\n\n // Set the values that will be added to the table\n foreach ($curr_vals as $key => $value) {\n // Convert key from the Database's capitalization to\n // this model's attribute capitalization style (all lowercase)\n $local_key = strtolower($key);\n // If user didn't specify property\n if (($this->attr[$local_key] === \"\") || ($this->attr[$local_key] === null)){\n // Then use the value that's already in the database\n $this->attr[$local_key] = $curr_vals[$key];\n }\n }\n\n // Create query\n $query = \"UPDATE \" . $this->table .\n \" SET = \" .\n \" WHERE MID = :mid AND Spot = :spot \";\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean the data (reduce malicious SQL injection, etc.)\n foreach ($this->attr as $key => $value) {\n $this->attr[$key] = htmlspecialchars(strip_tags($value));\n }\n \n // Bind the data to a variable for an SQL attribute\n foreach ($this->attr as $key => $value) {\n $stmt->bindValue((\":\" . $key), $value);\n }\n\n // Execute the prepared statement and check for errors in running it\n return $this->runPrepStmtChkErr($stmt);\n }", "private function Update()\n {\n $return = false;\n $action = $this->Action();\n $values = $this->Values();\n $table = $this->Table();\n $where = $this->Where();\n $errorInfo = $this->ERROR_INFO(__FUNCTION__);\n if(MySQLChecker::isAction($action, $errorInfo) && MySQLChecker::isTable($table, $errorInfo) &&\n Checker::isArray($values, false, $errorInfo) && Checker::isArray($where, false, $errorInfo) ) {\n if (isset($values[Where::VALUES]) && isset($values[self::COLUMNS]) && isset($where[Where::VALUES])) {\n $columns = $values[self::COLUMNS];\n $values = $values[Where::VALUES] + $where[Where::VALUES];\n if (Checker::isArray($columns, false, $errorInfo) && Checker::isArray($values, false, $errorInfo)) {\n $return[Where::QUERY] = \"$action $table SET \";\n foreach($columns as $column => $key)\n {\n $return[Where::QUERY] .= \"$column=$key, \";\n }\n $return[Where::QUERY] = trim($return[Where::QUERY],\", \");\n $return[Where::QUERY] .= $where[Where::QUERY];\n $return[Where::VALUES] = $values;\n }\n } else $this->addError(__FUNCTION__, \"Values and Query are not set!\", $values);\n }\n return $return;\n }", "public function updateData($table, $data, $condition=1){\r\n\t\t$i = 0;\r\n\t\t$columnValueSet = \"\";\r\n\t\tforeach($data as $key=>$value){\r\n\t\t\t$comma = ($i<count($data)-1 ? \", \" : \"\");\r\n\t\t\t$columnValueSet .= $key. \"='\".$value.\"'\".$comma;\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t$sql = \"update $table set $columnValueSet where $condition\";\r\n\t\t// echo $sql;\r\n\t\t$this->execteQuery($sql);\r\n\t}", "function QueryUpdate($table, $data, $where='1') {\r\n $q = \"UPDATE `\" . $this->pre . $table . \"` SET \";\r\n\r\n foreach ($data as $key => $val) {\r\n if (strtolower($val) == 'null')\r\n $q.= \"`$key` = NULL, \";\r\n elseif (strtolower($val) == 'now()')\r\n $q.= \"`$key` = NOW(), \";\r\n elseif (strtolower($val) == 'unix_timestamp()')\r\n $q.= \"`$key` = UNIX_TIMESTAMP(), \";\r\n else\r\n $q.= \"`$key`='\" . $this->escape($val) . \"', \";\r\n }\r\n\r\n $q = rtrim($q, ', ') . ' WHERE ' . $where . ';';\r\n\r\n //echoLine( $q );\r\n\r\n return $this->query($q);\r\n }", "public function modifyRecords(){\n \n // Get the sql statement\n $sql = $this->updateSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->requestUpdateValues as $key => $value) {\n $stmt->bindParam($this->params['columnName_Pdo'][$key], $this->requestUpdateValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }", "final protected function queryUpdate(CDFIDataConnection $db, $tableName = null, $whereColumn = null, $skipKeys = null)\n\t\t{\n\t\t\t// note: whereColumn can be null - be warned!\n\n\t\t\t// get the table name\n\t\t\t$tableName = $this->requireTableName($tableName);\n\n\t\t\t// build list of setters\n\t\t\t$sets = array();\n\t\t\tforeach($this->getColumnNames($skipKeys) as $key)\n\t\t\t\t$sets[] = $key . '=' . CDFIDataConnection_TokenCharacter; // foo=?\n\n\t\t\t// build sql\n\t\t\t$sql = sprintf('update `%s` set %s ', $tableName, implode(',', $sets));\n\n\t\t\t// append an additional parameter for the where clause\n\t\t\t$where = $this->findColumn($whereColumn);\n\t\t\tif($where != null)\n\t\t\t{\n\t\t\t\t$db->AddParameter($where->getDataType(), $where->getValue());\n\t\t\t\t$sql .= sprintf(' where `%s`=', $where->getName()) . CDFIDataConnection_TokenCharacter;\n\t\t\t}\n\n\t\t\t// pass query on to processor\n\t\t\t$db->Query($sql);\n\t\t}", "public function updateData()\n\t{\n\t\tif(empty($this->_queryIds))\n\t\t\tthrow new Exception('Unable to update, no data!');\n\t\t\n\t\t$sQueryIds = implode(', ', $this->_queryIds);\n\t\t$iTimeStamp = time();\n\n\t\t$sSql = \"UPDATE se_query SET xml_parsed = 1, pingback_timestamp = $iTimeStamp WHERE id IN ($sQueryIds)\";\n\t\t$this->_db->query($sSql);\n\t\t\n\t\t$this->_queryIds = array();\n\t}", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "function fn_update($table, $param, $condition) {\r\n foreach ($param as $key => $value) {\r\n $this->query(\"update $table set $key = $value where $condition\");\r\n }\r\n }", "function lazyUpdate($table, $where, $data){\n \t$sql = 'SHOW COLUMNS FROM '.$table.';';//fetch all columns\n \t$query = mysql_query($sql);\n \t$set = '';\n \twhile($column = mysql_fetch_array($query)){\n \t\t//create the field- and value string\n \t\tif(isset($data[$column['Field']])){\n \t\t\t$set .= $column['Field'].'=\\''.mysql_real_escape_string($data[$column['Field']]).'\\', ';\n \t\t}\n \t}\n \t$set = substr($set,0,-2);\n \treturn mysql_query('UPDATE '.$table.' SET '.$set.' WHERE '.$where.';');//insert the data\n }", "public function update()\n\t{\n\t\t$mytable = WikiRevision::$table;\n\t\t$buf = \"UPDATE $mytable SET \";\n\t\tfor ($i = 0; $i < count(WikiRevision::$fields); $i++) {\n\t\t\t$buf .= WikiRevision::$fields[$i] . \" = '\" . DBConnection::get()->handle()->real_escape_string($this->data[$fields[$i]]) . \"'\" . ($i == count(WikiRevision::$fields) - 1)?(', '):(' ');\n\t\t}\n\t\t$buf .= \"WHERE rev_id = \" . $data['rev_id'];\n\t\tDBConnection::get()->handle()->query($buf);\n\t}", "function update_configuracion($sql,$params)\n {\n $this->db->where('',$sql);\n return $this->db->update('configuracion',$params);\n }", "function update($table, $data, $idField, $idValue) {\n $this->connect();\n $sql = '';\n foreach ($data as $key => $value) {\n $sql .= \"$key = '\" . $value . \"',\";\n }\n $sql = 'UPDATE ' . $table . ' SET ' . trim($sql, ',') . ' WHERE ' . $idField . ' = ' . $idValue . ';';\n return mysqli_query($this->_conn, $sql);\n }", "function update($id,$fields_val){\n $count=0;$set='';\n foreach($fields_val as $f => $v){\n $count++;\n $set .= \"$f = '$v'\";\n $set .=($count != count($fields_val))?',':'';\n \n }\n $sql = \"UPDATE {$this -> table} SET {$set} WHERE {$this -> pk} = '{$id}'\";\n $updt = $this -> query($sql);\n return $updt;//returns true on success and false if otherwise\n }", "public function update($data = NULL, $where = NULL){\n $this->db->where($where);\n return $this->db->update($this->table,$data);\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "protected function updateData($table_name, $data, $where)\n {\n $con = $this->connect();\n //echo mysqli_real_escape_string($con, $data['is_active']);exit();\n $sql = \"UPDATE \" . $table_name;\n $prepared_data = (array)$data;\n $sets = \" SET \";\n foreach ($prepared_data as $key => $value) {\n //if ($value != null) {\n $sets .= \" $key = '\" . mysqli_real_escape_string($con, $value) . \"',\";\n //}\n }\n $sets = rtrim($sets, ',');\n\n $sql .= $sets;\n //echo $sql;exit();\n\n if ($where != '' && gettype($where) == 'array' && count($where)>0) {\n $where_sql = count($where) > 0 ? ' WHERE ' : '';\n $count = 0;\n foreach ($where as $key => $value) {\n if ($count == 0) {\n $where_sql .= \" $key = '$value' \";\n } else {\n $where_sql .= \" AND $key = '$value' \";\n }\n }\n $sql .= $where_sql;\n } else if ($where != '' && gettype($where) == 'string') {\n $sql .= $where;\n }\n\n //echo $sql;exit();\n\n if($where==''){\n return false;\n }else if (mysqli_query($con, $sql)) {\n mysqli_close($con);\n return true;\n }\n mysqli_close($con);\n return false;\n }", "abstract public function updateData();", "abstract public function updateRecord($tableName, $record, $where = '');", "public function update($data, $table, $where) {\n\t\tforeach ($data as $column => $value) {\n\t\t\t$sql = \"UPDATE $table SET $column = $value WHERE $where\";\n\t\t\t$this->_connection->query($sql) ;\n\t\t}\n\t\treturn true;\n\t}", "function update_data($update_data,$where_arr,$tbl_name)\n\t{\n\t\tif(!empty($update_data))\n\t\t{\n\t\t\t$this->db->where($where_arr);\n\t\t\t$this->db->update($tbl_name,$update_data);\n\t\t\t\n\t\t\tif($this->db->affected_rows()>0)\n\t\t\t{\n\t\t\t\treturn TRUE;\t\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "public function getForUpdateSQL();", "public function update(array $data, array $where, $noWhereForSure = false) {\r\n $this->checkGateway();\r\n\r\n $sql = \"UPDATE {$this->name} SET \";\r\n\r\n // Columns\r\n foreach ($data as $column => $value) {\r\n\r\n // Generate a random code to make sure that column bind name will not repeat\r\n $columnCode = preg_replace('/[^a-zA-Z0-9]/', '', $column). rand(0, 999);\r\n\r\n if (! is_null($value)) {\r\n $sql .= \"`$column` = :$columnCode, \";\r\n\r\n // Safe query\r\n $this->db->bind($columnCode, $value);\r\n } else {\r\n $sql .= \"`$column` = NULL, \";\r\n }\r\n }\r\n\r\n // There is some command to run every update?\r\n if ($this->onUpdate && is_array($this->onUpdate)) {\r\n foreach ($this->onUpdate as $column => $value) {\r\n if (! isset($data[$column])) {\r\n $sql .= \"`$column` = \" . str_replace(';', '', $value) . \", \";\r\n }\r\n }\r\n }\r\n\r\n $sql = trim($sql, ', ');\r\n\r\n // UPDATE without WHERE? =S\r\n if (! $where && ! $noWhereForSure) {\r\n throw new DatabaseGatewayException(\"UPDATE without WHERE clause. We do not encourage it\");\r\n\r\n } else if ($where) {\r\n\r\n // Where\r\n $sql .= \" WHERE \";\r\n foreach ($where as $column => $value) {\r\n $sql .= \"`$column` = :w_$column AND \";\r\n\r\n // Safe query\r\n $this->db->bind(\"w_\" . $column, $value);\r\n }\r\n $sql = trim($sql, \" AND \");\r\n }\r\n\r\n // Runs query\r\n return (bool) $this->db->query($sql);\r\n }", "public function update_data($tbl_name, $data, $where)\n\t\t{\n\t\t\t$query = \"UPDATE $tbl_name SET $data WHERE $where\";\n\t\t\treturn $query;\n\t\t}", "public static function update($table, $data, $where) {\n// $data = add_magic_quotes($data);\n $bits = $wheres = array();\n foreach ( array_keys($data) as $k ){\n $bits[] = \"`$k` = '$data[$k]'\";\n }\n if ( is_array( $where ) ){\n foreach ( $where as $c => $v )\n $wheres[] = \"$c = '\" . addslashes( $v ) . \"'\";\n }else{\n return false;\n }\n return self::query(\"UPDATE \".iPHP_DB_PREFIX_TAG.\"{$table} SET \" . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ) . ' LIMIT 1;' );\n }", "function update($tab, $data, $cond)\n{\n\t$fields = '';\n\tif (is_array($data)) {\n\t\t$sep = '';\n\t\tforeach($data as $k => $v) {\n\t\t\t//if ($k == '' or $v == '') continue;\n\t\t\tif (is_null($v)) $v = 'NULL'; else $v = \"'\".$this->escape($v).\"'\";\n\t\t\t$fields .= $sep.$this->drv->quote($k).\"=$v\";\n\t\t\t$sep = ',';\n\t\t}\n\t}\n\telse $fields = $data;\n\t\n\t$args = (func_num_args() > 3)? array_slice(func_get_args(),3) : null;\n\t$where = $this->getWhereSql($cond, $args);\n\t$sql = \"UPDATE $tab set $fields WHERE $where\";\n\t$res = $this->query($sql);\n\treturn $res;\n}", "public function update(){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"UPDATE \".$table.\" SET \";\n foreach($this as $k=>$v){\n $sql .= $k.\" = '\".$v.\"',\";\n }\n $sql = trim($sql, ',');\n $sql .= \" WHERE \".$keyColumn.\" = \".$this->keyColumn;\n mysqli_query(static::$conn, $sql);\n }", "function update($where_clause=null)\n {\n $db = $this->getDb();\n \n $sets = array();\n $values = array();\n// Kint::dump($this->fields);\n foreach( array_keys( $this->fields ) as $field )\n {\n //echo \"<br> field \".Kint::dump($field,'Field',false);\n if(!is_null($where_clause) && $field == $this->id_name){\n \techo \"Skipping primary key '$field' & $this->id_name since there is another WC '$where_clause' \";\n \tcontinue;\n }\t\n if('0'==$field ){\n \tcontinue;\n }\n elseif(is_int($field)){\n \t//Kint::dump($field);\n \t//Kint::dump(array_keys($this->fields));\n \tcontinue;\n }\n elseif (!isset($this->fields[$field]))\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n }\n elseif ($field == 'updated')\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n } \n else{\t\n \t$sets []= $field.'=?';\n \t$values []= $this->fields[ $field ];\n }\n }\n $set = join( \", \", $sets );\n \n if(is_null($where_clause)){\n \tif($this->id<0)\n \t\tdie(kint::dump('ERROR: this->id was not set on DBObject',$this));\n \t//$values []= $this->id;\n \t$where_clause = $this->id_name.'='.$this->id; \t\n }\n if(!str_contains($set, 'updated')){\n \t$set .= ',updated = null ';\n }\n\t$sql = 'UPDATE '.$this->table.' SET '.$set.\n \t' WHERE '.$where_clause;\n\t//$this->execute($sql,$values);\n\t//die ('SQL in Update<br/>'.$sql.'<br/>'.var_dump($values));\n //Kint::dump('UpdateSQL',$sql);\n //die('TEST');\n $cmd = 'prepare';\n\ttry{\n\t\t$sth = $db->prepare( $sql );\n\t\t$cmd = 'execute';\n\t\t$this->execute( $sth, $values );\n\t}\n catch(exception $e){\n \t$debug=Zend_Debug::dump('Statement with error',$sql);\t\n \tdie(__LINE__.'Exception in DBObject::'.$cmd.'() while cmd='.$cmd.' SQL='.$sql\n \t\t.' with values <br>'.$values\n \t\t.__LINE__.'Exception:<br>'.nl2br($e)\n \t\t.'<hr/>'.$debug);\n } \t\n }", "function editNewsDB($update_arr=array(),$condition_arr=array()) {\n\t\t$this->db->where($condition_arr);\n\t\t$update= $this->db->update('dipp_news', $update_arr);\n\t\t//echo $this->db->last_query(); die();\n\t\tif($update) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function genericupdate ($table, $primary, $data) {\n\n /* Support single and combined primary keys. */\n if(gettype($primary)=='string'){\n $primary=array($primary);\n }\n $where = '';\n foreach ($primary as $k) {\n $where .= $k.'=\"'.$data[$k].'\" AND ';\n unset($data[$k]);\n }\n $set = '';\n foreach ($data as $key => $value) {\n foreach ($primary as $k) {\n if($key != $k) continue; }\n if (substr($key,0,1) == '@')\n $set .= substr($key,1).'='.$value.',';\n else\n $set .= $key.'=\"'.mysql_real_escape_string($value).'\",';\n }\n // UPDATE table SET a=1, b=2, c=3\n $query = 'UPDATE '.$table.' SET '.substr($set,0,strlen($set)-1).\n ' WHERE '.substr($where,0,strlen($where)-5);\n return $query;\n}", "public function update() {\n\t\t$date = date(\"Y-m-d H:i:s\");\n\n\t\t$query=mysql_query(\"update \".$this->table.\" set \".$this->column.\" = '\".mysql_escape_string($this->value).\"', modified_by = \".$this->userID.\", modified='\".$date.\"' where id=\".$this->id);\n\n\t}", "public function updateRow($table, $col, $colVal, $data) {\n \t\t$this->db->where($col,$colVal);\n\t\t$this->db->update($table,$data);\n\t\treturn true;\n \t}", "public function update($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"UPDATE \";\n\t\t$p = $this->clean($params);\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']).$this->genWhere($p['where']);\t\n\t\t$DB->alter($statement);\t\n\t}", "function dbUpdate_updateUser($data){\n\t$whereClause = \"\";\n\t\n\t$tableName = \"tbl_user\";\n\t$updateVal = \"\";\n\tforeach($data as $fieldData){\n\t\tif ($fieldData[\"type\"] == \"text\") {\t$updateVal .= $fieldData[\"name\"].\" = '\".$fieldData[\"val\"].\"',\";\t}\n\t\telseif(\"num\") {\t$updateVal .= $fieldData[\"name\"].\" = \".$fieldData[\"val\"].\",\";\t};\n\t}\n\t$updateVal = substr($updateVal, 0, -1);\n\t$sql = \"UPDATE $tableName SET $updateVal\";\n\techo $sql;\n}", "public function updateDbFromRequest()\n\t\t{\n\t\t\t$this->columnsInfo->data_seek(0);\n\t\t\t$pkExistsInRequest = true;\n\t\t\t$PK = \"1=1\";\n\t\t\t$upd = \"\";\n\t\t\twhile($column = $this->columnsInfo->fetch_assoc())//$info->fetch_row()\n\t\t\t{\n\t\t\t\tif($column[\"COLUMN_KEY\"] == \"PRI\")\n\t\t\t\t{\n\t\t\t\t\tif($pkExistsInRequest = $pkExistsInRequest && isset($_REQUEST[$column[\"COLUMN_NAME\"]]))\n\t\t\t\t\t\t$PK = \"$PK and \".$column[\"COLUMN_NAME\"].\"=\".$this->wherePkValue($_REQUEST[$column[\"COLUMN_NAME\"]], $column[\"DATA_TYPE\"]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$upd = \"$upd, \".$column[\"COLUMN_NAME\"].\"=\".$this->insertColumnValue($_REQUEST[$column[\"COLUMN_NAME\"]], $column[\"IS_NULLABLE\"], $column[\"DATA_TYPE\"], $column[\"CHARACTER_MAXIMUM_LENGTH\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($pkExistsInRequest)\n\t\t\t{\n\t\t\t\t$query = \"update $this->table set \".substr($upd, 2, strlen($upd)).\" where $PK\";\n\t\t\t\techo \"<br>$query<br>\";\n\t\t\t}\n\t\t\telse\n\t\t\t\techo \"<br>PK dont exists in request<br>\";\n\t\t}", "static function Update($table,$param,$param_value,$condition){\n mysql_query(\"update $table set $param = $param_value where $condition\");\n }", "function Update()\n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t$updateParam = \"\";\n\t\t$updateValue = \"\";\n\t\t$blobs = array();\n\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\t$command = 'if(isset($this->'.$fld['varname'].')) { ';\n\t\t\tif( $fld[\"key\"] )\n\t\t\t\t$command.= '$this->Param[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\telse\n\t\t\t\t$command.= '$this->Value[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\t$command.= ' }';\n\t\t\t\n\t\t\teval($command);\n\t\t\t\n\t\t\tif( !$fld[\"key\"] && !array_key_exists( strtoupper($fieldname), array_change_key_case($this->Param, CASE_UPPER) ) )\n\t\t\t{\n\t\t\t\tforeach($this->Value as $field => $value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateValue.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \", \";\n\t\t\t\t\t\n\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Oracle || $this->_connection->dbType == nDATABASE_DB2 || $this->_connection->dbType == nDATABASE_Informix )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( IsBinaryType( $fld[\"type\"] ) )\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Informix && IsTextType( $fld[\"type\"] ) )\t\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($this->Param as $field=>$value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateParam.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \" and \";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\tconstruct SQL and do update\t\n\t\tif ($updateParam)\n\t\t\t$updateParam = substr($updateParam, 0, -5);\n\t\tif ($updateValue)\n\t\t\t$updateValue = substr($updateValue, 0, -2);\n\t\t\t\n\t\tif ($updateValue && $updateParam)\n\t\t{\n\t\t\t$dalSQL = \"update \".$this->_connection->addTableWrappers( $this->m_TableName ).\" set \".$updateValue.\" where \".$updateParam;\n\t\t\t$this->Execute_Query($blobs, $dalSQL, $tableinfo);\n\t\t}\n\n\t\t//\tcleanup\n\t\t$this->Reset();\n\t}", "public function update($columns, $data, $column, $condition, $value) {\r\n\t\t$this->query = \"UPDATE \" . $this->table . \" SET \";\r\n\r\n\t\t# Loop through \r\n\t\tfor($i = 0; $i < count($columns); $i++) {\r\n\t\t\t# Do this for all but the last\r\n\t\t\tif($i < count($columns) - 1) {\r\n\t\t\t\t$this->query .= $columns[$i] . \"='\" . $data[$i] . \"',\";\r\n\t\t\t}else {\r\n\t\t\t\t$this->query .= $columns[$i] . \"='\" . $data[$i] . \"'\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t# Add the rest\r\n\t\t$this->query .= \" WHERE \" . $column . \"=\" . $value;\r\n\r\n\t\t# Make the query\r\n\t\t$result = $this->connection->query($this->query) or die(\"Query could not be made. update()\");\r\n\r\n\t\treturn $result;\r\n\t}", "function patch(String $tblname, array $where, array $data)\n {\n $cmd = \"UPDATE {$tblname} SET \";\n $cmd2 = \"\";\n $cmd3 = \"\";\n foreach ($data as $key => $value) {\n $value = $this->__sanitize($value);\n if ($value === '?') {\n $cmd2 .= strtoupper($key) . \"=!\" . strtoupper($key) . \", \";\n } else {\n $cmd2 .= strtoupper($key) . \"='{$value}'\" . \", \";\n }\n }\n foreach ($where as $key => $value) {\n $value = $this->__sanitize($value);\n $cmd3 .= strtoupper($key) . \"='{$value}'\" . \" AND \";\n }\n\n # The above (params/data) loops result in a trailing\n # (comma & a concatination operator) thus we remove them below..!\n $cmd2 = substr($cmd2, 0, strrpos($cmd2, \", \"));\n $cmd3 = substr($cmd3, 0, strrpos($cmd3, \" AND \"));\n $cmd .= \"{$cmd2} WHERE {$cmd3}\";\n\n // send query and Return Results:\n $this->send($cmd);\n return $this->result;\n }", "function update($tbl_name, $data, $where) {\n if (empty($data))\n throw new Exception('Update data should not be empty!');\n else if (empty($tbl_name))\n throw new Exception('Table name should not be empty!');\n \n $update_str = $this->get_update_str($data);\n $where_str = $this->get_where_str($where);\n $query = 'UPDATE ' . $tbl_name . ' SET ' . $update_str . ' WHERE ' . $where_str;\n $resource = $this->query($query);\n return $this->affected_rows($resource);\n }", "function updateData($table,$data,$id){\n\t\treturn $this->db->update($table,$data,$id);\n\t}", "protected function updateSql()\n {\n $sql = \"UPDATE \" . $this->dbName . \".\" . $this->table . \" SET \";\n $preparedPlaceholders = $this->prepareNamedPlaceholder();\n\n $sql.= $preparedPlaceholders . \" WHERE \" . $this->tablePK . \"=:id;\";\n\n $this->query = $sql;\n }", "public function updateRow($row);", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",lastname=\\\"$this->lastname\\\",username=\\\"$this->username\\\",email=\\\"$this->email\\\",kind=\\\"$this->kind\\\",status=\\\"$this->status\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function updatecol4_data() {\n\t\t$sql=\"select rd.col1,rd.col4 from reestr_distinct rd where rd.col4 <> 'Бессрочно' ORDER BY rd.col1 desc\"; // limit 40\n\t\t$result = $this->get_data($sql);\n\t\t$col4=\"\";\n\t\t$col4_state=\"\";\n\t\t$col1=\"\";\n\t\t$stmt = parent::$mysqliPublic->stmt_init();\n\t\tif (!self::$mysqliPublic->set_charset(\"utf8\")) {printf(\"Ошибка при загрузке набора символов utf8: %s\\n\", self::$mysqliPublic->error);}\n\t\tif (!($stmt = parent::$mysqliPublic->prepare(\"UPDATE `\" . TableReestrDistinct. \"` SET col4_data= (?),col4_state=(?) WHERE col1=(?)\"))) {\n\t\t\techo \"Не удалось подготовить запрос: (\" . parent::$mysqliPublic->errno . \") \" . parent::$mysqliPublic->error;\n\t\t}\n\t\tif (!$stmt->bind_param(\"sss\", $col4, $col4_state, $col1)) {\n\t\t\techo \"Не удалось привязать параметры: (\" . $stmt->errno . \") \" . $stmt->error;\n\t\t}\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t$cur_date=$this->StringToDate($row[col4]);\n\t\t\t$col1=$row[col1];\n\t\t\t$col4=$cur_date;\n\n\t\t\t$find='Отменено';\n\t\t\t$find_pos = strpos($row[col4], $find);\n\t\t\t$col4_state='Отменено';\n\t\t\tif ($find_pos === false) {\n\t\t\t\t$cur_date_now=date(\"Y-m-d\");\n\t\t\t\tif ($cur_date <=$cur_date_now) { \n\t\t\t\t\t$col4_state='Срок действия истек';\n\t\t\t\t} else {\n\t\t\t\t\t$col4_state='Действующий';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($cur_date != 'NULL') {\n\t\t\t\t$stmt->execute();\n\t\t\t\techo(sprintf(\"%s -> %s = '%s'\", $row[col1], $row[col4], $col4));\n\t\t\t\techo \"<br>\";\n\t\t\t}\n\t\t}\n\t}", "protected function saveUpdate(array $data, array &$param = array()) {\r\n\r\n // TEMPORARY: SAVE LOG DISABLED\r\n // $this->saveLog('UPDATE', $data);\r\n\r\n //\r\n // disable cache reset, if model is not enabled for it.\r\n // At the moment, we don't even use the PRIMARY cache\r\n //\r\n if($this->cache) {\r\n $cacheGroup = $this->getCachegroup();\r\n $cacheKey = \"PRIMARY_\" . $data[$this->getPrimarykey()];\r\n $this->clearCache($cacheGroup, $cacheKey);\r\n }\r\n\r\n // raw data for usage with the timemachine\r\n if($this->useTimemachine()) {\r\n $raw = $data;\r\n }\r\n\r\n $query = 'UPDATE ' . $this->getTableIdentifier() .' SET ';\r\n $parts = [];\r\n\r\n foreach ($this->config->get('field') as $field) {\r\n if(in_array($field, array($this->getPrimarykey(), $this->table . \"_modified\", $this->table . \"_created\"))) {\r\n continue;\r\n }\r\n\r\n // If it exists, set the field\r\n if(array_key_exists($field, $data)) {\r\n\r\n if (is_object($data[$field]) || is_array($data[$field])) {\r\n $data[$field] = $this->jsonEncode($data[$field]);\r\n }\r\n\r\n $var = $this->getStatementVariable(array_keys($param), $field);\r\n\r\n // performance hack: store modelfield instance!\r\n if(!isset($this->modelfieldInstance[$field])) {\r\n $this->modelfieldInstance[$field] = \\codename\\core\\value\\text\\modelfield::getInstance($field);\r\n }\r\n $fieldInstance = $this->modelfieldInstance[$field];\r\n\r\n $param[$var] = $this->getParametrizedValue($this->delimit($fieldInstance, $data[$field]), $this->getFieldtype($fieldInstance));\r\n $parts[] = $field . ' = ' . ':'.$var;\r\n }\r\n }\r\n\r\n if($this->saveUpdateSetModifiedTimestamp) {\r\n $parts[] = $this->table . \"_modified = \".$this->getServicingSqlInstance()->getSaveUpdateSetModifiedTimestampStatement($this);\r\n }\r\n $query .= implode(',', $parts);\r\n\r\n $var = $this->getStatementVariable(array_keys($param), $this->getPrimarykey());\r\n // use timemachine, if capable and enabled\r\n // this stores delta values in a separate model\r\n\r\n // if ( ((new \\ReflectionClass($this))->implementsInterface('\\\\codename\\\\core\\\\model\\\\timemachineInterface')\r\n if($this->useTimemachine()) {\r\n $tm = \\codename\\core\\timemachine::getInstance($this->getIdentifier());\r\n $tm->saveState($data[$this->getPrimarykey()], $raw); // we have to use raw data, as we can't use jsonified arrays.\r\n }\r\n\r\n $param[$var] = $this->getParametrizedValue($data[$this->getPrimarykey()], 'number_natural'); // ? hardcoded type?\r\n\r\n $query .= \" WHERE \" . $this->getPrimarykey() . \" = \" . ':'.$var;\r\n return $query;\r\n\r\n }", "function update( $table = '', $data = NULL, $where = NULL, $format = NULL, $where_format = NULL )\n\t{\n\t\t//check all necessary arguments\n\t\tif( !$table || !$data || !$where )\n\t\t\treturn FALSE;\n\t\t\n\t\t//prepare a list to store the insert args as they come\n\t\t$arg_list = array();\n\t\t\n\t\t//begin building the query\n\t\t$query = 'UPDATE';\t\t\t\n\t\t\n\t\t//set the table name in the query\n\t\tif( is_array( $table ) ) //allow for different prefix\n\t\t{\n\t\t\t$query .= $table[0];\n\t\t\t$arg_list[] = $table[1];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$query .= ' %t';\n\t\t\t$arg_list[] = $table;\n\t\t}\n\t\t\n\t\t$query .= ' SET';\n\t\t\n\t\t//add each piece of data to the query\n\t\t$i=0;\n\t\tforeach( $data as $name => $value )\n\t\t{\n\t\t\t//if format is specified, use it, else default to string\n\t\t\tif( is_array( $format ) )\n\t\t\t\t$query .= ' '.$name.' = '.$format[$i];\n\t\t\telse\n\t\t\t\t$query .= ' '.$name.' = %s';\n\t\t\n\t\t\t//append the value to the arglist\n\t\t\t$arg_list[] = $value;\n\t\t\t\n\t\t\t//if not the final value, be sure to append a comma\n\t\t\tif( $i < count( $data ) - 1)\n\t\t\t\t$query .= ',';\n\t\t\t\t\n\t\t\t$i++;\t\t\t\n\t\t}\n\t\t\n\t\t$query .= ' WHERE';\n\t\t\n\t\t//add each where condition to the query\n\t\t$i=0;\n\t\tforeach( $where as $name => $value )\n\t\t{\n\t\t\t//if format is specified, use it, else default to string\n\t\t\tif( is_array( $where_format ) )\n\t\t\t\t$query .= ' '.$name.' = '.$where_format[$i];\n\t\t\telse\n\t\t\t\t$query .= ' '.$name.' = %s';\n\t\t\n\t\t\t//append the value to the arglist\n\t\t\t$arg_list[] = $value;\n\t\t\t\n\t\t\t//if not the final value, be sure to append a comma\n\t\t\tif( $i < count( $where ) - 1)\n\t\t\t\t$query .= ',';\n\t\t\t\t\n\t\t\t$i++;\t\t\t\n\t\t}\n\t\t\n\t\t$query .= ';';\n\t\t\n\t\t//prepare/sanitze the query\n\t\t$query = $this->prepare( $query, $arg_list );\n\n\t\t//execute the query and return the results\n\t\treturn $this->query( $query );\n\t}", "function update($values){\n\n $id = $values['id'];\n unset($values['id']);\n $query = \" UPDATE \" . $this->tableName;\n $separator = \" SET \";\n\n foreach ($values as $key => $value){\n $query .= $separator . $key . \" = '\" . $value . \"'\";\n $separator = \", \";\n\n }\n $query .= \" where id = $id \";\n $query .= \";\";\n return $this->dbh->query($query);\n \n }", "public function update(){\r\n\t\tif (!$this->hasChanged) return self::RES_UNCHANGED;\r\n\t\t$table = $this->getTable();\r\n\t\tif ($this->new){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the record doesn't exist.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\tif (!$table->hasPrimaryKey()){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the table does not have a primary key.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$where = array();\r\n\t\t$changeCount = 0;\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\tif ($value->hasChanged()){\r\n\t\t\t\t$vals[] = \"`$name` = \".$value->getSQLValue();\r\n\t\t\t\t$changeCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\t$where[] = \"`$name` = \".$this->values[$name]->getSQLValue();\r\n\t\t}\r\n\t\t$sql = 'UPDATE '.$this->getFullTableName().' SET '.implode(', ',$vals).' WHERE '.implode(' AND ',$where).' LIMIT 1';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to update record in '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "function update()\n {\n global $config;\n $query=file_get_contents(\"sql/updateArticle.sql\"); \n $query =sprintf($query, $config->prefix.self::$table); \n $query = $config->sql->prepare($query);\n $param=array(\n $this->title, $this->content, $this->lang, $this->date,\n $this->cat, $this->id, $this->lang\n );\n $result=$query->execute($param);\n if ($result) {\n return true;\n } else {\n print_r($query->errorInfo());\n }\n \n }", "function updateGenericData($table,$paramList,$data){\n $this->db->where($paramList);\n $this->db->update($table, $data);\n return true;\n }", "function update_table_where( $update_data, $where_data, $table){\t\n\t$this->db->where($where_data);\n\t$this->db->update($table, $update_data);\n\t\n\t\n }", "protected function updateRow()\n { \n $tableName = $this->getTableName($this->className);\n $assignedValues = $this->getAssignedValues();\n $updateDetails = [];\n\n for ($i = 0; $i < count($assignedValues['columns']); $i++) { \n array_push($updateDetails, $assignedValues['columns'][$i] .' =\\''. $assignedValues['values'][$i].'\\'');\n }\n\n $connection = Connection::connect();\n\n $allUpdates = implode(', ' , $updateDetails);\n $update = $connection->prepare('update '.$tableName.' set '. $allUpdates.' where id='.$this->resultRows[0]['id']);\n \n if ($update->execute()) { \n return 'Row updated';\n } else { \n throw new Exception(\"Unable to update row\"); \n }\n }" ]
[ "0.72804505", "0.6987087", "0.69710433", "0.6954731", "0.6622494", "0.65963155", "0.65783167", "0.6530105", "0.6510925", "0.65071124", "0.65034616", "0.64861476", "0.64648145", "0.6448322", "0.643992", "0.64243627", "0.63846296", "0.63089395", "0.6296487", "0.628962", "0.6279582", "0.62780964", "0.62778634", "0.6277288", "0.6265743", "0.6250271", "0.62454", "0.6241868", "0.623277", "0.6225358", "0.62117356", "0.62009543", "0.6199243", "0.6188659", "0.61866313", "0.6185274", "0.6175325", "0.6158705", "0.61580515", "0.6156916", "0.613042", "0.61285233", "0.61281115", "0.612781", "0.61089426", "0.6099257", "0.6096101", "0.60835534", "0.6080565", "0.60720253", "0.6067172", "0.60637516", "0.6055002", "0.6052159", "0.6040462", "0.60365874", "0.6023861", "0.60145926", "0.60087544", "0.6005918", "0.60037386", "0.60024345", "0.5992376", "0.59912163", "0.5989324", "0.5983528", "0.5982457", "0.5977074", "0.59766835", "0.59762263", "0.59698224", "0.5969137", "0.5967335", "0.5965983", "0.59452635", "0.5940301", "0.5939194", "0.593707", "0.593188", "0.5927533", "0.5926598", "0.5926468", "0.5920698", "0.5919659", "0.5916409", "0.591106", "0.5907099", "0.5903581", "0.5898536", "0.58959335", "0.58913773", "0.5888691", "0.588761", "0.5884178", "0.5884178", "0.58759004", "0.5865947", "0.58646613", "0.58608186", "0.5857767", "0.58524793" ]
0.0
-1
update() Delete data in Data Base Delete set the _status to 255
public function delete($id) { debugInfo(get_class($this)."->delete($id)"); // clear private variables $this->_clear(); $return = $this->set('_status', 255)->update($id); debug('->delete(), $return', $return); return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::update(FALSE, ['isdeleted', 'deletedtime', 'deleteduser']);\n }", "function deleteTurmaCatequese()\n {\n $sql = \"UPDATE TurmaCatequese SET status = 0 WHERE id=:id\";\n $query = $this->db->prepare($sql);\n $query->bindParam(\":id\",$this->id);\n $query->execute();\n echo json_encode(\"{'message': 'Turma apagada'}\");\n }", "function deleteParoquia()\n {\n $sql = \"UPDATE Paroquia SET status = 0 WHERE id=:id\";\n $query = $this->db->prepare($sql);\n $query->bindParam(\":id\",$this->id);\n $query->execute();\n echo json_encode(\"{'message': 'Paroquia apagada'}\");\n }", "protected function deleteInternal() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::updateInternal(['isdeleted', 'deletedtime', 'deleteduser']);\n }", "function delete_update($id, $user){//set deleted status as 0\n\t\t$this->db->where('company_id', $id);\n\t\t$this->db->update('tbl_companies', $user);\n\t}", "public function delete() {\n\t\t\n\t\t$data = array('active'=>false,'deleted'=>true);\n\t\t$this->db->where('id',$this->_id);\n\t\t$this->db->update($this->_table, $data);\n\t\t\n\t\treturn true;\n\t}", "public function delete(){\n \t\ttry{\n \t\t\t$db = DB::get();\n \t\t\t$sql = \"UPDATE t_\" . self::$Table . \" \n \t\t\t\t\tSET \" . self::$Table . \"_supprime='1' \n \t\t\t\t\tWHERE \" . self::$Table . \"_id = '\".$this->Id.\"' \";\n \t\t\n \t\t\t$result = $db->query($sql);\n \t\t}\n \t\tcatch(Exception $e){\n \t\t\tvar_dump($e->getMessage());\n \t\t}\n }", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t $id=$_POST['id'];\n\t foreach($id as $ids)\n\t {\n\t\t$model=$this->loadModel($ids);\n\t\t$model->recordstatus=0;\n\t\t$model->save();\n\t }\n\t echo CJSON::encode(array(\n\t\t\t 'status'=>'success',\n\t\t\t 'div'=>'Data deleted'\n\t\t\t ));\n\t Yii::app()->end();\n\t}", "public function DELETE() {\n #\n }", "public function delete(){\n\t\tglobal $db;\n\t\t$response = array('success' => false);\n\t\t$response['success']=$db->delete($this->table, \"id = $this->id\");\n\t return $response;\n\t}", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t\t$id=$_POST['id'];\n\t\tforeach($id as $ids)\n\t\t{\n\t\t $model=$this->loadModel($ids);\n\t\t $model->recordstatus=0;\n\t\t $model->save();\n\t\t}\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}", "protected function setDeleteData()\n\t{\n\n\t}", "public function delete()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['enabled'] = 0;\n $update['data']['active'] = 0;\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/logout','refresh');\n\n }", "function undelete() {\n\t\t$query = \"UPDATE \".$this->table.\" SET \".$this->deleted_field.\" = '0'\".$this->where_this();\n\n\t\t$this->db->query($query);\n\n\t}", "function dataDelete($p_id)\n {\n $result_update = false;\n \n $sql = 'UPDATE user SET ';\n $sql .= 'isactive = 0, ';\n $sql .= 'isdeleted = 1 ';\n $sql .= 'WHERE id = ? ';\n\n $paramtype = 'i';\n \n $paramdata = array(\n 'userid' => $p_id \n ); \n\n parent::stmtPrepare($sql); \n\n parent::stmtSetParamTypeString($paramtype);\n parent::stmtSetParamData($paramdata);\n parent::stmtBindParam();\n \n parent::stmtExecute();\n $result = parent::stmtGetTotalAffectedRows();\n \n if ($result > 0)\n {\n $result_update = '1';\n }\n\n parent::stmtReset(); \n parent::stmtClose(); \n \n return $result_update; \n }", "function delete($id)\r\n {\r\n \r\n // status change \r\n if ($this->fuel_refill_model->save(array('status'=>'I'),$id) == TRUE)\r\n {\r\n redirect(site_url('driver/fuel_refill/index/?msg_success=Successfully details updated'));\r\n }\r\n else\r\n {\r\n redirect(site_url('driver/fuel_refill/index/?msg_error=Unsuccess full opertation'));\r\n\r\n }\r\n\r\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 }", "public final function delete() {\n\t\t$sql = \"\n\tDELETE FROM\n\t\t\" . $this->table . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute(array($this->{$this->primaryField}));\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "public function destroy($id)\n {\n $orden=Orden::find($id)->update(['status'=>0]);\n return 1;\n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public function actionDel($id){\n $user = $this->findModel($id);\n $user->status = 1;\n $user->save();\n // echo \"<pre>\".print_r($user->errors, true); die;\n// var_dump($user->status); die;\n return $this->redirect('index');\n }", "public function delete($id){\n \n $response=array(\"message\"=>'',\"status\"=>false);\n \n $sql=\"UPDATE area SET status=0, updatedAt=CURRENT_TIMESTAMP WHERE idArea=$id\";\n $res = DB::query($sql);\n \n if($res){\n \n $response[\"message\"]='eliminado(a) con éxito';\n $response[\"status\"]=true;\n }\n \n return $response;\n }", "public function delete( ) {\n\t $query = \"DELETE FROM stat WHERE id=?\";\n\t return $this->db->execute( $query, array($this->id) ); \t\n\t }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "public function delete_data($tablename, $cond, $flag = false) {\n if ($flag) {\n $str = \"DELETE FROM `\".$tablename.\"` WHERE \".$cond;\n } else {\n $str = \"UPDATE `\".$tablename.\"` SET `status` = 'INACTIVE' WHERE \".$cond;\n }\n $str .= \";\\nCOMMIT;\\n\";\n try {\n $result = $this->conn->query($str);\n } catch (PDOException $e) {\n die(\"DB ERROR: \".$e->getMessage());\n }\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function softdelete(){\n \ttry{\n\t\t\t\t$this->deleted_at=date('Y/m/d H:i:s');\n \t\t$connect=Database::connect();\n \t\t$query='UPDATE vehicles SET deleted_at = :deleted_at WHERE id = :id';\n \t\t$statement=$connect->prepare($query);\n \t\t$statement->bindParam(':deleted_at',$this->deleted_at);\n \t\t$statement->bindParam(':id', $data->id);\n \t\treturn $statement->execute();\n \t} catch(\\Exception $e) {\n\t\t\t\techo $e;\n\t\t\t}\n }", "function index_delete() {\n\t\t$id = $this->delete('id');\n\t\t$this->db->where('id', $id);\n\t\t$delete = $this->db->delete('driver_detail');\n\t\tif ($delete) {\n\t\t\t$this->response(array('status' => 'success'), 201);\n\t\t} else {\n\t\t\t$this->response(array('status' => 'fail', 502));\n\t\t}\n\t}", "public function delete() {\n\t\ttry {\n\t\t\tif($this->_state == self::STATE_UNCHANGED) {\n\t\t\t\t$sql = 'DELETE FROM ' . self::sanitize($this->_table->getProperty('name')) . ' WHERE ' . self::sanitize($this->_key_primary->name) . ' = ' . self::sanitize($this->_data[$this->_key_primary->name]);\n\t\t\t\t\\Bedrock\\Common\\Logger::info('Deleting record with query: ' . $sql); echo $sql;\n\t\t\t\t$this->_connection->exec($sql);\n\t\t\t}\n\t\t\telseif($this->_state == self::STATE_CHANGED) {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Unsaved changes found, cannot delete record.');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Record not found in database.');\n\t\t\t}\n\t\t}\n\t\tcatch(\\PDOException $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('A database error was encountered, the record could not be deleted.');\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The record could not be deleted.');\n\t\t}\n\t}", "function index_delete() {\n $id = $this->delete('id'); // Memanggil data berdasarkan arraynya\n $this->db->where('id', $id);\n $delete = $this->db->delete('telepon'); \n if ($delete) {\n $this->response(array('status' => 'success'), 201);// Jika berhasil maka akan tampil\n } else {\n $this->response(array('status' => 'fail', 502));// Jika gagal maka akan tampil\n }\n }", "function index_delete() {\n $id = $this->delete('id');\n $this->db->where('id', $id);\n $delete = $this->db->delete('barang');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "function record_update(){\n\t\t\n\t\t$data=array();\n\t\t\n\t\t$data['status']=$this->uri->segment(3);\n\t\t\n\t\t$this->ObjM->update($data,'slc_mater','id',$this->uri->segment(4));\n\t\t\n\t\t$sts=$this->uri->segment(3);\n\t\t\n\t\tif($this->uri->segment(3)==\"Delete\"){\n\t\t\t\n\t\t\t$this->session->set_flashdata(\"show_msg\", \" <b>Sucess</b> Record Deleted successfully.....\");\n\t\t\t\n\t\t}\n\t\t\n\t\theader('Location: '.base_url().'index.php/'.$this->uri->segment(1));\n\t\t\n\t}", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "function delete($id)\r\n {\r\n \r\n // status change \r\n if ($this->chat_model->save(array('status'=>'I'),$id)==TRUE)\r\n {\r\n redirect(site_url('admin/chat/index/?msg_success=Successfully details updated'));\r\n }\r\n else\r\n {\r\n redirect(site_url('admin/chat/index/?msg_error=Unsuccess full opertation'));\r\n\r\n }\r\n \r\n }", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "public function deleteProduct(){\n if($_POST['action'] != 'deleteProduct'){\n echo json_encode(['success' => false]);\n return false;\n }\n $model = parent::model('UpdateProductModel');\n $id = $_POST['id'];\n $name = $model->getProductById($id)->name;\n $deleteProduct = $model->deleteProduct($id);\n // var_dump($deleteProduct);die;\n if(!$deleteProduct){\n $deleteStatus = $model->deleteProductStatus($id);\n if($deleteStatus){\n echo json_encode([\n 'id' => $id,\n 'name' => $name,\n 'action' => 'updateStatus',\n 'success' => true,\n 'message' => \"Product name have include in bill, CAN'T DELETE PERMANENTLY, DataBase have updated 'PRODUCT STATUS' to DELETED ( not able to use anymore )\"\n ]);\n }else{\n echo json_encode([\n 'action' => 'updateStatus',\n 'success' => false,\n 'message' => \"there is an error, can't not update status deleted !\"\n ]);\n }\n }else{\n echo json_encode([\n 'id' => $id,\n 'name' => $name,\n 'action' => 'deletePermanently',\n 'success' => true\n ]);\n\n }\n \n }", "protected function _delete()\n\t{\n\t}", "public function chang_status( $aData ){\n // $aSave[\"update_by\"] = $aData[\"user\"];\n // $aSave[\"status\"] = $aData[\"status\"];\n // debug($aData, true);\n $this->db->where(\"word\", $aData[\"language_word\"]);\n if ($this->db->delete('language')) {\n $aReturn[\"flag\"] = true;\n $aReturn[\"msg\"] = \"success\";\n }else{\n $aReturn[\"flag\"] = false;\n $aReturn[\"msg\"] = \"Error SQL !!!\";\n }\n\n return $aReturn;\n }", "public function soft_delete(){\n\t\tif($this->data[$this->primary_key]){\n\t\t\t$this->data['deleted'] = 1;\n\t\t\treturn $this->save();\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public static function delete($id){\n\t\t\t$conn = Db::getInstance();\n\t\t\t\n\t\t\t$st = $conn->prepare(\"UPDATE `\" . static::db_table . \"` SET `status` = ? WHERE `id` = ?\");\n\t\t\t$st->execute([0, $id]);\n\t\t\t\n\t\t\treturn true;\n\t\t}", "public function delete($id){\n $soft_deleted = $this->master->delete_record($id);\n if($soft_deleted > 0){\n $this->session->set_flashdata('success','State deleted successfully.');\n redirect('state');\n }\n }", "public function delete($data)\n {\n $id=$data->input('id');\n $employee = Employee::find($id);\n $employee-> delete_flag = true; \n $employee-> deleted_at = date('Y-m-d H:i:s');;\n $employee->save();\n\n }", "public function __doDelete()\n {\n $strSQL = $this->getDeleteSql();\n $result = $this->query($strSQL);\n }", "public function index_delete(){\n $id=$this->delete('id'); //ambil value dari key id\n if ($id===null){ //jika id samadengan kosong\n $this->response([\n 'status' => false, //status= false\n 'message' => 'provide id' //message not found\n ], REST_Controller::HTTP_BAD_REQUEST);// status http menjadi 400 BAD REQUEST\n }else{ //selain itu\n\n $id=$this->delete('id'); //ambil value dari key id\n $w = array('id' => $id ); //where id=$id\n\n if($this->m_mahasiswa->delete('mahasiswa',$w) > 0){ //jika berhasil menjalankan m_mahasiswa delete dan diatas 0\n $this->response([\n 'status' => true, //status= true\n 'id'=> $id,\n 'message' => 'deleted' //message not found\n ], REST_Controller::HTTP_OK); //204 no content\n }else{ //selain itu\n\n $this->response([\n 'status' => false, //status= false\n 'message' => 'id not found' //message not found\n ], REST_Controller::HTTP_BAD_REQUEST); //400 bad request\n\n }\n\n }\n }", "public function setDeleted() {}", "public function delete_command(){\n\t\t$this->layout = 'ajax';\n\t\n\t\tif($this->request->is('post')){\n\t\t\t$command_id = $this->request->data['command_id'];\n\t\n\t\t\t$obj_command = $this->Command->findBy('IDCommand', $command_id);\n\t\t\tif($obj_command->saveField('Status', 0)){\n\t\t\t\techo json_encode(array('success'=>true,'msg'=>__('Eliminado con &eacute;xito.')));\n\t\t\t\texit();\n\t\t\t}else{\n\t\t\t\techo json_encode(array('success'=>false,'msg'=>__('Error inesperado.')));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\n\t}", "public function deleteModel($id){\t\r\n\t\t$this->db->where('id',$id);\r\n\t\treturn $this->db->update('uqc',array('delete_status'=>1));\r\n\t}", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function delete_image($img) {\n $this->db->where('Images',$img);\n $this->db->update('advertisement_image',array('StatusID'=>3));\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }", "protected function delete() {\n\t}", "public function delete(){\r\n\t\tif(!$this->input->is_ajax_request()) show_404();\r\n\r\n\t\t//$this->auth->set_access('delete');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\tif($this->input->post('ang_id') === NULL) ajax_response();\r\n\r\n\t\t$all_deleted = array();\r\n\t\tforeach($this->input->post('ang_id') as $row){\r\n\t\t\t//$row = uintval($row);\r\n\t\t\t//permanent delete row, check MY_Model, you can set flag with ->update_single_column\r\n\t\t\t$this->m_anggota->permanent_delete($row);\r\n\r\n\t\t\t//this is sample code if you cannot delete, but you must update status\r\n\t\t\t//$this->m_anggota->update_single_column('ang_deleted', 1, $row);\r\n\t\t\t$all_deleted[] = $row;\r\n\t\t}\r\n\t\twrite_log('anggota', 'delete', 'PK = ' . implode(\",\", $all_deleted));\r\n\r\n\t\tajax_response();\r\n\t}", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "public function delete_data_to_tombstone(){\n }", "public function delete_post() {\n $data = $this->input->post();\n if($data['id'] == null) {\n $this->set_response(array('response_code'=>400, 'response_message'=>'Parameter missing', 'response_data'=>array()), REST_Controller::HTTP_OK);\n return;\n }\n $result = $this->Api_model->deleteData('info', array('id'=>$data['id']));\n if($result == 1) {\n $this->set_response(array('response_code'=>200,'response_message'=>'Success','response_data'=>$result), REST_Controller::HTTP_OK); \n return; \n }\n $this->set_response(array('response_code'=>400,'response_message'=>'Error occurs while process','response_data'=>array()), REST_Controller::HTTP_OK);\n return;\n }", "public function delete()\r\n\t{\r\n\t}", "public function delete($id)\n\t {\n $this->db->where('id',$id);\n return $this->db->update('bank_account',array('delete_status'=>1));\n\t }", "protected function _postDelete()\n\t{\n\t}", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "function del_blog($id,$status){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->query(\"UPDATE `utilisateur` SET `fqdn_blog` = 'supprimer' WHERE `id_utilisateur` = $id\");\n\t\t$req = $bdd->query(\"UPDATE `utilisateur` SET `status_blog` = '$status' WHERE `id_utilisateur` = $id\");\n\t\t\n\t\t$req->closeCursor();\n\t}", "public function delete()\n {\n \n }", "public function delete($id)\n {\n \n $this->db->set('delete_flag', 1);\n $this->db->where('id', $id);\n $this->db->update('items');\n echo json_encode(['success'=>true]);\n }", "public function delete(){\n\t\t$kiwi_class = Model_Kiwi::get_classname( get_class($this) ); //returns User for Model_User\n\t\t$pcol = $this->kiwi_primary_key();\n\t\t$pk = $this->$pcol;\n\t\t$mc_key = static::kiwi_mc_key($kiwi_class, $pk);\n\t\tif (empty($pk))\n\t\tthrow new ActiveRecordException(\"Cannot delete, no primary key defined for: \" . $kiwi_class);\n\t\t//FIRST delete the key from memcache\n\t\tstatic::delete_from_memcache($mc_key, $kiwi_class);\n\t\t$return_status = false;\n\t\t//DO NOT DELETE - just soft delete\n\t\tif( Kohana::$config->load('gameconfig.mysql_hard_delete_disabled') &&\n\t\t\t\tin_array( Model_Kiwi::get_table_name($kiwi_class), ActiveRecord\\Model::$soft_delete_enabled_tables)\t){\n\t\t\tKohana::$log->add(Log::DEBUG, \"Mysql Deletes are disabled - using soft delete\");\n\t\t\t$return_status = $this->update_attribute(ActiveRecord\\Model::$soft_deleted_column, 1);\n\t\t}else{\n\t\t\t$return_status = static::table()->delete(array($pcol => $pk));\n\t\t}\n\t\treturn $return_status ;\n\t}", "public function setDeleted(): void\n {\n $this->attributes['mode'] = 'delete';\n }", "function index_delete() {\n $id_diagnosa = $this->delete('id_diagnosa');\n $this->db->where('id_diagnosa', $id_diagnosa);\n $delete = $this->db->delete('diagnosa');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function preDelete() { }", "protected function _preDelete() {}", "function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}", "function updateStatus(){\n\t\t$this->setPost();\n\n\t\t$postData = $_POST;\n\n\t\tif($postData->status_id == 1){\n\t\t\t$updateData = array('status_id' => 2);\n\t\t}else{\n\t\t\t$updateData = array('status_id' => 1);\n\t\t}\n\n\t\t$where = array('id' => $postData->id);\n\n\t\t$result = $this->base_model->updateCommon($this->primaryTable, $updateData, $where);\n\n\t\t$response = array('status' => TRUE, 'message' => 'Document status updated successfully.');\n\n\t\techo json_encode($response);\n\t}", "function delete(){\n\t\t\t\t$servername = \"localhost\";\n\t\t\t\t$username = \"root\";\n\t\t\t\t$password = \"\";\n\t\t\t\t$dbname = \"CS230\";\n\t\t\t\t//Variables for holding entity data\n\t\t\t\t$i = $_POST['i'];\n\t\t\t\t$conn = mysqli_connect($servername, $username, $password, $dbname);\n\t\t\t\tif($conn){\n\t\t\t\t//echo \"Connection OK\";\n\t\t\t\t}else{\n\t\t\t\t\tdie(\"The Connection has failed: \" .mysqli_connect_error());\n\t\t\t\t}\n\t\t\t\t$sql = \"DELETE FROM eBook_MetaData WHERE id='$i'\";\n\t\t\t\t$data = mysqli_query($conn,$sql);\n\t\t\t\t\t//If data is not transfered to the database\n\t\t\t\t\tif(!$data){\n\t\t\t\t\techo \"error\";\n\t\t\t\t\t//If it is transfered\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"Data deleted\";\n\t\t\t\t\t}\n\t\t\t\t$conn = null;\n\t\t\t\t}", "function delete_record($_DELETE)\n {\n $delete_data = json_decode($_DELETE[\"0\"], true);\n if (isset($delete_data[\"id\"])) {\n $id = $delete_data[\"id\"];\n if ($id <= 0) {\n $this->invalid_data_format(array(\n 'error' => 'Invalid Data Format',\n 'SampleJsonDataFormat' => '[{\"id\":24}]'\n ));\n return;\n }\n } else {\n $statusCode = 400;\n $this->setHttpHeaders(\"application/json\", $statusCode);\n $rows = array(\n 'error' => 'Invalid Data Format Gopi',\n 'SampleJsonDataFormat' => '{\"id\":24}'\n );\n $response = json_encode($rows);\n echo $response;\n return;\n }\n $db = new DB();\n $conn = $db->connect();\n if (empty($conn)) {\n $statusCode = 404;\n $rawData = array(\n 'error' => 'No databases found!'\n );\n $response = json_encode($rawData);\n echo $response;\n return;\n } else {\n $statusCode = 200;\n }\n $stmt = $conn->prepare(\"Delete from user_agents where id=?\");\n $stmt->bind_param('i', $id);\n $stmt->execute();\n $conn->close();\n\n $this->setHttpHeaders(\"application/json\", $statusCode);\n }", "function delete() {\n \tglobal $mysql;\n \tif(empty($this->id)) return;\n \t$tablename = $this->class_name();\n \t$id = $this->id;\n \t$query = \"DELETE FROM $tablename WHERE id=$id\";\n \t$mysql->update($query);\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "function evento_pessoa_delete($idevento){\r\n\r\n\t\t$this->idevento = $idevento;\r\n\t\t$this->status = 2;\r\n\t\t$bd = Crud_Evento::conexao();\r\n\t\t$sql = \"UPDATE evento set status = :status WHERE idevento = :idevento\";\r\n\t\t$stmt = $bd->prepare( $sql );\r\n\t\t$stmt->bindParam(':idevento',$this->idevento,PDO::PARAM_INT);\r\n\t\t$stmt->bindParam(':status', $this->status, PDO::PARAM_INT);\r\n\r\n\t\t\r\n\r\n\t\t$bd = Crud_Evento::conexao();\r\n\r\n\t\t$sql = \"DELETE FROM evento_pessoa WHERE idevento = :idevento \";\r\n\t\t$stmt = $bd->prepare($sql);\r\n\t\t$stmt->bindParam(':idevento',$idevento, PDO::PARAM_INT);\r\n\r\n\t\t$result = $stmt->execute();\r\n\r\n\t}", "public function deleteData(){\n //buatlah query\n $sqlQuery = \"DELETE FROM \" . $this->t_name . \" WHERE id = ?\";\n\n //persiapkan stmt\n $stmt = $this->conn->prepare($sqlQuery);\n\n //cukup converte id\n $this->id=htmlspecialchars(strip_tags($this->id));\n\n //bind\n $stmt->bindParam(1,$this->id);\n\n //eksekusi\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "public function delete() {\r\n }", "public function deleteStatus(Request $request){\n $id = $request->id;\n $status = Status::where( 'id' , $id )->first(); \n if (!isset($status)) {\n return response()->json(['data' => '' , 'message' => 'Status Not Found'], 400);\n } \n $status->delete();\n return response()->json(['data' => '' , 'message' => 'Status Deleted Successfully'], 200); \n }", "public function delete($data)\n {\n }", "public function delete($data)\n {\n }", "public function DELETE($kode){\n\t\t$this->db->where('KODE_KARTU_KREDIT',$kode);\n\t\t$this->db->update('kartu_kredit',array('status'=>'0'));\n\t}", "public function DELETE($kode){\n\t\t$this->db->where('KODE_KARTU_KREDIT',$kode);\n\t\t$this->db->update('kartu_kredit',array('status'=>'0'));\n\t}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function deleteRecord(){\n\t\t/* Variable initialization */\n\t\t$intEmailCode \t= ($this->input->post('txtDeleteRecordCode') !='') ? getDecyptionValue($this->input->post('txtDeleteRecordCode')) : 0;\n\n\t\t/* if email code is not pass then do needful */\n\t\tif($intEmailCode == 0){\n\t\t\t/* Return error message */\n\t\t\tjsonReturn(array('status'=>0,'message'=>\"Invalid email template code requested.\"), true);\n\t\t}\n\t\t/* Setting the updated array */\n\t\t$strUpdatedArr\t= array(\n\t\t\t\t\t\t\t\t\t'table'=>$this->_strPrimaryTableName,\n\t\t\t\t\t\t\t\t\t'data'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t'deleted'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t'updated_by'=>$this->getUserCode(),\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'where'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t'id'=>$intEmailCode\n\t\t\t\t\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\t\t);\n\t\t/* Updating the requested record set */\n\t\t$intNunberOfRecordUpdated = $this->_objDataOperation->setUpdateData($strUpdatedArr);\n\n\t\tif($intNunberOfRecordUpdated > 0){\n\t\t\tjsonReturn(array('status'=>1,'message'=>'Requested email template deleted successfully.'), true);\n\t\t}else{\n\t\t\tjsonReturn(array('status'=>0,'message'=>DML_ERROR), true);\n\t\t}\n\n\t\t/* removed variables */\n\t\tunset($strUpdatedArr);\n\t}", "public function deleting()\n {\n # code...\n }", "public function delete()\n\t{\n\t}", "public function actionDelete()\n {\n try{\n $id = $_POST['hapusIndex'];\n\n if($id == \"all\"){\n $session = new Session();\n $id_perkara = $session->get('id_perkara');\n\n PdmBa13::updateAll(['flag' => '3'], \"id_perkara = '\" . $id_perkara . \"'\");\n }else{\n for($i=0;$i<count($id);$i++){\n $model = $this->findModel($id[$i]);\n $model->flag = '3';\n $model->update();\n }\n }\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Berhasil di Hapus',\n 'title' => 'Hapus Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect(['index']);\n }catch (Exception $e){\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Gagal di Hapus',\n 'title' => 'Hapus Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect(['index']);\n }\n }", "function del($ar){\n $p = new XParam($ar, array());\n $oid = $p->get('oid');\n $lnkuser = selectQuery('select lnkuser from '.$this->xset->getTable().' where KOID=\\''.$oid.'\\'')->fetch(PDO::FETCH_COLUMN);\n // satus du compte \n updateQuery('update '.$this->xset->getTable().' set STATUS=\\'INACTIVE\\' where KOID=\\''.$oid.'\\'');\n // date du users\n updateQuery('update USERS set DATET=\\''.date('Y-m-d').'\\' where KOID=\\''.$lnkuser.'\\'');\n }", "public function deleteStatus()\n {\n $order_status = new OrderState((int)ConfPPM::getConf('status_paysto'));\n if (Validate::isLoadedObject($order_status)) {\n $order_status->delete();\n }\n }", "public function deleteAction()\n {\n $request = $this->getRequest();\n if($request->isPost()){\n $id = $this->params()->fromPost('id');\n $combo = $this->modelCombo->findOneBy(array('id'=>$id));\n $combo->setIsdelete(1);\n $this->modelCombo->edit($combo);\n //$this->model->delete(array('id'=>$id));\n echo 1;\n }\n die;\n\n }", "public function delete()\r\n {\r\n $recordId = $this->getRecId();\r\n $command = static::getDb()->newDeleteCommand(static::$defaultLayout, $recordId);\r\n try {\r\n $command->execute();\r\n return 1;\r\n } catch (FileMakerException $e) {\r\n $this->addError('delete', $e->getMessage());\r\n return 0;\r\n }\r\n }", "public function index_delete(){\n\t\t\n\t\t}", "public function beforeDelete() {\n\t\tif (parent::beforeDelete() && $this->hasAttribute('status')) {\n\t\t\t$this->status = self::STATUS_DELETED;\n\t\t\t$this->save(false);\n\t\t\treturn false; // Prevent actual DELETE query from being run\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}" ]
[ "0.69490266", "0.6895396", "0.67349416", "0.66336715", "0.6492244", "0.64740676", "0.6442557", "0.64202857", "0.6404068", "0.6362154", "0.63542485", "0.6352109", "0.6309286", "0.62875897", "0.6278759", "0.6266776", "0.62657243", "0.62543064", "0.6251172", "0.62450856", "0.6240081", "0.62239903", "0.62165815", "0.62159544", "0.6202113", "0.61886954", "0.6184991", "0.6155852", "0.6154035", "0.61496955", "0.61364007", "0.6113566", "0.61123663", "0.6108426", "0.61015326", "0.6080587", "0.608034", "0.60748976", "0.6067352", "0.6065786", "0.60607314", "0.60525995", "0.60428137", "0.603457", "0.60344374", "0.6032907", "0.60266405", "0.60201603", "0.60131216", "0.6009437", "0.6007043", "0.60050994", "0.6002745", "0.6001781", "0.598647", "0.5982808", "0.5982594", "0.59821385", "0.5978907", "0.59760976", "0.5967963", "0.5964569", "0.59643656", "0.5962932", "0.59621483", "0.5960286", "0.59592456", "0.59569293", "0.5955814", "0.59545314", "0.59515446", "0.59511346", "0.59510636", "0.5949925", "0.59485763", "0.59466696", "0.59411675", "0.593999", "0.5937027", "0.59369045", "0.59362924", "0.59362924", "0.59322363", "0.5930549", "0.59275585", "0.59219486", "0.5915671", "0.5915671", "0.59052354", "0.59052354", "0.5903718", "0.5902178", "0.59012145", "0.5893513", "0.5893111", "0.5892334", "0.589153", "0.5881912", "0.587736", "0.5870592", "0.5870179" ]
0.0
-1
delete() Clear all datas in Data Base
public function truncate() { debugInfo(get_class($this)."->truncate"); // clear private variables $this->_clear(); $this->_query = "TRUNCATE TABLE $this->_table;"; $return = $this->_execute(false); debug('->truncate(), $return', $return); return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteall() {\n\t\t$this->_query( \"DELETE FROM $0\" );\n\t}", "protected function clearAllPersistentData()\r\n {\r\n }", "function erase() {\n //delete * from database\n }", "public function clear()\n {\n $this->conn->flushDb();\n }", "public function clear()\r\n\t{\r\n\t\t$this->db->runQuery(\"TRUNCATE TABLE `\" . $this->name . \"`\");\r\n\t}", "public function delall()\n {\n }", "public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }", "public function deleteAll()\n {\n $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';\n $this->db->sql_query($query);\n }", "public function delete_all()\n {\n }", "static function deleteAll()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores;\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands;\");\n }", "public function clearAllDevices(){\n\t\t$db = Db::getInstance();\n\n\t\t$req = $db->prepare('DELETE FROM Devices');\n\t\t$req->execute();\n\t\t\n\n\n\t}", "public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public function clearDb ()\n {\n // Empty tables and reset auto-increment values\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 0');\n foreach (self::$dbTables as $table) {\n $stmt = $this->_dbh->prepare('TRUNCATE `' . $table . '`');\n $stmt->execute();\n $stmt = $this->_dbh->prepare('ALTER TABLE `' . $table . '` AUTO_INCREMENT = 1');\n $stmt->execute();\n }\n // Re-enable checks only if set as such in config\n $config = parse_ini_file('config/AcToBs.ini', true);\n if (isset($config['checks']['fk_constraints']) && $config['checks']['fk_constraints'] == 1) {\n $this->_dbh->query('SET FOREIGN_KEY_CHECKS = 1');\n }\n // Delete denormalized tables\n foreach (self::$dbDenormalizedTables as $table) {\n $stmt = $this->_dbh->prepare('DROP TABLE IF EXISTS `' . $table . '`');\n $stmt->execute();\n }\n // Delete non-standard taxonomic ranks\n $stmt = $this->_dbh->prepare(\n 'DELETE FROM `taxonomic_rank` WHERE `standard` = ?');\n $stmt->execute(array(\n 0\n ));\n unset($stmt);\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function deleteAll(): void;", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "function delete(){\r\n\t\t//Connect\r\n\t\t$sql = new DataBase;\r\n\t\t$sql->connect();\r\n\t}", "function ClearDatabase() {\n $link = mysql_connect($this->servername, $this->username, $this->password);\n if (!$link) {\n die('Could not connect: ' . mysql_error());\n }\n \n //Make Players the current database\n $db_selected = mysql_select_db($this->dbname, $link);\n \n $delete = \"DELETE FROM Player\";\n mysql_query($delete, $link);\n \n mysql_close($link);\n \n $this->GenerateJSONResponseData();\n }", "public function deleteAllPersistentData()\n {\n foreach ($this->persistantMap as $key) {\n $this->store->delete($key);\n }\n }", "public function deleteDatabaseStructure( );", "abstract public function deleteAll();", "function clear() {\r\n /* clear datasource. you should call this before calling another populate() to avoid datasource gets appended\r\n */\r\n $this->ds = new DataSource;\r\n $this->db_count = 0;\r\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM aluno';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "public function delete(){\r\n\t\t$this->db->delete();\r\n\t}", "public function clearDatabase()\n {\n $purger = new ORMPurger($this->getEntityManager());\n $purger->purge();\n }", "public function clear()\n {\n $this->dataStorage = [];\n }", "public function deleteAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->deleteAll();\n }\n }\n }\n }\n $this->delete();\n }", "public function clearAll() {\n $list = scandir(self::ROOT_PATH . \"/public/{$this->storagePath}\");\n foreach ($list as $file) {\n if ($file == '.' || $file == '..') {\n continue;\n }\n $filePath = self::ROOT_PATH . \"/public/{$this->storagePath}/$file\";\n unlink($filePath);\n }\n $this->_tableGw->delete();\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "public static function deleteAll() {\n // Initiate implicit tx if explicit one doesn't exist\n $is_implicit_tx = false;\n if (self::$numTransactions == 0) {\n $is_implicit_tx = true; \n self::beginTx();\n }\n\n // Fail because 'databaseHandle' wasn't initialized by 'beginTx()' \n assert(isset(self::$databaseHandle));\n\n try {\n $sql_records = static::fetchAll();\n foreach ($sql_records as $record) {\n $record->delete();\n } \n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Close implicit tx\n if ($is_implicit_tx) {\n self::endTx();\n }\n }", "public function clear(): void\n {\n $app = App::get();\n $list = $app->data->getList()\n ->filterBy('key', '.temp/cache/', 'startWith');\n foreach ($list as $item) {\n $app->data->delete($item->key);\n };\n }", "private function clear_dummy_data()\n {\n $this->adapter->query('DELETE FROM ' . RUCKUSING_TS_SCHEMA_TBL_NAME);\n }", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "public static function deleteAll() {\n\t\treturn self::_getDao()->deleteAll();\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM ano_letivo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function clear()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->multiRef = [];\n\n }", "function clear() {\n\n switch ($this->type) {\n case 'sqlite':\n case 'mysql':\n $query[0] = 'DROP TABLE `enrolled`;';\n\n $query[1] = 'DROP TABLE `paid`;';\n\n $query[2] = 'DROP TABLE `admin`;';\n\n $query[3] = 'DROP TABLE `log`';\n\n $query[4] = 'DROP TABLE `stage`';\n\n\t\t\t\t$query[5] = 'DROP TABLE `guest`';\n\n break;\n\n default:\n throw new Exception($this->type . \" is not a valid database type.\");\n break;\n\n }\n\n foreach ($query as $drop) {\n $this->query($drop);\n }\n\n /**\n * Integrity Checking goes here\n */\n\n }", "public function clearAll();", "public function clearAll();", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function flush()\n {\n $this->table()->delete();\n }", "function deleteAll() {\n\t\t$dbh=$this->getdbh();\n\t\t$sts = $dbh->exec('DELETE FROM '.$this->enquote($this->tablename));\n\t\treturn $sts;\n\t\n\t}", "public function clearAction()\n {\n $this->container->get('dbal_connection')->executeQuery('SET FOREIGN_KEY_CHECKS = 0');\n $this->container->get('dbal_connection')->executeQuery('TRUNCATE TABLE s_plugin_mailcatcher_attachments');\n $this->container->get('dbal_connection')->executeQuery('TRUNCATE TABLE s_plugin_mailcatcher');\n $this->container->get('dbal_connection')->executeQuery('SET FOREIGN_KEY_CHECKS = 1');\n }", "public function removeAll() {\n $sql = 'SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE course';\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare($sql);\n \n $stmt->execute();\n $count = $stmt->rowCount();\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM compra_coletiva';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function emptyDb()\n {\n $this->client->run('MATCH (n) OPTIONAL MATCH (n)-[r]-() DELETE r,n', null, null);\n }", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}", "function clear_all(){\r\n\r\n if (isset($_POST['clear'])){\r\n global $connection;\r\n\r\n // Clear all entries\r\n $query = \"DELETE FROM games\";\r\n $result = mysqli_query($connection, $query);\r\n }\r\n }", "public function deleteAll($initAutoIncrement = false): void;", "public function clear()\n {\n $this->connection->del($this->key);\n\n if ($this->on_change) {\n call_user_func($this->on_change, []);\n }\n\n if ($this->on_clear) {\n call_user_func($this->on_clear, []);\n }\n }", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public static function dbClear(){\n\t\tif (App::runningUnitTests()) {\n\t\t\tself::clearModelTables(TestSettings::$modelTables);\n\t\t\tself::clearTables(TestSettings::$pivotTables);\n\t\t}\n\t}", "public function clear()\n\t{\n\t\t$this->co_usuario = null;\n\t\t$this->nu_cpf = null;\n\t\t$this->ds_password = null;\n\t\t$this->no_usuario = null;\n\t\t$this->ds_login = null;\n\t\t$this->dt_ultimo_login = null;\n\t\t$this->ds_email = null;\n\t\t$this->co_perfil = null;\n\t\t$this->nu_celular = null;\n\t\t$this->nu_telefone = null;\n\t\t$this->st_usuario = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->applyDefaultValues();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}", "public function clear() {\n\t\t$this->_where\t\t= array();\n\t\t$this->_order\t\t= array();\n\t\t$this->_isAddingNew\t= false;\n\t\t$this->_currentRow\t= 0;\n\t\t$this->_relationship\t= array();\n\t\t$this->_recordset\t= array();\n\t\t$this->_updateBuffer\t= array();\n\t\t$this->_limit\t\t= NULL;\n\t\t$this->_offset\t\t= NULL;\n\t\t$this->isDirty( false );\n\t}", "function delete()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores WHERE id = {$this->getId()};\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands WHERE store_id = {$this->getId()};\");\n }", "public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }", "public function clear()\n {\n $this->sekolah_id = null;\n $this->semester_id = null;\n $this->id_ruang = null;\n $this->hari = null;\n $this->bel_ke_01 = null;\n $this->bel_ke_02 = null;\n $this->bel_ke_03 = null;\n $this->bel_ke_04 = null;\n $this->bel_ke_05 = null;\n $this->bel_ke_06 = null;\n $this->bel_ke_07 = null;\n $this->bel_ke_08 = null;\n $this->bel_ke_09 = null;\n $this->bel_ke_10 = null;\n $this->bel_ke_11 = null;\n $this->bel_ke_12 = null;\n $this->bel_ke_13 = null;\n $this->bel_ke_14 = null;\n $this->bel_ke_15 = null;\n $this->bel_ke_16 = null;\n $this->bel_ke_17 = null;\n $this->bel_ke_18 = null;\n $this->bel_ke_19 = null;\n $this->bel_ke_20 = null;\n $this->create_date = null;\n $this->last_update = null;\n $this->soft_delete = null;\n $this->last_sync = null;\n $this->updater_id = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->alreadyInClearAllReferencesDeep = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "private function purgeTables()\n\t{\t\n\t\t$this->db->query(\"DELETE FROM categories\");\n\t\t$this->db->query(\"DELETE FROM album_art\");\n\t\t$this->db->query(\"TRUNCATE TABLE albums\");\n\t\t\n\t}", "public function delete_data_to_tombstone(){\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "public function destroy() {\n\t\t$sql = 'DELETE FROM ' . static::$table . ' WHERE id = ' . $this->get('id') . ';';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute();\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM conta_a_pagar';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function reset()\n {\n $this->getDb()->exec('delete from media');\n //pictures and vignettes deletion\n $this->deleteMedias();\n //backup deletion\n $this->deleteBackup();\n }", "public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}", "public function destroy()\n {\n $db = XenForo_Application::get('db');\n $db->query('DROP TABLE `' . self::DB_TABLE . '`');\n }", "public function clear_all()\n {\n }", "function clearSQL() {}", "function deleteAllData() {\n $successObservers = $this->databaseDeleteRecord($this->tableObservers, NULL);\n $successActions = $this->databaseDeleteRecord($this->tableActions, NULL);\n $successGroups = $this->databaseDeleteRecord($this->tableGroups, NULL);\n if ($successObservers !== FALSE && $successActions !== FALSE && $successGroups !== FALSE) {\n return TRUE;\n }\n return FALSE;\n }", "public function flushDataStore()\n {\n $this->database->flushAll(); \n }", "public function remove_all_data()\n\t{\n\t\t$this->_data = array();\n\t}", "function clearwatson(){\n\t\t$connection = Database::getConnection();\n\t\t//Empty watson table\n\t\t$query=\"TRUNCATE TABLE watson\";\n\t\tif (!$connection->query($query)){\n\t\t\techo \"Error :\" .$query . \"<br>\" . $connection->error;\n\t\t}\n\t\t//Empty watson_country table\n\t\t$query=\"TRUNCATE TABLE watson_country\";\n\t\tif (!$connection->query($query)){\n\t\t\techo \"Error :\" .$query . \"<br>\" . $connection->error;\n\t\t}\n\t}", "public function clear()\n {\n $this->id = null;\n $this->code = null;\n $this->category = null;\n $this->address = null;\n $this->address2 = null;\n $this->zipcode = null;\n $this->city = null;\n $this->geo_coordinate_x = null;\n $this->geo_coordinate_y = null;\n $this->distance_camping = null;\n $this->image = null;\n $this->priority = null;\n $this->tel = null;\n $this->fax = null;\n $this->email = null;\n $this->website = null;\n $this->created_at = null;\n $this->updated_at = null;\n $this->active = null;\n $this->alreadyInSave = false;\n $this->alreadyInValidation = false;\n $this->clearAllReferences();\n $this->applyDefaultValues();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function clear()\n\t{\n\t\t$this->id = null;\n\t\t$this->uf_id = null;\n\t\t$this->nome = null;\n\t\t$this->slug = null;\n\t\t$this->longitude = null;\n\t\t$this->latitude = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}", "protected function clearAllPersistentData()\n {\n foreach ($this->_sessionNamespace as $key => $value) {\n unset($this->_sessionNamespace->{$key});\n }\n }", "public function clearApplicationData();", "public function clear()\n {\n self::foreignChecks(false);\n $this->model->truncate();\n self::foreignChecks(true);\n }", "function clearDatabase1()\n {\n global $db;\n $sql = \"TRUNCATE TABLE messages\";\n $query = $db->prepare($sql);\n $query->execute();\n }", "public static function gc()\n {\n Dba::write('DELETE FROM `album` USING `album` LEFT JOIN `song` ON `song`.`album` = `album`.`id` WHERE `song`.`id` IS NULL');\n }", "public function clearAll() {}", "public function delete()\n {\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers;\");\n $this->entityManager->getConnection()->exec(\"TRUNCATE subscriptions_products_tiers_payment_options;\");\n }", "static function empty_temp_db() {\n\t\tif(self::using_temp_db()) {\n\t\t\t$dbadmin = new DatabaseAdmin();\n\t\t\t$dbadmin->clearAllData();\n\t\t\t\n\t\t\t// Some DataExtensions keep a static cache of information that needs to \n\t\t\t// be reset whenever the database is cleaned out\n\t\t\tforeach(array_merge(ClassInfo::subclassesFor('DataExtension'), ClassInfo::subclassesFor('DataObject')) as $class) {\n\t\t\t\t$toCall = array($class, 'on_db_reset');\n\t\t\t\tif(is_callable($toCall)) call_user_func($toCall);\n\t\t\t}\n\t\t}\n\t}", "public function clear()\n\t{\n\t\tforeach($this->all() as $ip)\n\t\t{\n\t\t\t$this->delete($ip['ip_address']);\n\t\t}\n\t}", "public static function deleteAllPlayers() {\n \tCommonDao::connectToDb();\n \t$query = \"delete from player where player_id > 0\";\n \tmysql_query($query);\n }", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "public function clear()\n\t{\n\t\t$this->id = null;\n\t\t$this->perfil_id = null;\n\t\t$this->endereco_id = null;\n\t\t$this->cargo_id = null;\n\t\t$this->departamento_id = null;\n\t\t$this->matricula = null;\n\t\t$this->nome = null;\n\t\t$this->email = null;\n\t\t$this->dni = null;\n\t\t$this->data_nascimento = null;\n\t\t$this->data_contratacao = null;\n\t\t$this->celular = null;\n\t\t$this->telefone = null;\n\t\t$this->token = null;\n\t\t$this->nome_usuario = null;\n\t\t$this->senha = null;\n\t\t$this->token_senha = null;\n\t\t$this->token_firebase = null;\n\t\t$this->data_rescisao = null;\n\t\t$this->ativo = null;\n\t\t$this->tipo_acesso = null;\n\t\t$this->estado_civil = null;\n\t\t$this->nivel_acesso = null;\n\t\t$this->usuario_validado = null;\n\t\t$this->sexo = null;\n\t\t$this->data_cadastro = null;\n\t\t$this->alreadyInSave = false;\n\t\t$this->alreadyInValidation = false;\n\t\t$this->clearAllReferences();\n\t\t$this->applyDefaultValues();\n\t\t$this->resetModified();\n\t\t$this->setNew(true);\n\t\t$this->setDeleted(false);\n\t}", "public function reset_rezultati()\n {\n $query = $this->query(\"SELECT * FROM rezultati;\");\n foreach ($query->getResultArray() as $row)\n {\n $this->delete($row['idrezultati']);\n }\n }", "public function clear()\n {\n $this->data = [];\n }", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "public function clearAll(){\n\n }", "public static function cleanDatabase()\n\t{\n\t\t$expire = time() - 86400*30;\n\t\tDB::get()->prepare(\"\n\t\t\tDELETE FROM forms\n\t\t\tWHERE forms_created_time < ?\")\n\t\t\t->execute(array($expire));\n\t}", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();" ]
[ "0.77941537", "0.77784026", "0.7759786", "0.7755928", "0.7698843", "0.76385784", "0.7627604", "0.7610106", "0.7601753", "0.7599697", "0.7589855", "0.75759554", "0.75436896", "0.75381684", "0.7478449", "0.7461462", "0.7461462", "0.7461462", "0.7436603", "0.74345714", "0.7344497", "0.7332473", "0.7312848", "0.72821134", "0.72591746", "0.72526467", "0.7249631", "0.7230373", "0.72288495", "0.72222733", "0.72158194", "0.7204544", "0.7191961", "0.71909624", "0.7190455", "0.7190437", "0.7178882", "0.7156283", "0.714009", "0.7124911", "0.71226496", "0.7114879", "0.71133196", "0.7101856", "0.7101856", "0.7082974", "0.7082438", "0.70776594", "0.7072987", "0.7056958", "0.70368963", "0.7034472", "0.7023925", "0.70077246", "0.69989973", "0.6988467", "0.69810885", "0.69773465", "0.69744885", "0.69620246", "0.6939985", "0.6927976", "0.69201493", "0.69193256", "0.6915724", "0.6914089", "0.69083196", "0.6906529", "0.68957293", "0.68923503", "0.6889381", "0.688791", "0.68837094", "0.6881816", "0.6874808", "0.68655306", "0.68611133", "0.685013", "0.6839848", "0.6838751", "0.6833155", "0.68209606", "0.68140024", "0.6801554", "0.6791106", "0.6790501", "0.6788546", "0.6786319", "0.6781215", "0.6780256", "0.6778659", "0.6765122", "0.67617047", "0.67608947", "0.6753053", "0.67518234", "0.6744953", "0.6744953", "0.6744953", "0.6744953", "0.6744953" ]
0.0
-1
raw() / Tools (has) has() Read where 'id' or array(columns => values) in Data Base, return true or false.
public function has($idorarray) { if (gettype($idorarray) == 'array') { foreach($idorarray as $key => $value) { $this->where($key, '=', $value); } // foreach } // if $return = $this->limit(1)->read(); // ... !=0) null: no result, false: issue if ($return != 0) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasSql(){\n return $this->_has(1);\n }", "private function getDbData()\n\t{\n\t\t//make sure we have an id....\n\t\tif ($this->id)\n\t\t{\n\t\t\t$result = db()->getRow(\"\n\t\t\t\tSELECT *\n\t\t\t\tFROM $this->tableName\n\t\t\t\tWHERE id = '$this->id'\n\t\t\t\");\n\n\t\t\tif (is_array($result))\n\t\t\t\treturn $result;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function has(string $id);", "public function has($id);", "public function has($id);", "public function RawQuery( $sql, $parameters ){\n\t\tif($this->Execute($sql, $parameters)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function has(string $id): bool;", "function is_reference_in_table($field, $table, $id)\n{\n $CI =& get_instance();\n $CI->db->where($field, $id);\n $row = $CI->db->get($table)->row();\n if ($row) {\n return true;\n }\n\n return false;\n}", "public function hasWhere()\n {\n return $this->_has('_where');\n }", "public function existsData () {\n\t\tif (is_null($this->bExistsData)) {\n\t\t\t$sQuery = \"\n\t\t\t\tPREFIX skos: <\" . self::SKOS_CORE . \">\n\n\t\t\t\tSELECT ?concept\n\t\t\t\tWHERE {\n\t\t\t\t\t?concept a skos:Concept .\n\t\t\t\t}\n\t\t\t\tLIMIT 1\";\n\t\t\t$aRow = $this->oStore->query($sQuery, 'row');\n\t\t\t$this->bExistsData = count($aRow) ? TRUE : FALSE;\n\t\t}\n\n\t\treturn $this->bExistsData;\n\t}", "function isDataExists($tableName, $id, $key) {\n $ci = & get_instance();\n $ci->load->database();\n if ($tableName && $id && $key) {\n $query = $ci->db->get_where($tableName, array($key => $id));\n return ($query->num_rows()) ? true : false;\n }\n return false;\n}", "public function hasColumn($name);", "public function get() {\n if ($this->db_get() || $this->api_query()) {\n return true;\n }\n\n return false;\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 hasQuery() {\n return $this->_has(4);\n }", "public function hasRecord();", "public function exists()\n {\n return ! is_null($this->first([Grammar::VIRTUAL_META_ID_COLUMN]));\n }", "abstract public function hasRow();", "public function has(string $col) : bool;", "public function exists()\r\n {\r\n $sql = $this->builder->exists($this);\r\n\r\n $rs = $this->db->select_one($sql, $this->get_binds_values());\r\n\r\n $row = (array) $rs;\r\n\r\n return (bool) $row['exist'];\r\n }", "public function check_availability_with_id($table, $columnname, $value, $where, $id) {\n $this->db->select($columnname);\n $this->db->from($table);\n $this->db->where($columnname, $value);\n $this->db->where($where, $id);\n $result = $this->db->get();\n\n if ($result->num_rows() > 0) {\n // var_dump($result);die;\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function isPrimaryKey(): bool;", "function findbyid(){\r\n $conn=$this->connect();\r\n $id = $conn -> real_escape_string($this->id);\r\n $sql=\"SELECT * FROM quanly WHERE id = '$id'\";\r\n $result=$conn -> query($sql);\r\n $conn->close();\r\n return $result;\r\n }", "private function exist() {\n $stmt = $this->pdo->prepare(\"SELECT * FROM $this->table WHERE \"\n . \"product_category_id= :cat_id and product_id= :prod_id \");\n $stmt->bindValue(\":cat_id\", $this->product_category_id, \\PDO::PARAM_INT);\n $stmt->bindValue(\":prod_id\", $this->product_id, \\PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetch();\n }", "public function read(){\n\t\t$this->_getDAO(false);\n\t\tif($array = $this->dao->read($this->user->getID(), $this->ident)){\n\t\t\t$this->_setFromArray($array);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasId(){\r\n return $this->_has(5);\r\n }", "private function _exists($wherePk=''){\n\t\tif($this->_forceExists===false){\n\t\t\tif($this->_schema){\n\t\t\t\t$table = $this->_schema.'.'.$this->_source;\n\t\t\t} else {\n\t\t\t\t$table = $this->_source;\n\t\t\t}\n\t\t\tif($wherePk===''){\n\t\t\t\t$wherePk = array();\n\t\t\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\t\t\tif(count($primaryKeys)>0){\n\t\t\t\t\tforeach($primaryKeys as $key){\n\t\t\t\t\t\tif($this->$key!==null&&$this->$key!==''){\n\t\t\t\t\t\t\t$wherePk[] = ' '.$key.' = \\''.$this->$key.'\\'';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(count($wherePk)){\n\t\t\t\t\t\t$this->_wherePk = join(' AND ', $wherePk);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\t$query = 'SELECT COUNT(*) AS rowcount FROM '.$table.' WHERE '.$this->_wherePk;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(is_numeric($wherePk)){\n\t\t\t\t\t$query = 'SELECT COUNT(*) AS rowcount FROM '.$table.' WHERE id = \\''.$wherePk.'\\'';\n\t\t\t\t} else {\n\t\t\t\t\t$query = 'SELECT COUNT(*) AS rowcount FROM '.$table.' WHERE '.$wherePk;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$num = $this->_db->fetchOne($query);\n\t\t\treturn (bool) $num['rowcount'];\n\t\t} else {\n\t\t\t$wherePk = array();\n\t\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\t\tif(count($primaryKeys)>0){\n\t\t\t\tforeach($primaryKeys as $key){\n\t\t\t\t\tif($this->$key!==null&&$this->$key!==''){\n\t\t\t\t\t\t$wherePk[] = ' '.$key.' = \\''.$this->$key.'\\'';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count($wherePk)){\n\t\t\t\t\t$this->_wherePk = join(' AND ', $wherePk);\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}", "protected function metaRowExists($id_meta){\r\n\t$res = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaDataTableName.\" WHERE id_meta = \".(int)$id_meta.\" AND \".$this->metaConnectId.\" = \".$this->id);\r\n\treturn count($res);\r\n}", "public function load($id){\n\n /*\n * select from the database\n */\n $query = $this->db->get_where($this::DB_TABLE, array($this::DB_TABLE_PK => $id));\n\n /**\n * Populate to an object\n */\n if(!empty($query->row())){\n $this->populate($query->row());\n return true;\n } else {\n return false;\n }\n }", "public function read($id = null) {\r\n\t\tif ($id != null) {\r\n\t\t\treturn $this->query(\"SELECT * FROM \" . $this->table . \" WHERE id = \" . $id . \" LIMIT 1;\")\r\n\t\t\t\t\t\t->fetch_assoc();\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function sql ( /* void */ )\n {\n /*\n Never used or not complete ?\n */\n if (($this->sMethod === false))\n {\n if (empty($this->aFields) and empty($this->aValues) and\n empty($this->aTables) and empty($this->aJoin) and\n empty($this->aWhere) and empty($this->aLike))\n {\n return null;\n }\n else\n {\n return false;\n }\n }\n /*\n Switch by method.\n */\n $func = '_sql_' . $this->sMethod;\n return $this->$func();\n }", "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 }", "public function get($id) {\n $where = (is_int($id)) ? $this->Table.'.'.$this->Id.' = '.addslashes($id) : $this->Table.'.'.$this->Ref.' = \\''.addslashes($id).'\\'';\n $where = \"WHERE $where\";\n if(method_exists($this, \"AltQuery\")) {\n $query = $this->AltQuery($where);\n } else {\n $query = \"SELECT * FROM {$this->Table} $where\";\n }\n $result = $this->query($query);\n if($result == true && mysql_num_rows($result) > 0) {\n foreach (mysql_fetch_assoc($result) as $key => $value) {\n $this->$key = $value; \n }\n return true;\n } else {\n return false;\n }\n }", "public function testWhereRaw()\n {\n $query = (new WhereBuilder($this->mockConnection))->whereRaw('field', 'op', 'COUNT(field1)');\n $array = $query->toArray();\n\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'op',\n 'value' => 'COUNT(field1)',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n $this->assertInstanceOf(Raw::class, $array['where'][0]['value']);\n }", "public function whereId($id);", "public function isHasRecord(): bool;", "private function Select()\n {\n $return = false;\n $action = $this->Action();\n $columns = $this->Columns();\n $table = $this->Table();\n $where = (Checker::isArray($this->Where(), false))?$this->Where():array(Where::QUERY => \"\", Where::VALUES => array());\n $order = (Checker::isString($this->Order()))?$this->Order():\"\";\n $limit = (Checker::isInt($this->Limit()))?\" LIMIT \".$this->Limit():\"\";\n if($columns && $table && Checker::isArray($where, false))\n {\n $return[Where::QUERY] = \"$action $columns FROM $table\".$where[Where::QUERY].\"$order$limit\";\n\n if(Checker::isArray($where, false) && isset($where[Where::VALUES])) $return[Where::VALUES] = $where[Where::VALUES];\n else $return[Where::VALUES] = array();\n }\n return $return;\n }", "public function check_if_in_db($conn,$tabel,$column,$data,$userid=0){\r\n $query=\"SELECT * FROM \".$tabel.\" WHERE \".$column.\"= :data AND user_id = \". $userid;\r\n $get=$conn->prepare($query);\r\n $get->bindValue(':data', $data);\r\n $get->execute();\r\n $row=$get->rowCount();\r\n if($row==0){return false;}\r\n else{return true ;}\r\n \r\n}", "function load() {\n\t\t$return = false;\n\t\t$values = array();\n\n\t\t$query = '\n\t\t\tSELECT ID, coverImageID, trackID, status, rank, createDate\n\t\t\t FROM '.system::getConfig()->getDatabase('momusic_content').'.handpickedMusic';\n\n\t\t$where = array();\n\t\tif ( $this->_ID !== 0 ) {\n\t\t\t$where[] = ' ID = :ID ';\n\t\t\t$values[':ID'] = $this->getID();\n\t\t}\n\n\t\tif ( count($where) == 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$query .= ' WHERE '.implode(' AND ', $where);\n\n\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\n\t\t$this->reset();\n\t\tif ( $oStmt->execute($values) ) {\n\t\t\t$row = $oStmt->fetch();\n\t\t\tif ( $row !== false && is_array($row) ) {\n\t\t\t\t$this->loadFromArray($row);\n\t\t\t\t$oStmt->closeCursor();\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function load($id) {\n\t\t$query = self::$pdo->prepare(\"SELECT * FROM {$this->table} WHERE id = :id LIMIT 1\");\n\t\t$query->bindParam(':id', $id, \\PDO::PARAM_INT);\n\t\t$query->execute();\n\t\tif (!$query->rowCount()) {\n\t\t\t$this->values = array();\n\t\t\treturn false;\n\t\t}\n\t\t$this->values = $query->fetch(\\PDO::FETCH_ASSOC);\n\t\treturn true;\n\t}", "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 exists(){\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$bReturn = false;\r\n\r\n\t\t\tif (! isset ( $this->id )) {\r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$dsh_id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"SELECT COUNT(*) as totalRow FROM $this->sqlTable WHERE dsh_id = ?\";\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\t$totalRow = $ks_db->fetchOne ( $sql, $this->id );\r\n\r\n\t\t\tif ($totalRow > 0) {\r\n\t\t\t\t$bReturn = true;\r\n\t\t\t}else {\r\n\t\t\t\t$bReturn = false;\r\n\t\t\t}\r\n\r\n\t\t\treturn $bReturn;\r\n\r\n\t\t} catch(Exception $e) {\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}", "public function hasDatas(){\n return $this->_has(5);\n }", "function recordExists()\n {\n global $objDatabase;\n\n $query = \"\n SELECT 1\n FROM \".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_products\n WHERE id=$this->id\";\n $objResult = $objDatabase->Execute($query);\n if (!$objResult || $objResult->EOF) return false;\n return true;\n }", "function FetchByID()\n\t{\n\t\tglobal $dal_info;\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\n\t\t$dal_where = \"\";\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\t$command = 'if(isset($this->'.$fld['varname'].')) { ';\n\t\t\t$command.= '$this->Value[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\t$command.= ' }';\n\t\t\t\n\t\t\teval($command);\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$dal_where.= $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// cleanup\n\t\t$this->Reset();\n\t\t// construct and run SQL\n\t\tif ($dal_where)\n\t\t\t$dal_where = \" where \".substr($dal_where, 0, -5);\n\t\t\t\n\t\t$dalSQL = \"select * from \".$this->_connection->addTableWrappers( $this->m_TableName ).$dal_where;\n\t\treturn $this->_connection->query( $dalSQL );\n\t}", "function read($keys,$extra_cols='',$join='')\n\t{\n\t\tif (!parent::read($keys,$extra_cols,$join))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (($id = (int)$this->data[$this->db_key_cols[$this->autoinc_id]]) && $this->customfields &&\n\t\t\t($cfs = $this->read_customfields($id)))\n\t\t{\n\t\t\t$this->data = array_merge($this->data,$cfs[$id]);\n\t\t}\n\t\treturn $this->data;\n\t}", "protected static function where_is($id){\n\t\t$stmt = self::$db->prepare(self::$WHERE);\n\n\t\t$stmt->execute(array($id, $id));\n\n\t\t$data = $stmt->fetchAll();\n\n\t\t$stmt->closeCursor();\n\n\t\tswitch($id){ //A way of using a switch that a lot aren't used to, but it's fast and efficient.\n\t\t\tcase $data[0]['memid']:\n\t\t\t\treturn self::MEM_TBL;\n\n\t\t\tcase $data[0]['diskid']:\n\t\t\t\treturn self::DISK_TBL;\n\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}", "public function whereall() {\n\t\t\treturn 'id=id';\n\t\t}", "public function query()\n\t\t{\n\t\t\t\n\t\t\t$this->prep = $this->pdo->prepare($this->query);\n\n\t\t\tif($this->prep){\n\t\t\t\t$this->prep->execute();\n\n\t\t\t\treturn $this->prep->fetchall(PDO::FETCH_ASSOC);\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function hasRecord() {}", "public function fetch( )\n {\n\n if ( $this->db_query_result )\n {\n $this->db_current_object = @ mysql_fetch_object( $this->db_query_result );\n if(!$this->db_current_object)\n return false;\n\n $l_fields_names = $this->table_fields_names[$this->table_name];\n\n if($l_fields_names)\n {\n foreach ($l_fields_names as $field_index => $field_name)\n {\n if(@isset($this->db_current_object->$field_name))\n {\n if(@array_key_exists($field_name,$this->out_filters[$this->table_name]))\n $this->db_current_object->$field_name = $this->applyOutFilter($field_name);\n }\n }\n return true;\n }\n else\n return true;\n }\n else\n return false;\n\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 isInDB() {\n\t\t$db = Loader::db();\n\t\treturn (boolean) $db->getOne('select count(*) from '.$this->btTable.' where bID = ?', array($this->bID));\n\t}", "abstract protected function _doContains($id);", "public function exists(){\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\t\t\t\r\n\t\t\t$bReturn = false;\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"SELECT COUNT(*) as totalRow FROM $this->sqlTable WHERE lp_id = ?\";\r\n\r\n\t\t\t//count how many rows found\r\n\t\t\t$totalRow = $ks_db->fetchOne ( $sql, $this->id );\r\n\t\t\t\r\n\t\t\tif ($totalRow > 0) {\r\n\t\t\t\t$bReturn = true;\r\n\t\t\t}else {\r\n\t\t\t\t$bReturn = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $bReturn;\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "function getDataRowWhere($table,$fields = null,$where = null,$order = null) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadObject();\r\n\t}", "function questionExistsDB($condition_arr=array())\r\n\t{\r\n $this->db->select('*');\r\n $this->db->from('dipp_question_master');\r\n $this->db->where($condition_arr);\r\n $query = $this->db->get();\r\n $num = $query->num_rows();\r\n return ($num > 0) ? TRUE : FALSE;\r\n }", "public function find($id) {\n $data = $this->db->fetchAssoc(\"SELECT * FROM $this->table WHERE id = ?\", [ $id ]);\n return $data ? $this->build($data) : FALSE;\n }", "function exists() {\r\n\t\t$sql_inicio \t= \" select * from \".$this->table.\" where \";\r\n\t\t$sql_fim \t\t= \" \".($this->get($this->pk) ? \" and \".$this->pk.\" <> \".$this->get($this->pk) : \"\").\" limit 1 \";\r\n\t\t\r\n\t\t$sql \t= \"con_id = \".$this->get(\"con_id\").\" and exa_id = \".$this->get(\"exa_id\").\" \";\r\n\t\tif (mysql_num_rows(Db::sql($sql_inicio.$sql.$sql_fim))){\r\n\t\t\t$this->propertySetError (\"con_id\", \"Já existe no banco de dados.\");\r\n\t\t\t$this->propertySetError (\"exa_id\", \"Já existe no banco de dados.\");\r\n\t\t}\r\n\t}", "public function select()\r\n\t{\r\n\t\t$this->clear();\r\n\t\t$where = null;\r\n\t\t// no args, so I'm searching for ALL... or doing a specific search\r\n\t\tif(func_num_args() === 0\r\n\t\t || ($where = call_user_func_array(array($this->obj, 'buildWhere'), func_get_args())))\r\n\t\t{\r\n\t\t\t$query = 'SELECT *\r\n\t\t\t\tFROM '.$this->obj->buildFrom();\r\n\t\t\t// pass args to where generator\r\n\t\t\tif($where)\r\n\t\t\t{\r\n\t\t\t\t$query .= ' WHERE '.$where;\r\n\t\t\t}\r\n\t\t\t$results = $this->site->db->query($query);\r\n\t\t\t$success = ($results->num_rows > 0);\r\n\t\t\twhile($row = $results->fetch_assoc())\r\n\t\t\t{\r\n\t\t\t\t$obj = new $this->obj->__CLASS__($this->obj->site);\r\n\t\t\t\tif($obj->loadRow($row))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->push($obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $success;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function newsExistsDB($condition_arr=array()) {\n\t\t$this->db->select('*');\n\t\t$this->db->from('dipp_news');\n\t\t$this->db->where($condition_arr);\n\t\t$query = $this->db->get();\n\t\t$num = $query->num_rows();\n\t\treturn ($num > 0) ? TRUE : FALSE;\n\t}", "public function hasData(){\n return $this->_has(1);\n }", "public function does_database_have_data() {\n\t\tglobal $wpdb;\n\n\t\t$tableprefix = $wpdb->prefix;\n\t\t$simple_history_table = self::DBTABLE;\n\n\t\t$sql_data_exists = \"SELECT id AS id_exists FROM {$tableprefix}{$simple_history_table} LIMIT 1\";\n\t\t// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\t$data_exists = (bool) $wpdb->get_var( $sql_data_exists, 0 );\n\n\t\treturn $data_exists;\n\t}", "function exists($id);", "public function has($id)\n {\n return (bool)$this->_engine->read($id);\n }", "public function hasId(){\n return $this->_has(17);\n }", "public function check(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore \n INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine WHERE stato = 3\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\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 }", "public function has($uid)\n {\n $options = $this->getOptions();\n $stmt = $this->adapter->query(\n sprintf('SELECT %s FROM %s WHERE %s = \"%s\"',\n $options['column_value'],\n $options['table'],\n $options['column_key'],\n $uid\n ), Adapter::QUERY_MODE_EXECUTE\n );\n return $stmt->count() > 0;\n }", "public function exists($id);", "public function exists($id);", "public function read_single() {\n // Create query\n $query = \"SELECT * FROM \" . $this->table . \n \" WHERE MID = :mid AND Spot = :spot \";\n\n // Prepare the statement\n $stmt = $this->conn->prepare($query);\n\n // Clean the query\n $this->attr[\"mid\"] = htmlspecialchars(strip_tags($this->attr[\"mid\"]));\n $this->attr[\"spot\"] = htmlspecialchars(strip_tags($this->attr[\"spot\"]));\n\n // Bind the data\n $stmt->bindValue(\":mid\", $this->attr[\"mid\"]);\n $stmt->bindValue(\":spot\", $this->attr[\"spot\"]);\n \n // Execute the prepared statement and check for errors in running it\n if ($this->runPrepStmtChkErr($stmt) === false) {\n return false;\n }\n\n // Get the result of reading one of the rows of the relation\n return $row_res = $stmt->fetch(PDO::FETCH_ASSOC);\n }", "public function returnExists($id);", "public function hasCriteria();", "function exists( $conds = array()) {\n\t\t// where clause\n\t\t$this->custom_conds( $conds );\n\n\t\t// from table\n\t\t$this->db->from( $this->table_name );\n\n\t\t// get query\n\t\t$query = $this->db->get();\n\t\t\n\t\t// return the result\n\t\treturn ($query->num_rows() == 1);\n\t}", "function load() {\n\t\t$return = false;\n\t\t$values = array();\n\n\t\t$query = '\n\t\t\tSELECT ID, EventID, SourceID, UserID, hasEvent\n\t\t\t FROM '.system::getConfig()->getDatabase('mofilm_content').'.userSourcePermissions';\n\n\t\t$where = array();\n\t\tif ( $this->_ID !== 0 ) {\n\t\t\t$where[] = ' ID = :ID ';\n\t\t\t$values[':ID'] = $this->getID();\n\t\t}\n\n\t\tif ( count($where) == 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$query .= ' WHERE '.implode(' AND ', $where);\n\n\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\n\t\t$this->reset();\n\t\tif ( $oStmt->execute($values) ) {\n\t\t\t$row = $oStmt->fetch();\n\t\t\tif ( $row !== false && is_array($row) ) {\n\t\t\t\t$this->loadFromArray($row);\n\t\t\t\t$oStmt->closeCursor();\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "function isIdVerified($table_name=NULL,$id=NULL){\r\n\t\tif($id==null && $table_name==null) return array();\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('id'=>$id));\r\n\t\t$recordSet = $this->db->get($table_name);\r\n\t\t$data=$recordSet->result() ;\r\n\t\tif(count($data)>0){\r\n \t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function hasAny()\n {\n return $this->model->first() ? true : false;\n }", "public function isnationalitiesExisting ($id){\n $sqlQuery = \"SELECT count (*) as isExisting \";\n $sqlQuery .= \"FROM nationalities \";\n $sqlQuery .= \"WHERE id= $id\";\n $result = $this -> getDbManager() -> executeSelectQuery ( $sqlQuery );\n if ( $result [0][ \" isExisting \"] == 1) return ( true );\n else return ( false );\n }", "public function hasPrimaryKeyColumns(){\n return $this->_has(4);\n }", "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}", "static function custom_get_one_sql($id) {\n # this is the default functionality\n $primary_key = static::get_primary_key();\n return static::get_sql() . \" WHERE o.`$primary_key`='$id'\";\n }", "public function load($fields = null) {\n\t\tif (is_null($fields)) $fields = $this->id;\n\t\tif (!$fields) return;\n\n\t\t// $fields could be a scalar in which case we assume it's the value for the\n\t\t// ID field:\n\t\tif (!is_array($fields)) $fields = array('id' => $fields);\n\n\t\tif (!count($fields)) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->clear();\n\n\t\tif ($this->errors = $this->before_load($fields)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$where_arr = array();\n\t\tforeach ($fields as $field => $value) $where_arr[] = \"$field = :$field\";\n\t\t$where_str = implode(' AND ', $where_arr);\n\n\t\t$tb = $this->attr('tb');\n\n\t\tif ($this->init($this->db()->get_fields('*', $tb, $where_str, $fields))) {\n\t\t\tif ($this->errors = $this->after_load()) {\n\t\t\t\treturn false;\n\t\t\t}\n\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}", "abstract public function queryRaw($q);", "function db_raw_exec( $sql )\n{\n return Chev_PDO::instance()->raw_exec( $sql );\n}", "public function getViaTableCondition();", "function existeTitulacion($base, $id)\n{\n $query = \"SELECT `id` FROM `titulaciones` WHERE `id`=\" . $id;\n $resultado = $base->query($query);\n if (empty($resultado->fetchAll())) {\n return false;\n }\n $resultado->closeCursor();\n return true;\n}", "public function runExists() {\r\n $db = static::getDB();\r\n $stmt = $db->query(\r\n \"SELECT * FROM runboard \"\r\n . \"WHERE fromStore='$this->fromStore' \"\r\n . \"AND toStore='$this->toStore' \"\r\n . \"AND category='$this->category' \"\r\n . \"AND item='$this->item' \"\r\n );\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n \r\n return $results;\r\n }", "public static function has( $key )\n {\n $params = array(\n 'cacheKey' => $key,\n 'valid' => true,\n );\n \n $queryParts = self::getQueryParts( $params );\n $queryParts['select'] = '`t`.`id`';\n \n return ( bool ) dbGetOne( $queryParts );\n }", "private function _exists($uid){\n $select = $this->select()\n ->from($this->_name,array('uid'))\n ->where('uid = ?', $uid);\n $row = $this->fetchRow($select);\n\t\t\n // Zend_Debug::dump($select->__toString());\n if($row){\n return true;\n }\n return false;\n \n }" ]
[ "0.6726449", "0.61166793", "0.5860723", "0.58520633", "0.58520633", "0.57678014", "0.5678366", "0.5649908", "0.5608025", "0.55675197", "0.55455846", "0.553615", "0.5514127", "0.55093986", "0.5508543", "0.54952973", "0.5490948", "0.5481387", "0.5466435", "0.545866", "0.5457156", "0.54545224", "0.5446926", "0.54396707", "0.54336524", "0.543106", "0.542709", "0.54211843", "0.5402925", "0.5398745", "0.5386584", "0.53859365", "0.53671044", "0.5365443", "0.53577405", "0.5356094", "0.5355546", "0.53467345", "0.5340057", "0.5335425", "0.53338534", "0.5329581", "0.5328842", "0.532836", "0.53269905", "0.53261", "0.532163", "0.5314302", "0.5308217", "0.53062296", "0.5305958", "0.5305219", "0.5305219", "0.5305219", "0.5305219", "0.5305219", "0.5305219", "0.5305219", "0.5305219", "0.5305219", "0.5305219", "0.53023", "0.53018564", "0.53017426", "0.5296236", "0.5295992", "0.52918327", "0.5285996", "0.52639556", "0.52562845", "0.52518016", "0.52455306", "0.5244217", "0.52430475", "0.52393335", "0.5238707", "0.5236019", "0.52258354", "0.52235276", "0.52235276", "0.52191436", "0.521506", "0.52083814", "0.52046436", "0.520414", "0.51957977", "0.51852924", "0.5184337", "0.51841676", "0.51798344", "0.5176997", "0.51697236", "0.5158333", "0.5154894", "0.51469797", "0.5145878", "0.5144493", "0.5141986", "0.51400805", "0.513648" ]
0.5826988
5
getId() __get() Generic getter
public function __get($name) { if (isset($this->_result[0][$name])) { return $this->_result[0][$name]; } else if (($name == 'role') && (isset($this->_result[0]['_status']))) { return $this->_result[0]['_status']; } else { debugWarning('$this->_result[0][\''.$name.'\'] is not defined.'); return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getId(): mixed;", "function getId(){\n\t\t\treturn $this->$id;\n\t\t}", "public function getId()\n { // getter ID\n return $this->id;\n }", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "public function getId() ;", "public function getId ();", "abstract function getId();", "abstract public function get($id);", "abstract public function get($id);", "abstract public function get($id);", "function id() {\n $function = 'get' . get_class($this) . 'Id';\n return $this->$function();\n }", "public abstract function get($id);", "abstract function &get($int_id);", "function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId() {}", "public function getId() {}", "public function getById() {}", "public function getById()\n {\n }", "function get_id(){\n return $this -> id;\n }", "function get_id(){\n return $this -> id;\n }", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "public function getIdProperty();", "abstract public function getById($id);", "abstract public function getById($id);", "public abstract function getById($id);", "public function getId() : string;", "function getId() {\n return $this->id;\n }", "public function getId(){\n return $this->_id;\n }" ]
[ "0.78174216", "0.7815378", "0.76353896", "0.7620736", "0.7620736", "0.7620736", "0.7598302", "0.7587366", "0.7578012", "0.7531423", "0.7522362", "0.7522362", "0.7522362", "0.75108683", "0.7509959", "0.7503954", "0.7460061", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7456528", "0.7436098", "0.7436098", "0.7407177", "0.7393209", "0.7361789", "0.7361789", "0.7331778", "0.7331778", "0.7331778", "0.7323726", "0.73235095", "0.73235095", "0.7322602", "0.73095345", "0.7290702", "0.728582" ]
0.0
-1
__get() / set(), where(), limit() Define attributes for Read() SQL : LIMIT Offset, Depth
public function limit($depth, $offset=0) { $this->_limit['depth'] = $depth; $this->_limit['offset'] = $offset; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$arg3=false,$secs2cache=0) \r\n\t {\r\n\t $offsetStr = ($offset >= 0) ? \" OFFSET $offset\" : '';\r\n\t $limitStr = ($nrows >= 0) ? \" LIMIT $nrows\" : '';\r\n\t return $secs2cache ?\r\n\t $this->CacheExecute($secs2cache,$sql.\"$limitStr$offsetStr\",$inputarr,$arg3)\r\n\t :\r\n\t $this->Execute($sql.\"$limitStr$offsetStr\",$inputarr,$arg3);\r\n\t }", "public function get( $limit = 10 );", "public function getLimit()\n {\n //a little different than normal gets...\n return array (\n $this->_count, $this->_offset,\n );\n }", "public function limit($limit,$offset);", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->limit=$row->answersperpage;\n }", "public function apiFetch( $limit, $offset );", "public function getLimit() {}", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function get(array $columns = ['*'], int $limit = 0, int $offset = 0);", "function limit($limit, $offset = 0)\n{\n\t$this->tryModify();\n\t$this->query['limit'] = array((int)$limit, (int)$offset);\n\treturn $this;\n}", "public function get_limit();", "public function read() \n {\n // Create query\n $sql = \"\n SELECT \n id,\n name,\n created_at\n FROM\n $this->table\n ORDER BY \n created_at DESC\n ;\";\n\n // Prepare statement\n $stmt = $this->conn->prepare($sql);\n\n // Execute statement\n $stmt->execute();\n \n return $stmt;\n }", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->questionsPerPage=$row->questionsperpage;\n }", "private function query($cursor, $limit) {\n // here. Since this is an example, we just use a premade dataset.\n\n return array_slice($this->data, $cursor, $limit);\n }", "function fetchList($limit, $offset);", "public function getLimit() {\n return $this->limit;\n }", "public function getQueryLimit() {\n\t\treturn $this->queryLimit;\n\t}", "public function get_limit(){\r\n return $this->limit;\r\n }", "public function findAllOverruleLimitClause()\n {\n $mockResult = $this->getMock('stubDatabaseResult');\n $this->mockConnection->expects($this->any())->method('query')->will($this->returnValue($mockResult));\n $mockResult->expects($this->once())\n ->method('fetchAll')\n ->will($this->returnValue(array(array('bar' => 'Here is bar.', 'default' => 'And this is default.'))));\n $finderResult = $this->dbFinder->findAll($this->mockConnection, new stubReflectionClass('MockSinglePrimaryKeyEntity'), null, 50, 10);\n $this->assertEquals(1, $finderResult->count());\n $data = $finderResult->current();\n $this->assertEquals('Here is bar.', $data->withAnnotation());\n $this->assertEquals('And this is default.', $data->withDefaultValue());\n $select = $this->mockQueryBuilder->getSelect();\n $this->assertEquals('foo', $select->getBaseTableName());\n $this->assertEquals('bar ASC', $select->getOrderedBy());\n $this->assertTrue($select->hasLimit());\n $this->assertEquals(50, $select->getOffset());\n $this->assertEquals(10, $select->getAmount());\n $this->assertFalse($select->hasCriterion());\n }", "public function dbLimit($limit) {\r\n $this->limit = $limit;\r\n return $this;\r\n }", "public function getLimit()\n {\n return $this->_limit;\n }", "public function limit($limit)\r\n {\r\n $this->query->limit($limit);\r\n \r\n return $this;\r\n }", "public function limit($limit)\n\t{\n\t\t$this->query->limit = $limit;\n\t\treturn $this;\n\t}", "public function fetchLazy()\n {\n return $this->query->select(\n $this->filter,\n $this->order,\n null,\n $this->limitOffset,\n PDO::FETCH_CLASS,\n true\n );\n }", "public function limit($limit)\n {\n return $this->query->limit($limit);\n }", "public function read(){\n //Create query\n $query = 'SELECT *\n FROM ' . $this->table . '\n ORDER BY created_at DESC';\n\n //Prepare statement\n $stmt = $this->conn->prepare();\n\n //Execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function load($limit = null, $offset = null, $cb = null)\n {\n if ($cb !== null) {\n return $this->loadAsync($limit, $offset, $cb);\n }\n // Fetch object(s) from data storage\n $result = $this->where->fetch(\n $this->fields,\n $this->orderBy,\n $offset !== null ? $offset : $this->offset,\n $this->multiMode ? $limit : 1,\n $this->innerJoins,\n $this->groupBy\n );\n if ($result === null) {\n // @TODO: exception, no storages are capable of processing this query\n $result = new ResultList([]);\n }\n\n if ($this->multiMode) {\n if ($offset == null && $limit !== null) {\n // Increment offset\n $this->offset += count($result->objects);\n }\n $it = new Iterator($this, $result);\n if ($this->vFieldCallbacks) {\n // Applying joined fields\n $it->withVirtualFields($this->vFieldCallbacks);\n }\n return $it;\n }\n if ($this->where === null) { // If 'where' is undefined\n $this->loadDefaultWhere(); // try to extract it from object (e.g. '<primary> = ?')\n }\n $this->data = current($result->objects);\n $this->onLoad();\n if ($this->vFieldCallbacks) {\n // Applying joined fields\n foreach ($this->vFieldCallbacks as $field => $cb) {\n $cb($this, $field);\n }\n }\n\n return $this;\n\n }", "function read($from_record_num, $records_per_page){\r\n\t$query = \"SELECT\r\n\t\t\t\tid, name, description, price \r\n\t\t\tFROM\r\n\t\t\t\t\" . $this->table_name . \"\r\n\t\t\tORDER BY\r\n\t\t\t\tcreated DESC\r\n\t\t\tLIMIT\r\n\t\t\t\t?, ?\";\r\n\r\n\t// prepare query statement\r\n\t$stmt = $this->conn->prepare( $query );\r\n\r\n\t// bind limit clause variables\r\n\t$stmt->bindParam(1, $from_record_num, PDO::PARAM_INT);\r\n\t$stmt->bindParam(2, $records_per_page, PDO::PARAM_INT);\r\n\r\n\t// execute query\r\n\t$stmt->execute();\r\n\r\n\t// return values\r\n\treturn $stmt;\r\n}", "public function limit($limit, $offset = null);", "public function load($where = NULL, $limit = NULL)\n\t{\n\t\t$meta = $this->meta();\n\t\t\n\t\t// Apply the limit\n\t\tif (is_int($where) || is_string($where))\n\t\t{\n\t\t\t$this->where($meta->primary_key, '=', $where);\n\t\t\t$limit = 1;\n\t\t}\n\t\t// Simple where clause\n\t\telse if (is_array($where))\n\t\t{\n\t\t\tforeach($where as $column => $value)\n\t\t\t{\n\t\t\t\t$this->where($column, '=', $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Anything to load with?\n\t\tif ($meta->load_with)\n\t\t{\n\t\t\t$this->with($meta->load_with);\n\t\t}\n\n\t\t// Set the working query\n\t\t$query = $this->build(Database::SELECT);\n\t\t$query->from($meta->table);\n\t\t\n\t\t// limit() is overloaded so that if the second argument exists \n\t\t// the call will override what's passed here for $limit. This allows us\n\t\t// to set a limit before load and have it load single rows directly into the object\n\t\tif (isset($this->_db_applied['limit'][1]) && $this->_db_applied['limit'][0] == 1)\n\t\t{\n\t\t\t$limit = 1;\n\t\t}\n\t\t\n\t\t// Apply the limit if we can\n\t\tif ($limit !== NULL)\n\t\t{\n\t\t\t$query->limit($limit);\n\t\t}\n\t\t\n\t\t// We can load directly into the model\n\t\tif ($limit === 1)\n\t\t{\n\t\t\t$result = $query->execute($meta->db);\n\t\t\t\n\t\t\t// Ensure we have something\n\t\t\tif (count($result))\n\t\t\t{\n\t\t\t\t// Insert the original values\n\t\t\t\t$this->set($result[0], TRUE, TRUE);\n\t\t\t\t\n\t\t\t\t// We're good!\n\t\t\t\t$this->_loaded = $this->_saved = TRUE;\n\t\t\t\t$this->_changed = array();\n\t\t\t}\n\n\t\t\treturn $this->end();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Apply sorting options\n\t\t\tforeach($meta->sorting as $column => $direction)\n\t\t\t{\n\t\t\t\t$query->order_by($this->alias($column), $direction);\n\t\t\t}\n\t\t\t\n\t\t\treturn $query->as_object(get_class($this))->execute($meta->db);\n\t\t}\n\t}", "function getLimit() ;", "public function getLimit ()\r\n\t{\r\n\t\treturn $this->limit;\r\n\t}", "public function limit($limit = 10, $offset = 0): Database\n {\n $this->query .= 'LIMIT ' . $limit . ' OFFSET ' . $offset . ' ';\n return $this;\n }", "public function limit($limit = 20, $offset = null)\n\t{\n\t\tif($this->activeQuery instanceof phpDataMapper_Database_Query_Interface) {\n\t\t\t$this->activeQuery->limit($limit, $offset);\n\t\t}\n\t\treturn $this;\n\t}", "function _data_seek($n = 0)\n\t{\n\t\treturn mysqli_data_seek($this->result_id, $n);\n\t}", "public function Limit()\n {\n return $this->limit;\n }", "public function testLimit()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->limit(10));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(10, $elasticQuery['size']);\n\n $this->assertSame($query, $query->limit(20));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(20, $elasticQuery['size']);\n }", "public function find($n, $f = 0){\n $this->params[\"LIMIT\"] = \"$f,$n\";//adding the limit to the sql query\n return $this;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function getLimit()\n {\n return $this->limit;\n }", "public function limit($limit) {\r\n\t\t$this->query .= \" LIMIT \" . $limit;\r\n\r\n\t\t# Return this instance of the class, so we can chain methods\r\n\t\treturn $this;\r\n\t}", "public function limit($limit, $offset=null)\n\t{\n\t\t\t\t\t$this->_query['limit']=(int)$limit;\n\t\t\t\t\tif($offset!==null)\n\t\t\t\t\t\t\t\t\t$this->offset($offset);\n\t\t\t\t\treturn $this;\n\t}", "private function sql_limit()\n {\n // Get LIMIT statement\n $limit = null;\n\n // RETURN LIMIT statement\n return $limit;\n }", "public function fetch(int $mode = \\PDO::ATTR_DEFAULT_FETCH_MODE, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0);", "public function limit($limit) {\r\n $this->sqlLimit = $limit;\r\n return $this;\r\n }", "public function limit($limit)\n {\n if ( $this->driver->type == 'sqlite' ) {\n // throw new Exception('sqlite does not support limit syntax');\n }\n $this->limit = $limit;\n return $this;\n }", "public function read()\n {\n $query = $this->queryBuilder->new($this->entityName)\n ->select()\n ->get();\n\n return $this->executeQueryForMultipleResults($query);\n }", "public function getLimitOffsetClause()\n\t{\n\t\treturn $this->limit;\n\t}", "function getFields($table,$fields=\"\",$condition=\"\",$limit=\"\",$calculateRows=false,$fastHint=false);", "function fetch($type=PDO::FETCH_ASSOC, $ori=PDO::FETCH_ORI_NEXT, $offset=0) {\r\n\r\n // calculate offset\r\n $last = & $this->i;\r\n $target = array( \r\n PDO::FETCH_ORI_NEXT => $last + 1,\r\n PDO::FETCH_ORI_PRIOR => $last,\r\n PDO::FETCH_ORI_REL => $last + $offset,\r\n PDO::FETCH_ORI_FIRST => -1,\r\n PDO::FETCH_ORI_LAST => $this->rowCount() - 1,\r\n PDO::FETCH_ORI_ABS => $offset,\r\n );\r\n $target = $target[$ori];\r\n#print \"seek($last->$target) \";\r\n \r\n // last row? got that covered!\r\n if (isset($this->cache[$target])) {\r\n#print \"seek(==) \";\r\n return $this->rowType($type, $this->cache[$target]);\r\n }\r\n \r\n // moving farther backwards\r\n if ($target < $last) {\r\n#print \"seek(<<) \";\r\n $this->reExecute();\r\n }\r\n \r\n // jump forwards\r\n while ($target > $last + 1) {\r\n#print \"seek(>>) \";\r\n $row = $this->stmt->fetch(PDO::FETCH_ASSOC);\r\n $last++;\r\n if (!$row) {\r\n return pdo_trigger_error(\"PDOStatement_Seekable: scrolling past last row\", E_USER_WARNING) and $row;\r\n }\r\n }\r\n\r\n // actually fetch next row\r\n if ($row = $this->stmt->fetch(PDO::FETCH_ASSOC)) {\r\n#print \"seek(ft) \";\r\n assert($target == ++$last);\r\n // keep last row(s)\r\n if (count($this->cache) > PDO_SEEKABLE) {\r\n $this->cache = array_slice($this->cache, $last, -PDO_SEEKABLE, true);\r\n }\r\n $this->cache[$last] = $row;\r\n }\r\n return $this->rowType($type, $row);\r\n }", "public function getLimit() {\n\t\treturn $this->limit;\n\t}", "public function testFindByQWithOffsetAndLimit()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'offset' => 0, 'limit' => 1];\n $this->filterTest($filters, [$all[0]]);\n $filters = ['q' => 'desc', 'offset' => 1, 'limit' => 1];\n $this->filterTest($filters, [$all[1]]);\n }", "public function limit($limit);", "public function limit($limit);", "public function testLimit()\n {\n $obj_query = new \\Search\\Query();\n $this->assertEquals(20, $obj_query->getLimit());\n $obj_query->limit(121);\n $this->assertEquals(121, $obj_query->getLimit());\n $obj_query->limit(-10);\n $this->assertEquals(1, $obj_query->getLimit());\n $obj_query2 = $obj_query->limit(2001);\n $this->assertEquals(1000, $obj_query->getLimit());\n $this->assertSame($obj_query, $obj_query2);\n }", "public function read () {\n $pdo = $this->_backend->getPDO();\n\n /* TODO: selection criteria.\n // New FileMaker find command.\n if (count($this->_findCriteria) > 0) {\n // This search query will contain criterion.\n $findCommand = $FM->newFindCommand($this->_layout);\n foreach ($this->_findCriteria as $fieldName => $testValue) {\n $findCommand->addFindCriterion($fieldName, $testValue);\n }\n } else {\n // No criteria, so 'find all'.\n $findCommand = $FM->newFindAllCommand($this->_layout);\n }\n\n // Script calling.\n if ($this->_postOpScript !== NULL) {\n $findCommand->setScript($this->_postOpScript, $this->_postOpScriptParameter);\n }\n if ($this->_preOpScript != NULL) {\n $findCommand->setPreCommandScript($this->_preOpScript, $this->_preOpScriptParameter);\n }\n */\n\n $findSkip = $this->_readOffset;\n $findMax = $this->_readCount;\n\n // Find the number of records in this table.\n // This may not be a cheap operation, may be ok in some databases.\n $statement = $pdo->prepare('SELECT COUNT(*) FROM `'. $this->_validatedTable);\n try {\n $statement->execute();\n } catch (\\PDOException $e) {\n throw new PdoResponseException($e);\n }\n $result = $statement->fetch(\\PDO::FETCH_NUM);\n $tableRecordCount = $result[0];\n $statement->closeCursor();\n\n if ($findSkip == -1) {\n // If we are to skip to the end ...\n $findSkip = $tableRecordCount - $findMax;\n $findSkip = max(0, $findSkip); // Ensure not less than zero.\n }\n\n // Query.\n $statement = $pdo->prepare('SELECT * FROM `'. $this->_validatedTable . '` LIMIT ? OFFSET ?');\n $statement->bindParam(1, intval($findMax), \\PDO::PARAM_INT);\n $statement->bindParam(2, intval($findSkip), \\PDO::PARAM_INT);\n try {\n $statement->execute();\n } catch (\\PDOException $e) {\n throw new PdoResponseException($e);\n }\n\n $restfmMessage = new \\RESTfm\\Message\\Message();\n\n $this->_parseMetaField($restfmMessage, $statement);\n\n $fetchCount = 0;\n foreach ($statement->fetchAll() as $record) {\n if ($this->_uniqueKey === NULL) {\n $recordID = NULL;\n } else {\n $recordID = $this->_uniqueKey . '===' . $record[$this->_uniqueKey];\n }\n\n $restfmMessage->addRecord(new \\RESTfm\\Message\\Record(\n $recordID,\n NULL,\n $record\n ));\n $fetchCount++;\n }\n\n $statement->closeCursor();\n\n // Info.\n $restfmMessage->setInfo('tableRecordCount', $tableRecordCount);\n $restfmMessage->setInfo('foundSetCount', $tableRecordCount);\n $restfmMessage->setInfo('fetchCount', $fetchCount);\n\n return $restfmMessage;\n }", "function getResult($limit, $idField, $dateField = null);", "public function testFindByQWithLimit()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'limit' => 1];\n $this->filterTest($filters, [$all[0]]);\n $filters = ['q' => 'desc', 'limit' => 2];\n $this->filterTest($filters, [$all[0], $all[1]]);\n }", "public function limit($offset, $limit)\n\t{\n\t\t$this->data_source->size = $limit;\n\t\t$this->data_source->from = $offset;\n\n\t\treturn $this;\n\t}", "function get_limit_data($limit, $start = 0, $q = NULL) {\n $db2 = $this->load->database('database_kedua', TRUE);\n\n $db2->order_by($this->id, $this->order);\n $db2->like('id', $q);\n\t$db2->or_like('kelas', $q);\n\t$db2->limit($limit, $start);\n return $db2->get($this->table)->result();\n }", "public function limit($limit = NULL, $offset = NULL) {\n if (is_numeric($limit) && is_numeric($offset)) {\n $this->db->limit($limit, $offset);\n } elseif (is_numeric($limit)) {\n $this->db->limit($limit);\n }\n return $this;\n }", "public function limit($count, $offset);", "public function getLimit(): int\n {\n return $this->getQueryPageSize();\n }", "public static function limit($limit, $offset = null)\n {\n self::select(self::tableName(), '','*','',$limit, $offset);\n if (!self::$instance) {\n self::$instance = new AbstractModel();\n }\n return self::$instance;\n }", "private static function getData($table, $count = null, $start = 0, $where = null)\n {\n $params = array();\n $sql = \"SELECT * FROM \".$table;\n if($where != null)\n {\n $sql .= \" WHERE \".KEY($where).\"=:\".KEY($where);\n $params[KEY($where)] = $where[KEY($where)];\n }\n $sql.= \" ORDER BY id DESC \";\n if ($count != null)\n {\n $sql.= \" LIMIT \";\n $sql.= $start.\" , \";\n $sql.= $count;\n }\n $result = self::prepareQuery($sql, $params);\n return $result;\n }", "public function limit($limit)\t{\n\t\t$this->limit = array(\"LIMIT $limit\");\n\t\treturn $this;\n\t}", "public function cpSelectDsclimit($tablename,$value3, $value1=0,$value2=0) {\n /*** The SQL SELECT statement ***/\n /*\n * Prepare the select statement\n */\n $startvalue=($value1-1)*10;\n $sql=\"SELECT * FROM $tablename \";\n if($value2!=0)\n { $key1= key($value2);\n $sql.=\" where $key1='$value2[$key1]'\";\n }\n \n $sql.= \" ORDER BY $value3 DESC LIMIT $startvalue, 10\";\n \n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n \n}", "public function fetchFields();", "public function limit($limit = null)\n {\n if(null === $limit)\n {\n return $this->property('limit');\n }\n return $this->property('limit', (int) $limit);\n }", "public function limit($limit = null)\n {\n if(null === $limit)\n {\n return $this->property('limit');\n }\n return $this->property('limit', (int) $limit);\n }", "public function take($limit = 20);", "function GetData($_start=0,$_count=9999999)\r\n\t{\r\n\t\t\r\n\t\t$_tpl_select_command = \"SELECT {limit} * FROM ({SelectCommand}) AS _TMP {where} {orderby} {groupby}\";\r\n\t\t\r\n\t\t//Filters\r\n\t\t$_where = \"\";\r\n\t\t$_filters = $this->Filters;\r\n\t\tfor($i=0;$i<sizeof($_filters);$i++)\r\n\t\t{\r\n\t\t\t$_where.=\" and \".$this->GetFilterExpression($_filters[$i]);\r\n\t\t}\r\n\t\tif ($_where!=\"\")\r\n\t\t{\r\n\t\t\t$_where = \"WHERE \".substr($_where,5);\r\n\t\t}\r\n\t\t//Order\r\n\t\t$_orderby = \"\";\r\n\t\t$_orders = $this->Sorts;\r\n\t\tfor($i=0;$i<sizeof($_orders);$i++)\r\n\t\t{\r\n\t\t\t$_orderby.=\", \".$_orders[$i]->Field.\" \".$_orders[$i]->Order;\r\n\t\t}\r\n\t\tif ($_orderby!=\"\")\r\n\t\t{\r\n\t\t\t$_orderby = \"ORDER BY \".substr($_orderby,2);\r\n\t\t}\r\n\t\t//Group\r\n\t\t$_groupby = \"\";\r\n\t\t$_groups = $this->Groups;\r\n\t\tfor($i=0;$i<sizeof($_groups);$i++)\r\n\t\t{\r\n\t\t\t$_groupby.=\", \".$_groups[$i]->Field;\r\n\t\t}\r\n\t\tif ($_groupby!=\"\")\r\n\t\t{\r\n\t\t\t$_groupby = \"GROUP BY \".substr($_groupby,2);\r\n\t\t}\r\n\t\t//Limit\r\n\t\t$_limit = \"TOP \".($_start+$_count); \t\t\r\n\t\t\r\n\t\t$_select_command = str_replace(\"{SelectCommand}\",$this->SelectCommand,$_tpl_select_command);\r\n\t\t$_select_command = str_replace(\"{where}\",$_where,$_select_command);\r\n\t\t$_select_command = str_replace(\"{orderby}\",$_orderby,$_select_command);\r\n\t\t$_select_command = str_replace(\"{groupby}\",$_groupby,$_select_command);\r\n\t\t$_select_command = str_replace(\"{limit}\",$_limit,$_select_command);\r\n\t\t\r\n\t\t//echo $_select_command;\r\n\t\t$_result = mssql_query($_select_command,$this->_Link);\r\n\t\t$_rows = array();\r\n\t\t$_i=0;\r\n\t\twhile ($_row = mssql_fetch_assoc($_result)) \r\n\t\t{\r\n\t\t\tif($_i>=$_start)\r\n\t\t\t{\r\n\t\t\t\tarray_push($_rows,$_row);\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$_i++;\r\n\t\t}\r\n\r\n\t\treturn $_rows;\r\n\t}", "public function getLimit()\n {\n return null;\n }", "public function getLimit()\n {\n return null;\n }", "public function fetch()\n {\n return $this->query->select(\n $this->filter,\n $this->order,\n null,\n $this->limitOffset,\n PDO::FETCH_CLASS\n );\n }", "function find(\n\t\t$criteria=NULL,$order=NULL,$limit=NULL,$offset=NULL,$ttl=0) {\n\t\t$query=array(\n\t\t\t'method'=>'find',\n\t\t\t'criteria'=>$criteria,\n\t\t\t'order'=>$order,\n\t\t\t'limit'=>$limit,\n\t\t\t'offset'=>$offset\n\t\t);\n\t\treturn $ttl?$this->cache($query,$ttl):$this->exec($query);\n\t}", "function get($limit = NULL, $offset = NULL)\r\n\t{\r\n\t\t// Check if this is a related object and if so, perform a related get\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\t// Set limit and offset\r\n\t\t\t$this->limit($limit, $offset);\r\n\r\n\t\t\t// If this is a \"has many\" related item\r\n\t\t\tif (in_array($this->parent['model'], $this->has_many))\r\n\t\t\t{\r\n\t\t\t\t$this->_get_relation($this->parent['model'], $this->parent['id']);\r\n\t\t\t}\r\n\r\n\t\t\t// If this is a \"has one\" related item\r\n\t\t\tif (in_array($this->parent['model'], $this->has_one))\r\n\t\t\t{\r\n\t\t\t\t$this->_get_relation($this->parent['model'], $this->parent['id']);\r\n\t\t\t}\r\n\r\n\t\t\t// For method chaining\r\n\t\t\treturn $this;\r\n\t\t}\r\n\r\n\t\t// Check if object has been validated\r\n\t\tif ($this->validated)\r\n\t\t{\r\n\t\t\t// Reset validated\r\n\t\t\t$this->validated = FALSE;\r\n\r\n\t\t\t// Use this objects properties\r\n\t\t\t$data = $this->_to_array(TRUE);\r\n\r\n\t\t\tif ( ! empty($data))\r\n\t\t\t{\r\n\t\t\t\t// Clear this object to make way for new data\r\n\t\t\t\t$this->clear();\r\n\r\n\t\t\t\t// Get by objects properties\r\n\t\t\t\t$query = $this->db->get_where($this->table, $data, $limit, $offset);\r\n\r\n\t\t\t\tif ($query->num_rows() > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Populate all with records as objects\r\n\t\t\t\t\t$this->all = $this->_to_object($query->result(), $this->model);\r\n\r\n\t\t\t\t\t// Populate this object with values from first record\r\n\t\t\t\t\tforeach ($query->row() as $key => $value)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->{$key} = $value;\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\telse\r\n\t\t{\r\n\t\t\t// Clear this object to make way for new data\r\n\t\t\t$this->clear();\r\n\r\n\t\t\t// Get by built up query\r\n\t\t\t$query = $this->db->get($this->table, $limit, $offset);\r\n\r\n\t\t\tif ($query->num_rows() > 0)\r\n\t\t\t{\r\n\t\t\t\t// Populate all with records as objects\r\n\t\t\t\t$this->all = $this->_to_object($query->result(), $this->model);\r\n\r\n\t\t\t\t// Populate this object with values from first record\r\n\t\t\t\tforeach ($query->row() as $key => $value)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->{$key} = $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_refresh_stored_values();\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function fetchNrRecordsToGet();", "function getRecentComments($table, $post_id, $offset, $limit) {\n $conn = new my_mysql();\n $query = \"SELECT * FROM $table WHERE post_id=$post_id ORDER BY post_date DESC LIMIT $offset, $limit;\";\n $res = $conn->readQuery($query);\n return $res;\n}", "public function getLimit()\n {\n return self::LIMIT;\n }", "public function get($offset);", "public function testLimitSetFromClauseString()\n {\n $query = new SQLSelect();\n $query->setSelect('*');\n $query->setFrom('\"SQLSelectTest_DO\"');\n\n $query->setLimit('20 OFFSET 10');\n $limit = $query->getLimit();\n $this->assertEquals(20, $limit['limit']);\n $this->assertEquals(10, $limit['start']);\n }", "function read(){\n //select all data\n $query = \"SELECT\n id, name, status\n FROM\n \" . $this->table_name . \"\n ORDER BY\n id DESC\"; \n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "function getRecords($limit = false)\n\t{\n\t\tif ($limit !== false)\n\t\t\t$this->setParam(\"limit\", $limit);\n\n\t\t$this->table->getRecords();\n\t}", "public function limit(int $limit, int $offset);", "function limit($count) {\n\t\t$this->appendStmt('limit', \"LIMIT ?\", [$count]);\n\t\treturn $this;\n\t}", "function limit($value, $offset = '')\r\n\t{\r\n\t\t$this->db->limit($value, $offset);\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}" ]
[ "0.64965904", "0.62303704", "0.60361505", "0.60327953", "0.59793574", "0.5876172", "0.586869", "0.58648276", "0.58648276", "0.58648276", "0.58648276", "0.58648276", "0.58347994", "0.58133674", "0.5728893", "0.5676856", "0.5670686", "0.5667905", "0.56673217", "0.5658921", "0.56397283", "0.5629308", "0.5620079", "0.5604866", "0.55992657", "0.5596865", "0.5577076", "0.55760384", "0.5575544", "0.5567304", "0.5564013", "0.55438787", "0.554136", "0.5540372", "0.5537357", "0.5519021", "0.55118215", "0.55076236", "0.548381", "0.5483444", "0.548258", "0.5478831", "0.5467012", "0.5467012", "0.5467012", "0.5467012", "0.5467012", "0.5467012", "0.5467012", "0.5467012", "0.5467012", "0.5467012", "0.5467012", "0.5467012", "0.5466888", "0.5458515", "0.54560137", "0.54509634", "0.5447321", "0.54447633", "0.54437375", "0.5436053", "0.54340774", "0.5428783", "0.54090434", "0.5399741", "0.5396937", "0.5396937", "0.5394473", "0.538218", "0.53808606", "0.5372448", "0.53666943", "0.5364068", "0.53586626", "0.53559715", "0.53534067", "0.53497887", "0.53463", "0.5344275", "0.5340721", "0.5339622", "0.53360826", "0.53360826", "0.5336041", "0.533289", "0.5331266", "0.5319235", "0.5314253", "0.53087234", "0.5308025", "0.53078365", "0.5307312", "0.53072214", "0.5303152", "0.52974224", "0.5288607", "0.5280289", "0.52798456", "0.52796394", "0.5277475" ]
0.0
-1
limit() Define attributes for Create( (columns,) VALUES ('Values',)) and Update (SET) SQL : (col1, col2) VALUES ('val1', 'val2') SQL : SET col1='val1', col2='val2'
public function set($column, $value = null) { if (gettype($column) == 'array') { foreach($column as $key => $value) { $this->_set[$key] = addslashes($value); } // foreach } else { $this->_set[$column] = addslashes($value); } // if return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function getUpdateSQL($table, $data, $where, $values, $order, $limit);", "protected function setLimit() {\r\n if( $this->sqlLimit ) {\r\n $this->sql .= ' LIMIT ' . $this->sqlLimit;\r\n }\r\n }", "public function set_limit($limit);", "public function limit($limit) {\r\n $this->sqlLimit = $limit;\r\n return $this;\r\n }", "public function setLimit($limit) {\n\t$this->parseQuery->setLimit($limit);\n }", "final public function setLimit(YMKM_SQL_Entity_Limit $s)\n {\n $this->doSetLimit($s);\n return $this;\n }", "public function update(){\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $fieldsList = \" SET \";\n foreach ($this->attributes as $column => $value) {\n $fieldsList.=$column.\"=\".'\\''.$value.'\\''.\", \";\n }\n $fieldsList = str_last_replace(\", \", \"\", $fieldsList);\n $sqlQuery = \"UPDATE \".$this->table.$fieldsList.\" WHERE \".$this->idName.\"=\".$this->attributes[$this->idName];\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n }\n }", "public function dbLimit($limit) {\r\n $this->limit = $limit;\r\n return $this;\r\n }", "public function limit($limit)\n {\n if ( $this->driver->type == 'sqlite' ) {\n // throw new Exception('sqlite does not support limit syntax');\n }\n $this->limit = $limit;\n return $this;\n }", "private function setField()\n {\n $sql = '';\n $sql = rtrim($sql , ', ');\n\n foreach (array_keys($this->data) as $key){\n $sql .= '`' . $key . '` = ?, ';\n }\n\n $sql = rtrim($sql , ', ');\n return $sql;\n }", "public function limit($limit)\t{\n\t\t$this->limit = array(\"LIMIT $limit\");\n\t\treturn $this;\n\t}", "public function change(): void\n {\n $table = $this->table(\n EmployeeValues::TABLE_NAME, ['id' => false, 'primary_key' => ['id']]\n );\n\n $table->addColumn('id', Column::BINARYUUID, ['null' => false])\n ->addColumn('employer_id', Column::BINARYUUID, ['null' => true])\n ->addColumn('position_id', Column::BINARYUUID, ['null' => true])\n ->addColumn('status_id', Column::BINARYUUID, ['null' => true])\n ->addColumn(\n 'name', Column::STRING, ['null' => true, 'limit' => 100]\n )\n ->addColumn(\n 'initial', Column::STRING, ['null' => true, 'limit' => 5]\n )\n ->addColumn(\n 'email', Column::STRING, ['null' => true, 'limit' => 100]\n )\n ->addColumn('birthday', Column::DATETIME, ['null' => true])\n ->addColumn('created_at', Column::TIMESTAMP, ['null' => true])\n ->addColumn('updated_at', Column::TIMESTAMP, ['null' => true])\n ->addColumn('deleted_at', Column::TIMESTAMP, ['null' => true])\n ->addIndex(['employer_id'])\n ->addIndex(['status_id'])\n ->addIndex(['position_id'])\n ->addIndex(['email'])\n ->create()\n ;\n }", "private function setFields()\n\t{\t\n\t\t$sql = '';\n\t\t\n\t\tforeach (array_keys($this->data) as $key)\n\t\t{\n\t\t\t$sql .= '`' . $key . '` = ? , ';\n\t\t}\n\t\t\n\t\t$sql = rtrim($sql, ', ');\n\t\t\n\t\treturn $sql;\n\t}", "public function setLimit(?int $limit): void\n {\n $this->limit['value'] = $limit;\n }", "function setLimit($limit, $offset)\n {\n if ($limit || $offset) {\n return Tree::raiseError(TREE_ERROR_DB_ERROR, null, null, 'limit is not supported by this backend');\n }\n }", "public function set_limit($new_limit){\r\n $this->limit = $new_limit;\r\n }", "public function setQueryLimit($limit) {\n\t\t$this->queryLimit = (integer) $limit;\n\t}", "public function setViaTableAttributesValue($value);", "public function set($column,$value);", "function setLimit($start, $end) {\n\t\tif (!is_int($start) || !is_int($end)) {\n\t\t\tthrow new DBException(\"Limit must be integer\");\n\t\t}\n\t\t$this->start = $start;\n\t\t$this->end = $end;\n\t\treturn $this;\n\n\t}", "public static function setQueryLimit($limit){\t\t\n\t\t//reset the queryCount\n\t\tself::$queryCount = 0;\n\t\t\n\t\tself::$queryLimit = $limit;\n }", "public function setLimit($limit)\n {\n //argument 1 must be a string\n Argument::i()->test(1, 'int');\n $this->query['limit'] = $limit;\n \n return $this;\n }", "public function setLimit($limit) {\n\t\t$this->limit = $limit;\n\t}", "public function set(array $columns, array $values, array $clauseProps = array()){\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 -> INSERT\r\n $this->queryString .= \"INSERT INTO \" . $table . \"(\" . $_columns . \") VALUES (\" . implode(', ', $this->prepareInsertPlaceholder($values)) . \")\";\r\n\r\n if(count($clauseProps) > 0){\r\n $this->queryString .= \" ON DUPLICATE KEY UPDATE \";\r\n $this->queryString .= implode(', ', $this->prepareUpdatePlaceholder($clauseProps));\r\n }\r\n\r\n return $this;\r\n }", "public function setAll($values) {\n\t\tif (isset($values[self::$primaryKey[$this->table]])) {\n\t\t\t$this->originalData = $values;\n\t\t}\n\t\telse {\n\t\t\t$this->modifiedData = $values;\n\t\t}\n\t}", "public function setDataRange($limit, $offset = 0) {\n\t\t\t$this->limit = (int) $limit;\n\t\t\t$this->offset = (int) $offset;\n\t\t}", "private function setFields(): string\n {\n $sql = '';\n\n foreach (array_keys($this->data) as $key) {\n $sql .= '`' . $key . '` = ? , ';\n }\n return rtrim($sql, ', ');\n }", "public function setLimit(int $limit): self;", "function limit($count) {\n\t\t$this->appendStmt('limit', \"LIMIT ?\", [$count]);\n\t\treturn $this;\n\t}", "public function limit( $limit ) {\n\t\t$this->isDirty( true );\n\t\t$this->_limit = $limit;\n\t\treturn $this;\n\t}", "public function change()\n {\n $table = $this->table('summary');\n $table->addColumn('batch_id', 'biginteger', [\n 'limit' => 14,\n 'null' => false,\n 'default' => 0\n ]);\n $table->update();\n }", "function limit($limit, $offset = 0)\n{\n\t$this->tryModify();\n\t$this->query['limit'] = array((int)$limit, (int)$offset);\n\treturn $this;\n}", "public function updateSql(){\n\n $sql = \"UPDATE {$this->table} SET \";\n $i = 0;\n $size = sizeof($this->requestUpdateValues);\n\n foreach ($this->requestUpdateValues as $key=>$value) {\n $sql .= \"{$key} = {$this->params['columnName_Pdo'][$key]} \";\n $i++;\n if($i < $size) { $sql .= ' , '; }\n }\n \n $sql .= \" WHERE id IN ({$this->updateIds}) \";\n \n return $sql;\n }", "public function limit($limit)\n\t{\n\t\t$this->query->limit = $limit;\n\t\treturn $this;\n\t}", "function getLimitSql()\n\t{\n\t\t$sql = \"LIMIT \" . $this->getLimit();\n\t\treturn $sql;\n\t}", "abstract protected function platformUpdateBatchStatement($table, $values, $index);", "function getSaveStatement($model,&$args,$columns_to_update=false);", "public function setLimit($limit)\n {\n $this->limit = $limit;\n }", "protected function prepare( array $values, $mode = 'INSERT' )\n {\n // create temporary array\n $columns = array_keys( $values );\n\t\t\n // begin creating sql statment\n $sql = $mode.' INTO `'.$this->name.'`';\n\t\t\n $count=0;\n $cols = '';\n $vals = '';\n\t\t\n foreach( $columns as $value ){\n $cols .= ( $count > 0 ? ', ' : '' ) . '`' . $value . '`';\n $vals .= ( $count > 0 ? ', ' : '' ) . '?';\n $count++;\n }\n\t\t\n $sql .= ' (' . $cols . ')';\n\t\t\n //$values = Database::quote( $values );\n $sql .= ' VALUES (' . $vals . ')';\n\n return $sql;\n \n }", "protected function prepareSaveStatement() {\n $fields = implode(',', $this->columns);\n\n $placeholders = [];\n foreach ($this->columns as $column) {\n $placeholders[] = ':' . $column;\n }\n $placeholders = implode(',', $placeholders);\n\n // Prepare our statement.\n return $this->connection->prepare(\"INSERT INTO {$this->table} ($fields) VALUES ($placeholders)\");\n }", "public function create() {\n\t\t$columns = implode(', ', array_keys($this->params));\n\t\t$bindings = substr(str_repeat(', ?', count($this->params)), 2);\n\t\t$sql = 'INSERT INTO ' . static::$table . ' (' . $columns . ') VALUES (' . $bindings . ');';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "public function getForUpdateSQL();", "public function setValues($values);", "private function sqlstatements() {\n $this->select = array( );\n $this->insert = array( 'INSERT INTO :entity (xxx) VALUES (yyy)' );\n $this->update = array( );\n $this->delete = array( );\n }", "public function limit($limit)\n\t{\n\t\t$this->limit = (int) $limit;\n\t}", "private function sql_limit()\n {\n // Get LIMIT statement\n $limit = null;\n\n // RETURN LIMIT statement\n return $limit;\n }", "private function setAddColumnSql() {\n\n if (!empty($this->add_columns)) {\n\n foreach ($this->add_columns as $key => $value) {\n\n foreach ($value as $keys) {\n\n $column_data = $this->one_db_table_columns[$key][$keys];\n\n\n\n $add_colum_params = \"\";\n $default_is_string = false;\n $null_string = \"\";\n $default_string = \"\";\n\n\n\n\n //Sütun tipi\n $add_colum_params .= \" \" . $column_data['Type'] . \" \";\n\n\n if ($column_data['Null'] == \"NO\") {\n\n $null_string = \"NOT NULL\";\n } else if ($column_data['Null'] == \"YES\") {\n\n $null_string = \"NULL\";\n }\n\n\n\n $field_type_detect = substr($column_data['Type'], 0, 4);\n\n if (\n $field_type_detect == \"varc\" ||\n $field_type_detect == \"text\" ||\n $field_type_detect == \"date\") {\n\n $default_is_string = true;\n }\n\n\n\n if ($column_data['Default'] != \"\" || !empty($column_data['Default']) || $column_data['Default'] != NULL) {\n\n\n $default_string = \" DEFAULT \";\n\n\n if ($default_is_string) {\n\n\n $default_string .= \" '\" . $column_data['Default'] . \"' \";\n } else {\n\n $default_string .= \" \" . $column_data['Default'] . \" \";\n }\n }\n\n\n\n $add_colum_params .= $null_string . $default_string;\n\n $writesql = <<< EOT\nALTER TABLE {$key} ADD COLUMN {$column_data['Field']} {$add_colum_params};\nEOT;\n\n $this->execute_sql[\"add_columns\"][] = $writesql;\n }\n }\n }\n }", "public function change()\n {\n $table = $this->table('api_requests', ['id' => false, 'primary_key' => ['id']]);\n $table->addColumn('id', 'uuid', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ]);\n $table->addColumn('http_method', 'string', [\n 'limit' => 10,\n 'null' => false,\n ]);\n $table->addColumn('endpoint', 'string', [\n 'limit' => 2048,\n 'null' => false,\n ]);\n $table->addColumn('token', 'string', [\n 'default' => null,\n 'limit' => 2048,\n ]);\n $table->addColumn('ip_address', 'string', [\n 'default' => null,\n 'limit' => 50,\n 'null' => false,\n ]);\n $table->addColumn('request_data', 'text', [\n 'default' => null,\n 'null' => false,\n ]);\n $table->addColumn('response_code', 'integer', [\n 'limit' => 5,\n 'default' => null,\n 'null' => false,\n ]);\n $table->addColumn('response_data', 'text', [\n 'default' => null,\n 'null' => false,\n ]);\n $table->addColumn('exception', 'text', [\n 'default' => null,\n 'null' => false,\n ]);\n $table->addColumn('created', 'datetime', [\n 'null' => false,\n ]);\n $table->addColumn('modified', 'datetime', [\n 'null' => false,\n ]);\n $table->create();\n }", "public function limit($limit)\n {\n }", "public function testIncrementalSet()\n {\n $method = $this->builder_reflection->getMethod('sql_set');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('set');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array( array('column1' => 'value1')));\n $method->invokeArgs($this->builder, array( array('column2' => 'value2')));\n\n $string = 'SET column1 = value1, column2 = value2';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }", "function setParamsToSaveQuery()\n {\n \n \n if($this->form->getQuery())\n {\n $stringTmp=$this->form->getQuery()->getSqlQuery();\n $stringTmp=substr($stringTmp, strpos($stringTmp,' FROM ' ));\n $stringTmp=substr($stringTmp, 0, strpos($stringTmp,' LIMIT ' ));\n $this->getUser()->setAttribute('queryToSaveWhere', $stringTmp);\n }\n \n if($this->form->getQuery()->getParams())\n {\n $stringTmp=\"\";\n $arrayTmp=$this->form->getQuery()->getParams();\n if(isset($arrayTmp['where']))\n {\n foreach($arrayTmp['where'] as $key=>$value)\n {\n $stringTmp.=\";|\".$value.\"|\";\n }\n $this->getUser()->setAttribute('queryToSaveParams', $stringTmp);\n }\n }\n return;\n }", "private function setLimit($limit)\n {\n $this->limit = (int)$limit;\n }", "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 change()\n {\n $this->table('mail_queues')\n ->addColumn('id', 'uuid', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addPrimaryKey(['id'])\n ->addColumn('template', 'string', [\n 'default' => \"default\",\n 'limit' => 50,\n 'null' => false,\n ])\n ->addColumn('toUser', 'string', [\n 'limit' => 250,\n 'null' => false,\n ])\n ->addColumn('subject', 'string', [\n 'limit' => 250,\n 'null' => false,\n ])\n ->addColumn('viewvars', 'text', [\n 'default' => null,\n 'limit' => null,\n 'null' => true,\n ])\n ->addColumn('body', 'text', [\n 'default' => null,\n 'limit' => null,\n 'null' => false,\n ])\n ->addColumn('created_at', 'timestamp', [\n 'default' => 'CURRENT_TIMESTAMP',\n 'limit' => null,\n 'null' => false,\n ])\n ->create();\n }", "public function change()\n {\n $statistics = $this->table('vrchat');\n $statistics->addColumn('auth', 'string', ['limit' => 100])\n ->addColumn('apiKey', 'string', ['limit' => 100])\n ->addColumn('login', 'string', ['limit' => 100])\n ->addColumn('password', 'string', ['limit' => 100])\n ->create();\n\n // inserting only one row\n $singleRow = [\n 'id' => 1,\n 'auth' => '',\n 'apiKey' => 'JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26',\n 'login' => 'Loli E1ON',\n 'password' => ''\n ];\n\n $table = $this->table('vrchat');\n $table->insert($singleRow);\n $table->saveData();\n\n }", "protected function limit(int $limit){\n $this->query .= \"LIMIT \" . $limit . \" \";\n }", "function dbSetVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->set($f,$this->$f);\n }\n\n }", "public function change()\n {\n $table = $this->table('block_attributes', ['signed' => false]);\n $table->addColumn('block_id', 'integer', [\n 'limit' => 10,\n 'null' => false,\n ]);\n $table->addColumn('attribute_id', 'integer', [\n 'limit' => 10,\n 'null' => false,\n ]);\n $table->addColumn('created', 'datetime', [\n 'default' => 'CURRENT_TIMESTAMP',\n 'null' => false,\n 'comment' => '作成日',\n ]);\n $table->addColumn('modified', 'timestamp', [\n 'default' => null,\n 'null' => false,\n 'comment' => '更新日',\n ]);\n $table->addIndex([\n 'block_id',\n 'attribute_id',\n ], [\n 'name' => 'UNIQUE_BLOCK_ATTRIBUTE',\n 'unique' => true,\n ]);\n $table->create();\n }", "public function setLimit($limit) {\n $this->limit = $limit;\n return $this;\n }", "public function testLimitSetFromClauseString()\n {\n $query = new SQLSelect();\n $query->setSelect('*');\n $query->setFrom('\"SQLSelectTest_DO\"');\n\n $query->setLimit('20 OFFSET 10');\n $limit = $query->getLimit();\n $this->assertEquals(20, $limit['limit']);\n $this->assertEquals(10, $limit['start']);\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function setLimit(?int $limit): void\n {\n $this->limit = $limit;\n }", "public function cpSelectDsclimit($tablename,$value3, $value1=0,$value2=0) {\n /*** The SQL SELECT statement ***/\n /*\n * Prepare the select statement\n */\n $startvalue=($value1-1)*10;\n $sql=\"SELECT * FROM $tablename \";\n if($value2!=0)\n { $key1= key($value2);\n $sql.=\" where $key1='$value2[$key1]'\";\n }\n \n $sql.= \" ORDER BY $value3 DESC LIMIT $startvalue, 10\";\n \n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n return $result;\n \n}", "public final function setLimit($val1, $val2)\n {\n $this->limit['lower'] = (int) $val1;\n $this->limit['upper'] = (int) $val2;\n return $this;\n }", "private function setParams($statement, $parameters = array()){\n\t\tforeach ($parameters as $key => $value) { ///percorrer as linhas rows\n\t\t\t$this->setParam($key,$value);///percorer as colunas ID\n\t\t}\n\t}", "public function setLimit($limit, $offset = 0)\n {\n if ((is_numeric($limit) && $limit < 0) || (is_numeric($offset) && $offset < 0)) {\n throw new InvalidArgumentException(\"SQLSelect::setLimit() only takes positive values\");\n }\n\n if (is_numeric($limit)) {\n $this->limit = [\n 'start' => (int)$offset,\n 'limit' => (int)$limit,\n ];\n } elseif ($limit && is_string($limit)) {\n if (strpos($limit ?? '', ',') !== false) {\n list($start, $innerLimit) = explode(',', $limit ?? '', 2);\n } else {\n list($innerLimit, $start) = explode(' OFFSET ', strtoupper($limit ?? ''), 2);\n }\n\n $this->limit = [\n 'start' => (int)$start,\n 'limit' => (int)$innerLimit,\n ];\n } elseif ($limit === null && $offset) {\n $this->limit = [\n 'start' => (int)$offset,\n 'limit' => $limit\n ];\n } else {\n $this->limit = $limit;\n }\n\n return $this;\n }", "public function limit($limit)\r\n {\r\n $this->query->limit($limit);\r\n \r\n return $this;\r\n }", "public function limit($limit){\n $self = $this;\n $fnApply = static function($values) use ($self, $limit) {\n return $self->apply($values)->limit($limit);\n };\n return new FnSequence($fnApply);\n }", "private function setSQL($sSQL) {\n\t\t// Rows und Offset fürs Statement generieren\n\t\t$nRows = $this->Limit;\n\t\t$nOffs = ($this->Page * $this->Limit) - $this->Limit;\n\t\t// Limit klausel anhängen\n\t\t$sSQL .= \" LIMIT $nOffs,$nRows\";\n\t\t$this->sSQL = $sSQL;\n\t}", "public function setLimit($limit)\r\n {\r\n $this->limit = intval($limit);\r\n }", "public function setLimit($value)\n {\n return $this->setParameter('limit', $value);\n }", "protected function _createColumnQuery()\n\t{\n\t\n\t}", "public function setLimit($limit) {\n $this->limit = (int)$limit;\n }", "public function setSqlLimit($limit)\n {\n if ($this->searchResult !== null) {\n $limit = '';\n }\n\n return $limit;\n }", "public abstract function getSelectSQL($fields, $from, $joins, $where, $having, $group, $order, $limit, $values, $forupdate);", "public function setLimit(int $limit): void\n {\n $this->_limit = $limit;\n }", "function setAllFieldsParam($name, $value)\n\t{\n \t\tforeach ($this->table->fields as $field)\n\t\t{\n\t\t\t$array[] = $field->name;\n\t\t}\n\n\t\t$this->setFieldParam($array, $name, $value);\n\t}", "public function update(){\n $set_param_cols_vals = $this->iniParamvalues($this->data, \",\");\n // check for extra set_column\n $extra_set = ($this->custom !== NULL) ? $this->custom : NULL ;\n if($this->custom !== NULL){\n if($this->data !== NULL){\n if(!empty($this->where)){\n $this->custom = \",$this->custom\"; \n }\n else{\n $this->custom = 'WHERE '.$this->custom; \n }\n }\n else{\n if(empty($this->where)){\n $this->custom = 'WHERE '.$this->custom; \n }\n else{\n $this->custom = $this->custom; \n }\n } \n }\n // set where cols param values\n $set_param_where = $this->update_iniParamvalues($this->where, \"and\", \"WHERE\");\n\n $sql = \"UPDATE \".self::$table.\" SET $set_param_cols_vals $this->custom $set_param_where\";\n\n // prepare sql statement\n $this->query = $this->conn->prepare($sql);\n\n // bind cols_vals param values\n $this->update_cusBindparam($this->data);\n \n // bind where param values\n if(!empty($this->data)){\n $this->cusBindparam($this->where,count($this->data)+1); \n }\n else if(!empty($this->where)){\n $this->cusBindparam($this->where); \n }\n // execute query\n $execute = $this->query->execute();\n\n if(!$execute){\n return false;\n }\n else{\n return true;\n }\n }", "public function update(array $values = [])/*# : UpdateStatementInterface */;", "private function transfer_data()\n\t{\n\t\t$num_rows = db::select_one(\"select count(*) from {$this->table}\");\n\t\t\n\t\tfor ($i = 0; $i < $num_rows; $i += BATCH_SIZE)\n\t\t{\n\t\t\techo \"$i / $num_rows (select {$this->before_alter_select_query} from {$this->table})\\n\";\n\t\t\t$r = mysql_query(\"select {$this->before_alter_select_query} from {$this->table} limit $i, \".BATCH_SIZE);\n\t\t\twhile ($d = mysql_fetch_assoc($r))\n\t\t\t{\n\t\t\t\tif ($this->renamed_cols)\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->renamed_cols as $before_key => $after_key)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d[$after_key] = $d[$before_key];\n\t\t\t\t\t\tunset($d[$before_key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdb::insert($this->temp_table, $d);\n\t\t\t}\n\t\t}\n\t}", "function lazyUpdate($table, $where, $data){\n \t$sql = 'SHOW COLUMNS FROM '.$table.';';//fetch all columns\n \t$query = mysql_query($sql);\n \t$set = '';\n \twhile($column = mysql_fetch_array($query)){\n \t\t//create the field- and value string\n \t\tif(isset($data[$column['Field']])){\n \t\t\t$set .= $column['Field'].'=\\''.mysql_real_escape_string($data[$column['Field']]).'\\', ';\n \t\t}\n \t}\n \t$set = substr($set,0,-2);\n \treturn mysql_query('UPDATE '.$table.' SET '.$set.' WHERE '.$where.';');//insert the data\n }", "public function update( $table, $set, $where='', $joins=array(), $limit=NULL, $flags=0 )\n\t{\n\t\t$binds = array();\n\t\t\n\t\t/* Work out table */\n\t\t$table = is_array( $table ) ? \"`{$this->prefix}{$table[0]}` {$this->prefix}{$table[1]}\" : \"`{$this->prefix}{$table}` {$table}\";\n\n\t\t/* Work out joins */\n\t\t$_joins\t= array();\n\t\t\n\t\tforeach ( $joins as $join )\n\t\t{\n\t\t\t$type = ( isset( $join['type'] ) and in_array( \\strtoupper( $join['type'] ), array( 'LEFT', 'INNER', 'RIGHT' ) ) ) ? \\strtoupper( $join['type'] ) : 'LEFT';\n\t\t\t$_table = is_array( $join['from'] ) ? \"`{$this->prefix}{$join['from'][0]}` {$this->prefix}{$join['from'][1]}\" : \"`{$this->prefix}{$join['from']}` {$join['from']}\";\n\n\t\t\t$on = $this->compileWhereClause( $join['where'] );\n\t\t\t$binds = array_merge( $binds, $on['binds'] );\n\n\t\t\t$_joins[] = \"{$type} JOIN {$_table} ON {$on['clause']}\";\n\t\t}\n\t\t$joins = empty( $_joins ) ? '' : ( ' ' . implode( \"\\n\", $_joins ) );\n\t\t\n\t\t/* Work out SET clause */\n\t\tif ( is_array( $set ) )\n\t\t{\n\t\t\t$_set = array();\n\t\t\tforeach ( $set as $k => $v )\n\t\t\t{\n\t\t\t\t$_set[] = \"`{$k}`=\" . ( is_object( $v ) ? '(?)' : '?' );\n\t\t\t\t$binds[] = $v;\n\t\t\t}\n\t\t\t$set = implode( ',', $_set );\n\t\t}\n\t\t\t\t\n\t\t/* Compile where clause */\n\t\tif ( $where !== '' )\n\t\t{\n\t\t\t$_where = $this->compileWhereClause( $where );\n\t\t\t$where = 'WHERE ' . $_where['clause'];\n\t\t\t$binds = array_merge( $binds, $_where['binds'] );\n\t\t}\n\t\t\n\t\t/* Build query */\n\t\t$query = 'UPDATE ';\n\t\tif ( $flags & static::LOW_PRIORITY )\n\t\t{\n\t\t\t$query .= 'LOW_PRIORITY ';\n\t\t}\n\t\tif ( $flags & static::IGNORE )\n\t\t{\n\t\t\t$query .= 'IGNORE ';\n\t\t}\n\t\t$query .= \"{$table} {$joins} SET {$set} {$where} \";\n\t\t\n\t\t/* Limit */\n\t\tif( $limit !== NULL )\n\t\t{\n\t\t\t$query .= $this->compileLimitClause( $limit );\n\t\t}\n\t\t\t\t\n\t\t/* Run it */\n\t\t$stmt = $this->preparedQuery( $query, $binds );\n\t\treturn $stmt->affected_rows;\n\t}", "function modifyLimitQuery($query, $from, $count)\n {\n $this->limit_from = $from;\n $this->limit_count = $count;\n return $query;\n }", "public function set(array $pairs)\n {\n if ($this->_type == db::INSERT) \n {\n // 把key存到 _columns 里面\n $this->columns(array_keys($pairs));\n // 把值存到 _values 里面\n $this->values($pairs);\n }\n elseif ($this->_type == db::UPDATE) \n {\n foreach ($pairs as $column => $value)\n {\n $this->_set[] = array($column, $value);\n }\n }\n\n return $this;\n }", "public function setLimit(int $limit): void\n {\n $this->limit = $limit;\n }", "public function setValues($values)\n {\n foreach ($this->entities as $entity) \n {\n $entity->setValues($values);\n }\n }", "public function limit($offset, $limit)\n\t{\n\t\t$this->data_source->size = $limit;\n\t\t$this->data_source->from = $offset;\n\n\t\treturn $this;\n\t}", "public function modifyRecords(){\n \n // Get the sql statement\n $sql = $this->updateSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->requestUpdateValues as $key => $value) {\n $stmt->bindParam($this->params['columnName_Pdo'][$key], $this->requestUpdateValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }", "public function setLimit($limit)\n\t{\n\t\t$this->limit = $limit;\n\t\treturn $this;\n\t}", "abstract protected function platformUpdateStatement($table, array $sets);", "public function setLimit($x) { $this->limit = $x; }", "private function setAttribute($sql, $fetchAction, $mode) {\n $this->mode = self::getMode($mode);\n $this->fetchAction = self::fetchAction($fetchAction);\n $this->pdo->setAttribute(\\PDO::ATTR_CASE, $this->mode);\n $this->query = $this->base_query($sql);\n $this->query->setFetchMode($this->fetchAction);\n return $this->query;\n }", "public function sqlSetSelectLimit($selectSql, $limit, $offset = null) {\n if (!preg_match('/\\s+ORDER\\s+BY\\s+/i', $selectSql)) $selectSql .= ' ORDER BY 1';\n $offset = null === $offset ? 0 : (int)$offset;\n $selectSql .= ' OFFSET ' . $offset . ' ROWS';\n if ($limit !== null) {\n $limit = (int)$limit;\n $selectSql .= ' FETCH NEXT ' . $limit . ' ROWS ONLY';\n }\n return $selectSql;\n }", "public function setLimit ($value)\r\n\t{\r\n\t\t$this->limit = $value;\r\n\t}", "public function Values(array $Values, array ...$Multiple): IInsert;", "public function set_item_limit($limit = 0)\n {\n }", "public function set ($limit, $offset = 0)\n {\n $isString = FALSE;\n\n if (NULL == $limit) {\n $limit = 'ALL';\n }\n\n if ('string' === gettype($limit)) {\n $isString = (boolean) $limit = strtoupper($limit);\n }\n\n if (TRUE === $isString && 'ALL' != $limit) {\n $limit = self::DEFAULT_LIMIT;\n }\n\n if (FALSE === $isString && 0 > (integer) $limit) {\n $limit = 0;\n }\n\n $this->_offset = (integer) $offset;\n $this->_limit = $limit;\n return $this;\n }", "protected function update(string $table, array $columns, array $conditions, int $limit = 0) {\n $columnsInput = \"\";\n $conditionsInput = \"\";\n $inputs = [];\n foreach ($columns as $key => $value) {\n $inputs[] = $value;\n $columnsInput .= \"$key = ?, \";\n }\n foreach ($conditions as $key => $value) {\n $inputs[] = $value;\n $conditionsInput .= \"$key = ?, \";\n }\n $columnsInput = rtrim($columnsInput, \", \");\n $conditionsInput = rtrim($conditionsInput, \", \");\n\n $sql = \"UPDATE $table\n SET $columnsInput\n WHERE $conditionsInput\";\n if ($limit) {\n $sql .= \"\\nLIMIT $limit;\";\n }\n\n // $sql = \"UPDATE users SET firstName = '?', lastName = '?', studentID = ? WHERE ID = ? LIMIT 1;\";\n // var_dump($sql);\n // var_dump($inputs);\n // echo showQuery($sql, $inputs);\n\n $sth = self::run($sql, $inputs);\n return $sth;\n }", "function GenerateSqlSet_ParamList($param_list, $fields)\n{\n // Generate a data set.\n $data = array();\n foreach($param_list as $param_spec)\n {\n if(!isset($param_spec[\"FieldName\"])) continue;\n if(!isset($param_spec[\"Value\"])) continue;\n $fn = $param_spec[\"FieldName\"];\n $v = $param_spec[\"Value\"];\n $data[$fn] = $v;\n }\n return GenerateSqlSet($data, $fields);\n}", "public function setLimits($mode, $lower = null, $upper = null)\n {\n try {\n if ($upper) {\n $before = $this->genTime($upper);\n } else {\n $before = $this->genTime('- 2 min');\n }\n if ($lower) {\n $after = $this->genTime($lower);\n } else {\n $after = $this->genTime('- 2 min');\n }\n if ($after > $before) {\n $after = $this->genTime($upper . ' - 150 sec');\n }\n if ($mode == 'Created') {\n $this->options['CreatedAfter'] = $after;\n if ($before) {\n $this->options['CreatedBefore'] = $before;\n }\n unset($this->options['LastUpdatedAfter']);\n unset($this->options['LastUpdatedBefore']);\n } else if ($mode == 'Modified') {\n $this->options['LastUpdatedAfter'] = $after;\n if ($before) {\n $this->options['LastUpdatedBefore'] = $before;\n }\n unset($this->options['CreatedAfter']);\n unset($this->options['CreatedBefore']);\n } else {\n $this->log('warning', 'First parameter should be either \"Created\" or \"Modified\".');\n return false;\n }\n\n } catch (\\Exception $e) {\n $this->log('error', 'Error: ' . $e->getMessage() . $this->options['LastUpdatedAfter'] . $this->options['LastUpdatedBefore'] . $e->getFile() . $e->getLine());\n return false;\n }\n\n }", "public function setLimit($limit)\n {\n $this->_limit = $limit;\n return $this;\n }" ]
[ "0.5810931", "0.5731352", "0.5613755", "0.5600523", "0.5457687", "0.53943217", "0.5384469", "0.53753144", "0.5268876", "0.5212638", "0.51852846", "0.51767033", "0.5161241", "0.515598", "0.5127167", "0.51013994", "0.5091897", "0.5081236", "0.50794166", "0.5078419", "0.5078199", "0.506747", "0.50529623", "0.5042418", "0.5036066", "0.50259924", "0.5017159", "0.5005203", "0.50022393", "0.5000745", "0.4999746", "0.49900088", "0.49894875", "0.4984455", "0.49748927", "0.4959476", "0.49574807", "0.49428067", "0.49353573", "0.49335638", "0.49173898", "0.4910742", "0.49044368", "0.48936665", "0.48923957", "0.48892665", "0.48841792", "0.48767558", "0.4875178", "0.4868614", "0.48664677", "0.48639426", "0.48638725", "0.48586524", "0.48423257", "0.48339084", "0.48331752", "0.48325375", "0.48294044", "0.48264873", "0.4826162", "0.4826162", "0.48215252", "0.4821361", "0.48096195", "0.47986174", "0.47876936", "0.47871146", "0.47859138", "0.47857046", "0.47825846", "0.47759447", "0.47748372", "0.4771083", "0.4769445", "0.47681305", "0.47655144", "0.4761996", "0.47573438", "0.4750138", "0.4747765", "0.47453234", "0.4734615", "0.4733722", "0.47256348", "0.47219366", "0.47179666", "0.47131893", "0.4711093", "0.4706007", "0.4700622", "0.46996474", "0.4699536", "0.46981218", "0.4694685", "0.46849352", "0.46835443", "0.46770382", "0.46769834", "0.46769753", "0.4675225" ]
0.0
-1
set() Define attributes for all SQL : WHERE col1 = 'val1' AND col2 = 'val2'
public function where($column, $condition, $value) { $this->_where[] = array('row' => $column, 'condition' => $condition, 'value' => $value); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setField()\n {\n $sql = '';\n $sql = rtrim($sql , ', ');\n\n foreach (array_keys($this->data) as $key){\n $sql .= '`' . $key . '` = ?, ';\n }\n\n $sql = rtrim($sql , ', ');\n return $sql;\n }", "protected function setConditions() {\r\n if( count($this->sqlConditions) ) {\r\n $this->sql .= ' WHERE ' . $this->sqlStrConditions;\r\n }\r\n }", "protected function create_set($data = []){\n $set = '';\n foreach($data as $column => $value){\n // make sure it is in our column list before we add it to the WHERE\n if(in_array($column, $this->column_list)){\n // the first time through add the SET keyword, otherwise add a comma\n $set .= (strlen($set) == 0 ? \"SET \" : \", \") . \"$column = \\\"$value\\\"\";\n }\n }\n return $set;\n }", "private function setFields()\n\t{\t\n\t\t$sql = '';\n\t\t\n\t\tforeach (array_keys($this->data) as $key)\n\t\t{\n\t\t\t$sql .= '`' . $key . '` = ? , ';\n\t\t}\n\t\t\n\t\t$sql = rtrim($sql, ', ');\n\t\t\n\t\treturn $sql;\n\t}", "protected function _setWhere(&$sql, $where, $whereValues) {\n\t\t\n\t\tif (!is_null($where)) $sql.= ' WHERE ' . $where;\n\t}", "public static function setCondition($args = null){\r\n return self::$PDO->setCondition($args);\r\n }", "private function setFields(): string\n {\n $sql = '';\n\n foreach (array_keys($this->data) as $key) {\n $sql .= '`' . $key . '` = ? , ';\n }\n return rtrim($sql, ', ');\n }", "function dbSetVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->set($f,$this->$f);\n }\n\n }", "public function set_where(array $params) {\n $where = '';\n foreach ($params as $field_name => $field_value) {\n $where .= '`' . $field_name . '` = \\'' . $field_value . '\\' AND ';\n }\n\n $where = rtrim($where, ' AND ');\n $this->where = ' WHERE ' . $where;\n }", "private function setAttribute($sql, $fetchAction, $mode) {\n $this->mode = self::getMode($mode);\n $this->fetchAction = self::fetchAction($fetchAction);\n $this->pdo->setAttribute(\\PDO::ATTR_CASE, $this->mode);\n $this->query = $this->base_query($sql);\n $this->query->setFetchMode($this->fetchAction);\n return $this->query;\n }", "public function testIncrementalSet()\n {\n $method = $this->builder_reflection->getMethod('sql_set');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('set');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array( array('column1' => 'value1')));\n $method->invokeArgs($this->builder, array( array('column2' => 'value2')));\n\n $string = 'SET column1 = value1, column2 = value2';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }", "function set_row($keys,$sql_set) {\r\n $sql_where = '';\r\n if (count($keys) > 0) {\r\n $sql_wheres = array();\r\n foreach ($keys as $key=>$val) {\r\n if (is_array($val)) die('setrow: multi value does not supported');\r\n $sql_wheres[] = \"`$key`='\".myaddslashes($val).\"'\";\r\n }\r\n $sql_where = ' where '.join(' and ',$sql_wheres);\r\n }\r\n if (is_array($sql_set)) { # Note, if using array, I DONOT support mysql function/expression!! use string for that.\r\n $sql_sets = array();\r\n foreach ($sql_set as $key=>$val) {\r\n $sql_sets[] = '`'.$key.'` = \\''.addslashes($url).'\\'';\r\n }\r\n $sql_set = join(',',$sql_sets);\r\n }\r\n assert($sql_where != ''); # safeguard against setting all rows\r\n $sql = 'update `'.$this->db_table.'` set '.$sql_set.$sql_where;\r\n #~ echo $sql;exit;\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n }", "public function set($column,$value);", "public function setViaTableAttributesValue($value);", "function setParamsToSaveQuery()\n {\n \n \n if($this->form->getQuery())\n {\n $stringTmp=$this->form->getQuery()->getSqlQuery();\n $stringTmp=substr($stringTmp, strpos($stringTmp,' FROM ' ));\n $stringTmp=substr($stringTmp, 0, strpos($stringTmp,' LIMIT ' ));\n $this->getUser()->setAttribute('queryToSaveWhere', $stringTmp);\n }\n \n if($this->form->getQuery()->getParams())\n {\n $stringTmp=\"\";\n $arrayTmp=$this->form->getQuery()->getParams();\n if(isset($arrayTmp['where']))\n {\n foreach($arrayTmp['where'] as $key=>$value)\n {\n $stringTmp.=\";|\".$value.\"|\";\n }\n $this->getUser()->setAttribute('queryToSaveParams', $stringTmp);\n }\n }\n return;\n }", "public function where($arr){//ex of $arr : ['name' => 'LIKE A%','email' => '= [email protected]']\n $c = \"\";\n $x = 0;\n foreach($arr as $key => $v){//for each param, translate to SQL language\n if($x != 0){\n $c .= \" AND\";\n }\n $x++;\n $c .= \" $key $v\";\n }\n $this->params[\"WHERE\"] = $c;//adding the conditions to the query\n return $this;\n }", "public function on($column1,$column2,$operator = \"=\");", "function dbWhereVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->where($this->model.'.'.$f,$this->$f);\n }\n\n }", "protected function setFilterArray() {\n $primary_keys = getPrimaryKeys($this->table_name);\n foreach ($primary_keys as $pk) {\n if (isset($_GET[$pk])) {\n $this->filter[$pk] = Mysql::SQLValue($_GET[$pk]);\n }\n }\n }", "public function setViaTableCondition($value);", "protected function _update()\n\t{\n\t\t// UPDATE 'table' SET\n\t\t$this->_query = 'UPDATE '.$this->_table.' SET ';\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$this->_query .= \"$key = '$value'\";\n\n\t\t\t$first = false;\n\t\t} // foreach\n\n\t\t// WHERE foo = 'bar'\n\t\t$this->_query .= ' WHERE ';\n\t\t$imax = count($this->_where);\n\t\t$first = true;\n\t\tfor($i=0; $i<$imax; $i++) {\n\t\t\t$this->_query .= ($first) ? ('') : (' AND '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $this->_where[$i]['row'].' ';\n\t\t\t$this->_query .= $this->_where[$i]['condition'].' \\'';\n\t\t\t$this->_query .= $this->_where[$i]['value'].'\\'';\n\t\t} // foreach\n\n\t\t// end ;\n\t\t$this->_query .= ';';\n\n\t\treturn $this->_query;\n\t}", "public function setWhere($sql, $value, $type, $check_blank = false, $throw_exception = false) {\n\t\t$this->logDebugInfo(debug_backtrace());\n\t\treturn $this->set($sql, $value, $type, 'where', $check_blank, $throw_exception);\n\t}", "public function setAll($values) {\n\t\tif (isset($values[self::$primaryKey[$this->table]])) {\n\t\t\t$this->originalData = $values;\n\t\t}\n\t\telse {\n\t\t\t$this->modifiedData = $values;\n\t\t}\n\t}", "function updateSetWhere ($tablename, $newFields, $whereClause)\n\t{\n\t\t$schema = $this->getSchema($tablename);\n\t\t$lockfp = $this->getLock($tablename);\n\t\tfor ($i = 0; $i < count($this->tables[$tablename]); ++$i) {\n\t\t\tif ($whereClause === NULL ||\n\t\t\t $whereClause->testRow($this->tables[$tablename][$i], $schema)) {\n\t\t\t\tforeach ($newFields as $k => $v)\n\t\t\t\t{\n\t\t\t\t\t$this->tables[$tablename][$i][$k] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->writeTable($tablename);\n\t\t$this->releaseLock($lockfp);\n\t\t$this->loadTable($tablename);\n\t}", "function _set ($data_array, $o = TRUE) {\n\t\t$statement = $o ? ' SET ' : ' ';\n\t\t$count = count($data_array);\n\t\t$pointer = 0;\n\t\tforeach ($data_array as $column_name => $value) {\n\t\t\t$statement .= '`' . $column_name . '` = ';\n\t\t\tif ($pointer == $count - 1) {\n\t\t\t\t$statement .= $this->escape($data_array[$column_name]);\n\t\t\t} else {\n\t\t\t\t$statement .= $this->escape($data_array[$column_name]) . ', ';\n\t\t\t}\n\t\t\t$pointer ++;\n\t\t}\n\t\treturn $statement;\n\t}", "public function testConstructSQLClauseLikeValues()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' AND ';\n $columns = [\n 'firstname' => 'Bob',\n 'user_agent' => '%Firefox%'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname = 'Bob' AND user_agent LIKE '%Firefox%'\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "function setAttributes($attributes) {\n \n if(isset($attributes['date_filter'])) {\n switch($attributes['date_filter']) {\n case self::DATE_FILTER_SELECTED_DATE:\n $this->filterByDate($attributes['date_on']);\n break;\n case self::DATE_FILTER_SELECTED_RANGE:\n $this->filterByRange($attributes['date_from'], $attributes['date_to']);\n break;\n case self::DATE_FILTER_SELECTED_YEAR:\n $this->filterByYear($attributes['year']);\n break;\n default:\n $this->setDateFilter($attributes['date_filter']);\n } // switch\n } // if\n \n if(isset($attributes['company_filter'])) {\n switch ($attributes['company_filter']) {\n case self::CLIENT_FILTER_SELECTED:\n $this->filterByCompany($attributes['company_id']);\n break;\n default:\n $this->setCompanyFilter($attributes['company_filter']);\n }//switch\n }//if\n \n if(isset($attributes['include_comments'])) {\n $this->setIncludeComments($attributes['include_comments']);\n }//if\n \n if(isset($attributes['payment_status_filter'])) {\n switch ($attributes['payment_status_filter']) {\n case self::STATUS_FILTER_SELECTED:\n $this->filterByStatus($attributes['payment_status_selected']);\n break;\n default:\n $this->setStatusFilter($attributes['payment_status_filter']);\n }//switch\n }//if\n \n if(isset($attributes['group_by'])) {\n $this->setGroupBy($attributes['group_by']);\n } // if\n \n parent::setAttributes($attributes);\n }", "public function applyTo($q) {\n//\t\tprivate $valuesets = array(); // QRYvalueset array (insert/update pairs)\n\n\t\tif ($this->flags & QRY::NAMED_PARAMS) {\n\t\t\t$q->option('named_params', 1);\n\t\t}\n\n\t\tforeach ($this->tablesets as $set) {\n\t\t\tfor ($i = 0; $i < $set->count(); $i++) {\n\t\t\t\t$elem = $set->findByOffset($i);\n\t\t\t\t$q->FROM($elem->asName(), $elem->asAlias());\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->fieldsets as $set) {\n\t\t\t//print_r($set);\n\t\t\tfor ($i = 0; $i < $set->count(); $i++) {\n\t\t\t\t$elem = $set->findByOffset($i);\n\t\t\t\t//print_r($elem);\n\t\t\t\t$q->SELECT($elem->asName());\n\t\t\t}\n\t\t}\n\n\t\tforeach ($this->matchsets as $j => $set) {\n\t\t\tfor ($i = 0; $i < $set->count(); $i++) {\n\t\t\t\t$elem = $set->findByOffset($i);\n\t\t\t\tif (get_class($elem) == 'QRYset') {\n\t\t\t\t\t$q->WHERE_literal($elem->toString());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$left_table = $elem->getLeft()->asTable();\n\t\t\t\t$left_name = $elem->getLeft()->asName();\n\t\t\t\t$left = $elem->getLeft()->asAlias();\n\t\t\t\t$right = $elem->getRight();\n\t\t\t\t$cmp = $elem->asCmp();\n\t\t\t\t$literal = false;\n\t\t\t\t$right_ptr = NULL;\n\t\t\t\tif ($cmp == 'IN' && get_class($right) == 'QRYset') {\n\t\t\t\t\t$param_arr = $right->toArray();\n\t\t\t\t\t$dataset = $this->getSet('data', 0);\n\t\t\t\t\t$dataset_arr = $dataset->toArray();\n\t\t\t\t\t$right_ptr = array();\n\t\t\t\t\tforeach ($param_arr as $offset => $param) {\n\t\t\t\t\t\t$name = $param->asName();\n\t\t\t\t\t\tif (isset($dataset_arr[$name])) {\n\t\t\t\t\t\t\t$right_ptr[] = $dataset_arr[$name];\n\t\t\t\t\t\t} else if (isset($dataset_arr[$offset])) {\n\t\t\t\t\t\t\t$right_ptr[] = $dataset_arr[$offset];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($left == $left_table . '__' . $left_name) {\n\t\t\t\t\t$left = $left_table . '.' . $left_name;\n\t\t\t\t}\n\t\t\t\t$q->WHERE_once($left, $cmp, $right_ptr, $literal);\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($this->ordersets as $set) {\n\t\t\tfor ($i = 0; $i < $set->count(); $i++) {\n\t\t\t\t$elem = $set->findByOffset($i);\n\t\t\t\t$q->ORDER_BY($elem->asName(), $elem->asOrder());\n\t\t\t}\n\t\t}\t\t\n\n\t\tforeach ($this->groupsets as $set) {\n\t\t\tfor ($i = 0; $i < $set->count(); $i++) {\n\t\t\t\t$elem = $set->findByOffset($i);\n\t\t\t\t$q->GROUP_BY($elem->asName());\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t\n\t\t/* datasets */\n\t\t$matchset = $q->getSet('match', 0);\t\n\t\tforeach ($this->datasets as $j => $set) {\n\t\t\t$dataset = $q->getSet('data', $j);\t\n\t\t\tif (!$dataset) $dataset = $q->add_DATASET();\n\t\t\t$k = 0;\n\t\t\tfor ($i = 0; $i < $set->count(); $i++) {\n\t\t\t\t$match = $matchset->findByOffset($k);\n\t\t\t\tif (get_class($match) == 'QRYmatch' && $match->asCmp() == 'IN') {\t\t\t\t\t\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$elem = $set->findByOffset($i);\n\t\t\t\t$key = $set->keyByOffset($i);\n\t\t\t\tif (is_numeric($key)) $key = null;\n\t\t\t\t$q->add_DATA($key, $elem, $dataset); \n\t\t\t\t$k++;\n\t\t\t}\n\t\t\t//$q->DATA($arr);\n\n\t\t}\n\n\t\treturn true;\n\t}", "public function where() {\r\n\t\t$args = func_get_args();\r\n\t\t$expr = array_shift($args);\r\n\t\tarray_push($this->_wheres, '(' . $this->_parameterize($expr, $args) . ')');\r\n\t\t$this->_dirty = true;\r\n\t}", "public function addWhere(string $col, $val, string $comparison = '=', bool $or = false) : void;", "public function update(){\n $set_param_cols_vals = $this->iniParamvalues($this->data, \",\");\n // check for extra set_column\n $extra_set = ($this->custom !== NULL) ? $this->custom : NULL ;\n if($this->custom !== NULL){\n if($this->data !== NULL){\n if(!empty($this->where)){\n $this->custom = \",$this->custom\"; \n }\n else{\n $this->custom = 'WHERE '.$this->custom; \n }\n }\n else{\n if(empty($this->where)){\n $this->custom = 'WHERE '.$this->custom; \n }\n else{\n $this->custom = $this->custom; \n }\n } \n }\n // set where cols param values\n $set_param_where = $this->update_iniParamvalues($this->where, \"and\", \"WHERE\");\n\n $sql = \"UPDATE \".self::$table.\" SET $set_param_cols_vals $this->custom $set_param_where\";\n\n // prepare sql statement\n $this->query = $this->conn->prepare($sql);\n\n // bind cols_vals param values\n $this->update_cusBindparam($this->data);\n \n // bind where param values\n if(!empty($this->data)){\n $this->cusBindparam($this->where,count($this->data)+1); \n }\n else if(!empty($this->where)){\n $this->cusBindparam($this->where); \n }\n // execute query\n $execute = $this->query->execute();\n\n if(!$execute){\n return false;\n }\n else{\n return true;\n }\n }", "function Set($strWhere=NULL, $arrWhere=NULL)\r\n\t{\r\n\t\tif (!is_null($strWhere))\r\n\t\t{\r\n\t\t\t$this->_strWhere = $strWhere;\r\n\t\t}\r\n\t\t\r\n\t\tif (is_array($arrWhere) || is_object($arrWhere))\r\n\t\t{\r\n\t\t\t$this->_arrWhere = $arrWhere;\r\n\t\t}\r\n\t}", "function __construct($get = array()) {\n\t\t$this->setSQLCondition($get);\n \t}", "function array_to_set_clause($a_vars) {\n\tglobal $mysqli;\n\n\t$a_set = array();\n\t$a_values = array();\n\tforeach($a_vars as $k=>$v) {\n\t\t\t$k = $mysqli->real_escape_string($k);\n\t\t\t$v = $mysqli->real_escape_string($v);\n\t\t\t$a_set[] = $k;\n\t\t\t$a_values[] = $v;\n\t}\n\t$s_set = \"(`\".implode(\"`,`\", $a_set).\"`) VALUES ('\".implode(\"','\",$a_values).\"')\";\n\treturn $s_set;\n}", "public function set(array $columns, array $values, array $clauseProps = array()){\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 -> INSERT\r\n $this->queryString .= \"INSERT INTO \" . $table . \"(\" . $_columns . \") VALUES (\" . implode(', ', $this->prepareInsertPlaceholder($values)) . \")\";\r\n\r\n if(count($clauseProps) > 0){\r\n $this->queryString .= \" ON DUPLICATE KEY UPDATE \";\r\n $this->queryString .= implode(', ', $this->prepareUpdatePlaceholder($clauseProps));\r\n }\r\n\r\n return $this;\r\n }", "public function whereall() {\n\t\t\treturn 'id=id';\n\t\t}", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "public function setAttributes();", "public function update(){\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $fieldsList = \" SET \";\n foreach ($this->attributes as $column => $value) {\n $fieldsList.=$column.\"=\".'\\''.$value.'\\''.\", \";\n }\n $fieldsList = str_last_replace(\", \", \"\", $fieldsList);\n $sqlQuery = \"UPDATE \".$this->table.$fieldsList.\" WHERE \".$this->idName.\"=\".$this->attributes[$this->idName];\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n }\n }", "private function _set_where($params) {\n if (count($params) == 1) {\n if (!is_array($params[0]) && !strstr($params[0], \"'\")) {\n $this->db->where($this->primary_key, $params[0]); // 1.\n } else {\n $this->db->where($params[0]); // 2.\n }\n } elseif (count($params) == 2) {\n if (is_array($params[1])) {\n $this->db->where_in($params[0], $params[1]); // 4.\n } else {\n $this->db->where($params[0], $params[1]); // 3.\n }\n }\n }", "public function setConditions($val)\n {\n $this->_propDict[\"conditions\"] = $val;\n return $this;\n }", "public function setConditions($val)\n {\n $this->_propDict[\"conditions\"] = $val;\n return $this;\n }", "public function setConditions($val)\n {\n $this->_propDict[\"conditions\"] = $val;\n return $this;\n }", "function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }", "public function set($arrParams)\n\t{\n\t\t$arrParams = $this->escapeParams($arrParams);\n\n\t\t// INSERT\n\t\tif (strncasecmp($this->strQuery, 'INSERT', 6) === 0)\n\t\t{\n\t\t\t$strQuery = sprintf('(%s) VALUES (%s)',\n\t\t\t\t\t\t\t\timplode(', ', array_keys($arrParams)),\n\t\t\t\t\t\t\t\timplode(', ', array_values($arrParams)));\n\t\t}\n\n\t\t// UPDATE\n\t\telseif (strncasecmp($this->strQuery, 'UPDATE', 6) === 0)\n\t\t{\n\t\t\t$arrSet = array();\n\n\t\t\tforeach ($arrParams as $k=>$v)\n\t\t\t{\n\t\t\t\t$arrSet[] = $k . '=' . $v;\n\t\t\t}\n\n\t\t\t$strQuery = 'SET ' . implode(', ', $arrSet);\n\t\t}\n\n\t\t$this->strQuery = str_replace('%p', $strQuery, $this->strQuery);\n\t\treturn $this;\n\t}", "private function sqlstatements() {\n $this->select = array( );\n $this->insert = array( 'INSERT INTO :entity (xxx) VALUES (yyy)' );\n $this->update = array( );\n $this->delete = array( );\n }", "function get_set($params)\n\t\t{\n\t\t\tif( !is_array( $params ) )\n\t\t\t{\n\t\t\t\t$this->register_error( 'get_set() parameter invalid. Expected array in '.__FILE__.' on line '.__LINE__);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$sql = array();\n\t\t\tforeach ( $params as $field => $val )\n\t\t\t{\n\t\t\t\tif ( $val === 'true' || $val === true )\n\t\t\t\t\t$val = 1;\n\t\t\t\tif ( $val === 'false' || $val === false )\n\t\t\t\t\t$val = 0;\n\n\t\t\t\tswitch( $val ){\n\t\t\t\t\tcase 'NOW()' :\n\t\t\t\t\tcase 'NULL' :\n\t\t\t\t\t $sql[] = \"$field = $val\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault :\n\t\t\t\t\t\t$sql[] = \"$field = '\".$this->escape( $val ).\"'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn implode( ', ' , $sql );\n\t\t}", "function get_set($params)\n\t\t{\n\t\t\tif( !is_array( $params ) )\n\t\t\t{\n\t\t\t\t$this->register_error( 'get_set() parameter invalid. Expected array in '.__FILE__.' on line '.__LINE__);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$sql = array();\n\t\t\tforeach ( $params as $field => $val )\n\t\t\t{\n\t\t\t\tif ( $val === 'true' || $val === true )\n\t\t\t\t\t$val = 1;\n\t\t\t\tif ( $val === 'false' || $val === false )\n\t\t\t\t\t$val = 0;\n\n\t\t\t\tswitch( $val ){\n\t\t\t\t\tcase 'NOW()' :\n\t\t\t\t\tcase 'NULL' :\n\t\t\t\t\t $sql[] = \"$field = $val\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault :\n\t\t\t\t\t\t$sql[] = \"$field = '\".$this->escape( $val ).\"'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn implode( ', ' , $sql );\n\t\t}", "public function setquery($c = \"No comment!\", $query = \"NONEE\", $data_array = array(), $run = true){\n\t\t$this->comment = $c;\n\t\t$query = $this->securestring($query,$data_array);\n\t\t$this->query = $query;\n\t\t\n\t\tif($run)\n\t\t\treturn $this->resultset = $this->query($query);\n\t}", "public function testInitialSet()\n {\n $method = $this->builder_reflection->getMethod('sql_set');\n $method->setAccessible(TRUE);\n\n $property = $this->builder_reflection->getProperty('set');\n $property->setAccessible(TRUE);\n\n $method->invokeArgs($this->builder, array( array('column1' => 'value1')));\n\n $string = 'SET column1 = value1';\n\n $this->assertEquals($string, $property->getValue($this->builder));\n }", "function defineCriterias($criterio,$PreparedStatement){\n\t\t\tif(isset ($criterio[\"consumo_id\"]) && trim($criterio[\"consumo_id\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_id = \".Connection::inject($criterio[\"consumo_id\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"socio_id\"]) && trim($criterio[\"socio_id\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND socio_id = \".Connection::inject($criterio[\"socio_id\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"nro_medidor\"]) && trim($criterio[\"nro_medidor\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND nro_medidor LIKE '%\".Connection::inject($criterio[\"nro_medidor\"]).\"%'\";\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_lectura\"]) && trim($criterio[\"fecha_lectura\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_lectura = \".Connection::inject($criterio[\"fecha_lectura\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_emision\"]) && trim($criterio[\"fecha_emision\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_emision = \".Connection::inject($criterio[\"fecha_emision\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"periodo_mes\"]) && trim($criterio[\"periodo_mes\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND periodo_mes = \".Connection::inject($criterio[\"periodo_mes\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"periodo_anio\"]) && trim($criterio[\"periodo_anio\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND periodo_anio = \".Connection::inject($criterio[\"periodo_anio\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"consumo_total_lectura\"]) && trim($criterio[\"consumo_total_lectura\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_total_lectura = \".Connection::inject($criterio[\"consumo_total_lectura\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"consumo_por_pagar\"]) && trim($criterio[\"consumo_por_pagar\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND consumo_por_pagar = \".Connection::inject($criterio[\"consumo_por_pagar\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"costo_consumo_por_pagar\"]) && trim($criterio[\"costo_consumo_por_pagar\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND costo_consumo_por_pagar = \".Connection::inject($criterio[\"costo_consumo_por_pagar\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"estado\"]) && trim($criterio[\"estado\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND estado = '\".Connection::inject($criterio[\"estado\"]).\"'\";\n\t\t\t}\n\t\t\tif(isset ($criterio[\"fecha_hora_pago\"]) && trim($criterio[\"fecha_hora_pago\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND fecha_hora_pago = \".Connection::inject($criterio[\"fecha_hora_pago\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"usuario_pago\"]) && trim($criterio[\"usuario_pago\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND usuario_pago = \".Connection::inject($criterio[\"usuario_pago\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"monto_pagado\"]) && trim($criterio[\"monto_pagado\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND monto_pagado = \".Connection::inject($criterio[\"monto_pagado\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"pagado_por\"]) && trim($criterio[\"pagado_por\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND pagado_por = \".Connection::inject($criterio[\"pagado_por\"]);\n\t\t\t}\n\t\t\tif(isset ($criterio[\"ci_pagado_por\"]) && trim($criterio[\"ci_pagado_por\"]) != \"0\"){\n\t\t\t\t$PreparedStatement .=\" AND ci_pagado_por = \".Connection::inject($criterio[\"ci_pagado_por\"]);\n\t\t\t}\n\t\t\treturn $PreparedStatement;\n\t\t}", "public abstract function set(string $query, array $data) : bool;", "public function set($values, $alias = FALSE, $original = FALSE)\n\t{\n\t\t$meta = $this->meta();\n\t\t\n\t\t// Accept set('name', 'value');\n\t\tif (!is_array($values))\n\t\t{\n\t\t\t$values = array($values => $alias);\n\t\t\t$alias = FALSE;\n\t\t}\n\t\t\n\t\t// Determine where to write the data to, changed or original\n\t\tif ($original)\n\t\t{\n\t\t\t$data_location =& $this->_original;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data_location =& $this->_changed;\n\t\t}\n\n\t\t// Why this way? Because it allows the model to have \n\t\t// multiple fields that are based on the same column\n\t\tforeach($values as $key => $value)\n\t\t{\n\t\t\t// Key is coming from a with statement\n\t\t\tif (substr($key, 0, 1) === ':')\n\t\t\t{\n\t\t\t\t$targets = explode(':', ltrim($key, ':'), 2);\n\t\t\t\t\n\t\t\t\t// Alias as it comes back in, which allows people to use with()\n\t\t\t\t// with alaised field names\n\t\t\t\t$relationship = $this->field(array_shift($targets), TRUE);\n\t\t\t\t\t\t\t\t\n\t\t\t\tif (!array_key_exists($relationship, $this->_with_values))\n\t\t\t\t{\n\t\t\t\t\t$this->_with_values[$relationship] = array();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->_with_values[$relationship][implode(':', $targets)] = $value;\n\t\t\t}\n\t\t\t// Key is coming from a database result\n\t\t\telse if ($alias === TRUE && !empty($meta->columns[$key]))\n\t\t\t{\n\t\t\t\t// Contains an array of fields that the column is mapped to\n\t\t\t\t// This allows multiple fields to get data from the same column\n\t\t\t\tforeach ($meta->columns[$key] as $field)\n\t\t\t\t{\n\t\t\t\t\t$data_location[$field] = $meta->fields[$field]->set($value);\n\t\t\t\t\t\n\t\t\t\t\t// Invalidate the cache\n\t\t\t\t\tif (array_key_exists($field, $this->_retrieved))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($this->_retrieved[$field]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Standard setting of a field \n\t\t\telse if ($alias === FALSE && $field = $this->field($key))\n\t {\n\t\t\t\t$value = $field->set($value);\n\t\t\t\t\n\t\t\t\t// Ensure value has actually changed\n\t\t\t\tif ($field->in_db && $value == $this->_original[$field->name])\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$data_location[$field->name] = $value;\n\n\t\t\t\t// Invalidate the cache\n\t\t\t\tif (array_key_exists($field->name, $this->_retrieved))\n\t\t\t\t{\n\t\t\t\t\tunset($this->_retrieved[$field->name]);\n\t\t\t\t}\n \t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_unmapped[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "function _buildAttributeQuery($glue, $criteria, $join = false)\n {\n /* Initialize the clause that we're building. */\n $clause = '';\n\n /* Get the table alias to use for this set of criteria. */\n if ($join) {\n $alias = $this->_getAlias(true);\n } else {\n $alias = $this->_getAlias();\n }\n\n foreach ($criteria as $key => $vals) {\n if (!empty($vals['OR']) || !empty($vals['AND'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= '(' . $this->_buildAttributeQuery($glue, $vals) . ')';\n } elseif (!empty($vals['JOIN'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= $this->_buildAttributeQuery($glue, $vals['JOIN'], true);\n } else {\n if (isset($vals['field'])) {\n if (!empty($clause)) {\n $clause .= ' ' . $glue . ' ';\n }\n $clause .= Horde_Sql::buildClause($this->_db, $alias . '.attribute_' . $vals['field'], $vals['op'], $vals['test']);\n } else {\n foreach ($vals as $test) {\n if (!empty($clause)) {\n $clause .= ' ' . $key . ' ';\n }\n $clause .= Horde_Sql::buildClause($this->_db, $alias . '.attribute_' . $test['field'], $test['op'], $test['test']);\n }\n }\n }\n }\n\n return $clause;\n }", "public function set($sql, $execArr = array())\n {\n $stmt = $this->db->prepare($sql);\n $stmt->execute($execArr);\n }", "public function setParameters()\n {\n $params = array();\n $associations = array();\n foreach ($this->datatablesModel->getColumns() as $key => $data) {\n // if a function or a number is used in the data property\n // it should not be considered\n if( !preg_match('/^(([\\d]+)|(function)|(\\s*)|(^$))$/', $data['data']) ) {\n $fields = explode('.', $data['data']);\n $params[$key] = $data['data'];\n $associations[$key] = array('containsCollections' => false);\n\n if (count($fields) > 1) {\n $this->setRelatedEntityColumnInfo($associations[$key], $fields);\n } else {\n $this->setSingleFieldColumnInfo($associations[$key], $fields[0]);\n }\n }\n }\n\n $this->parameters = $params;\n // do not reindex new array, just add them\n $this->associations = $associations + $this->associations;\n }", "protected function setWhereFilters() : ApiGetService\n {\n if(count($this->where_filters) === 0){\n return $this;\n }\n\n // Traverse prepared filters\n foreach($this->where_filters as $column => $value){\n // {column}:{operator} = {value}\n $column_operator = preg_split('/[:\\s]+/', $column);\n\n // Split value by \" , \"\n $splited_value = preg_split('/[,]+/', $value);\n\n //... and if {value} is not scalar\n if(count($splited_value) > 1){\n // ... we know that we will have SQL IN operator in WHERE\n $in_operator = true;\n }\n // ... else we are good with simple \" = \"\n else{\n $in_operator = false;\n }\n\n // Depending on $in_operator, we know if we are using IN or =\n $this->builder\n ->when($in_operator ,\n // If it is true, we are using IN\n function ($query) use($column_operator, $splited_value){\n if(isset($column_operator[1]) && $column_operator[1] == \"eq\"){\n\n return $query->whereIn($column_operator[0], $splited_value);\n\n }elseif(isset($column_operator[1]) && $column_operator[1] == \"ne\"){\n\n return $query->whereNotIn($column_operator[0], $splited_value);\n\n }else{\n\n return $query->whereIn($column_operator[0], $splited_value);\n }\n },\n // Else, we are using scalar operators...\n function ($query) use($column_operator, $splited_value) {\n\n return $query->where($column_operator[0],\n ((isset($column_operator[1]) && $column_operator[1] != \"\") ? $this->api_operators[$column_operator[1]] : \"=\"),\n $splited_value[0]);\n });\n }\n\n return $this;\n }", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "private function setParams($statement, $parameters = array()){\n\t\tforeach ($parameters as $key => $value) { ///percorrer as linhas rows\n\t\t\t$this->setParam($key,$value);///percorer as colunas ID\n\t\t}\n\t}", "public function andWhere($col, $oper,$val)\n {\n if(!in_array($oper, $this->_allowedOpperators)){\n $oper = '=';\n }\n $this->_rawWhereData[] = strip_tags(trim(implode(\" \",[$col,$oper,'?'])));\n $this->_addWhereArr[] = $this->clean($val);\n\n return $this;\n }", "public function __SET($att, $valor){\r\n $this->$att = $valor;\r\n}", "public function addCondition($attribute, $values, $operator = ComparisonOperator::EQ);", "abstract protected function updateSpecificProperties($row);", "public static function query_set($query = NULL)\n\t{\n\t\treturn new Database_SQLite_DML_Set($query);\n\t}", "public function set_atts($where)\n {\n //select vis_name, and both database names that contain the unique uri. Return as one array.\n $data = $this->db->get_where('user_visualisation', $where)->row_array();\n //set the left and right attributes using the data just selected from the database...\n $left = array_merge($this->db->list_fields($data['db_one']), $this->db->list_fields($data['db_two']));\n $right = array('att_one' => $data['att_one'], 'att_two' => $data['att_two'], 'att_three' => $data['att_three']);\n return array('content' => $data, 'attributes' => array_diff($left, $right), 'set_attributes' => $right);\n }", "protected function user_where_clause() {}", "function AndWhereClause() {\n\t\t$this->clauses = func_get_args();\n\t}", "public function where()\n {\n $args = func_get_args();\n $count = count($args);\n \n if ($count == 1) {\n if (is_array($args[0])) {\n # This is expected to be a column => value associated array.\n # In this case, the array is stored as is.\n $this->where[] = $args[0];\n } else {\n # This is expected to be a string.\n $this->where[] = $args[0];\n }\n } elseif ($count) {\n # Case: $query->where(\"foo\", true, \"bar_baz\", $bar);\n if ($count >= 2 && is_int($count / 2) && (!is_array($args[1]) || Toolbox\\ArrayTools::isIndexed($args[1])) && is_bool(strpos($args[0], ' '))) {\n $where = [];\n foreach ($args as $key => $value) {\n $key++;\n if ($key && !($key % 2)) {\n $where[$next_key] = $value;\n } else {\n $next_key = $value;\n }\n }\n $this->where[] = $where;\n } else {\n $this->where[] = array_shift($args);\n \n # Case: $query->where('foo => :foo', ['foo' => $foo]);\n if ($count == 2 && is_array($args[0]) && !Toolbox\\ArrayTools::isIndexed($args[0]))\n $args = $args[0];\n \n if ($args)\n $this->where_params = array_merge($this->where_params, $args);\n }\n }\n return $this;\n }", "function createSelect($_table, $_value, $_colum)\n{\n\n $_prev_par= false;\n $_query = \"SELECT * FROM $_table\";\n\n foreach ($_value as $_key => $_value)\n {\n if ($_value != \"\")\n {\n if ($_prev_par)\n {\n $_query.= \" AND \";\n }\n else\n {\n $_query.= \" WHERE \";\n }\n\n $_query.= $_colum[$_key].\" = '$_value'\";\n $_prev_par = true;\n }\n }\n $_query.=\";\";\n\n return $_query;\n}", "public function set($fields = null)\n {\n if ($fields === null) {\n return $this->clause('set');\n }\n\n if (!in_array($this->clause('action'), [self::ACTION_CREATE, self::ACTION_UPDATE])) {\n throw new \\UnexpectedValueException(__('The action of this query needs to be either create update'));\n }\n\n $this->_parts['set'] = $fields;\n\n return $this;\n }", "function __construct(record $r, $primary){\n //\n //Get the primary column \n $this->column_primary= $this->get_primary();\n //\n //This is the value from which we create a where \n $this->primary_value=$primary;\n //\n //Get the condition for the update \n $wheres= new binary($this->column_primary, \"=\", new literal($primary));\n //\n //Create the parent\n parent::__construct($r, $wheres);\n }", "function testQueryset() {\n $comments = new Dormio_Queryset('Comment');\n $blogs = new Dormio_Queryset('Blog');\n \n $set = $blogs->filter('author__profile_set__fav_colour', 'IN', array('red', 'green'));\n \n }", "public function setQuery(array $query);", "public function where($table,$column,$data = \"\");", "function setAllFieldsParam($name, $value)\n\t{\n \t\tforeach ($this->table->fields as $field)\n\t\t{\n\t\t\t$array[] = $field->name;\n\t\t}\n\n\t\t$this->setFieldParam($array, $name, $value);\n\t}", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "public function columnsWithValues()\n {\n // $sqlQuery = str_replace(\"&\", ', ',$query);\n $keys = array_keys($this->attributes);\n $values = array_values($this->attributes);\n $sql = null;\n for ($i = 0; $i < sizeof($this->attributes); $i++) {\n $sql .= $keys[$i]. '=';\n if (is_string($values[$i])) {\n $sql .= '\"'.$values[$i].'\"';\n } else { \n $sql .= $values[$i];\n }\n if ($i != sizeof($values) - 1) {\n $sql .= ', ';\n }\n } \n return $sql;\n }", "public function set(array $pairs)\n {\n if ($this->_type == db::INSERT) \n {\n // 把key存到 _columns 里面\n $this->columns(array_keys($pairs));\n // 把值存到 _values 里面\n $this->values($pairs);\n }\n elseif ($this->_type == db::UPDATE) \n {\n foreach ($pairs as $column => $value)\n {\n $this->_set[] = array($column, $value);\n }\n }\n\n return $this;\n }", "public function where()\r\n {\r\n $arguments = func_get_args();\r\n $columnName = array_shift($arguments);\r\n $column = $this->getColName($columnName);\r\n if(isset($arguments[2]))\r\n {\r\n $namedCondition = $arguments[2];\r\n unset($arguments[2]);\r\n }\r\n else\r\n {\r\n $namedCondition = null;\r\n }\r\n list($value, $comparison) = self::getValueAndComparisonFromArguments($arguments);\r\n $this->addCondition('and', $column, $comparison, $value, $namedCondition);\r\n \r\n return $this;\r\n }", "function load_db_values($row)\n\t{\n\t\tforeach($row as $prop => $val)\n\t\t\t$this->{$prop} = $val;\n\t}", "private function setQueryParams()\n {\n if (empty($this->generator->types[CustomsInterface::CUSTOM_TYPES_QUERY_PARAMS][ApiInterface::RAML_PROPS]) === false) {\n $queryParams = $this->generator->types[CustomsInterface::CUSTOM_TYPES_QUERY_PARAMS][ApiInterface::RAML_PROPS];\n $this->openEntity(ConfigInterface::QUERY_PARAMS);\n foreach ($this->queryParams as $param) {\n if (empty($queryParams[$param][ApiInterface::RAML_KEY_DEFAULT]) === false) {\n $this->setParam($param, $queryParams[$param][ApiInterface::RAML_TYPE], $queryParams[$param][ApiInterface::RAML_KEY_DEFAULT], 2);\n }\n }\n $this->closeEntities();\n }\n }", "public function _testConstructorConditions($di)\n\t{\n\t\t// ------------- test for setters(classic) way ----------------\n\n\t\t$standardSelectBuilder = new SelectBuilder();\n\t\t$standardSelectBuilder->from('Robots')\n\t\t\t->where(\n\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR)\n\t\t\t);\n\n\t\t$standardResult = $standardSelectBuilder->getQuery()->execute();\n\n\t\t// --------------- test for single condition ------------------\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min: AND year < :max:\",\n\t\t\t\t\tarray(\"min\" => '2013-01-01', 'max' => '2100-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR, 'max' => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t$builderWithSingleCondition = new SelectBuilder($params);\n\t\t$singleConditionResult = $builderWithSingleCondition->getQuery()->execute();\n\n\t\t// ------------- test for multiple conditions ----------------\n\n\t\t$params = array(\n\t\t\t'models' => 'Robots',\n\t\t\t'conditions' => array(\n\t\t\t\tarray(\n\t\t\t\t\t\"year > :min:\",\n\t\t\t\t\tarray(\"min\" => '2000-01-01'),\n\t\t\t\t\tarray(\"min\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t\"year < :max:\",\n\t\t\t\t\tarray('max' => '2100-01-01'),\n\t\t\t\t\tarray(\"max\" => PDO::PARAM_STR),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\t// conditions are merged!\n\t\t$builderMultipleConditions = new SelectBuilder($params);\n\t\t$multipleConditionResult = $builderMultipleConditions->getQuery()->execute();\n\n\t\t$expectedPhql = \"SELECT [Robots].* FROM [Robots] \"\n\t\t\t. \"WHERE year > :min: AND year < :max:\";\n\n\t\t/* ------------ ASSERTING --------- */\n\n\t\t$this->assertEquals($expectedPhql, $standardSelectBuilder->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $standardResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderWithSingleCondition->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $singleConditionResult);\n\n\t\t$this->assertEquals($expectedPhql, $builderMultipleConditions->getPhql());\n\t\t$this->assertInstanceOf(\"Phalcon\\Mvc\\Model\\Resultset\\Simple\", $multipleConditionResult);\n }", "public function __SET($attr, $value){ //Establece valor y atributo\n\n\t\t\t$this->$attr=$value;\n\t\t}", "function setRowDatas(&$row) {\r\n\t\t/* for optimization reason, do not save row. save just needed parameters */\r\n\r\n\t\t//$this->_specific_data\t= isset($row->specific) ? $row->specific : '';\r\n\t}", "function setAllValues($id=\"\",$condition=\"\")\n\t{\n\t\t$rs=$this->fetchRecordSet($id, $condition);\n\t\tif($artheme= mysql_fetch_array($rs))\n\t\t{\n\t\t\t$this->theme_id = $artheme[\"theme_id\"];\n\t\t\t$this->user_id = $artheme[\"user_id\"];\n\t\t\t$this->theme_color = $artheme[\"theme_color\"];\n\t\t\t$this->theme_backimage = $artheme[\"theme_backimage\"];\n\t\t\t$this->created_date = $artheme[\"created_date\"];\n\t\t\t$this->created_by = $artheme[\"created_by\"];\n\t\t\t$this->updated_date = $artheme[\"updated_date\"];\n\t\t\t$this->updated_by = $artheme[\"updated_by\"];\n\t\t}\n\t}", "public function orWhere($table,$column,$data = \"\");", "public function initAttrInfos($cols)\n\t{\n\t\tif($this->prod_etype==null)\n\t\t{\n\t\t\t//Find product entity type\n\t\t\t$tname=$this->tablename(\"eav_entity_type\");\n\t\t\t$this->prod_etype=$this->selectone(\"SELECT entity_type_id FROM $tname WHERE entity_type_code=?\",\"catalog_product\",\"entity_type_id\");\n\t\t}\n\n\t\t$toscan=array_values(array_diff($cols,array_keys($this->attrinfo)));\n\t\tif(count($toscan)>0)\n\t\t{\n\t\t\t//create statement parameter string ?,?,?.....\n\t\t\t$qcolstr=$this->arr2values($toscan);\n\n\t\t\t$tname=$this->tablename(\"eav_attribute\");\n\t\t\tif($this->getMagentoVersion()!=\"1.3.x\")\n\t\t\t{\n\t\t\t\t$extra=$this->tablename(\"catalog_eav_attribute\");\n\t\t\t\t//SQL for selecting attribute properties for all wanted attributes\n\t\t\t\t$sql=\"SELECT `$tname`.*,$extra.is_global FROM `$tname`\n\t\t\t\tLEFT JOIN $extra ON $tname.attribute_id=$extra.attribute_id\n\t\t\t\tWHERE ($tname.attribute_code IN ($qcolstr)) AND (entity_type_id=?)\";\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql=\"SELECT `$tname`.* FROM `$tname` WHERE ($tname.attribute_code IN ($qcolstr)) AND (entity_type_id=?)\";\n\t\t\t}\n\t\t\t$toscan[]=$this->prod_etype;\n\t\t\t$result=$this->selectAll($sql,$toscan);\n\n\t\t\t$attrinfs=array();\n\t\t\t//create an attribute code based array for the wanted columns\n\t\t\tforeach($result as $r)\n\t\t\t{\n\t\t\t\t$attrinfs[$r[\"attribute_code\"]]=$r;\n\t\t\t}\n\t\t\tunset($result);\n\n\t\t\t//create a backend_type based array for the wanted columns\n\t\t\t//this will greatly help for optimizing inserts when creating attributes\n\t\t\t//since eav_ model for attributes has one table per backend type\n\t\t\tforeach($attrinfs as $k=>$a)\n\t\t\t{\n\t\t\t\t//do not index attributes that are not in header (media_gallery may have been inserted for other purposes)\n\t\t\t\tif(!in_array($k,$cols))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$bt=$a[\"backend_type\"];\n\t\t\t\tif(!isset($this->attrbytype[$bt]))\n\t\t\t\t{\n\t\t\t\t\t$this->attrbytype[$bt]=array(\"data\"=>array());\n\t\t\t\t}\n\t\t\t\t$this->attrbytype[$bt][\"data\"][]=$a;\n\t\t\t}\n\t\t\t//now add a fast index in the attrbytype array to store id list in a comma separated form\n\t\t\tforeach($this->attrbytype as $bt=>$test)\n\t\t\t{\n\t\t\t\t$idlist;\n\t\t\t\tforeach($test[\"data\"] as $it)\n\t\t\t\t{\n\t\t\t\t\t$idlist[]=$it[\"attribute_id\"];\n\t\t\t\t}\n\t\t\t\t$this->attrbytype[$bt][\"ids\"]=implode(\",\",$idlist);\n\t\t\t}\n\t\t\t$this->attrinfo=array_merge($this->attrinfo,$attrinfs);\n\t\t}\n\t\t$notattribs=array_diff($cols,array_keys($this->attrinfo));\n\t\tforeach($notattribs as $k)\n\t\t{\n\t\t\t$this->attrinfo[$k]=null;\n\t\t}\n\t\t/*now we have 2 index arrays\n\t\t 1. $this->attrinfo which has the following structure:\n\t\t key : attribute_code\n\t\t value : attribute_properties\n\t\t 2. $this->attrbytype which has the following structure:\n\t\t key : attribute backend type\n\t\t value : array of :\n\t\t data => array of attribute_properties ,one for each attribute that match\n\t\t the backend type\n\t\t ids => list of attribute ids of the backend type */\n\t}", "public function addFilters($values)\n {\n $attributes = $this->getAttributes();\n $allConditions = [];\n\n foreach ($attributes as $attribute) {\n /* @var $attribute Attribute */\n if (!isset($values[$attribute->getAttributeCode()])) {\n continue;\n }\n $value = $values[$attribute->getAttributeCode()];\n $preparedSearchValue = $this->getPreparedSearchCriteria($attribute, $value);\n if (false === $preparedSearchValue) {\n continue;\n }\n $this->addSearchCriteria($attribute, $preparedSearchValue);\n\n if ($attribute->getAttributeCode() == 'price') {\n $rate = 1;\n $store = $this->_storeManager->getStore();\n $currency = $store->getCurrentCurrencyCode();\n if ($currency != $store->getBaseCurrencyCode()) {\n $rate = $store->getBaseCurrency()->getRate($currency);\n }\n\n $value['from'] = (isset($value['from']) && is_numeric($value['from']))\n ? (float)$value['from'] / $rate\n : '';\n $value['to'] = (isset($value['to']) && is_numeric($value['to']))\n ? (float)$value['to'] / $rate\n : '';\n }\n\n if ($attribute->getBackendType() == 'datetime') {\n $value['from'] = (isset($value['from']) && !empty($value['from']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['from']))\n : '';\n $value['to'] = (isset($value['to']) && !empty($value['to']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['to']))\n : '';\n }\n $condition = $this->_getResource()->prepareCondition(\n $attribute,\n $value,\n $this->getProductCollection()\n );\n if ($condition === false) {\n continue;\n }\n\n $table = $attribute->getBackend()->getTable();\n if ($attribute->getBackendType() == 'static') {\n $attributeId = $attribute->getAttributeCode();\n } else {\n $attributeId = $attribute->getId();\n }\n $allConditions[$table][$attributeId] = $condition;\n }\n //if ($allConditions)\n if ($allConditions || (isset($values['cat']) && is_numeric($values['cat'])) ) {\n $this->_registry->register('advanced_search_conditions', $allConditions);\n $this->getProductCollection()->addFieldsToFilter($allConditions);\n } else {\n throw new LocalizedException(__('Please specify at least one search term.'));\n }\n\n return $this;\n }", "protected final function simple_update_query ( $sql )\n\t{\n\t\t//----------\n\t\t// Tables\n\t\t//----------\n\n\t\t$_tables = array();\n\t\tif ( !isset( $sql['tables'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif ( !is_array( $sql['tables'] ) )\n\t\t{\n\t\t\t$sql['tables'] = array( $sql['tables'] );\n\t\t}\n\t\tif ( !count( $sql['tables'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( $sql['tables'] as $_table )\n\t\t{\n\t\t\t# If \"table name aliases\" are used\n\t\t\tif ( is_array( $_table ) and count( $_table ) )\n\t\t\t{\n\t\t\t\tforeach ( $_table as $_alias=>$_table_name )\n\t\t\t\t{\n\t\t\t\t\tif ( is_numeric( $_alias ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$_tables[] = $this->db->quoteIdentifier( $this->attach_prefix( $_table_name ), true );\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$_tables[] = $this->db->quoteIdentifier( $this->attach_prefix( $_table_name ), true )\n\t\t\t\t\t\t\t. \" AS \"\n\t\t\t\t\t\t\t. $this->db->quoteIdentifier( $_alias, true );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t# If its just an array of strings - i.e. no \"table name aliases\"\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_tables[] = $this->db->quoteIdentifier( $this->attach_prefix( $_table ), true );\n\t\t\t}\n\t\t}\n\n\t\t//---------\n\t\t// \"SET\"\n\t\t//---------\n\n\t\tif ( !count( $sql['set'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$_set = array();\n\t\tforeach ( $sql['set'] as $_col => $_val )\n\t\t{\n\t\t\tif ( $_val instanceof Zend_Db_Expr )\n\t\t\t{\n\t\t\t\t$_val = $_val->__toString();\n\t\t\t\tunset( $sql['set'][ $_col ] );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_val = \"?\";\n\t\t\t}\n\t\t\t$_set[] = $this->db->quoteIdentifier( $_col, true ) . ' = ' . $_val;\n\t\t}\n\n\t\t//-----------\n\t\t// \"WHERE\"\n\t\t//-----------\n\n\t\t$_where = ! is_array( $sql['where'] ) ? array( $sql['where'] ) : $sql['where'];\n\n\t\tforeach ($_where as $_cond => &$_term) {\n # is $_cond an int? (i.e. Not a condition)\n if ( is_int( $_cond ) ) {\n # $_term is the full condition\n if ( $_term instanceof Zend_Db_Expr ) {\n $_term = $_term->__toString();\n }\n } else {\n # $_cond is the condition with placeholder,\n # and $_term is quoted into the condition\n $_term = $this->db->quoteInto( $_cond, $_term );\n }\n $_term = '(' . $_term . ')';\n }\n\n $_where = implode(' AND ', $_where);\n\n\t\t//------------------------------\n\t\t// Build the UPDATE statement\n\t\t//------------------------------\n\n\t\t$this->cur_query = \"UPDATE \"\n\t\t\t. implode( \", \" , $_tables )\n\t\t\t. \" SET \" . implode( \", \" , $_set )\n\t\t\t. ( $_where ? \" WHERE \" . $_where : \"\" );\n\n\t\t//----------------------------------------------------------------\n\t\t// Execute the statement and return the number of affected rows\n\t\t//----------------------------------------------------------------\n\n\t\ttry\n\t\t{\n\t\t\t$stmt = $this->db->query( $this->cur_query, array_values( $sql['set'] ) );\n\t\t\t$result = $stmt->rowCount();\n\t\t\treturn $result;\n\t\t}\n\t\tcatch ( Zend_Db_Exception $e )\n\t\t{\n\t\t\t$this->Registry->exception_handler( $e );\n\t\t\treturn false;\n\t\t}\n\t}", "public function initAttrInfos($cols)\n\t{\n\t\tif($this->cat_etype==null)\n\t\t{\n\t\t\t//Find product entity type\n\t\t\t$tname=$this->tablename(\"eav_entity_type\");\n\t\t\t$this->cat_etype=$this->selectone(\"SELECT entity_type_id FROM $tname WHERE entity_type_code=?\",\"catalog_category\",\"entity_type_id\");\n\t\t}\n\n\t\t$toscan=array_values(array_diff($cols,array_keys($this->attrinfo)));\n\t\tif(count($toscan)>0)\n\t\t{\n\t\t\t//create statement parameter string ?,?,?.....\n\t\t\t$qcolstr=$this->arr2values($toscan);\n\n\t\t\t$tname=$this->tablename(\"eav_attribute\");\n\t\t\tif($this->getMagentoVersion()!=\"1.3.x\")\n\t\t\t{\n\t\t\t\t$extra=$this->tablename(\"catalog_eav_attribute\");\n\t\t\t\t//SQL for selecting attribute properties for all wanted attributes\n\t\t\t\t$sql=\"SELECT `$tname`.*,$extra.is_global FROM `$tname`\n\t\t\t\tLEFT JOIN $extra ON $tname.attribute_id=$extra.attribute_id\n\t\t\t\tWHERE ($tname.attribute_code IN ($qcolstr)) AND (entity_type_id=?)\";\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sql=\"SELECT `$tname`.* FROM `$tname` WHERE ($tname.attribute_code IN ($qcolstr)) AND (entity_type_id=?)\";\n\t\t\t}\n\t\t\t$toscan[]=$this->cat_etype;\n\t\t\t$result=$this->selectAll($sql,$toscan);\n\n\t\t\t$attrinfs=array();\n\t\t\t//create an attribute code based array for the wanted columns\n\t\t\tforeach($result as $r)\n\t\t\t{\n\t\t\t\t$attrinfs[$r[\"attribute_code\"]]=$r;\n\t\t\t}\n\t\t\tunset($result);\n\n\t\t\t//create a backend_type based array for the wanted columns\n\t\t\t//this will greatly help for optimizing inserts when creating attributes\n\t\t\t//since eav_ model for attributes has one table per backend type\n\t\t\tforeach($attrinfs as $k=>$a)\n\t\t\t{\n\t\t\t\t//do not index attributes that are not in header (media_gallery may have been inserted for other purposes)\n\t\t\t\tif(!in_array($k,$cols))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$bt=$a[\"backend_type\"];\n\t\t\t\tif(!isset($this->attrbytype[$bt]))\n\t\t\t\t{\n\t\t\t\t\t$this->attrbytype[$bt]=array(\"data\"=>array());\n\t\t\t\t}\n\t\t\t\t$this->attrbytype[$bt][\"data\"][]=$a;\n\t\t\t}\n\t\t\t//now add a fast index in the attrbytype array to store id list in a comma separated form\n\t\t\tforeach($this->attrbytype as $bt=>$test)\n\t\t\t{\n\t\t\t\t$idlist;\n\t\t\t\tforeach($test[\"data\"] as $it)\n\t\t\t\t{\n\t\t\t\t\t$idlist[]=$it[\"attribute_id\"];\n\t\t\t\t}\n\t\t\t\t$this->attrbytype[$bt][\"ids\"]=implode(\",\",$idlist);\n\t\t\t}\n\t\t\t$this->attrinfo=array_merge($this->attrinfo,$attrinfs);\n\t\t}\n\t\t$notattribs=array_diff($cols,array_keys($this->attrinfo));\n\t\tforeach($notattribs as $k)\n\t\t{\n\t\t\t$this->attrinfo[$k]=null;\n\t\t}\n\t\t/*now we have 2 index arrays\n\t\t 1. $this->attrinfo which has the following structure:\n\t\t key : attribute_code\n\t\t value : attribute_properties\n\t\t 2. $this->attrbytype which has the following structure:\n\t\t key : attribute backend type\n\t\t value : array of :\n\t\t data => array of attribute_properties ,one for each attribute that match\n\t\t the backend type\n\t\t ids => list of attribute ids of the backend type */\n\t}", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public static function updateAll($attributes, $condition = null){}", "protected function _createColumnQuery()\n\t{\n\t\n\t}", "public function where($field, $value, $comparison = '==', $logical = 'and');", "function db_get_set_statement($mysqli, $items)\n{\n\t$escape = function($item) use ($mysqli) {\n\t\treturn array('name' => $item['name'],\n\t\t 'value' => __db_escape_values($mysqli, $item['type'], $item['value']));\n\t};\n\n\t$set = function($item) {\n\t\treturn $item['name'] . '=' . $item['value'];\n\t};\n\n\t$items = array_map($escape, $items);\n\t$items = array_map($set, $items);\n\treturn implode(',', $items);\n}", "public function setCondition($args = null){\r\n $this->_conditions = $args;\r\n return $this;\r\n }", "public function conditions_for($arg1 = null, $arg2 = null) {\n switch (func_num_args()) {\n case 0:\n return '';\n case 1:\n if (is_array($arg1)) {\n $values = array();\n foreach ($this->auto_quote_array($arg1) as $k => $v) $values[] = \"$k = $v\";\n return implode(' AND ', $values);\n } else {\n return $arg1;\n }\n case 2:\n if (is_array($arg2)) {\n return $this->auto_quote_query($arg1, $arg2);\n } else {\n list($type, $name) = $this->resolve_field_type_and_name($arg1);\n if ($type !== null) {\n $quoter = self::$quote_methods[$type];\n $arg2 = $this->$quoter($arg2);\n }\n return \"$name = $arg2\";\n }\n default:\n throw new GDBException;\n }\n }", "public static function setters();", "protected function applyFieldConditions()\n {\n if ($this->field !== null) {\n $this->andWhere(Db::parseParam('fieldId', $this->parseFieldValue($this->field)));\n }\n }", "public abstract function getUpdateSQL($table, $data, $where, $values, $order, $limit);", "private function Update()\n {\n $return = false;\n $action = $this->Action();\n $values = $this->Values();\n $table = $this->Table();\n $where = $this->Where();\n $errorInfo = $this->ERROR_INFO(__FUNCTION__);\n if(MySQLChecker::isAction($action, $errorInfo) && MySQLChecker::isTable($table, $errorInfo) &&\n Checker::isArray($values, false, $errorInfo) && Checker::isArray($where, false, $errorInfo) ) {\n if (isset($values[Where::VALUES]) && isset($values[self::COLUMNS]) && isset($where[Where::VALUES])) {\n $columns = $values[self::COLUMNS];\n $values = $values[Where::VALUES] + $where[Where::VALUES];\n if (Checker::isArray($columns, false, $errorInfo) && Checker::isArray($values, false, $errorInfo)) {\n $return[Where::QUERY] = \"$action $table SET \";\n foreach($columns as $column => $key)\n {\n $return[Where::QUERY] .= \"$column=$key, \";\n }\n $return[Where::QUERY] = trim($return[Where::QUERY],\", \");\n $return[Where::QUERY] .= $where[Where::QUERY];\n $return[Where::VALUES] = $values;\n }\n } else $this->addError(__FUNCTION__, \"Values and Query are not set!\", $values);\n }\n return $return;\n }" ]
[ "0.61162704", "0.60619783", "0.59788805", "0.596645", "0.5749322", "0.56257844", "0.56180847", "0.5610255", "0.5605645", "0.55929446", "0.558957", "0.5574879", "0.55322397", "0.55059254", "0.5477473", "0.547343", "0.5462049", "0.5461154", "0.5455579", "0.5452806", "0.5420863", "0.540528", "0.53918016", "0.5376788", "0.5373456", "0.5365874", "0.5342926", "0.53355557", "0.52930087", "0.5243974", "0.5241185", "0.52316463", "0.5220062", "0.52183324", "0.5217511", "0.52128834", "0.52043396", "0.5196915", "0.5191388", "0.51863176", "0.5183784", "0.5183784", "0.5183784", "0.51733243", "0.5171738", "0.5169751", "0.51682216", "0.51682216", "0.5162309", "0.5160583", "0.5151446", "0.5147566", "0.51413965", "0.5135435", "0.5132228", "0.51244223", "0.5120601", "0.5111969", "0.5111347", "0.51058114", "0.5104799", "0.5087736", "0.507231", "0.5068261", "0.50612926", "0.50527006", "0.5050463", "0.5016143", "0.5014267", "0.50059247", "0.4999953", "0.49971828", "0.4994872", "0.49849507", "0.49843934", "0.49827427", "0.49807924", "0.49765974", "0.49747548", "0.49741763", "0.49583414", "0.49560735", "0.49469194", "0.49446273", "0.49405605", "0.49363008", "0.49354503", "0.49348792", "0.49277192", "0.49215195", "0.49202424", "0.4910487", "0.49000198", "0.4894502", "0.4892343", "0.48905137", "0.48813817", "0.48785722", "0.48779696", "0.48696202", "0.4866615" ]
0.0
-1
where() / Protected functions _clear() Clear private variables
protected function _clear() { $this->_query = null; $this->_set = null; $this->_where = null; $this->_limit = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearWhere()\n {\n \t$this->_where = null;\n }", "protected function clear() {}", "private function clear() {\n $this->select = null;\n $this->where = null;\n $this->order_by = array();\n $this->group_by = '';\n $this->join = array();\n $this->limit = '';\n $this->where_in = null;\n }", "public function clear() {\n\t\t$this->_where\t\t= array();\n\t\t$this->_order\t\t= array();\n\t\t$this->_isAddingNew\t= false;\n\t\t$this->_currentRow\t= 0;\n\t\t$this->_relationship\t= array();\n\t\t$this->_recordset\t= array();\n\t\t$this->_updateBuffer\t= array();\n\t\t$this->_limit\t\t= NULL;\n\t\t$this->_offset\t\t= NULL;\n\t\t$this->isDirty( false );\n\t}", "function clear() {}", "function clear() {}", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear () {\n \n }", "public function clear( );", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "public function resetWhere()\n\t{\n\t\t$this->wheres = array();\n\t\t$this->bindings = array();\n\t}", "private function clear()\n {\n $this->mappedQueries = [];\n $this->mappedFilters = [];\n $this->requestData = [];\n }", "public function clear() {\n\t}", "public function clear()\n {\n }", "function Clean()\r\n\t{\r\n\t\t$this->_strWhere = '';\r\n\t\t$this->_arrWhere = Array();\r\n\t}", "public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}", "public function clear_all()\n {\n }", "function clear()\n \t{\n \t\tforeach ($this as &$value) \n \t\t $value = null;\n \t}", "public function clearAll() {\n $this->param = array();\n $this->method_map = array();\n $this->response = NULL;\n $this->query = '';\n }", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear()\n {\n $this->sql = '';\n $this->columns = array();\n $this->values = array();\n }", "public static function clear()\n {\n self::$map = array();\n self::$instances = array();\n }", "public static function clear()\n\t\t{\n\t\t\tself::$data = [];\n\t\t\tself::$file = [];\n\t\t}", "public function clearMembros()\n\t{\n\t\t$this->collMembros = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clear()\n\t{\n\t\t$this->stmt = null;\n\t\t$this->str = null;\n\t}", "function clear(): void;", "public function clear ()\n {\n\n $this->groups = null;\n $this->groups = array();\n $this->names = null;\n $this->names = array();\n\n }", "public static function __clearSetArray(){\r\n self::$_units = array();\r\n self::$_totalGrade = array();\r\n self::$_totalUnitsFail = array();\r\n self::$_totalUnitsPass = array();\r\n self::$_remarks = array();\r\n }", "public function clear() {\n\t\t$vars = get_object_vars($this);\n\t\tforeach ($vars as $key => $val) {\n\t\t\t$this->$key = null;\n\t\t}\n\t}", "final public static function clear() {\n static::free_all();\n }", "function reset_data() {\n\t\t$this->data_layer()->clear();\n\t\t$this->log = null;\n\t\t$this->location = null;\n\t\t$this->tax_location = null;\n\t}", "private function clear()\n {\n $this->files = [];\n $this->cdr_ofs = 0;\n $this->cdr_len = 0;\n $this->opt = [];\n }", "public function clear(): self;", "private function clearvariables()\n {\n $this->pointer = 0;\n $this->index = 0;\n $this->imagedata = array();\n $this->imageinfo = array();\n $this->handle = 0;\n $this->parsedfiles = array();\n }", "public function clearAll() {}", "public function clearAll(){\n\n }", "function clear()\r\n\t{\r\n\t\t// Clear the all list\r\n\t\t$this->all = array();\r\n\r\n\t\t// Clear errors\r\n\t\t$this->error = new stdClass();\r\n\t\t$this->error->all = array();\r\n\t\t$this->error->string = '';\r\n\r\n\t\t// Clear this objects properties and set blank error messages in case they are accessed\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\t$this->{$field} = NULL;\r\n\t\t\t$this->error->{$field} = '';\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has many\" related objects\r\n\t\tforeach ($this->has_many as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has one\" related objects\r\n\t\tforeach ($this->has_one as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear the query related list\r\n\t\t$this->query_related = array();\r\n\r\n\t\t// Clear and refresh stored values\r\n\t\t$this->stored = new stdClass();\r\n\r\n\t\t$this->_refresh_stored_values();\r\n\t}", "public function clear() {\n\t\t$this->array = array();\n\t}", "public function clear()\n\t{\n\t\t$this->uniqid = '';\n\t\t$this->base_url = '';\n\t\t$this->no_result = '';\n\t\t$this->pagination_tmpl = '';\n\n\t\t$this->sort = array();\n\t\t$this->column_config = array();\n\n\t\t$this->jq_template = FALSE;\n\n\t\t$this->rows\t\t\t\t= array();\n\t\t$this->heading\t\t\t= array();\n\t\t$this->auto_heading\t\t= TRUE;\n\t}", "public function clear() {\n foreach ($this->Fields as $key => $item) {\n $this->$key = null;\n }\n }", "public function clear()\r\n\t{\r\n\t\t$this->isLoaded = false;\r\n\t\t$this->elements = array();\r\n\t\t$this->keyAssocation = array();\r\n\t\t$this->i = 0;\r\n\t\t$this->count = 0;\r\n\t}", "public static function clear()\n {\n self::$map = array();\n }", "public function clearAll();", "public function clearAll();", "public function clearAll()\n {\n }", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "public function clear() {\n $this->_documentBoost = FALSE;\n\n $this->_fields = array();\n $this->_fieldBoosts = array();\n }", "function clear() {\r\n /* clear datasource. you should call this before calling another populate() to avoid datasource gets appended\r\n */\r\n $this->ds = new DataSource;\r\n $this->db_count = 0;\r\n }", "public function clear()\n {\n $this->_data = [];\n }", "protected function _clear_cache() {\n\t\t$this->_attrs = array();\n\t\t$this->_options = array();\n\t}", "function clear()\n {\n # files\n $this->file_objs = array(); # list of file objects\n # params\n $this->name = null;\n $this->meta_updated = null;\n $this->yt_id = null;\n $this->tags = array(); # list of tag strings\n $this->meta_objs = array(); # list of meta objects\n # file_params\n $this->thumb_used = \"\";\n $this->update_files = 0;\n # chapters & comments\n $this->chapters = array();\n $this->comments = array();\n }", "function clear ();", "public function clearSearch(): void {}", "public function clearInternalCache()\n {\n $this->_cached = null;\n }", "public function clearExperts()\n\t{\n\t\t$this->collExperts = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clearWhere() {\n $this->where = '';\n return $this;\n }", "public function clear(){\n\t\t$this->pile = array();\n\t}", "private function reset()\n\t{\t\t\n\t\t$this->limit = null;\n\t\t\n\t\t$this->table = null;\n\t\t\n\t\t$this->offset = null;\n\t\t\n\t\t$this->data = [];\n\t\t\n\t\t$this->joins = [];\n\t\t\n\t\t$this->wheres = [];\n\t\t\n\t\t$this->orderBy = [];\n\t\t\n\t\t$this->selects = [];\n\t\t\n\t\t$this->bindings = [];\n\t\t\t\n\t}", "private function clearData()\n {\n $this->_data=array();\n }", "public function cleanLookupCache(){\n\t\t$this->lookup = [];\n\t}", "public function clear() {\n $this->_data = [];\n }", "protected static function clearState() {}", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "public static function clear()\n {\n self::$context = new Context();\n self::$macros = array();\n self::$citationItem = false;\n self::$context = new Context();\n self::$rendered = new Rendered();\n self::$bibliography = null;\n self::$citation = null;\n\n self::setLocale(Factory::locale());\n self::$locale->readFile();\n }", "public function free()\n {\n if ($this->freed) {\n return;\n }\n $this->freed = true;\n\n $this->where = null;\n $this->orderBy = null;\n $this->groupBy = null;\n $this->innerJoins = [];\n $this->data = null;\n $this->joinedData = [];\n $this->vFieldCallbacks = [];\n $this->options = [];\n }", "public function clearModified()\n\t{\n\t\t$this->_modified = array();\n\t}", "function clearall() {\n}", "public function clear()\n {\n $this->_params = null;\n }" ]
[ "0.7692992", "0.7459287", "0.73276985", "0.70599455", "0.7014523", "0.6972879", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6941274", "0.6940626", "0.6940626", "0.6940626", "0.6940626", "0.68861705", "0.681158", "0.67832816", "0.67615813", "0.6703484", "0.67024744", "0.6695361", "0.66839623", "0.6675018", "0.6666654", "0.6642368", "0.66356075", "0.6612803", "0.6612803", "0.6612803", "0.6612803", "0.6612803", "0.6612803", "0.6600611", "0.6588132", "0.6576524", "0.6576132", "0.6566814", "0.6545175", "0.65415686", "0.6538398", "0.6528752", "0.65228003", "0.6512383", "0.65118253", "0.6497142", "0.6492234", "0.6483694", "0.64679205", "0.64617205", "0.64601755", "0.6445233", "0.64432913", "0.6431074", "0.6428025", "0.6415971", "0.6415971", "0.6409393", "0.64074874", "0.63764715", "0.6367182", "0.63641465", "0.6363866", "0.6362955", "0.636075", "0.63559246", "0.63412935", "0.63408214", "0.6333094", "0.6329616", "0.63235736", "0.63153106", "0.6303863", "0.6300602", "0.6300446", "0.6289201", "0.6287286", "0.62788665", "0.62660724", "0.62660104", "0.62505674" ]
0.77487195
0
clear() _isCleared() Test if all private variables are cleared
protected function _isCleared() { // Initialisation $return = true; // Tests if ($this->_query !== null) $return = false; if ($this->_set !== null) $return = false; if ($this->_where !== null) $return = false; if ($this->_limit !== null) $return = false; return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clear()\n\t{\n\t\t$classvars = get_class_vars(__CLASS__);\n\n\t\tforeach ($classvars as $property => $value)\n\t\t{\n\t\t\tif ('_s_' == substr($property, 0, 3)) // Don't touch static variables\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tunset($this->$property);\n\t\t\t$this->$property = $value;\n\t\t}\n\n\t\t$objvars = get_object_vars($this);\n\n\t\tforeach ($objvars as $property => $value)\n\t\t{\n\t\t\tif (!array_key_exists($property, $classvars))\n\t\t\t{\n\t\t\t\tunset($this->$property);\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function clear(): bool;", "public function clear(): bool;", "public function clear(): bool;", "function clear() {\n\t\treturn ($this->_data = array()) ? true : false;\n\t}", "public static function clear() {\n\t\t\t$klass = self::getInstance();\n\t\t\t$klass->cache = array();\n\t\t\treturn true;\n\t\t}", "public function clear()\r\n {\r\n //no action because always isEmpty is true\r\n }", "public function clearMembros()\n\t{\n\t\t$this->collMembros = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clear ()\n {\n return true;\n }", "protected function clear() {}", "public function clear() {\n\t\t$vars = get_object_vars($this);\n\t\tforeach ($vars as $key => $val) {\n\t\t\t$this->$key = null;\n\t\t}\n\t}", "public function clear()\n\t{\n\t\treturn true;\n\t}", "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 }", "function clear() {}", "function clear() {}", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clearInternalCache() {\n\t\t$this->_internalCache = array();\n\t\treturn true;\n\t}", "protected function _clear()\n\t{\n\t\t$this->_query = null;\n\t\t$this->_set = null;\n\t\t$this->_where = null;\n\t\t$this->_limit = null;\n\t}", "public function testClear() {\n\t\t$value='ipsum lorum';\n\t\t$this->instance->set('1_value1', $value);\n\t\t$this->instance->set('1_value2', $value);\n\t\t$this->instance->set('2_value1', $value);\n\t\t$this->instance->set('3_value1', $value);\n\n\t\t$this->assertTrue($this->instance->clear('1_'));\n\n\t\t$this->assertFalse($this->instance->hasKey('1_value1'));\n\t\t$this->assertFalse($this->instance->hasKey('1_value2'));\n\t\t//$this->assertTrue($this->instance->hasKey('2_value1'));\n\t\t//$this->assertTrue($this->instance->hasKey('3_value1'));\n\n\t\t$this->assertTrue($this->instance->clear());\n\n\t\t$this->assertFalse($this->instance->hasKey('1_value1'));\n\t\t$this->assertFalse($this->instance->hasKey('1_value2'));\n\t\t$this->assertFalse($this->instance->hasKey('2_value1'));\n\t\t$this->assertFalse($this->instance->hasKey('3_value1'));\n\t}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public static function __clearSetArray(){\r\n self::$_units = array();\r\n self::$_totalGrade = array();\r\n self::$_totalUnitsFail = array();\r\n self::$_totalUnitsPass = array();\r\n self::$_remarks = array();\r\n }", "protected static function clearState() {}", "public function clear() {\n return true;\n }", "public function clear()\r\n\t{\r\n\t\t$this->isLoaded = false;\r\n\t\t$this->elements = array();\r\n\t\t$this->keyAssocation = array();\r\n\t\t$this->i = 0;\r\n\t\t$this->count = 0;\r\n\t}", "public function clearInternalCache()\n {\n $this->_internalCache = [];\n return true;\n }", "public function clear( );", "public function clear()\n {\n }", "public function clear() {\n\t}", "public function clear () {\n \n }", "public static function clear()\n {\n self::$map = array();\n self::$instances = array();\n }", "public function _memorizeCleanState() {}", "public function clear() {\n $this->_documentBoost = FALSE;\n\n $this->_fields = array();\n $this->_fieldBoosts = array();\n }", "public function clearState() {}", "public function clear() {\n $this->elements = array();\n $this->count = 0;\n return TRUE;\n }", "public function clear() {\n\t\t$this->array = array();\n\t}", "public function clearState()\n {\n $this->fields = array();\n }", "public static function clear()\n\t\t{\n\t\t\tself::$data = [];\n\t\t\tself::$file = [];\n\t\t}", "function clear(): void;", "function _memorizeCleanState() ;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "public function clear(): void;", "function clear()\n \t{\n \t\tforeach ($this as &$value) \n \t\t $value = null;\n \t}", "public function testCacheCleanup(){\n\n $this->initCache();\n\n // Cleanup all previously set values\n $this->cache->clear();\n $this->cache->save();\n $this->assertEmpty($this->cache->get('test_var'));\n }", "public function clearCheckInformations()\n\t{\n\t\t$this->collCheckInformations = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}", "protected function checkUnsetProperties()\r\n {\r\n $ar = get_object_vars($this);\r\n if (self::$DEBUG)\r\n {\r\n //echo \"Object Vars:\" .PHP_EOL;\r\n // var_dump(get_object_vars($this));\r\n }\r\n foreach ($ar as $key => $val) {\r\n if (!isset($ar[$key]))\r\n trigger_error(\"{$key} not set in \" . get_class($this) . \". Try setting the value in __construct method.\");\r\n }\r\n }", "private function clear_variable()\n\t\t{\n\t\t\t$this->count_item_found = 'none';\t\t\t\t\t\t\t\t\t// No item found\n\t\t\t$this->fulllistexpand = Array();\t\t\t\t\t\t\t\t\t// No item list to expand\n\t\t\t$this->sqllistinvolved = '';\t\t\t\t\t\t\t\t\t\t// ??? TODO\n\t\t\t$this->listinvolved = Array();\n\t\t\t$this->html_result = '';\n\t\t}", "public function clear ()\n {\n\n $this->groups = null;\n $this->groups = array();\n $this->names = null;\n $this->names = array();\n\n }", "public function clearProperties();", "public function clear() {\n foreach ($this->Fields as $key => $item) {\n $this->$key = null;\n }\n }", "public function clearModified()\n\t{\n\t\t$this->_modified = array();\n\t}", "function clear()\r\n\t{\r\n\t\t// Clear the all list\r\n\t\t$this->all = array();\r\n\r\n\t\t// Clear errors\r\n\t\t$this->error = new stdClass();\r\n\t\t$this->error->all = array();\r\n\t\t$this->error->string = '';\r\n\r\n\t\t// Clear this objects properties and set blank error messages in case they are accessed\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\t$this->{$field} = NULL;\r\n\t\t\t$this->error->{$field} = '';\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has many\" related objects\r\n\t\tforeach ($this->has_many as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear this objects \"has one\" related objects\r\n\t\tforeach ($this->has_one as $related)\r\n\t\t{\r\n\t\t\tunset($this->{$related});\r\n\t\t}\r\n\r\n\t\t// Clear the query related list\r\n\t\t$this->query_related = array();\r\n\r\n\t\t// Clear and refresh stored values\r\n\t\t$this->stored = new stdClass();\r\n\r\n\t\t$this->_refresh_stored_values();\r\n\t}", "public function clearExperts()\n\t{\n\t\t$this->collExperts = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clear(): void\n {\n $this->debit = null;\n $this->credit = null;\n }", "public function clearParams(){\n\t\t$this->params = $this->paramsDefaults;\n\t\treturn true;\n\t}", "public static function clear_all() {\n\t\tstatic::$cache = array();\n\t\tstatic::$mapping = array();\n\t}", "function clearState() ;", "public function clear()\n {\n $this->_data = [];\n }", "function clear(){\r\n\t\t$_SESSION[self::_KEY_][get_class($this)]->reset();\r\n\t}", "public function clear()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->multiRef = [];\n\n }", "public function clearInternalCache()\n {\n $this->_cached = null;\n }", "public function clear_all()\n {\n }", "function clean() {\n\t\t$now = time();\n\t\tforeach($this->_cache as $key => $value) {\n\t\t\t// retain PRIVATE values\n\t\t\tif($value[1] == self::CACHE_PRIVATE) continue;\n\t\t\t// remove all other special values\n\t\t\tif($value[1] < 0) unset($this->_cache[$key]);\n\t\t\t// check timestamp for all positive values\n\t\t\tif($value[1] > 0 && $value[1] < $now) unset($this->_cache[$key]);\n\t\t}\n\t}", "private function clearData()\n {\n $this->_data=array();\n }", "function clear()\n {\n # files\n $this->file_objs = array(); # list of file objects\n # params\n $this->name = null;\n $this->meta_updated = null;\n $this->yt_id = null;\n $this->tags = array(); # list of tag strings\n $this->meta_objs = array(); # list of meta objects\n # file_params\n $this->thumb_used = \"\";\n $this->update_files = 0;\n # chapters & comments\n $this->chapters = array();\n $this->comments = array();\n }", "public function clear(){\n\t\t$this->pile = array();\n\t}", "private function clear()\n {\n $this->mappedQueries = [];\n $this->mappedFilters = [];\n $this->requestData = [];\n }", "final public static function clear() {\n static::free_all();\n }", "public function reset() {\n\t\t$this->_finalScore = 0;\n\t\t$this->_totalElements = 0;\n\t\t$this->resetCounts();\n\t\treturn true;\n\t}" ]
[ "0.72817653", "0.66775674", "0.66775674", "0.66775674", "0.6589037", "0.65865743", "0.6555389", "0.647018", "0.6465195", "0.64601016", "0.6452794", "0.6440897", "0.64340293", "0.64340293", "0.6346077", "0.63245875", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63097006", "0.63095486", "0.6286584", "0.62852085", "0.62565887", "0.62565887", "0.62565887", "0.62565887", "0.62349427", "0.62263143", "0.6219181", "0.62123525", "0.6206208", "0.62048006", "0.61520773", "0.6148203", "0.6131744", "0.6114446", "0.6103602", "0.6095502", "0.6092", "0.60824263", "0.6073922", "0.6057008", "0.6053584", "0.60447717", "0.60378575", "0.6036829", "0.6036829", "0.6036829", "0.6036829", "0.6036829", "0.6036829", "0.6013814", "0.60110277", "0.599518", "0.5983202", "0.59739363", "0.59720516", "0.5960441", "0.59530157", "0.5950242", "0.5944354", "0.5908701", "0.58902466", "0.5871504", "0.5863117", "0.5859556", "0.5857594", "0.5850969", "0.5837439", "0.5833464", "0.5829101", "0.5827917", "0.58231014", "0.5816841", "0.5811249", "0.58101434", "0.58077323", "0.5796316", "0.5792598" ]
0.6596902
4
_isCleared() _execute Prepare and execute the SQL request, private variables are clear.
protected function _execute($withResult = true) { debugInfo(get_class($this).'->_execute()'); debug('SQL Query', $this->_query); // Initialisation $this->_result = null; if ($this->_db === null) { trigger_error("Not connected to database"); return false; } // query if (($prepare = $this->_db->prepare($this->_query)) === false) { trigger_error("Not connected to database"); return false; } if (($return = $prepare->execute()) !== false) { if ($withResult) { $return = null; while($row = $prepare->fetch(PDO::FETCH_ASSOC)) { $return[] = $row; } // while $this->_result = $return; } // if } else { trigger_error("Not connected to database"); return false; } // if // clear private variables $this->_clear(); debug('->_execute(), $return', $return); return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _isCleared()\n\t{\n\t\t// Initialisation\n\t\t$return = true;\n\n\t\t// Tests\n\t\tif ($this->_query !== null) $return = false;\n\t\tif ($this->_set !== null) $return = false;\n\t\tif ($this->_where !== null) $return = false;\n\t\tif ($this->_limit !== null) $return = false;\n\n\t\treturn $return;\n\t}", "abstract protected function query_and_clear_cache($sql);", "function clearSQL() {}", "protected function prepareExecute()\n {\n parent::prepareExecute();\n }", "public function prepare_query()\n {\n }", "private function executeQuery() {\n\t\t$recordset = $this->getConnection()->execute( $this );\n\t\t\n\t\tif( $recordset === false ) {\n\t\t\t$this->_recordset = array();\n\t\t} else {\n\t\t\t$this->_recordset = $recordset;\n\t\t}\n\n\t\t$this->_currentRow = 0;\n\t\t$this->isDirty( false );\n\t}", "protected function _clear()\n\t{\n\t\t$this->_query = null;\n\t\t$this->_set = null;\n\t\t$this->_where = null;\n\t\t$this->_limit = null;\n\t}", "public function clear()\n\t{\n\t\t$this->stmt = null;\n\t\t$this->str = null;\n\t}", "public function flushQuery()\n\t{\n\t\t$this->cur_query = \"\";\n\t}", "public function prepare()\n {\n $this->getInstruction()->execute();\n }", "public function clear()\n {\n $this->sql = '';\n $this->columns = array();\n $this->values = array();\n }", "public function __doDelete()\n {\n $strSQL = $this->getDeleteSql();\n $result = $this->query($strSQL);\n }", "function flush()\n\t\t{\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\t\t\t$this->last_query = null;\n\t\t\t$this->from_disk_cache = false;\n $this->setParamaters();\n\t\t}", "public function execute()\n {\n if (!$this->sessionSet && $this->platform instanceof MySqlPlatform) {\n $this->connection->exec(\"SET @@SESSION.sql_mode = '';\");\n $this->sessionSet = true;\n }\n\n // Take a local copy so that we don't modify the original query and cause issues later\n $query = $this->replacePrefix((string) $this->sql);\n\n if (!($this->sql instanceof \\JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) {\n // @TODO\n if ($this->offset > 0) {\n $query .= ' LIMIT ' . $this->offset . ', ' . $this->limit;\n } else {\n $query .= ' LIMIT ' . $this->limit;\n }\n }\n\n $this->prepared = $this->connection->prepare($query);\n\n // Increment the query counter.\n $this->count++;\n\n // Reset the error values.\n $this->errorNum = 0;\n $this->errorMsg = '';\n $memoryBefore = null;\n\n // If debugging is enabled then let's log the query.\n if ($this->debug) {\n // Add the query to the object queue.\n $this->log[] = $query;\n\n \\JLog::add($query, \\JLog::DEBUG, 'databasequery');\n\n $this->timings[] = microtime(true);\n }\n\n // Execute the query.\n $this->executed = false;\n $previous = null;\n\n if ($this->prepared instanceof Statement) {\n // Bind the variables:\n if ($this->sql instanceof JDatabaseQueryPreparable) {\n $bounded = $this->sql->getBounded();\n\n foreach ($bounded as $key => $obj) {\n $this->prepared->bindParam($key, $obj->value, $obj->dataType, $obj->length, $obj->driverOptions);\n }\n }\n\n try {\n $this->executed = $this->prepared->execute();\n } catch (\\Exception $previous) {\n }\n }\n\n if ($this->debug) {\n $this->timings[] = microtime(true);\n\n if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) {\n $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n } else {\n $this->callStacks[] = debug_backtrace();\n }\n }\n\n // If an error occurred handle it.\n if (!$this->executed) {\n // Get the error number and message before we execute any more queries.\n $errorNum = (int) $this->connection->errorCode();\n $errorMsg = (string) 'SQL: ' . implode(\", \", $this->connection->errorInfo());\n\n // Get the error number and message from before we tried to reconnect.\n $this->errorNum = $errorNum;\n $this->errorMsg = $errorMsg;\n\n // Throw the normal query exception.\n \\JLog::add(\n \\JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg),\n \\JLog::ERROR,\n 'databasequery'\n );\n throw new RuntimeException($this->errorMsg, $this->errorNum, $previous);\n }\n\n return $this->prepared;\n }", "private function initQuery()\n {\n // reset\n $this->result = false;\n \n $this->errorCode = 0;\n $this->errorMessage = '';\n }", "public function reset()\n {\n // reset properties\n $this->query = '';\n $this->rewind();\n \n // release result resource\n if (!empty($this->db) && !empty($this->result) &&\n is_resource($this->db) && is_resource($this->result)) {\n $this->free_result();\n }\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}", "public function clearQueries();", "function _execute($sql) {\n\t\t$result = sqlite_query($this->connection, $sql);\n\n\t\tif (preg_match('/^(INSERT|UPDATE|DELETE)/', $sql)) {\n\t\t\t$this->resultSet($result);\n\t\t\tlist($this->_queryStats) = $this->fetchResult();\n\t\t}\n\t\treturn $result;\n\t}", "private function clear() {\n $this->select = null;\n $this->where = null;\n $this->order_by = array();\n $this->group_by = '';\n $this->join = array();\n $this->limit = '';\n $this->where_in = null;\n }", "public function execute() {\n $exec = $this->db->prepare($this->sql);\n $exec->execute($this->placeHolder);\n $this->placeHolder = array(); //make placeHolder array empty SO that placeholder property is ready for another action.\n $return = '';\n $this->count = $exec->rowCount();\n switch ($this->type) {\n case self::TYPE_SELECT:\n $return = $exec->fetchAll(PDO::FETCH_OBJ);\n break;\n case self::TYPE_DELETE:\n $return = $this->count;\n break;\n case self::TYPE_UPDATE:\n break;\n case self::TYPE_ALTER:\n break;\n default :\n $return = '';\n break;\n }\n return $return;\n }", "function flush() {\n\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\n\t\t}", "function flush()\n\t\t{\n\t\t\t// Get rid of these\n\t\t\t$this->last_result = null;\n\t\t\t$this->col_info = null;\n\t\t\t$this->last_query = null;\n\t\t\t$this->from_disk_cache = false;\n\t\t}", "private function execute() {\n $this->statement = $this->pdo->prepare($this->queryString);\n\n foreach ($this->params as $boundParam) {\n $this->statement->bindValue($boundParam->name, $boundParam->value, $boundParam->type);\n }\n\n $this->statement->execute();\n }", "public function clear() {\n\t\t$this->expected_query = '';\n\t}", "public function prepare();", "public function prepare();", "protected function prepareStatements()\n {\n if (!empty($this->statements)) {\n return;\n }\n $this->statements['load'] = $this->db->prepare(\n 'SELECT * FROM `' . $this->options['table'] . '` WHERE `userId` = :userId '\n . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'\n );\n\n $this->statements['save'] = $this->db->prepare(\n 'INSERT INTO `' . $this->options['table'] . '` (`userId`, `scope`, `name`, `args`, `xml`) VALUES '\n . '(:userId, :scope, :name, :args, :xml)'\n );\n\n $this->statements['delete'] = $this->db->prepare(\n 'DELETE FROM`' . $this->options['table'] . '` WHERE `userId` = :userId '\n . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'\n );\n }", "public function clean()\n {\n try {\n $this->conn->exec(self::CLEAN_SQL);\n } catch (\\PDOException $e) {\n return false;\n }\n return true;\n }", "private function ExecuteQuery()\n\t{\n\t\tswitch($this->querytype)\n\t\t{\n\t\t\tcase \"SELECT\":\n\t\t\t{\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$this->querydata = $this->stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"INSERT\":\n\t\t\tcase \"UPDATE\":\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->beginTransaction();\n\t\t\t\t\t$this->stmt->execute();\n\t\t\t\t\t$this->commit();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch (PDOException $e)\n\t\t\t\t{\n\t\t\t\t\t$this->rollBack();\n\t\t\t\t\techo(\"Query failed: \" . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function execute() {\r\n // $this->connecxao = parent::getConnect();\r\n $stmt = $this->connecxao->prepare($this->getQuery());\r\n $this->transition = $stmt->execute($this->getBinds());\r\n $this->error = $stmt->errorInfo();\r\n\r\n if ($this->error[0] == \"00000\") {\r\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\r\n $this->data = $stmt;\r\n } else {\r\n $this->setMsgError(\"Code Aplic Error: \" . $this->error[0] . \"<br />Code BD Error: \" . $this->error[1] . \"<br />Msg BD Error: \" . $this->error[2]);\r\n }\r\n }", "public function Clear() {\n\t\t$this->sql = \"SELECT 1, 2, 3, 4, 5, 6, 7\";\n }", "public function unprepared($query);", "public function unprepared($query);", "public function clean(){\n\t\t$sql = 'DELETE FROM compra_coletiva';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "protected function dbReset() {\r\n $this->query_result = '';\r\n }", "function clearQuery($inparms){\n unset($this->_query);\n $this->_query = new booleanQuery();\n $this->selectedNode = -1;\n $this->selectedOperator = -1;\n\n return $this->output(NULL);\n }", "public function cancel()\n {\n $this->_statement =null;\n }", "public function clean(){\n\t\t$sql = 'DELETE FROM conta_a_pagar';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "private function execute () {\n if($this->_query->execute()) {\n\n // It has been succesful so add the output to $this->results and set it as an object\n $this->_results = $this->_query->fetchAll(PDO::FETCH_OBJ);\n\n // Set the affected row count to $this->_count\n $this->_count = $this->_query->rowCount();\n\n } else {\n\n // The query failed so set $this->_error to true. MORE WORK NEEDED HERE\n $this->_error = true;\n\n }\n }", "public function execute () {\n $this->query->execute();\n }", "public function flush() {\n\t\t$this->last_result = null;\n\t\t$this->col_info = null;\n\t\t$this->last_query = null;\n\t}", "public function prepare_execute_add_up_del($_req, $_param = array()) {\n// var_dump($_param);\n $stmt = $this->base->prepare($_req);\n// echo \"<br>---------bdd--------<br> stmt <br>\";\n// var_dump($stmt);\n $stmt->execute($_param);\n }", "public function clear(){\n\t\t\t//empty query creation variables\n\t\t\t$this->parameters = array();\n\t\t\t$this->select = false;\n\t\t\t$this->orderBy = false;\n\t\t\t$this->limit();\n\t\t\t$this->offset();\n\t\t\t$this->insert = false;\n\t\t\t$this->where = false;\n\t\t\treturn $this;\n\t\t}", "public function executeUncached()\n\t{\n\t\t$this->arrParams = func_get_args();\n\n\t\tif (is_array($this->arrParams[0]))\n\t\t{\n\t\t\t$this->arrParams = array_values($this->arrParams[0]);\n\t\t}\n\n\t\treturn $this->query();\n\t}", "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 resetQuery(): void\n\t{\n\t\t$this->state = new State();\n\t\t$this->explain = FALSE;\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM ano_letivo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "public function clean(){\n\t\t$sql = 'DELETE FROM aluno';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "protected function freePrepared( $prepared ) {\n\t\t/* No-op by default */\n\t}", "function flush(){\n\t\t$this->last_result = array();\n\t\t$this->col_info = null;\n\t\t$this->last_query = null;\n\t}", "public function flushQuery();", "public function execute()\n {\n \tif ( $this->cur_query != \"\" )\n \t{\n \t\t$res = $this->query( $this->cur_query );\n \t}\n \t\n \t$this->cur_query \t= \"\";\n \t$this->is_shutdown \t= false;\n\n \treturn $res;\n }", "function SQLReset()\n\t{\n\t\t$sql_1 = 'TRUNCATE TABLE `egl_inetopia_newsletter`';\n\t\t$sql_2 = 'TRUNCATE TABLE `egl_inetopia_newsletter_drafts`';\n\t\t\n\t\t\n\t\tglobal $gl_oVars;\n\t\t\n\t\t// interface correct?\n\t\tif( $gl_oVars->cDBInterface )\n\t\t{\n\t\t\tif( $gl_oVars->cDBInterface->Query( $sql_1 ) )\n\t\t\t{\n\t\t\t\tif( $gl_oVars->cDBInterface->Query( $sql_2 ) )\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}//if\n\t\t\t}//if\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDEBUG( MSGTYPE_ERROR, __FILE__, __LINE__, \"Couldn't execute SQL reset by Module [\".$this->oInfos->ID.\"] - DBInterface not initialised\" );\n\t\t}\n\t\treturn 0;\n\t}", "public function clean()\n {\n // Set to default values\n $this->sSql = '';\n $this->aValues = [];\n }", "function discardQuery() {}", "public function clearActiveQuery()\n\t{\n\t\t$this->activeQuery = null;\n\t\t$this->activeQueryResults = null;\n\t\treturn true;\n\t}", "protected function prepare()\n\t{\n\t}", "public function prepare()\r\n\t{\r\n\t\treturn null; // nothing\r\n\t}", "public function reset()\n {\n $db = PDOController::getInstance();\n \n $req = $db->prepare(\"TRUNCATE TABLE `executedtask` \");\n $req->execute([]);\n }", "public function execute() {\n\t\t\t$connection = \\Leap\\Core\\DB\\Connection\\Pool::instance()->get_connection($this->data_source);\n\t\t\tif ($this->before !== NULL) {\n\t\t\t\tcall_user_func_array($this->before, array($connection));\n\t\t\t}\n\t\t\t$connection->execute($this->command());\n\t\t\tif ($this->after !== NULL) {\n\t\t\t\tcall_user_func_array($this->after, array($connection));\n\t\t\t}\n\t\t}", "function runQuery()\r\n\t\t{\r\n\t\tif(!$this->conn)\r\n\t\t\t{\r\n\t\t\t$this->createConnect();\r\n\t\t\t}\r\n\t\tif($this->query)\r\n\t\t\t{\r\n\t\t\t$this->errors=\"\";\r\n\t\t\t$this->query.=\";\";\r\n\t\t\t$this->result = mysql_query($this->query);\r\n\t\t\tif(mysql_affected_rows()>=0)\r\n\t\t\t\t{\r\n\t\t\t\tunset($this->query);\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\techo \"<br>Error:<br>\";\r\n\t\t\t\t$debugging=debug_backtrace();\r\n\t\t\t\tforeach ($debugging as $debug)\r\n\t\t\t\t\t{\r\n\t\t\t\t\techo \"<b>File :</b> \".$debug[\"file\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Line :</b> \".$debug[\"line\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Function :</b> \".$debug[\"function\"].\"<br />\";\r\n\t\t\t\t\techo \"<b>Cause :</b> \".mysql_error().\"<br />\";\r\n\t\t\t\t\t}\r\n\t\t\t\techo \"<b>Query :</b> \".$this->query.\"<hr>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\techo \"<br>-- NULL Query --\";\r\n\t\t\t}\r\n\t\tif (!is_resource($this->result))\r\n\t\t\t{\r\n\t\t\t$this->errors=mysql_error();\r\n\t\t\tif($this->transaction)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->transaction=FALSE;\r\n\t\t\t\t\t$this->query=\"ROLLBACK TRANSACTION\";\r\n\t\t\t\t\t$this->runQuery();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "public function prepare()\n {\n return null;\n }", "public function freeSQL($request){\n\t\t$pre = $this->db->prepare($request);\n\t\t$pre->execute();\n\n\t\treturn $pre->fetchAll(PDO::FETCH_OBJ);\n\t}", "private function initQuery()\n {\n $this->_lastSql = null;\n $this->_limit = null;\n $this->_offset = null;\n $this->_order = array();\n $this->_group = array();\n $this->_table = null;\n $this->_stmt = null;\n\n $this->fromStates = array();\n $this->selectFields = array();\n $this->whereStates = array();\n $this->havingStates = array();\n $this->values = array();\n $this->joinStates = array();\n }", "public function executeFull()\n {\n $this->execute([]);\n }", "protected function resetStatement(): void\n {\n $this->statement = null;\n }", "public function __invoke()\n {\n $this->execute();\n }", "public function prepare() {}", "public function prepare() {}", "private function resetQuery() {\r\n\t\tunset($this->query);\r\n\t\t$this->query = $this->createQuery();\r\n\t\tunset($this->queryConstraints);\r\n\t\t$this->queryConstraints = array();\r\n\t}", "public function complete(){\n\n $flag = 0;\n \n $query = \"SET foreign_key_checks = 0\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n \n $query1 = \"DELETE FROM \" . $this->table_name . \"\n WHERE id_ordine=?\";\n $stmt1 = $this->conn->prepare($query1);\n $this->id_ordine=htmlspecialchars($this->id_ordine);\n $stmt1->bindParam(1, $this->id_ordine);\n $stmt1->execute();\n if($stmt1){\n $query2 = \"UPDATE articolo set id_ordine = NULL \n WHERE id_ordine=?\";\n\n $stmt2 = $this->conn->prepare($query2);\n $this->id_ordine=htmlspecialchars($this->id_ordine);\n $stmt2->bindParam(1, $this->id_ordine);\n $stmt2->execute();\n\n if($stmt2){\n\n $query3 = \"SET foreign_key_checks = 1\";\n $stmt3 = $this->conn->prepare($query3);\n $stmt3->execute();\n if($stmt3)\n return true;\n }\n }\n else\n return false;\n }", "public static function unprepared($query)\n {\n }", "private function restartParam()\n\t{\n\t\t$this ->status = 0;\n\t\t$this ->num_rows = 0;\n\t\t$this ->affected_rows = 0;\n\t\t$this ->insert_id = 0;\n\t\t$this ->data = 0;\n\t\t$this ->types = \"\";\n\t\t$this ->query = \"\";\n\t\t$this ->queryFields = \"\";\n\t\t$this ->queryTablesKeys = \"\";\n\t\t$this ->queryForeign = \"\";\n\t\t$this ->table = \"\";\n\t\t$this ->alterTable = FALSE;\n\t}", "public function execute() {\n $lastImplementaion = '';\n $finalWhere = ( count($this->_lastWhere) > 0) ? ' WHERE ' . join($this->_currentImplement['where'], ' ' ) : '';\n $finalLimit = ( strlen($this->_lastLimit) > 0 ) ? ' lIMIT ' . $this->_lastLimit : '';\n\n if ( !empty($this->_lastSelect) ) {\n $finalSelect = ' SELECT ' . join( $this->_currentImplement['select'], ',' );\n\n $finalTables = ' FROM ' . join( array_map(function($item ){\n return '`'.$item.'`';\n }, $this->_currentImplement['table']), ',');\n\n $finalOrder = ( strlen($this->_lastOrder) > 0 ) ? ' ORDER BY ' . $this->_lastOrder : '';\n\n $finalJoin = '';\n\n if ( isset($this->_currentImplement['join']) && count($this->_currentImplement['join']) > 0 ) {\n foreach ( $this->_currentImplement['join'] as $key => $value ) {\n $finalJoin[] = ' ' . $value['type'] . ' JOIN `' . $value['table'] . '`' . ' ON ' . $value['on'];\n }\n\n $finalJoin = join( $finalJoin, ' ' );\n }\n\n $lastImplementaion = $finalSelect . $finalTables . $finalJoin . $finalWhere . $finalOrder . $finalLimit;\n } else if ( !empty($this->_lastUpdate) ) {\n if(empty($finalWhere)){\n throw new Exception(\"If you preform this query, you will update all rows in table\", 1);\n }\n\n $lastImplementaion = 'UPDATE ' . $this->_lastTable . ' SET ' . $this->_lastUpdate . $finalWhere . $finalLimit;\n } else if ( !empty($this->_lastInsert) ) {\n $lastImplementaion = 'INSERT INTO `' . $this->_lastTable . '` ' . $this->_lastInsert;\n } else if ( !empty($this->_lastCreate) ) {\n $lastImplementaion = $this->_lastCreate;\n } else if ( !empty($this->_lastDrop) ) {\n $lastImplementaion = $this->_lastDrop;\n }else if( !empty($this->_lastTruncate) ){\n $lastImplementaion = $this->_lastTruncate;\n }else if( !empty($this->_lastDelete) ) {\n if(empty($finalWhere)){\n throw new Exception(\"If you preform this query, you will delete all rows in table, if you want so user truncate() instead.\", 1);\n }\n\n $lastImplementaion = $this->_lastDelete . $finalWhere . $finalLimit;\n }\n\n $lastImplementaion = trim( $lastImplementaion );\n $this->unsetAll();\n\n unset( $this->_currentImplement );\n unset( $finalSelect );\n unset( $finalTables );\n unset( $finalJoin );\n unset( $finalWhere );\n unset( $finalOrder );\n unset( $finalLimit );\n return $lastImplementaion;\n }", "protected function prepareSelectStatement() {}", "public function clean(){\n\t\t$sql = 'DELETE FROM negociacao_contas';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}", "private function func_execute () {\n $this -> connection = parent::func_query ($this -> query, $this -> query_data);\n }", "function clearPoints(){\n global $mysqli;\n if (!($stmt = $mysqli->prepare('DELETE from PulseMeasurePoint'))) {\n echo \"error-del-1<br>\\n\";\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n exit();\n }\n if (!($stmt->execute())) {\n echo \"error-del-2<br>\\n\";\n exit();\n }\n }", "function Clean() // libera la consulta\n {oci_free_statement($this->consulta);}", "function freePrepared($stmt)\r\n {\r\n if (!is_resource($stmt)) {\r\n return false;\r\n }\r\n @ibase_free_query($stmt);\r\n unset($this->prepare_tokens[(int)$stmt]);\r\n unset($this->prepare_types[(int)$stmt]);\r\n unset($this->manip_query[(int)$stmt]);\r\n return true;\r\n }", "static function &QueryDelete($id, $table, $where_condition=NULL, $bind_vars=array()) {\n Profiler::StartTimer(\"DataManager::QueryDelete()\");\n Profiler::StartTimer(\"DataManager::QueryDelete($id)\", 3);\n $qstart = microtime(true);\n $rows_affected = NULL;\n $queryid = new DatamanagerQueryID($id);\n if ($source =& DataManager::PickSource($queryid)) {\n $rows_affected = $source->QueryDelete($queryid, $table, $where_condition, $bind_vars);\n }\n Profiler::StopTimer(\"DataManager::QueryDelete()\");\n Profiler::StopTimer(\"DataManager::QueryDelete($id)\");\n self::log(\"delete\", $id, $table, $qstart, microtime(true));\n return $rows_affected;\n }", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "public static function ClearParamsQuery(){\n \tself::SetParam('limit', 0);\n \tself::SetParam('sort', '');\n \tself::SetParam('dir', '');\n }", "public function executeQuery(string $sql) {\n try {\n $sql=$this->secureSQL($sql);\n $stmt = $this->conn->prepare($sql);\n $stmt->execute();\n $this->result=$stmt->fetchAll(PDO::FETCH_ASSOC);\n $this->rsetRowCount = count($this->result);\n } catch (PDOException $e) {\n $this->lastException = $e;\n }\n }", "private function _executeQuery() \n\t{\n\t\t$this->_stmt->execute ( $this->_stmtData );\n\t\t\n\t\tif ($this->_stmt->rowCount () > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn $this->_stmt->errorInfo();\n\t\t}\n\t}", "public function deleteStatement()\n {\n }", "public function executeStatement()\n {\n \n }", "function _execute($sql) {\n\t\treturn mysql_query($sql, $this->connection);\n\t}", "private function before_execute()\n {\n }", "public function flush()\n {\n try {\n $this->conn->exec(self::FLUSH_SQL);\n } catch (\\PDOException $e) {\n return false;\n }\n return true;\n }", "public function _clean_by_sql($sql = '')\n {\n }", "private function runQuery () {\n\n // Prepare the constructed SQL statement\n if ($this->_query = $this->_pdo->prepare($this->_sql)) {\n\n // Set a counter to one to use when binding\n $x = 1;\n \n // Loop through the binding array\n foreach($this->_bindArray as $param) {\n \n // Run the bindValue function to match the correct value to the correct placing\n $this->_query->bindValue($x, $param);\n\n // Increment the counter\n $x++;\n \n }\n \n // Run the execute function\n $this->execute();\n }\n }", "abstract protected function _prepare();", "public function clearWhere()\n {\n \t$this->_where = null;\n }", "public function sql ( /* void */ )\n {\n /*\n Never used or not complete ?\n */\n if (($this->sMethod === false))\n {\n if (empty($this->aFields) and empty($this->aValues) and\n empty($this->aTables) and empty($this->aJoin) and\n empty($this->aWhere) and empty($this->aLike))\n {\n return null;\n }\n else\n {\n return false;\n }\n }\n /*\n Switch by method.\n */\n $func = '_sql_' . $this->sMethod;\n return $this->$func();\n }", "public function __execute(): bool;", "private function prepare ($sql) {\n $this->query = $this->connection->prepare($sql);\n }", "public function exec_query($sql = null) {\n\t\t$this->setFoundRows();\n\t\tif($this->debug) {\n\t\t\ttry {\n\t\t\t\t// Execute query\n\t\t\t\t$this->query = (isset($sql) && !empty($sql)) ? $sql : $this->getFullQuery();\n\t\t\t\t$Rs = $this->Connection->Execute($this->query, $this->params);\n\t\t\t\t$Rs->last_query = $this->getSQL($this->query); // full query with parameter\n\t\t\t\t//$this->writeQueryInLog($Rs->last_query, debug_backtrace());\n\n\t\t\t\t// $this->query_debugger($Rs->last_query); // Debug queries\n\t\t\t\t\n\t\t\t\t$this->resetVariables(); // reset all variables\t\t\t\t\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$newex = new Exception($e->getMessage());\n\t\t\t\t//echo 'ex :: '.$this->getSQL($this->getFullQuery());exit;\n\t\t\t\t$this->displayException($newex);\n\t\t\t}\n\t\t} \n\t\telse {\n\t\t\t$this->query = (isset($sql) && !empty($sql)) ? $sql : $this->getFullQuery();\n\t\t\t$Rs = $this->Connection->Execute($this->query, $this->params);\n\t\t\t$Rs->last_query = $this->getSQL($this->query); // full query with parameter\n\t\t\t$this->resetVariables();\t\t\t\n\t\t}\n\t\t\n\t\t$this->query = trim($this->query);\n\t\tif(stripos($this->query, 'INSERT') === 0) {\n\t\t\treturn $this->Connection->getLastInsertedId();\n\t\t} \n\t\telseif(stripos($this->query, 'UPDATE') === 0) {\n\t\t\treturn $Rs;\n\t\t} \n\t\telse {\n\t\t\tif($Rs->RecordCount() == 0)\n\t\t\t\treturn false;\n return $Rs;\n\t\t}\n\t}", "public function execute($sql);", "public function execute($sql);" ]
[ "0.6504512", "0.6327302", "0.6219213", "0.6196421", "0.6131964", "0.6121101", "0.6102313", "0.60774815", "0.60575825", "0.6050034", "0.6040376", "0.5987197", "0.59328216", "0.5924499", "0.59111875", "0.589943", "0.58817804", "0.5865836", "0.58650964", "0.5785517", "0.5778861", "0.57599676", "0.5713434", "0.5707213", "0.57047176", "0.5702608", "0.5702608", "0.5698861", "0.5695138", "0.5687949", "0.56763333", "0.56661797", "0.5616773", "0.5616773", "0.5610064", "0.56006444", "0.5598681", "0.5598657", "0.5587524", "0.5586186", "0.5556212", "0.55512476", "0.5550617", "0.5539159", "0.5537979", "0.5535632", "0.55257064", "0.5524801", "0.5514817", "0.5507932", "0.5505875", "0.5504922", "0.5502923", "0.5487483", "0.54846495", "0.54805034", "0.5477467", "0.5449782", "0.54381496", "0.54368466", "0.5426318", "0.54227257", "0.5421895", "0.54187804", "0.5412183", "0.54081947", "0.5405675", "0.5403783", "0.54008204", "0.54001045", "0.5399449", "0.5395929", "0.53940713", "0.5388539", "0.5378642", "0.5377767", "0.5377213", "0.5375615", "0.5372368", "0.53717196", "0.5371334", "0.5363418", "0.5360705", "0.53601456", "0.53443354", "0.53377306", "0.53371185", "0.5332013", "0.53253925", "0.53220934", "0.53069353", "0.53064823", "0.5305163", "0.53034717", "0.52999365", "0.5297691", "0.5296243", "0.52938795", "0.5293433", "0.5292121", "0.5292121" ]
0.0
-1
_execute() Prepare INSERT request
protected function _insert() { // INSERT INTO 'table' $this->_query = 'INSERT INTO '.$this->_table.' ('; // * / row1, row2 $first = true; $vals = ''; foreach($this->_set as $key => $value) { $this->_query .= ($first) ? ('') : (', '); $vals .= ($first) ? ('') : (', '); $first = false; $this->_query .= $key; $vals .= "'$value'"; } // foreach $this->_query .= ") VALUES ($vals);"; return $this->_query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _prepareTransactionInsertStatement()\n {\n $stmtName = '_insertTransactionStatement';\n\n $prefix = $this->_tablePrefix;\n $queryString = 'INSERT INTO `'.$prefix.'Transactions` ';\n $queryString .= '(`transactionID`, `createDate`, `modifyDate`)';\n $queryString .= 'VALUES';\n $queryString .= '(:transID, NOW(), NOW())';\n return $this->_prepareGenericStatement(\n $stmtName,\n $queryString\n );\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 }", "protected function prepareSaveStatement() {\n $fields = implode(',', $this->columns);\n\n $placeholders = [];\n foreach ($this->columns as $column) {\n $placeholders[] = ':' . $column;\n }\n $placeholders = implode(',', $placeholders);\n\n // Prepare our statement.\n return $this->connection->prepare(\"INSERT INTO {$this->table} ($fields) VALUES ($placeholders)\");\n }", "public function insertRequestToDb()\n\t\t{\n\t\t\t$this->columnsInfo->data_seek(0);\n\t\t\t$columns = \"\";\n\t\t\t$values = \"\";\n\t\t\twhile($rowColumn = $this->columnsInfo->fetch_assoc())//$info->fetch_row\n\t\t\t{\n\t\t\t\tif($rowColumn[\"EXTRA\"] == \"auto_increment\")\n\t\t\t\t\tcontinue;\n\t\t\t\t$columns = $columns.\", \".$rowColumn[\"COLUMN_NAME\"];\n\t\t\t\t$val = \"\";\n\t\t\t\tif($rowColumn[\"COLUMN_NAME\"] == \"sid_a\")\n\t\t\t\t\t$val = $_SESSION[\"sid\"];\n\t\t\t\telse if($rowColumn[\"COLUMN_NAME\"] == \"date_a\")\n\t\t\t\t\t$val = \"now()\";\n\t\t\t\telse $val = $this->insertColumnValue($_REQUEST[$rowColumn[\"COLUMN_NAME\"]], $rowColumn[\"IS_NULLABLE\"], $rowColumn[\"DATA_TYPE\"], $rowColumn[\"CHARACTER_MAXIMUM_LENGTH\"]);\n\t\t\t\t$values = \"$values, $val\";\n\t\t\t}\n\t\t\t$columns = substr($columns, 2, strlen($columns));\n\t\t\t$values = substr($values, 2, strlen($values));\n\n\t\t\t$query = \"INSERT INTO $this->table ($columns) values($values);\";\n\t\t\t$GLOBALS[\"db\"]->query($query);\n\t\t\t//$info->free();\n\t\t}", "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\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$insertCols .= \"lp_userid, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$insertCols .= \"lp_random, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$insertCols .= \"lp_deadline, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\t\t\t\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\t\t\t\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the id property\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\t\t\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\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: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function insert() {\n\t\t\t\n\t\t\t$insert_array = $this->buildInsertFields();\n\t\t\t$query = \"INSERT INTO \" . $this->table_name . \" (\" . $insert_array['insert_statement'] . \") VALUES (\" . \n\t\t\t\t\t\t\t\t\t$insert_array['values_statement'] . \")\";\n\t\t\treturn $this->query($query, $insert_array['bind_params']);\n\n\t\t}", "protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }", "public function Insert(){\r\n $query = \"INSERT INTO \". $this->_table_name .\"(ITEM_ID , USER_ITEM_ID , USER_FROM , USER_TO , TOO , IO_TYPE , MODE , TRANK_NO , PERMIT_ID , TYPE , NOTE , IN_UNIT , IN_SUBUNIT , LONGDATE , STATUS , CREATE_ON , CREATE_BY , MODIFY_ON , MODIFY_BY , IS_ACTIVE) \r\n VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) \" ; \r\n $success = 0;\r\n try{\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam (1 , $this->getItemId()); \r\n $stmt->bindParam (2 , $this->getUserItemId()); \r\n $stmt->bindParam (3 , $this->getUserFrom()); \r\n $stmt->bindParam (4 , $this->getUserTo()); \r\n $stmt->bindParam (5 , $this->getToo()); \r\n $stmt->bindParam (6 , $this->getIoType()); \r\n $stmt->bindParam (7 , $this->getMode()); \r\n $stmt->bindParam (8 , $this->getTrankNo()); \r\n $stmt->bindParam (9 , $this->getPermitId()); \r\n $stmt->bindParam (10 , $this->getType()); \r\n $stmt->bindParam (11 , $this->getNote()); \r\n $stmt->bindParam (12 , $this->getInUnit()); \r\n $stmt->bindParam (13 , $this->getInSubunit()); \r\n $stmt->bindParam (14 , $this->getLongdate()); \r\n $stmt->bindParam (15 , $this->getStatus()); \r\n $stmt->bindParam (16 , $this->getCreateOn()); \r\n $stmt->bindParam (17 , $this->getCreateBy()); \r\n $stmt->bindParam (18 , $this->getModifyOn()); \r\n $stmt->bindParam (19 , $this->getModifyBy()); \r\n $stmt->bindParam (20 , $this->getIsActive()); \r\n\r\n $stmt->execute(); \r\n $this->setId($this->conn->lastInsertId());\r\n $success = 1;}\r\n catch(PDOException $ex){ echo $ex->getMessage(); } \r\n return $success;}", "private function insertStatement() {\n $altitude = empty($_POST['alt']) ? null : $_POST['alt'];\n $latitude = empty($_POST['lat']) ? null : $_POST['lat'];\n $longitude = empty($_POST['lon']) ? null : $_POST['lon'];\n\n $date_fallback = empty($_SERVER[\"REQUEST_TIME\"]) ? time() : $_SERVER[\"REQUEST_TIME\"];\n\n $date = empty($_POST['date']) ? $date_fallback : $_POST['date'];\n\n\n $status_table = TABLE_PREFIX.\"status\";\n $insert_stmt = $this->db_connection->prepare(\"INSERT INTO \"\n\t\t\t\t\t\t . $status_table\n\t\t\t\t\t\t . \" (message,ip,date,lon,lat,alt) VALUES (?,?,?,?,?,?)\");\n\n $insert_stmt->bind_param(\"ssiddd\",\n\t\t\t $_POST[\"message\"], \n\t\t\t $_SERVER['REMOTE_ADDR'], \n\t\t\t $date,\n\t\t\t $longitude,\n\t\t\t $latitude,\n\t\t\t $altitude );\n $insert_stmt->execute();\n\n $rows_inserted = $insert_stmt->affected_rows;\n\n if ( $rows_inserted ) {\n $this->log($rows_inserted.\" rows inserted\");\n return true;\n }\n else{\n $this->log(\"Insert error, 0 rows inserted\");\n return false;\n }\n \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}", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\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 perform_insertion($statement) {\n $dbconn = new DBConnection();\n $conn = $dbconn->getConnection();\n // on the connection, we need to check if the insertion worked.\n // Check affected_rows\n if ($conn->query($statement) == FALSE) {\n return array('response' => 'Failed to insert.');\n }\n return array('response' => 'Success');\n}", "protected function _insert()\n\t{\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 insert_to_uo($db, $orderID, $flour_qty, $cheese_qty) {\n $query = 'INSERT INTO undelivered_orders VALUES (:order_id, :flour, :cheese)';\n $statement = $db->prepare($query);\n $statement->bindValue(':order_id', $orderID); \n $statement->bindValue(':flour', $flour_qty); \n $statement->bindValue(':cheese', $cheese_qty); \n $statement->execute(); \n $statement->closeCursor();\n}", "private function insertResponseIntoDatabase()\n {\n $sql = \"INSERT INTO weather(city, country, min, max, stamp, temp) \n VALUES (:city, :country, :min, :max, NOW(), :temp)\";\n\n $stmt = $this->pdo->prepare($sql);\n $stmt->bindParam(':city', $this->response['city']);\n $stmt->bindParam(':country', $this->response['country']);\n $stmt->bindParam(':min', $this->response['min']);\n $stmt->bindParam(':max', $this->response['max']);\n $stmt->bindParam(':temp', $this->response['temp']);\n $stmt->execute();\n }", "function insert_stmt()\n {\n if ( (! array_key_exists(\"cust_fname\", $_POST)) or\n ($_POST[\"cust_fname\"] == \"\") or\n (! isset($_POST[\"cust_fname\"])) )\n {\n destroy_and_exit(\"must insert a First Name!\");\n }\n elseif ( (! array_key_exists(\"cust_lname\", $_POST)) or\n ($_POST[\"cust_lname\"] == \"\") or\n (! isset($_POST[\"cust_lname\"])) )\n {\n destroy_and_exit(\"must insert a Last Name!\");\n }\n elseif ( (! array_key_exists(\"cust_phone\", $_POST)) or\n ($_POST[\"cust_phone\"] == \"\") or\n (! isset($_POST[\"cust_phone\"])) )\n {\n destroy_and_exit(\"must insert a phone number!\");\n }\n elseif ( (! array_key_exists(\"cust_email\", $_POST)) or\n ($_POST[\"cust_email\"] == \"\") or\n (! isset($_POST[\"cust_email\"])) )\n {\n destroy_and_exit(\"must insert a Customer Email!\");\n }\n \n $username = $_SESSION[\"username\"];\n $password = $_SESSION[\"password\"];\n \n $conn = hsu_conn_sess($username, $password);\n\n $cus_fname = trim(htmlspecialchars($_POST['cust_fname']));\n $cus_lname = trim(htmlspecialchars($_POST['cust_lname']));\n $cus_pho = trim(htmlspecialchars($_POST['cust_phone']));\n $cus_email = trim(htmlspecialchars($_POST['cust_email']));\n\n ?>\n \n <p> [<?= $cus_fname ?>] </p>\n <p> [<?= $cus_lname ?>] </p>\n <p> [<?= $cus_pho ?>] </p>\n <p> [<?= $cus_email ?>] </p>\n <?php\n \n $adding_cus = \"begin project_insert(:cust_fname, :cust_lname, :cust_phone, :cust_email); end; \";\n \n $somethingcool = oci_parse($conn, $adding_cus);\n \n oci_bind_by_name($somethingcool, \":cust_fname\", $cus_fname);\n oci_bind_by_name($somethingcool, \":cust_lname\", $cus_lname);\n oci_bind_by_name($somethingcool, \":cust_phone\", $cus_pho);\n oci_bind_by_name($somethingcool, \":cust_email\", $cus_email);\n \n oci_execute($somethingcool, OCI_DEFAULT);\n \n oci_commit($conn);\n \n oci_free_statement($somethingcool);\n \n $outputting_stmt = \"select *\n from Customer\";\n \n $somethingcoolpart2 = oci_parse($conn, $outputting_stmt);\n \n oci_execute($somethingcoolpart2, OCI_DEFAULT);\n \n ?> \n <p> <a href=\"<?= htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES) ?>\">\n Start Over </a> </p>\n <?php\n \n \n oci_free_statement($somethingcoolpart2);\n \n oci_close($conn);\n }", "protected function insert() {\n $dbh = $this->getDbh();\n $table = $this->tableName;\n $data = [];\n\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n\n $query = 'INSERT INTO `' . $table . '` VALUES (NULL,';\n $first = true;\n foreach ($data AS $k => $value) {\n if (!$first)\n $query .= ', ';\n else\n $first = false;\n $query .= ':'.$k;\n }\n $query .= ')';\n\n $msc = microtime(true);\n\n $sth = $dbh->prepare($query);\n $sth->execute($data);\n\n $msc = microtime(true) - $msc;\n $line = \"insert() => \" . $query . \" with \" . implode(\"', '\", $data);\n $this->writeRequestLog($line, $msc);\n\n return true;\n }", "public function insert(){\n\t\t$parametro = func_get_args();\n\t\t$resultado = $this->execSql($this->INSERT,$parametro);\n//\t\t\tdie();\n\t\tif(!$resultado){\n\t\t\t$this->onError(\"COD_INSERT\",$this->INSERT);\n\t\t}\n\t\treturn $resultado;\n\t}", "protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "function insertTransaction($sender, $recipient, $amount, $description, $tan) {\n $connection = openDb();\n $date = date('Y-m-d');\n\n if ($amount > 10000) {\n\n //Using prepared statements and parameterized queries:\n $sql = \"INSERT INTO transactions (SENDER_ACCOUNT, RECIPIENT_ACCOUNT, AMOUNT, DESCRIPTION, STATUS, TAN_ID, DATE_CREATED) \";\n $sql.= \"VALUES (?, ?, ?, ?, 'P', ?, ?)\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"iidsss\",$sender,$recipient,$amount,$description,$tan,$date);\n } else {\n\n //Using prepared statements and parameterized queries:\n $sql = \"INSERT INTO transactions (SENDER_ACCOUNT, RECIPIENT_ACCOUNT, AMOUNT, DESCRIPTION, STATUS, TAN_ID, DATE_CREATED, APPROVED_BY, DATE_APPROVED) \";\n $sql.= \"VALUES (?, ?, ?, ?, 'A', ?, ?, 6, ?)\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"iidssss\",$sender,$recipient,$amount,$description,$tan,$date,$date);\n }\n\n return executeNonQuery($stmt, $connection);\n}", "function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}", "protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }", "function insertIntoRequests($db, $upload_book_id, $days, $borrower_id, $lender_id){\n echo \"inster\";\n try {\n $query = 'INSERT INTO requests (uploaded_book_id, days, borrower_id,lender_id) VALUES (:np_uploaded_book_id, :np_days, :np_borrower_id, :np_lender_id)';\n $statement = $db->prepare($query);\n echo \"inster1\";\n $statement->bindValue(':np_uploaded_book_id', $upload_book_id);\n $statement->bindValue(':np_days', $days);\n $statement->bindValue(':$borrower_id', $borrower_id);\n $statement->bindValue(':np_lender_id', $lender_id);\n $statement->execute();\n } catch (PDOException $e) {\n $error = $e->getMessage();\n include('database_error.php');\n exit();\n }\n \n}", "protected function RetInsert() {\n\n if (!isset($this->\n tables[0])) {\n\n throw new \\Exception(\"Error: Table not properly provided in QueryHelper.\");\n }\n\n if (!(is_array($this->\n values) &&\n count($this->\n values)) &&\n !($this->\n values instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $this->\n values->\n IsSelect())) {\n\n throw new \\Exception(\"Error: Values not properly provided in QueryHelper.\");\n }\n\n if ($this->\n values instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $this->\n values->\n IsSelect()) {\n\n $this->\n values->\n GetRow();\n\n $columnsInfo = $this->\n values->\n GetColInfo();\n\n $columns = [];\n\n foreach ($columnsInfo as $value) {\n\n $columns[] = $value->\n name;\n }\n\n $return = \"INSERT INTO `{$this->\n tables[0]}` (`\" . implode(\"`, `\", $columns) . \"`) \" . $this->\n values->\n Generate();\n } else {\n\n $multi = false;\n $columns = array_keys($this->\n values);\n\n $valuesArr = [];\n\n if (!is_string($columns[0])) {\n\n if (!is_array($this->\n values[$columns[0]])) {\n\n throw new \\Exception(\"Error: Values not properly provided in QueryHelper.\");\n }\n\n $columns = array_keys($this->\n values[$columns[0]]);\n\n $multi = true;\n }\n\n\n $return = \"INSERT INTO `{$this->\n tables[0]}` (`\" . implode(\"`, `\", $columns) . \"`) VALUES \";\n\n\n if ($multi) {\n\n foreach ($this->\n values as $row) {\n\n $values = array_values($row);\n\n foreach ($values as $key => $value) {\n\n if (is_string($value)) {\n\n $value = $this->\n connection->\n GetConn()->\n real_escape_string($value);\n $values[$key] = \"'{$value}'\";\n } else if (isset($value['function'])) {\n\n $values[$key] = $value['function'];\n }\n }\n\n $valuesArr[] = \"(\" . implode(\", \", $values) . \")\";\n }\n } else {\n\n $values = array_values($this->\n values);\n\n foreach ($values as $key => $value) {\n\n if (is_string($value)) {\n\n $value = $this->\n connection->\n GetConn()->\n real_escape_string($value);\n $values[$key] = \"'{$value}'\";\n } else if (isset($value['function'])) {\n\n $values[$key] = $value['function'];\n }\n }\n\n $valuesArr[] = \"(\" . implode(\", \", $values) . \")\";\n }\n\n $return .= implode(\", \", $valuesArr) . \";\";\n }\n\n return $return;\n }", "private function Execute(){\n $this->Connect();\n\n try{\n $this->Create->execute($this->Dados);\n $this->Result = $this->Conn->lastInsertId();\n $this->StatusInsert = true;\n\n }catch (PDOException $e){\n $this->Result = null;\n WSErro(\"<b>Erro ao cadastrar:</b> {$e->getMessage()}\", $e->getCode());\n }\n }", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "public function create() {\n\t\t$columns = implode(', ', array_keys($this->params));\n\t\t$bindings = substr(str_repeat(', ?', count($this->params)), 2);\n\t\t$sql = 'INSERT INTO ' . static::$table . ' (' . $columns . ') VALUES (' . $bindings . ');';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "public function testInsertStmt()\n {\n $insert = $this->getConnection()\n ->insert()\n ('dummy_posts')\n (['blog_id', 'blog_title'])\n ([':id', ':title']);\n return $this->assertEquals($insert, \"INSERT INTO dummy_posts(blog_id, blog_title) VALUES (:id, :title)\");\n }", "public function prepare() {\n\t\tif ($this->_statement == null) \n\t\t{\n\t\t\ttry {\n\t\t\t\t$this->_statement = $this->_connection->getPdoInstance()->prepare($this->getText());\n\t\t\t\t$this->_paramLog = array();\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$errorInfo = $e instanceof PDOException ? $e->errorInfo : null;\n\t\t\t\tthrow new \\GO\\Base\\Exception\\Database('DbCommand failed to prepare the SQL statement: '. $e->getMessage(), $e->getCode(), $errorInfo);\n\t\t\t}\n\t\t}\n\t}", "public function 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 }", "function ajouter_article($nom,$prix,$quantite,$description,$type){\r\n\tglobal $bdd;\r\n\r\n\t$req=$bdd->prepare('INSERT INTO article(id_article, nom_article, prix_article, quantite_article, description_article,type_article) VALUES (:id_article, :nom_article, :prix_article,:quantite_article, :description_article,:type_article)');\r\n\r\n\t$req->execute(array(\r\n\t\t'id_article'=>'',\r\n\t\t'nom_article'=>$nom,\r\n\t\t'prix_article'=>$prix,\r\n\t\t'quantite_article'=>$quantite,\r\n\t\t'description_article'=>$description,\r\n\t\t'type_article'=>$type));\r\n\r\n}", "protected function prepareStatements()\n {\n if (!empty($this->statements)) {\n return;\n }\n $this->statements['load'] = $this->db->prepare(\n 'SELECT * FROM `' . $this->options['table'] . '` WHERE `userId` = :userId '\n . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'\n );\n\n $this->statements['save'] = $this->db->prepare(\n 'INSERT INTO `' . $this->options['table'] . '` (`userId`, `scope`, `name`, `args`, `xml`) VALUES '\n . '(:userId, :scope, :name, :args, :xml)'\n );\n\n $this->statements['delete'] = $this->db->prepare(\n 'DELETE FROM`' . $this->options['table'] . '` WHERE `userId` = :userId '\n . 'AND `scope` = :scope AND `name` = :name AND `args` = :args'\n );\n }", "private function execute() {\n $this->statement = $this->pdo->prepare($this->queryString);\n\n foreach ($this->params as $boundParam) {\n $this->statement->bindValue($boundParam->name, $boundParam->value, $boundParam->type);\n }\n\n $this->statement->execute();\n }", "abstract protected function doInsert($subject, Statement $insertStatement);", "public function prepare()\n {\n $this->getInstruction()->execute();\n }", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \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 }", "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 insert() {\n $sql = \"INSERT INTO contratos (numero_contrato, objeto_contrato, presupuesto, fecha_estimada_finalizacion)\n VALUES (:numero_contrato, :objeto_contrato, :presupuesto, :fecha_estimada_finalizacion)\";\n $args = array(\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n if ($stmt) {\n $this->id = $this->getConnection()->lastInsertId();\n }\n\n return !$stmt ? false : true;\n }", "private function create() {\n global $connection;\n $sql = 'insert into ' . static::$tableName . ' set ' . self::buildNameParametersSQL();\n $stmt = $connection->prepare($sql);\n $this->prepareValues($stmt);\n return $stmt->execute();\n }", "function insert(){\n\t\t\t$sql=\"INSERT INTO $this->table (surveyor_type,payment_purpose,payment_amount,division,record_hide,user_id) VALUES (:surveyorType,:paymentPurpose,:paymentAmount,:division,:recordHide,:userId)\";\n\t\t\t$stmt = $this->dbConn->prepare($sql);\n\t\t\t$stmt->bindParam(\":surveyorType\",$this->paymentSurveyor);\n\t\t\t$stmt->bindParam(\":paymentPurpose\",$this->paymentPurpose);\n\t\t\t$stmt->bindParam(\":paymentAmount\",$this->paymentAmount);\n\t\t\t$stmt->bindParam(\":division\",$_SESSION['division']);\n\t\t\t$stmt->bindParam(\":recordHide\",$this->recordHide);\n\t\t\t$stmt->bindParam(\":paymentAmount\",$this->paymentAmount);\n\t\t\t$stmt->bindParam(\":userId\",$this->userId);\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}", "public function insert($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"INSERT \";\n\t\t$p = $this->clean($params);\t\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']);\t\n\t\t$DB->exec($statement);\t\n\t}", "function insert($conn,$table,$data)\n {\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 create_account($account_name, $account_phone) {\r\n global $db;\r\n $query = 'INSERT INTO Accounts(Account_Name, Phone_Number)\r\n VALUES (:Account_Name, :Account_Phone)';\r\n //var_dump($query);\r\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $statement = $db->prepare($query);\r\n var_dump($statement);\r\n $statement->bindParam(':Account_Name', $account_name);\r\n $statement->bindParam(':Account_Phone', $account_phone);\r\n $statement->execute();\r\n $last_id = $db->lastInsertId();\r\n echo \"New record created succesfully. Last inserted ID is: \" . $last_id .\"<br>\";\r\n $statement->closeCursor();\r\n echo \"New Entry Account ID: \" . $last_id;\r\n return $last_id;\r\n}", "public function insertTransaction($storeId, \r\n $transactionDate, \r\n $amount, \r\n $fee, \r\n $amountToPrincipal, \r\n $amountToEscrow, \r\n $amountToInterest, \r\n $ledgerBalance, \r\n $checkNumber, \r\n $transactionType, \r\n $pending, \r\n $generatedDescription, \r\n $transactionId, \r\n $intradayOrderId, \r\n $exportTNUM, \r\n $depositSlipIdentifier, \r\n $checkImageIdentifier, \r\n $creditTransaction ) {\r\n $db = $this->getDB();\r\n $binds = array( \":storeId\" => $storeId, \r\n \":transactionDate\" => $transactionDate, \r\n \":amount\" => $amount, \r\n \":fee\" => $fee, \r\n \":amountToPrincipal\" => $amountToPrincipal, \r\n \":amountToEscrow\" => $amountToEscrow, \r\n \":amountToInterest\" => $amountToInterest, \r\n \":ledgerBalance\" => $ledgerBalance, \r\n \":checkNumber\" => $checkNumber, \r\n \":transactionType\" => $transactionType, \r\n \":pending\" => $pending, \r\n \":generatedDescription\" => $generatedDescription, \r\n \":transactionId\" => $transactionId, \r\n \":intradayOrderId\" => $intradayOrderId, \r\n \":exportTNUM\" => $exportTNUM, \r\n \":depositSlipIdentifier\" => $depositSlipIdentifier, \r\n \":checkImageIdentifier\" => $checkImageIdentifier, \r\n \":creditTransaction\" => $creditTransaction);\r\n $stmt = $db->prepare(\"INSERT INTO checkingAccountImport SET storeId = :storeId,\r\n transactionDate = :transactionDate,\r\n amount = :amount,\r\n fee = :fee,\r\n amountToPrincipal = :amountToPrincipal,\r\n amountToEscrow = :amountToEscrow,\r\n amountToInterest = :amountToInterest,\r\n ledgerBalance = :ledgerBalance,\r\n checkNumber = :checkNumber,\r\n transactionType = :transactionType,\r\n pending = :pending,\r\n generatedDescription = :generatedDescription,\r\n transactionId = :transactionId,\r\n intradayOrderId = :intradayOrderId,\r\n exportTNUM = :exportTNUM,\r\n depositSlipIdentifier = :depositSlipIdentifier,\r\n checkImageIdentifier = :checkImageIdentifier,\r\n creditTransaction = :creditTransaction,\r\n importDate = now()\");\r\n\r\n if ( $stmt->execute($binds) && $stmt->rowCount() > 0 ) {\r\n return true;\r\n }\r\n \r\n return false;\r\n }", "protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}", "function test_insert($urabe, $body)\n{\n $insert_params = $body->insert_params;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->insert($table_name, $insert_params);\n}", "protected static function execute_insert($parametros){\n self::StartTrans();\n try {\n $tabla=strtolower(static::$prefijo_tabla.get_called_class());\n if(ACTIVAR_LOG_APACHE_DE_CONSULTAS_SQL) \n Logger::developper('INSERT '.$tabla.' VALUES '.static::$id_tabla.'='.$parametros['id'], 0);\n $tiempo_inicio=microtime(true);\n $result=self::$conection->AutoExecute($tabla, $parametros, 'INSERT');\n if($result) $resultado=true;\n else $resultado=false;\n $duracion=microtime(true)-$tiempo_inicio;\n// if($resultado) $resultado=Gestor_de_log::set_auto('INSERT',$tabla,static::$id_tabla,$parametros, $resultado,$duracion);\n\n } catch (Exception $e) {\n $resultado=false;\n error_log($e->getMessage());\n }\n self::CompleteTrans();\n if($resultado){\n return $result;\n }\n return false; \n }", "function prepareBind($conn)\r\n{\r\n\t// prepare and bind\r\n\t$stmt = $conn->prepare(\"INSERT INTO MyGuests (firstname, lastname, email) VALUES (?, ?, ?)\");\r\n\t$stmt->bind_param(\"sss\", $firstname, $lastname, $email);\r\n\r\n\t// set parameters and execute\r\n\t$firstname = \"John\";\r\n\t$lastname = \"Doe\";\r\n\t$email = \"[email protected]\";\r\n\t$stmt->execute();\r\n\r\n\t$firstname = \"Mary\";\r\n\t$lastname = \"Moe\";\r\n\t$email = \"[email protected]\";\r\n\t$stmt->execute();\r\n\t\r\n\t$firstname = \"Julie\";\r\n\t$lastname = \"Dooley\";\r\n\t$email = \"[email protected]\";\r\n\t$stmt->execute();\r\n\t\r\n\techo \"New records created successfully\";\r\n\r\n\t$stmt->close();\r\n}", "protected function insert()\n {\n $insert = 'INSERT INTO users (first_name, last_name, email, password)\n VALUES (:first_name, :last_name, :email, :password)';\n $statement = self::$dbc->prepare($insert);\n unset($this->attributes['id']);\n foreach ($this->attributes as $key => $value) {\n $statement->bindValue(\":$key\", $value, PDO::PARAM_STR);\n }\n $statement->execute();\n $this->attributes['id'] = self::$dbc->lastInsertId();\n }", "function insert($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\treturn $this->pdo->lastInsertId();\n\t}", "function insert($debug = false) {\n\t\t\tself::$bind_params = [ ];\n\t\t\t$t_name = &self::getTableName();\n\t\t\t$fields = get_object_vars($this);\n\t\t\t\n\t\t\t// Check fields are legal\n\t\t\t$errors = self::validateArray($fields, true);\n\t\t\tif (count($errors)) {\n\t\t\t\t$res = new TMResult(TMResult::InvalidData);\n\t\t\t\t$res->errors = $errors;\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t\n\t\t\t$cols = $vals = [ ];\n\t\t\t\n\t\t\tforeach ($fields as $c => $v) {\n\t\t\t\tif ($v === null) continue;\n\t\t\t\t$cols []= $c;\n\t\t\t\t$vals []= '?';\n\t\t\t\tself::$bind_params []= $v;\n\t\t\t}\n\t\t\t\n\t\t\t$cols = implode(', ', $cols);\n\t\t\t$vals = implode(', ', $vals);\n\t\t\t\n\t\t\t$q = \"insert into $t_name ( $cols ) values ( $vals )\";\n\t\t\tif ($debug) var_dump($q);\n\t\t\t$st = self::$pdo->prepare($q);\n\t\t\t\n\t\t\tself::bindBindParams($st);\n\t\t\t\n\t\t\t$r = $st->execute();\n\t\t\tif ($r) {\n\t\t\t\t$res = new TMResult(TMResult::Success);\n\t\t\t\t$res->result = (int) self::$pdo->lastInsertId();\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$res = new TMResult(TMResult::InternalError);\n\t\t\t\t$res->errors = $st->errorInfo();\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t}", "private function prepareStatements() {\n $sql = \"INSERT INTO users(userName, password, email) VALUES (:user, :pass, :email)\";\n $this->insertUser = $this->connection->prepare($sql);\n\n $sql = \"UPDATE users SET userName=:userName, password=:pass, email=:email WHERE userName=:user\";\n $this->updateUser = $this->connection->prepare($sql);\n\n $sql = \"SELECT * FROM users WHERE userName=:user\";\n $this->selectUser = $this->connection->prepare($sql);\n }", "function insertInDatabase($url, $title, $description, $keywords) {\n global $conn;\n\n $query = $conn->prepare(\"INSERT INTO sites (url, title, description, keywords) \n VALUES (:url, :title, :description, :keywords);\");\n\n // avoid sql injections\n $query->bindParam(\":url\", $url);\n $query->bindParam(\":title\", $title);\n $query->bindParam(\":description\", $description);\n $query->bindParam(\":keywords\", $keywords);\n\n return $query->execute(); // returns true if worked\n}", "function insert_purchase_request($db, $buyer_id, $seller_id, $bookid)\n{\n\t/* Create the query */\n\t$sql = 'INSERT INTO purchase_requests (buyer_id, seller_id, bookid, date_time) \n\t\t\t\t\tVALUES (:buyer_id, :seller_id, :bookid, NOW())';\n\n\t/* Execute the query */\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':buyer_id' =>$buyer_id, ':seller_id'=> $seller_id,\n\t\t\t\t\t\t\t\t\t\t ':bookid'=> $bookid));\n}", "public function insertRecord ($sqlString);", "public function insert ($values)\n {\n $insertQuery = \"INSERT INTO $this->table (\";\n $selectQuery = \"SELECT * FROM $this->table WHERE \";\n\n foreach ($values as $key => $value) {\n $insertKeys[] = $key;\n if (is_string($value)) {\n $value = \"'$value'\";\n }\n $insertValues[] = $value;\n\n }\n\n $insertKeys = implode(\", \",$insertKeys);\n $insertValues = implode(\", \",$insertValues);\n $insertQuery .= \"$insertKeys) values \";\n $insertQuery .= \"($insertValues)\";\n\n foreach ($values as $key => $value) {\n $selectParts[] = \"$key = '$value' \";\n }\n $selectParts = implode(\"AND \", $selectParts);\n $selectQuery .= \"$selectParts\";\n\n $stmt = $this->link->prepare($selectQuery);\n $stmt->execute();\n $check = $stmt->rowCount();\n\n if ($check == 0) {\n echo \"Data inserted\";\n $stmt = $this->link->prepare($insertQuery);\n $stmt->execute();\n return $stmt;\n }\n else {\n echo \"Record exists\";\n }\n }", "function create($table, $data){\n\n global $conn;\n // $sql = \"INSERT INTO users SET (username=?, admin=?, email=?, password=?)\"\n$sql = \"INSERT INTO $table SET \";\n\n$i = 0;\n foreach ($data as $key => $value){\n if($i === 0){\n $sql = $sql . \" $key=?\"; \n } else{\n $sql = $sql . \", $key=?\";\n }\n$i++;\n}\n\n$stmt = executeQuery($sql, $data);\n$id = $stmt->insert_id;\nreturn $id;\n}", "public function insert(...$field_values);", "function executeInsert($script) {\n\t\t$queryRes = mysqli_query($this->connectionString, $script);\n\t}", "public static function insert($sql,$data_array = null){\r\n\r\n\t/* connecting to the server */\r\n\t$pdo = self::connection();\r\n\r\n\t/* preparing the database query. */\r\n\t$query = $pdo->prepare($sql);\r\n\r\n\t/* executing the query. */\r\n\ttry {\r\n\t\t$query->execute($data_array);\r\n\t} \r\n\t\r\n\t/* throwing an error if something goes wrong and returning false. */\r\n\tcatch (PDOException $e) {\r\n\t\t\r\n\t\t// handling error code...\r\n\t\t\r\n\t\techo $e->getMessage();\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t/* counts the affected rows with the rowCount() function. */\r\n\tself::$affected_rows = $query->rowCount();\r\n\r\n\tself::$last_id = $pdo->lastInsertId();\r\n\r\n\t/* emptying the current recordset. */\r\n\t$query = null;\r\n\t\r\n\t/* closing the connection and setting the handler to nul. */\r\n\t$pdo \t = null;\r\n\r\n\t/* returning true if everything ig going well. */\r\n\treturn true;\r\n}", "private function PrepStatement()\n\t{\n\t\t$this->stmt = $this->prepare($this->query->statement);\n\t\tif($this->query->parameters !==NULL && $this->query->paramtype !==NULL\n\t\t\t&& count($this->query->parameters) == count($this->query->paramtype))\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, $this->query->paramtype[$parameter]);\n\t\t\t}\n\t\t}\n\t\telseif ($this->query->parameters!==NULL)\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, pdo::PARAM_STR);\n\t\t\t}\n\t\t}\n\t}", "public function insert( )\n {\n $sql_insert_string = $this->formatInsertCommand( );\n if ( $sql_insert_string == false )\n return false;\n\n $l_result = $this->query( $sql_insert_string );\n $this->clearDataBuffer( );\n if($l_result)\n return @mysql_insert_id(underQL::$db_handle);\n\n return false;\n }", "private function _prepareMessageInsertStatement()\n {\n $stmtName = '_insertMessageStatement';\n if ($this->$stmtName) {\n return true;\n }\n\n $prefix = $this->_tablePrefix;\n $queryString = 'INSERT INTO `'.$prefix.'Messages` ';\n $queryString .= '(`transaction`, `message`, `createDate`)';\n $queryString .= 'VALUES';\n $queryString .= '(:transID, :message, NOW())';\n return $this->_prepareGenericStatement(\n $stmtName,\n $queryString\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 insert_update_exec($sql){\n\t$conn = connect();\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\toci_commit($conn);\n\toci_free_statement($statement);\n\toci_close($conn);\n\techo \"Success \";\n}", "function insert($query, $param_type, $param_value_array) {\n $sql = $this->connection->prepare($query);\n $this->bindQueryParams($sql, $param_type, $param_value_array);\n $sql->execute();\n $insertId = $sql->insert_id;\n return $insertId;\n }", "public function testInsertSqlIsProperlyPrepared()\n {\n $batch_insert = $this->connection->batchInsert('writers', ['name', 'birthday']);\n\n $property = (new \\ReflectionClass(BatchInsert::class))->getProperty('sql_foundation');\n $property->setAccessible(true);\n\n $sql_foundation = $property->getValue($batch_insert);\n\n $this->assertEquals('INSERT INTO `writers` (`name`, `birthday`) VALUES ', $sql_foundation);\n }", "public function insert(){\r\n\t\tif (!$this->new){\r\n\t\t\tMessages::msg(\"Cannot insert {$this->getFullTableName()} record: already exists.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\t$vals[\"`$name`\"] = $value->getSQLValue();\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$sql = 'INSERT INTO '.$this->getFullTableName().' ('.implode(', ',array_keys($vals)).') VALUES ('.implode(', ',$vals).')';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to insert record into '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t// Get this here, because getPrimaryKey can call other SQL queries and thus override this value\r\n\t\t$auto_id = SQL::getInsertId();\r\n\t\t\r\n\t\t$table = $this->getTable();\r\n\t\t// Load the AUTO_INCREMENT value, if any, before marking record as not new (at which point primary fields cannot be changed)\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\tif ($table->getColumn($name)->isAutoIncrement()){\r\n\t\t\t\t$this->$name = $auto_id;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->new = false;\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function insert($insertConnection,$title,$description,$dueDate,$addDate,$editDate,$isDone){\n try {\n $query =\"INSERT INTO $this->tableName (title,description,dueDate,addDate,editDate,isDone)\n VALUES ('$title','$description','$dueDate','$addDate','$editDate','$isDone')\";\n $insertConnection->exec($query);\n echo json_encode(\"New record created successfully\");\n $insertConnection = null;\n } catch (PDOException $e) {\n echo json_encode(\"Execute failed: \".$e->getMessage());\n }\n }", "function createTask($taskName, $task_status, $task_time, $list_id) {\n if (isset($taskName)) {\n $dbconn = DBconnection();\n \n // prepares the statement to create the tasks\n $query = $dbconn->prepare(\"INSERT INTO Tasks (task_name, list_id, task_time, task_status) VALUES (:task_name, :list_id, :task_time, :task_status)\");\n $query->bindParam(':task_name', $taskName);\n $query->bindParam(':list_id', $list_id);\n $query->bindParam(':task_time', $task_time);\n $query->bindParam(':task_status', $task_status);\n $query->execute();\n }\n return $query;\n\n}", "static function execute($sql,$values,$types=null) {\n\t\t$stmt = self::prepareCommand($sql,$values,$types);\n\t\tif(strpos(strtolower(trim($sql)),'insert')===0) {\n\t\t\treturn $stmt->insert_id;\n\t\t}\n\t\treturn $stmt->affected_rows;\n\t}", "function addRow($question, $answer, $deckId)\r\n{\r\n global $dbh;\r\n\r\n $sql = \"INSERT INTO flashcard (question, answer, deckId) VALUES (:question, :answer, :deckId)\";\r\n\r\n // 2. prepare the statement\r\n $statement = $dbh->prepare($sql);\r\n\r\n // 3. bind parameters\r\n $statement->bindParam(':question', $question, PDO::PARAM_STR);\r\n $statement->bindParam(':answer', $answer, PDO::PARAM_STR);\r\n $statement->bindParam(':deckId', $deckId, PDO::PARAM_INT);\r\n\r\n $success = $statement->execute();\r\n return $success;\r\n}", "public function execute(): Statement;", "function insertContact($fname, $mname, $lname, $connection){\n if ($stmt = $connection->prepare(\"INSERT INTO Contact (Fname, Mname, Lname) VALUES ( ?, ?, ?)\")){\n \n $stmt->bind_param(\"sss\", $fname, $mname,$lname);\n\n if ($stmt->execute()) {\n echo \"Contact insert succeeded! - contact-id\" . $connection->insert_id;\n }\n else {\n echo \"Contact insert failed!\";\n exit();\n }\n $stmt->close();\n }\n}", "function insert(\\PDO $pdo) {\n\tif($this->commentId !== null) {\n\t\tthrow (new \\PDOException((\"not a new comment\"));\n\t}\n\n\t// create query template\n\n}", "protected function _postInsert()\n\t{\n\t}", "function insertRow($insertObject){\n $dbh = dbConnect();\n if(!$dbh){\n return false;\n }\n $keystring = $insertObject->colString();\n $valuesString = \"\";\n for ($i=0; $i < $insertObject->getTableSize(); $i++)\n {\n $valuesString .= \"?\";\n if($i < $insertObject->getTableSize() - 1){\n $valuesString .= \",\";\n }\n }\n $sql = \"INSERT INTO \".$insertObject::TABLENAME.\"($keystring)\".\" VALUES ($valuesString)\";\n $stmt = mysqli_prepare($dbh, $sql); //creates a statement, a container we can pass back and forth from database\n //$args = array(buildtypestring($dbh, $insertObject::TABLENAME));\n $values = $insertObject->getArray();\n array_unshift($values, buildtypestring($dbh, $insertObject::TABLENAME));\n call_user_func_array(array($stmt,\"bind_param\"), $values); //call bind param on stmt with args\n $result = $stmt->execute();\n if(!$result){\n logSQLError($stmt);\n mysqli_close($dbh);\n return false;\n }\n mysqli_close($dbh);\n return true;\n }", "public function insertData($sql, $param1, $param2, $param3) {\n $stmt = $this->con->stmt_init();\n if(!$stmt->prepare($sql)) {\n throw new \\Exception( 'Prepare failed' );\n } else {\n $stmt->bind_param(\"sss\", $param1, $param2, $param3);\n $stmt->execute();\n }\n }", "public function insert()\n {\n $sql = \"INSERT INTO \" . self::TABLE_NAME . \"(news_name,\n news_slug,\n news_content,\n news_seo_title,\n news_seo_description,\n news_publish_date,\n news_add_date,\n news_update_date,\n user_id,\n status)\n VALUES (?,?,?,?,?,?,?,?,?,?)\";\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"ssssssssii\",\n $this->getNewsName(),\n $this->getNewsSlug(),\n $this->getNewsContent(),\n $this->getNewsSeoTitle(),\n $this->getNewsSeoDescription(),\n $this->getNewsPublishDate(),\n $this->getNewsAddDate(),\n $this->getNewsUpdateDate(),\n $this->getUserId(),\n $this->getStatus()\n );\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n }", "function insert($user)\n{ \n $cmd = 'INSERT INTO ' . TABLE . ' (name, price) ' .\n 'VALUES (:name, :price)';\n $sql = $GLOBALS['db']->prepare($cmd);\n $sql->bindValue(':name', $user['name']);\n $sql->bindValue(':price', $user['price']);\n $sql->execute();\n}", "public function insert(){\n $sql = \"INSERT INTO author(\n name,\n job,\n created_at\n )\n VALUES(\n 'tgedf', 'sdvsdv', NOW())\";\n return $this->pdo->exec($sql);\n\n }", "static function prepareCommand($sql,$values=array(),$types=null) {\n\t\tif(self::$resource) {\n\t\t\t$stmt = self::$resource->prepare($sql);\n\t\t\tif($stmt) {\n\t\t\t\t/**\n\t\t\t\t * Use sequence of \"s\" (String) if no type list given.\n\t\t\t\t */\n\t\t\t\tif($types === null) {\n\t\t\t\t\t$types = str_repeat('s',count($values)); \n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * Bind parameters\n\t\t\t\t */\n\t\t\t\tif(strlen($types)) {\n\t\t\t\t $args = $values;\n\t\t\t\t array_unshift($args,$types);\n\t\t\t\t call_user_func_array(array($stmt,\"bind_param\"), $args);\n\t\t\t\t}\t\t\n\t\t\t} else {\n\t\t\t\tthrow new Exception('MYSQL: Statement could not be created');\n\t\t\t}\n\t\t\tif($stmt->execute()) {\n\t\t\t\treturn $stmt;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "function ajouterArticle($data){ \n global $connexion;\n $requete = $connexion -> prepare('\n INSERT INTO articles\n (title, created_at, modified_at, introduction, content, image_url, category_id) \n VALUES \n (:title, NOW(), NOW(), :introduction, :content, :image_url, :category_id)');\n $requete -> execute([\n ':title' => $data['title'],\n ':introduction' => $data['introduction'],\n ':content' => $data['content'],\n ':image_url' => $data['image_url'],\n ':category_id' => $data['category_id']\n ]);\n $idNewArticle = $connexion -> lastInsertId();\n return $idNewArticle;\n \n \n}", "function insert($bd,$data){\n$data_one = \"\";\n$data_two = \"\";\n$contador = count($data);\n$i = 1;\nforeach ($data as $key => $value) {\n\t\tif($i < $contador){\n\t\t\t$data_one .= $key.\",\";\n\t\t\t$data_two .= \":\".$key.\",\";\n\t\t}else{\n\t\t\t$data_one .= $key;\n\t\t\t$data_two .= \":\".$key;\n\t\t}\n\t\t$i++;\n}\n $sql = \"INSERT INTO \".$bd.\" (\".$data_one.\") VALUES (\".$data_two.\")\";\n$conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute($data);\n//$stmt = null;\nreturn $dato;\n}", "public function insertRecords(){\n // Get the sql statement\n $sql = $this->insertSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->paramsValues as $key=>$value) {\n $stmt->bindParam($this->params['columnNamePdo'][$key], $this->paramsValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }", "function insert($values){\n $query = \"insert into \" . $this->tableName . \" (\";\n $separator = \"\";\n \n foreach ($values as $key => $value){\n $query .= $separator . \"`\" . $key . \"`\";\n $separator = \", \";\n \n }\n $query .= \") values (\";\n $separator = \"\";\n \n foreach ($values as $key => $value){\n $query .= $separator . \"'\" . $value . \"'\";\n $separator = \", \";\n \n }\n $query .= \");\";\n\n $this->dbh->query($query); \n return $this->dbh->insert_id;\n \n }", "public function executeInsert($query)\n {\n $stmt = parent::prepare($query);\n\n if ($stmt) {\n # execute query\n $stmt->execute();\n\n return $stmt->rowCount();\n } else {\n return self::get_error();\n }\n }", "function insertQuery($sql)\n {\n\t\t\tif($this->rsQry = $this->parse($sql)) \n {\n\t\t\t\t$this->sql = $sql;\n\t\t\t\t\n\t\t\t\t$this->no_of_rows = $this->getNRows();\n\t\t $this->no_of_colums = $this->getNCols(); //Fetch no of rows affected....\n\t\t\t\t$this->close();\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n else\n { \n //echo \"Exit Part\";\n\t\t\t\treturn 0x00; \n\t\t\t}\n\t\t}", "protected function _insert()\n {\r\n $this->date_created = new Zend_Db_Expr(\"NOW()\");\r\n return parent::_insert();\n }", "abstract protected function platformInsertStatement($table, array $keys, array $values);", "public abstract function getInsertSQL($into, $data, $values);", "public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }", "public function execute()\n {\n if (isset($this->preparedQuery))\n {\n $result = $this->preparedQuery->execute();\n\n if ($result === false)\n {\n die('Execute() failed: ' . htmlspecialchars($this->preparedQuery->error));\n }\n\n $this->lastInsertId = $this->connection->insert_id;\n\n return true;\n }\n\n return false;\n }", "public function create(){\n\n try {\n //mysql_real_escape_string($clean)\n $this->_query = \"INSERT INTO \". $this->_dbtable .\" SET usuario = :usuario,contrasena = :contrasena,nombre = :nombre, apellido = :apellido, email = :email, telefono = :telefono\";\n\n // preparing statement\n $statement = $this->_conn->prepare($this->_query);\n\n // sanitizing parameters\n\n $this->usuario = Sanatize::xss_cleaner($this->usuario);\n $this->contrasena = Sanatize::xss_cleaner($this->contrasena);\n $this->nombre = Sanatize::xss_cleaner($this->nombre);\n $this->apellido = Sanatize::xss_cleaner($this->apellido);\n $this->email = Sanatize::xss_cleaner($this->email);\n $this->telefono = Sanatize::xss_cleaner($this->telefono);\n\n // binding params\n\n $statement->bindParam(':usuario', $this->usuario);\n $statement->bindParam(':contrasena', $this->contrasena);\n $statement->bindParam(':nombre', $this->nombre);\n $statement->bindParam(':apellido' ,$this->apellido);\n $statement->bindParam(':email', $this->email);\n $statement->bindParam(':telefono', $this->telefono);\n\n // executing statement\n if($statement->execute()){\n return true;\n }\n\n else{\n\n return false;\n }\n\n }\n\n catch (PDOException $ex) {\n echo \"Error\" . $ex->getMessage();\n }\n\n }", "public function insert($userid) {\r\n $sql = \"insert into bestelling (userid) values(?)\";\r\n $args = func_get_args();\r\n $stmt=parent::execPreppedStmt($sql, $args);\r\n return $stmt;\r\n }" ]
[ "0.7092085", "0.7036482", "0.7028186", "0.7021255", "0.6834408", "0.6658364", "0.66447985", "0.65978837", "0.65733945", "0.6542247", "0.64734507", "0.6438996", "0.6424913", "0.64090914", "0.63708663", "0.6348044", "0.6334525", "0.6332908", "0.63192165", "0.6317543", "0.6299603", "0.62973785", "0.62813187", "0.6268275", "0.62637746", "0.6248989", "0.6243425", "0.6230997", "0.6226929", "0.6219307", "0.62109125", "0.6204192", "0.62033457", "0.6193738", "0.6184213", "0.6168307", "0.61613", "0.61567724", "0.61567724", "0.61551344", "0.6146834", "0.61406076", "0.6132037", "0.6131262", "0.61306095", "0.6127087", "0.6126842", "0.60908616", "0.60818714", "0.6070774", "0.6066212", "0.60596406", "0.6057768", "0.6057541", "0.60565734", "0.6048984", "0.6042361", "0.6036879", "0.6036326", "0.6029203", "0.6027802", "0.6026136", "0.602518", "0.6022199", "0.6021959", "0.6019292", "0.6015718", "0.60126984", "0.60016423", "0.5994704", "0.5989567", "0.5986884", "0.5982288", "0.5980419", "0.5977219", "0.59742993", "0.59688026", "0.59660953", "0.5965533", "0.59612364", "0.59601814", "0.5957548", "0.59494984", "0.59455216", "0.59431696", "0.5942986", "0.5941252", "0.59394306", "0.59367543", "0.59366834", "0.5936457", "0.59358776", "0.59237903", "0.5922025", "0.59163433", "0.5911435", "0.59067434", "0.5906593", "0.5900324", "0.5893152" ]
0.65067697
10
_insert() Prepare SELECT request
protected function _select($columns) { // SELECT $this->_query = 'SELECT '; // * / row1, row2 $first = true; foreach($columns as $column) { $this->_query .= ($first) ? ('') : (' , '); $first = false; $this->_query .= $column; } // foreach // FROM 'table' $this->_query .= ' FROM '.$this->_table; // WHERE foo = 'bar' $this->_query .= ' WHERE '; $imax = count($this->_where); $first = true; for($i=0; $i<$imax; $i++) { $this->_query .= ($first) ? ('') : (' AND '); $first = false; $this->_query .= $this->_where[$i]['row'].' '; $this->_query .= $this->_where[$i]['condition'].' \''; $this->_query .= $this->_where[$i]['value'].'\''; } // foreach // LIMIT Offset, Depth if ($this->_limit !== null) { $this->_query .= ' LIMIT '.$this->_limit['offset'].', '.$this->_limit['depth']; } // if // end ; $this->_query .= ';'; return $this->_query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertRequestToDb()\n\t\t{\n\t\t\t$this->columnsInfo->data_seek(0);\n\t\t\t$columns = \"\";\n\t\t\t$values = \"\";\n\t\t\twhile($rowColumn = $this->columnsInfo->fetch_assoc())//$info->fetch_row\n\t\t\t{\n\t\t\t\tif($rowColumn[\"EXTRA\"] == \"auto_increment\")\n\t\t\t\t\tcontinue;\n\t\t\t\t$columns = $columns.\", \".$rowColumn[\"COLUMN_NAME\"];\n\t\t\t\t$val = \"\";\n\t\t\t\tif($rowColumn[\"COLUMN_NAME\"] == \"sid_a\")\n\t\t\t\t\t$val = $_SESSION[\"sid\"];\n\t\t\t\telse if($rowColumn[\"COLUMN_NAME\"] == \"date_a\")\n\t\t\t\t\t$val = \"now()\";\n\t\t\t\telse $val = $this->insertColumnValue($_REQUEST[$rowColumn[\"COLUMN_NAME\"]], $rowColumn[\"IS_NULLABLE\"], $rowColumn[\"DATA_TYPE\"], $rowColumn[\"CHARACTER_MAXIMUM_LENGTH\"]);\n\t\t\t\t$values = \"$values, $val\";\n\t\t\t}\n\t\t\t$columns = substr($columns, 2, strlen($columns));\n\t\t\t$values = substr($values, 2, strlen($values));\n\n\t\t\t$query = \"INSERT INTO $this->table ($columns) values($values);\";\n\t\t\t$GLOBALS[\"db\"]->query($query);\n\t\t\t//$info->free();\n\t\t}", "private function _prepareTransactionInsertStatement()\n {\n $stmtName = '_insertTransactionStatement';\n\n $prefix = $this->_tablePrefix;\n $queryString = 'INSERT INTO `'.$prefix.'Transactions` ';\n $queryString .= '(`transactionID`, `createDate`, `modifyDate`)';\n $queryString .= 'VALUES';\n $queryString .= '(:transID, NOW(), NOW())';\n return $this->_prepareGenericStatement(\n $stmtName,\n $queryString\n );\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}", "abstract public function prepareSelect();", "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 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}", "protected function _insert()\n\t{\n\t}", "public function insert() {\n\t\t\t\n\t\t\t$insert_array = $this->buildInsertFields();\n\t\t\t$query = \"INSERT INTO \" . $this->table_name . \" (\" . $insert_array['insert_statement'] . \") VALUES (\" . \n\t\t\t\t\t\t\t\t\t$insert_array['values_statement'] . \")\";\n\t\t\treturn $this->query($query, $insert_array['bind_params']);\n\n\t\t}", "public function testInsertWithSelectStatement()\n {\n $this->db->insert(\"test\", \"SELECT id FROM settings\");\n $this->assertEquals(\"INSERT INTO test SELECT id FROM settings\", (string) $this->db);\n }", "protected function prepareSelectStatement() {}", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\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 insert_select($totable='', $tocolumns='*', $fromtable, $fromcolumns='*', ...$fromwhere) {\n $puttotable = $this->_query_insert_replace($totable, $tocolumns, 'INSERT', false);\n $getfromtable = $this->select_sql($fromtable, $fromcolumns, ...$fromwhere);\n if (is_string($puttotable) && is_string($getfromtable))\n return (($this->getPrepare()) && !empty($this->getParamaters())) ? $this->query($puttotable.\" \".$getfromtable, true) : $this->query($puttotable.\" \".$getfromtable) ;\n else {\n\t\t\t$this->setParamaters();\n return false; \t\t\t\n\t\t} \n }", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }", "protected function RetInsert() {\n\n if (!isset($this->\n tables[0])) {\n\n throw new \\Exception(\"Error: Table not properly provided in QueryHelper.\");\n }\n\n if (!(is_array($this->\n values) &&\n count($this->\n values)) &&\n !($this->\n values instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $this->\n values->\n IsSelect())) {\n\n throw new \\Exception(\"Error: Values not properly provided in QueryHelper.\");\n }\n\n if ($this->\n values instanceof \\FluitoPHP\\Database\\DBQueryHelper &&\n $this->\n values->\n IsSelect()) {\n\n $this->\n values->\n GetRow();\n\n $columnsInfo = $this->\n values->\n GetColInfo();\n\n $columns = [];\n\n foreach ($columnsInfo as $value) {\n\n $columns[] = $value->\n name;\n }\n\n $return = \"INSERT INTO `{$this->\n tables[0]}` (`\" . implode(\"`, `\", $columns) . \"`) \" . $this->\n values->\n Generate();\n } else {\n\n $multi = false;\n $columns = array_keys($this->\n values);\n\n $valuesArr = [];\n\n if (!is_string($columns[0])) {\n\n if (!is_array($this->\n values[$columns[0]])) {\n\n throw new \\Exception(\"Error: Values not properly provided in QueryHelper.\");\n }\n\n $columns = array_keys($this->\n values[$columns[0]]);\n\n $multi = true;\n }\n\n\n $return = \"INSERT INTO `{$this->\n tables[0]}` (`\" . implode(\"`, `\", $columns) . \"`) VALUES \";\n\n\n if ($multi) {\n\n foreach ($this->\n values as $row) {\n\n $values = array_values($row);\n\n foreach ($values as $key => $value) {\n\n if (is_string($value)) {\n\n $value = $this->\n connection->\n GetConn()->\n real_escape_string($value);\n $values[$key] = \"'{$value}'\";\n } else if (isset($value['function'])) {\n\n $values[$key] = $value['function'];\n }\n }\n\n $valuesArr[] = \"(\" . implode(\", \", $values) . \")\";\n }\n } else {\n\n $values = array_values($this->\n values);\n\n foreach ($values as $key => $value) {\n\n if (is_string($value)) {\n\n $value = $this->\n connection->\n GetConn()->\n real_escape_string($value);\n $values[$key] = \"'{$value}'\";\n } else if (isset($value['function'])) {\n\n $values[$key] = $value['function'];\n }\n }\n\n $valuesArr[] = \"(\" . implode(\", \", $values) . \")\";\n }\n\n $return .= implode(\", \", $valuesArr) . \";\";\n }\n\n return $return;\n }", "function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}", "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\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$insertCols .= \"lp_userid, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$insertCols .= \"lp_random, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$insertCols .= \"lp_deadline, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\t\t\t\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\t\t\t\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the id property\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\t\t\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\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: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "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 process_query_insert( $query )\n\t{\n\t\treturn $query;\n\t}", "public function insert(){\n\t\t$parametro = func_get_args();\n\t\t$resultado = $this->execSql($this->INSERT,$parametro);\n//\t\t\tdie();\n\t\tif(!$resultado){\n\t\t\t$this->onError(\"COD_INSERT\",$this->INSERT);\n\t\t}\n\t\treturn $resultado;\n\t}", "protected function prepareSaveStatement() {\n $fields = implode(',', $this->columns);\n\n $placeholders = [];\n foreach ($this->columns as $column) {\n $placeholders[] = ':' . $column;\n }\n $placeholders = implode(',', $placeholders);\n\n // Prepare our statement.\n return $this->connection->prepare(\"INSERT INTO {$this->table} ($fields) VALUES ($placeholders)\");\n }", "public function 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 }", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "function test_insert($urabe, $body)\n{\n $insert_params = $body->insert_params;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->insert($table_name, $insert_params);\n}", "protected function _insert()\n {\r\n $this->date_created = new Zend_Db_Expr(\"NOW()\");\r\n return parent::_insert();\n }", "public function Insert(){\r\n $query = \"INSERT INTO \". $this->_table_name .\"(ITEM_ID , USER_ITEM_ID , USER_FROM , USER_TO , TOO , IO_TYPE , MODE , TRANK_NO , PERMIT_ID , TYPE , NOTE , IN_UNIT , IN_SUBUNIT , LONGDATE , STATUS , CREATE_ON , CREATE_BY , MODIFY_ON , MODIFY_BY , IS_ACTIVE) \r\n VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) \" ; \r\n $success = 0;\r\n try{\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam (1 , $this->getItemId()); \r\n $stmt->bindParam (2 , $this->getUserItemId()); \r\n $stmt->bindParam (3 , $this->getUserFrom()); \r\n $stmt->bindParam (4 , $this->getUserTo()); \r\n $stmt->bindParam (5 , $this->getToo()); \r\n $stmt->bindParam (6 , $this->getIoType()); \r\n $stmt->bindParam (7 , $this->getMode()); \r\n $stmt->bindParam (8 , $this->getTrankNo()); \r\n $stmt->bindParam (9 , $this->getPermitId()); \r\n $stmt->bindParam (10 , $this->getType()); \r\n $stmt->bindParam (11 , $this->getNote()); \r\n $stmt->bindParam (12 , $this->getInUnit()); \r\n $stmt->bindParam (13 , $this->getInSubunit()); \r\n $stmt->bindParam (14 , $this->getLongdate()); \r\n $stmt->bindParam (15 , $this->getStatus()); \r\n $stmt->bindParam (16 , $this->getCreateOn()); \r\n $stmt->bindParam (17 , $this->getCreateBy()); \r\n $stmt->bindParam (18 , $this->getModifyOn()); \r\n $stmt->bindParam (19 , $this->getModifyBy()); \r\n $stmt->bindParam (20 , $this->getIsActive()); \r\n\r\n $stmt->execute(); \r\n $this->setId($this->conn->lastInsertId());\r\n $success = 1;}\r\n catch(PDOException $ex){ echo $ex->getMessage(); } \r\n return $success;}", "private function insertResponseIntoDatabase()\n {\n $sql = \"INSERT INTO weather(city, country, min, max, stamp, temp) \n VALUES (:city, :country, :min, :max, NOW(), :temp)\";\n\n $stmt = $this->pdo->prepare($sql);\n $stmt->bindParam(':city', $this->response['city']);\n $stmt->bindParam(':country', $this->response['country']);\n $stmt->bindParam(':min', $this->response['min']);\n $stmt->bindParam(':max', $this->response['max']);\n $stmt->bindParam(':temp', $this->response['temp']);\n $stmt->execute();\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 abstract function getInsertSQL($into, $data, $values);", "abstract public function insert();", "function test_insert_bulk($urabe, $body)\n{\n $bulk = $body->insert_bulk;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->insert_bulk($table_name, $bulk->columns, $bulk->values);\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 addInsert() {\n if(count($this->cols) != 0) {\n // Only use the parameters that match with columns\n $params = array_slice($this->params, 0, count($this->cols));\n $this->sql .= \" (\" . implode(\", \", $this->cols) . \")\";\n $this->sql .= \" VALUES (\" . implode(\", \", $this->params) . \")\";\n }\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}", "public function addToInsertSQLArray();", "public function insert()\n {\n return new QueryProxy('insert', $this);\n }", "public function insert(...$field_values);", "function insert($conn,$table,$data)\n {\n }", "public abstract function insert();", "static function &QueryInsert($id, $table, $values, $extra=NULL) {\n Profiler::StartTimer(\"DataManager::QueryInsert()\");\n Profiler::StartTimer(\"DataManager::QueryInsert($id)\", 3);\n $qstart = microtime(true);\n $insert_id = NULL;\n $queryid = new DatamanagerQueryID($id);\n if ($source =& DataManager::PickSource($queryid)) {\n $insert_id = $source->QueryInsert($queryid, $table, $values, $extra);\n if ($insertid) {\n DataManager::CacheClear($id);\n }\n }\n Profiler::StopTimer(\"DataManager::QueryInsert()\");\n Profiler::StopTimer(\"DataManager::QueryInsert($id)\");\n self::log(\"insert\", $id, $table, $qstart, microtime(true));\n return $insert_id;\n }", "abstract protected function doInsert($subject, Statement $insertStatement);", "private function insertStatement() {\n $altitude = empty($_POST['alt']) ? null : $_POST['alt'];\n $latitude = empty($_POST['lat']) ? null : $_POST['lat'];\n $longitude = empty($_POST['lon']) ? null : $_POST['lon'];\n\n $date_fallback = empty($_SERVER[\"REQUEST_TIME\"]) ? time() : $_SERVER[\"REQUEST_TIME\"];\n\n $date = empty($_POST['date']) ? $date_fallback : $_POST['date'];\n\n\n $status_table = TABLE_PREFIX.\"status\";\n $insert_stmt = $this->db_connection->prepare(\"INSERT INTO \"\n\t\t\t\t\t\t . $status_table\n\t\t\t\t\t\t . \" (message,ip,date,lon,lat,alt) VALUES (?,?,?,?,?,?)\");\n\n $insert_stmt->bind_param(\"ssiddd\",\n\t\t\t $_POST[\"message\"], \n\t\t\t $_SERVER['REMOTE_ADDR'], \n\t\t\t $date,\n\t\t\t $longitude,\n\t\t\t $latitude,\n\t\t\t $altitude );\n $insert_stmt->execute();\n\n $rows_inserted = $insert_stmt->affected_rows;\n\n if ( $rows_inserted ) {\n $this->log($rows_inserted.\" rows inserted\");\n return true;\n }\n else{\n $this->log(\"Insert error, 0 rows inserted\");\n return false;\n }\n \n }", "public function insert($sql) {\n return $this->datai($sql);\n }", "protected function _postInsert()\n\t{\n\t}", "function insert($bd,$data){\n$data_one = \"\";\n$data_two = \"\";\n$contador = count($data);\n$i = 1;\nforeach ($data as $key => $value) {\n\t\tif($i < $contador){\n\t\t\t$data_one .= $key.\",\";\n\t\t\t$data_two .= \":\".$key.\",\";\n\t\t}else{\n\t\t\t$data_one .= $key;\n\t\t\t$data_two .= \":\".$key;\n\t\t}\n\t\t$i++;\n}\n $sql = \"INSERT INTO \".$bd.\" (\".$data_one.\") VALUES (\".$data_two.\")\";\n$conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute($data);\n//$stmt = null;\nreturn $dato;\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 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 insert($query, $param_type, $param_value_array) {\n $sql = $this->connection->prepare($query);\n $this->bindQueryParams($sql, $param_type, $param_value_array);\n $sql->execute();\n $insertId = $sql->insert_id;\n return $insertId;\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($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\treturn $this->pdo->lastInsertId();\n\t}", "function insertIntoRequests($db, $upload_book_id, $days, $borrower_id, $lender_id){\n echo \"inster\";\n try {\n $query = 'INSERT INTO requests (uploaded_book_id, days, borrower_id,lender_id) VALUES (:np_uploaded_book_id, :np_days, :np_borrower_id, :np_lender_id)';\n $statement = $db->prepare($query);\n echo \"inster1\";\n $statement->bindValue(':np_uploaded_book_id', $upload_book_id);\n $statement->bindValue(':np_days', $days);\n $statement->bindValue(':$borrower_id', $borrower_id);\n $statement->bindValue(':np_lender_id', $lender_id);\n $statement->execute();\n } catch (PDOException $e) {\n $error = $e->getMessage();\n include('database_error.php');\n exit();\n }\n \n}", "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 }", "function query_tb($new_insert) {\r\n\t\t$in = $this->session_vars;\r\n\t\t$conn = $this->conn;\r\n\t\t$dir_file = $this->uploaded_files_dir;\r\n\t\t$sql = new query ( $conn );\r\n\t\t$i = 0;\r\n\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$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 come list var_glob. 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\r\n\t\t\tif ($val ['TYPE'] == 'ckeditor') {\r\n\t\t\t\tunset($values[$val['VAR']]);\r\n\t\t\t\tforeach ( $field_obj->value_stmt as $key_f => $val_f ) {\r\n\t\t\t\t\tif($key_f==$val['VAR'])\r\n\t\t\t\t\t$clob[$val['VAR']]=$val_f;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t/*Inserimento in coordinate*/\r\n\t\tif ($this->xmr) {\r\n\t\t\t$config_service = $this->config_service;\r\n\t\t\t$visitclose = '0';\r\n\t\t\tif( isset ( $in ['ID_QUERY'] ) && $in ['ID_QUERY']!=\"\"){\r\n\t\t\t\t$visitclose = 'visitclose';\r\n\t\t\t}\r\n\t\t\tif ($new_insert) {\r\n\r\n\r\n\t\t\t\tif ($config_service ['VISITNUM_PROGR'] == '1') {\r\n\t\t\t\t\t$sql_query = \"\r\n\t\t\t\t\t\tselect count(*) as c from \" . $this->service . \"_coordinate\r\n\t\t\t\t\t\t\twhere {$this->PK_SERVICE}=:pk_service\r\n\t\t\t\t\t\t\tand visitnum=:visitnum\r\n\t\t\t\t\t\t\tand esam=:esam\r\n\t\t\t\t\t\t\tand progr=:progr\r\n\t\t\t\t\t\t\tand VISITNUM_PROGR=:visitnum_progr\r\n\t\t\t\t\t\t\t \";\r\n\t\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t\tunset($bind);\r\n\t\t\t\t\t$bind['PK_SERVICE']=$in [$this->PK_SERVICE];\r\n\t\t\t\t\t$bind['VISITNUM']=$in ['VISITNUM'];\r\n\t\t\t\t\t$bind['ESAM']=$in ['ESAM'];\r\n\t\t\t\t\t$bind['PROGR']=$this->progr;\r\n\t\t\t\t\t$bind['VISITNUM_PROGR']=$in['VISITNUM_PROGR'];\r\n\t\t\t\t\t//$sql->set_sql ( $sql_query );\r\n\t\t\t\t\t$sql->exec ($sql_query,$bind);//binded\r\n\t\t\t\t\t$sql->get_row ();\r\n\t\t\t\t\t$count=$sql->row ['C'];\r\n\t\t\t\t\tif ($count > 0){\r\n\t\t\t\t\t\t$sql=new query($conn);\r\n\t\t\t\t\t\t$sql_first_insert=\"select insertdt from \" . $this->service . \"_coordinate where {$this->PK_SERVICE}=:pk_service and esam=:esam and visitnum=:visitnum and progr=:progr and VISITNUM_PROGR=:visitnum_progr\";\r\n\t\t\t\t\t\tunset($bind);\r\n\t\t\t\t\t\t$bind['PK_SERVICE']=$in [$this->PK_SERVICE];\r\n\t\t\t\t\t\t$bind['ESAM']=$in ['ESAM'];\r\n\t\t\t\t\t\t$bind['VISITNUM']=$in ['VISITNUM'];\r\n\t\t\t\t\t\t$bind['VISITNUM_PROGR']=$in ['VISITNUM_PROGR'];\r\n\t\t\t\t\t\t$bind['PROGR']=$this->progr;\r\n\t\t\t\t\t\t//$sql->set_sql ( $sql_first_insert );\r\n\t\t\t\t\t\t$sql->exec ($sql_first_insert,$bind);//binded\r\n\t\t\t\t\t\t$sql->get_row ();\r\n\t\t\t\t\t\tif ($sql->row['INSERTDT']=='') $this->sql_query_coordinate = \"update \" . $this->service . \"_coordinate set visitclose=$visitclose, moddt=sysdate,insertdt=sysdate, fine='\" . $in ['INVIOCO'] . \"', inizio='1' where {$this->PK_SERVICE}='\" . $in [$this->PK_SERVICE] . \"' and esam='\" . $in ['ESAM'] . \"' and visitnum='\" . $in ['VISITNUM'] . \"' and progr='\" . $this->progr . \"' and VISITNUM_PROGR='{$in['VISITNUM_PROGR']}'\";\r\n\t\t\t\t\t\telse $this->sql_query_coordinate = \"update \" . $this->service . \"_coordinate set visitclose=$visitclose, moddt=sysdate, fine='\" . $in ['INVIOCO'] . \"', inizio='1' where {$this->PK_SERVICE}='\" . $in [$this->PK_SERVICE] . \"' and esam='\" . $in ['ESAM'] . \"' and visitnum='\" . $in ['VISITNUM'] . \"' and progr='\" . $this->progr . \"' and VISITNUM_PROGR='{$in['VISITNUM_PROGR']}'\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t$this->sql_query_coordinate = \"\r\n\t\t\t\t\tinsert into \" . $this->service . \"_coordinate\r\n\t\t\t\t\t({$this->PK_SERVICE}, visitnum, esam, progr, inizio, fine, insertdt,moddt, userid, abilitato, visitclose,VISITNUM_PROGR)\r\n\t\t\t\t\tvalues (\" . $in [$this->PK_SERVICE] . \",'\" . $in ['VISITNUM'] . \"','\" . $in ['ESAM'] . \"','\" . $this->progr . \"','1','\" . $in ['INVIOCO'] . \"',sysdate,sysdate,'\" . $in ['remote_userid'] . \"','1',$visitclose, {$in['VISITNUM_PROGR']})\";\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t$sql_query = \"\r\n\t\t\t\t\tselect count(*) as c from \" . $this->service . \"_coordinate\r\n\t\t\t\t\t\twhere {$this->PK_SERVICE}=:pk_service\r\n\t\t\t\t\t\tand visitnum=:visitnum\r\n\t\t\t\t\t\tand esam=:esam\r\n\t\t\t\t\t\tand progr=:progr\r\n\t\t\t\t\t\t \";\r\n\t\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t\tunset($bind);\r\n\t\t\t\t\t$bind['PK_SERVICE']=$in [$this->PK_SERVICE];\r\n\t\t\t\t\t$bind['VISITNUM']=$in ['VISITNUM'];\r\n\t\t\t\t\t$bind['ESAM']=$in ['ESAM'];\r\n\t\t\t\t\t$bind['PROGR']=$in ['PROGR'];\r\n\t\t\t\t\t//$sql->set_sql ( $sql_query );\r\n\t\t\t\t\t$sql->exec ($sql_query,$bind); //binded\r\n\t\t\t\t\t$sql->get_row ();\r\n\t\t\t\t\t$count=$sql->row ['C'];\r\n\t\t\t\t\tif ($count > 0)\r\n\t\t\t\t\t$this->sql_query_coordinate = \"update \" . $this->service . \"_coordinate set visitclose=$visitclose, moddt=sysdate, fine='\" . $in ['INVIOCO'] . \"', inizio='1' where {$this->PK_SERVICE}='\" . $in [$this->PK_SERVICE] . \"' and esam='\" . $in ['ESAM'] . \"' and visitnum='\" . $in ['VISITNUM'] . \"' and progr='\" . $this->progr . \"'\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t$this->sql_query_coordinate = \"insert into \" . $this->service . \"_coordinate ({$this->PK_SERVICE}, visitnum, esam, progr, inizio, fine, insertdt,moddt, userid, abilitato, visitclose) values (\" . $in [$this->PK_SERVICE] . \",'\" . $in ['VISITNUM'] . \"','\" . $in ['ESAM'] . \"','\" . $this->progr . \"','1','\" . $in ['INVIOCO'] . \"',sysdate,sysdate,'\" . $in ['remote_userid'] . \"','1',$visitclose)\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$bindVars=null;\r\n\t\t\t\tif (isset ( $config_service ['VISITNUM_PROGR'] ) && $config_service ['VISITNUM_PROGR'] == 1){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->sql_query_coordinate = \"\r\n\t\t\t\t\tupdate \" . $this->service . \"_coordinate set \r\n\t\t\t\t\t\tvisitclose=$visitclose, \r\n\t\t\t\t\t\tmoddt=sysdate, \r\n\t\t\t\t\t\tfine=:fine, \r\n\t\t\t\t\t\tinizio='1' \r\n\t\t\t\t\twhere {$this->PK_SERVICE}=:pk_service \r\n\t\t\t\t\tand esam=:esam \r\n\t\t\t\t\tand visitnum=:visitnum \r\n\t\t\t\t\tand progr=:progr \r\n\t\t\t\t\tand VISITNUM_PROGR=:visitnum_progr\"; //binded\r\n\t\t\t\t\t$bindVars['visitclose']=$visitclose;\r\n\t\t\t\t\t$bindVars['pk_service']=$in [$this->PK_SERVICE];\r\n\t\t\t\t\t$bindVars['fine']=$in ['INVIOCO'];\r\n\t\t\t\t\t$bindVars['esam']=$in ['ESAM'];\r\n\t\t\t\t\t$bindVars['visitnum']=$in ['VISITNUM'];\r\n\t\t\t\t\t$bindVars['progr']=$this->progr;\r\n\t\t\t\t\t$bindVars['visitnum_progr']=$in['VISITNUM_PROGR'];\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$this->sql_query_coordinate = \"\r\n\t\t\t\t\tupdate \" . $this->service . \"_coordinate set \r\n\t\t\t\t\t\tvisitclose=$visitclose, \r\n\t\t\t\t\t\tmoddt=sysdate, \r\n\t\t\t\t\t\tfine='\" . $in ['INVIOCO'] . \"', \r\n\t\t\t\t\t\tinizio='1' \r\n\t\t\t\t\twhere {$this->PK_SERVICE}='\" . $in [$this->PK_SERVICE] . \"' \r\n\t\t\t\t\tand esam='\" . $in ['ESAM'] . \"' \r\n\t\t\t\t\tand visitnum='\" . $in ['VISITNUM'] . \"' \r\n\t\t\t\t\tand progr='\" . $this->progr . \"'\";\r\n\t\t\t\t\t$this->sql_query_coordinate = \"\r\n\t\t\t\t\tupdate \" . $this->service . \"_coordinate set \r\n\t\t\t\t\t\tvisitclose=$visitclose, \r\n\t\t\t\t\t\tmoddt=sysdate, \r\n\t\t\t\t\t\tfine=:fine, \r\n\t\t\t\t\t\tinizio='1' \r\n\t\t\t\t\twhere {$this->PK_SERVICE}=:pk_service \r\n\t\t\t\t\tand esam=:esam \r\n\t\t\t\t\tand visitnum=:visitnum \r\n\t\t\t\t\tand progr=:progr\"; //binded\r\n\t\t\t\t\t$bindVars['visitclose']=$visitclose;\r\n\t\t\t\t\t$bindVars['pk_service']=$in [$this->PK_SERVICE];\r\n\t\t\t\t\t$bindVars['fine']=$in ['INVIOCO'];\r\n\t\t\t\t\t$bindVars['esam']=$in ['ESAM'];\r\n\t\t\t\t\t$bindVars['visitnum']=$in ['VISITNUM'];\r\n\t\t\t\t\t$bindVars['progr']=$this->progr;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$sql = new query ( $conn );\r\n\t\t\t$sql->ins_upd ( $this->sql_query_coordinate, $bindVars ); //binded\r\n\t\t}\r\n\r\n\t\t/*\t\tInserimento in storico\t\t*/\r\n\t\t$where = $this->pk_where ();\r\n\t\tif (! $new_insert && ! isset ( $in ['ID_QUERY'] )){\r\n\t\t\t$this->sql_query_storico = \"\r\n\t\t\tinsert into S_\" . $this->form ['TABLE'] . \" \r\n\t\t\t\tselect \r\n\t\t\t\t\t'\" . $in ['remote_userid'] . \"', \r\n\t\t\t\t\tsysdate, \r\n\t\t\t\t\tstorico_id.nextval, \r\n\t\t\t\t\t'V', \r\n\t\t\t\t\t'', \r\n\t\t\t\t\t\" . $this->form ['TABLE'] . \".* \r\n\t\t\t\tfrom \" . $this->form ['TABLE'] . \" where $where\";\r\n\t\t\t$this->sql_query_storico = \"\r\n\t\t\tinsert into S_\" . $this->form ['TABLE'] . \" \r\n\t\t\t\tselect \r\n\t\t\t\t\t:remote_userid, \r\n\t\t\t\t\tsysdate, \r\n\t\t\t\t\tstorico_id.nextval, \r\n\t\t\t\t\t'V', \r\n\t\t\t\t\t'', \r\n\t\t\t\t\t\" . $this->form ['TABLE'] . \".* \r\n\t\t\t\tfrom \" . $this->form ['TABLE'] . \" where $where\"; //binded\r\n\t\t\t$bindVars1=null;\r\n\t\t\t$bindVars1[\"remote_userid\"]=$in ['remote_userid'];\r\n\t\t\t\r\n\t\t}\r\n\t\tif (! $new_insert && isset ( $in ['ID_QUERY'] )){\r\n\t\t\t$this->sql_query_storico = \"\r\n\t\t\tinsert into S_\" . $this->form ['TABLE'] . \" \r\n\t\t\t\tselect '\" . $in ['remote_userid'] . \"', \r\n\t\t\t\tsysdate, storico_id.nextval, 'E', \r\n\t\t\t\t'\" . $in ['ID_QUERY'] . \"', \" . $this->form ['TABLE'] . \".* \r\n\t\t\t\tfrom \" . $this->form ['TABLE'] . \" where $where\";\r\n\t\t\t$this->sql_query_storico = \"\r\n\t\t\tinsert into S_\" . $this->form ['TABLE'] . \" \r\n\t\t\t\tselect :remote_userid, \r\n\t\t\t\tsysdate, storico_id.nextval, 'E', \r\n\t\t\t\t:id_query, \" . $this->form ['TABLE'] . \".* \r\n\t\t\t\tfrom \" . $this->form ['TABLE'] . \" where $where\"; //binded\r\n\t\t\t$bindVars1=null;\r\n\t\t\t$bindVars1[\"remote_userid\"]=$in ['remote_userid'];\r\n\t\t\t$bindVars1[\"id_query\"]=$in ['ID_QUERY'];\r\n\t\t}if ($this->sql_query_storico != '') {\r\n\t\t\t$sql = new query ( $conn );\r\n\t\t\t$sql->ins_upd ( $this->sql_query_storico , $bindVars1); //binded\r\n\t\t}\r\n\r\n\t\t$values['PROGR']=$this->progr;\r\n\t\t/* \tInserimento nella tabella \t*/\r\n\t\t//Edo: qua metto gli array dei clob?\r\n\t\t//\t\tprint_r($clob);\r\n\t\tif ($new_insert) {\r\n\t\t\t$result = $sql->insert ( $values, $this->form ['TABLE'], $pk, true, null, $clob);\r\n\t\t} else {\r\n\t\t\t$result = $sql->update ( $values, $this->form ['TABLE'], $pk, $clob );\r\n\t\t}\r\n\t\t$this->session_vars = $in;\r\n\t\t$this->errors=$sql->getErrors();\r\n\r\n\t\t//G.Tufano 22/07/2010\r\n\t\t//restituisco l'ID del paziente appena creato, letto dalla sequence\r\n\t\t//per poterlo utilizzare altrove\r\n\t\t//(per esempio per la chiusura di una scheda \"registrazione\" \r\n\t\t$pk_serv_val = $in [$this->PK_SERVICE];\r\n\t\treturn $pk_serv_val;\r\n\r\n\t}", "public function testInsert()\n {\n $statement = $this->getQueryBuilderConnection()\n ->insert()\n ->into('querybuilder_tests')\n ->values(\n [\n 'id' => 10,\n 'languageId' => 1,\n 'field' => 'zzzz',\n ]\n )->execute();\n\n $this->assertInstanceOf(\\PDOStatement::class, $statement);\n $this->assertEquals(1, $statement->rowCount());\n\n $result = $this->getQueryBuilderConnection()\n ->select('count(1) as counter')\n ->from('querybuilder_tests')\n ->getOneField('counter');\n\n $this->assertEquals(11, $result);\n\n $statement = $this->getQueryBuilderConnection()\n ->insert(\n [\n 'id' => 11,\n 'languageId' => 1,\n 'field' => 'yyyy',\n ]\n )\n ->into('querybuilder_tests')\n ->execute();\n\n $this->assertInstanceOf(\\PDOStatement::class, $statement);\n $this->assertEquals(1, $statement->rowCount());\n\n $result = $this->getQueryBuilderConnection()\n ->select('count(1) as counter')\n ->from('querybuilder_tests')\n ->getOneField('counter');\n\n $this->assertEquals(12, $result);\n }", "function QueryInsert($table, $data) {\r\n $q = \"INSERT INTO `\" . $this->pre . $table . \"` \";\r\n $v = '';\r\n $n = '';\r\n\r\n foreach ($data as $key => $val) {\r\n $n.=\"`$key`, \";\r\n if (strtolower($val) == 'null')\r\n $v.=\"NULL, \";\r\n elseif (strtolower($val) == 'now()')\r\n $v.=\"NOW(), \";\r\n elseif (strtolower($val) == 'unix_timestamp()')\r\n $v.=\"UNIX_TIMESTAMP(), \";\r\n else\r\n $v.= \"'\" . $this->escape($val) . \"', \";\r\n }\r\n\r\n $q .= \"(\" . rtrim($n, ', ') . \") VALUES (\" . rtrim($v, ', ') . \");\";\r\n\r\n //echoLine( $q );\r\n\r\n if ($this->query($q)) {\r\n //$this->free_result();\r\n return mysql_insert_id($this->link_id); //this can't be done on non autoincremented tables;\r\n }\r\n else\r\n return false;\r\n }", "public function insert($opt) {\n\t\t\t\n\t\t\t$statement = $this->buildInsert($opt);\n\t\t\t$pdoStatement = $this->prepare($statement);\n\t\t\t$this->__bindValues($pdoStatement);\n\t\t\t\n\t\t\t//$pdoStatement->execute();\n\t\t\t$pdoStatement->closeCursor();\n\t\t\t$this->__reset();\n\t\t}", "function insert() {\n\t\t$sql = \"INSERT INTO umgroup (GpID, GpNameT, GpNameE, GpDesc, GpStID)\n\t\t\t\tVALUES(?, ?, ?, ?, ?)\";\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpID, $this->GpNameT, $this->GpNameE, $this->GpDesc, $this->GpStID));\n\t\t$this->last_insert_id = $this->ums->insert_id();\n\t\t$this->last_insert_GpNameT = $this->GpNameT;\n\t\t//echo $this->last_insert_GpNameT;\n\t}", "public function insert(){\n $sql = \"INSERT INTO author(\n name,\n job,\n created_at\n )\n VALUES(\n 'tgedf', 'sdvsdv', NOW())\";\n return $this->pdo->exec($sql);\n\n }", "public function insertAndGetId($sql, $params = array());", "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 }", "public function insert($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"INSERT \";\n\t\t$p = $this->clean($params);\t\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']);\t\n\t\t$DB->exec($statement);\t\n\t}", "public function insert()\n {\n $sql = 'INSERT INTO '.$this->_data['from'].' ';\n switch (func_num_args()) {\n case 0:\n break;\n case 1:\n break;\n case 2:\n $sql .= '('.func_get_arg(0).') VALUES('.func_get_arg(1).')';\n break;\n }\n $this->_data['query'] = $sql;\n return $this;\n }", "protected function insert() {\n $dbh = $this->getDbh();\n $table = $this->tableName;\n $data = [];\n\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n\n $query = 'INSERT INTO `' . $table . '` VALUES (NULL,';\n $first = true;\n foreach ($data AS $k => $value) {\n if (!$first)\n $query .= ', ';\n else\n $first = false;\n $query .= ':'.$k;\n }\n $query .= ')';\n\n $msc = microtime(true);\n\n $sth = $dbh->prepare($query);\n $sth->execute($data);\n\n $msc = microtime(true) - $msc;\n $line = \"insert() => \" . $query . \" with \" . implode(\"', '\", $data);\n $this->writeRequestLog($line, $msc);\n\n return true;\n }", "public function insert($query, $bindings = []);", "public function insert($query, $bindings = []);", "public function inject()\n\t{\n\t\t$insert = '?id=1%27 and 1%3d1 union select ';\n\t\treturn $insert;\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 }", "static private function insert($data) {\n $insert_stmt = new SQLExecutor($GLOBALS['cli']->dbconn);\n $insert_item = array();\n // loop over potential insert data\n foreach ($data as $tx) {\n // make sure each tx object has the right stuff\n if ( isset($tx->site_id) && isset($tx->tagid) && isset($tx->pid) ) {\n // build statement\n $insert_item[] = \"({$tx->site_id},{$tx->tagid},{$tx->pid})\";\n }\n }\n\n // complete insert statement if there are insert items\n if (count($insert_item) > 0) {\n $insert_list = implode(\",\",$insert_item);\n $insert_list = rtrim($insert_list,\",\");\n $insert_results = $insert_stmt->sql('INSERT INTO table (site_id, tagid, pid) VALUES ' . $insert_list)->run();\n }\n }", "public function insert($connection, $table, $rows);", "function perform_insertion($statement) {\n $dbconn = new DBConnection();\n $conn = $dbconn->getConnection();\n // on the connection, we need to check if the insertion worked.\n // Check affected_rows\n if ($conn->query($statement) == FALSE) {\n return array('response' => 'Failed to insert.');\n }\n return array('response' => 'Success');\n}", "function insertQuery($sql)\n {\n\t\t\tif($this->rsQry = $this->parse($sql)) \n {\n\t\t\t\t$this->sql = $sql;\n\t\t\t\t\n\t\t\t\t$this->no_of_rows = $this->getNRows();\n\t\t $this->no_of_colums = $this->getNCols(); //Fetch no of rows affected....\n\t\t\t\t$this->close();\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n else\n { \n //echo \"Exit Part\";\n\t\t\t\treturn 0x00; \n\t\t\t}\n\t\t}", "function dbRowInsert($table_name, $form_data)\n{\n $fields = array_keys($form_data);\n\n // build the query\n $sql = \"INSERT INTO \".$table_name.\"\n (`\".implode('`,`', $fields).\"`)\n VALUES('\".implode(\"','\", $form_data).\"')\";\n\n $q = $this->conn->prepare($sql);\n $q->execute() or die(print_r($q->errorInfo()));\n return $this->conn->lastInsertId();\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}", "public function testInsertSqlIsProperlyPrepared()\n {\n $batch_insert = $this->connection->batchInsert('writers', ['name', 'birthday']);\n\n $property = (new \\ReflectionClass(BatchInsert::class))->getProperty('sql_foundation');\n $property->setAccessible(true);\n\n $sql_foundation = $property->getValue($batch_insert);\n\n $this->assertEquals('INSERT INTO `writers` (`name`, `birthday`) VALUES ', $sql_foundation);\n }", "public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}", "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}", "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}", "public function createInsertSql(): \\Hx\\Db\\Sql\\InsertInterface;", "public function Do_insert_Example1(){\n\n\t}", "function insert($debug = false) {\n\t\t\tself::$bind_params = [ ];\n\t\t\t$t_name = &self::getTableName();\n\t\t\t$fields = get_object_vars($this);\n\t\t\t\n\t\t\t// Check fields are legal\n\t\t\t$errors = self::validateArray($fields, true);\n\t\t\tif (count($errors)) {\n\t\t\t\t$res = new TMResult(TMResult::InvalidData);\n\t\t\t\t$res->errors = $errors;\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t\n\t\t\t$cols = $vals = [ ];\n\t\t\t\n\t\t\tforeach ($fields as $c => $v) {\n\t\t\t\tif ($v === null) continue;\n\t\t\t\t$cols []= $c;\n\t\t\t\t$vals []= '?';\n\t\t\t\tself::$bind_params []= $v;\n\t\t\t}\n\t\t\t\n\t\t\t$cols = implode(', ', $cols);\n\t\t\t$vals = implode(', ', $vals);\n\t\t\t\n\t\t\t$q = \"insert into $t_name ( $cols ) values ( $vals )\";\n\t\t\tif ($debug) var_dump($q);\n\t\t\t$st = self::$pdo->prepare($q);\n\t\t\t\n\t\t\tself::bindBindParams($st);\n\t\t\t\n\t\t\t$r = $st->execute();\n\t\t\tif ($r) {\n\t\t\t\t$res = new TMResult(TMResult::Success);\n\t\t\t\t$res->result = (int) self::$pdo->lastInsertId();\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$res = new TMResult(TMResult::InternalError);\n\t\t\t\t$res->errors = $st->errorInfo();\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t}", "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 }", "public function insert($userid) {\r\n $sql = \"insert into bestelling (userid) values(?)\";\r\n $args = func_get_args();\r\n $stmt=parent::execPreppedStmt($sql, $args);\r\n return $stmt;\r\n }", "function pg_execute_insert($table_name, $r_post, $return_row = 1)\n{\n global $db_lnk;\n $fields = 'created, modified';\n $values = 'now(), now()';\n $val_arr = array();\n $i = 1;\n foreach ($r_post as $key => $value) {\n if ($key != 'id') {\n $fields.= ', \"' . $key . '\"';\n $values.= ', $' . $i;\n if ($value === false) {\n $val_arr[] = 'false';\n } else if ($value === null) {\n $val_arr[] = null;\n } else {\n $val_arr[] = $value;\n }\n $i++;\n }\n }\n if (!empty($return_row)) {\n $row = pg_query_params($db_lnk, 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES (' . $values . ') RETURNING *', $val_arr);\n } else {\n $row = pg_query_params($db_lnk, 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES (' . $values . ')', $val_arr);\n }\n return $row;\n}", "function insert($tabla, $campos, $valores){\n #se forma la instruccion SQL\n $q = 'INSERT INTO '.$tabla.' ('.$campos.') VALUES ('.$valores.')';\necho $q;\n $resultado = $this->consulta($q);\n \n if($resultado) return true;\n else return false;\n}", "private function _insert($data){\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }", "private\tfunction\t_prepareSaveQuery()\n\t\t{\n\t\t\tif(!$this->_columns) {\n\t\t\t\tself::$_queries[$this->_class]['save']\t=\tNULL;\n\t\t\t} else {\n\t\t\t\tself::$_queries[$this->_class]['save']\t=\t'INSERT INTO `'.$this->_table.'`(`'.implode('`,`', array_keys($this->_columns)).'`)'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\t\"\\rVALUES(?\".str_repeat(',?', sizeof($this->_columns) - 1).')'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\t\"\\rON DUPLICATE KEY UPDATE \".trim(self::$_queries[$this->_class]['updates'],', ');\n\t\t\t}\n\t\t\tunset(self::$_queries[$this->_class]['updates']);\n\t\t\t\n\t\t\treturn\tself::$_queries[$this->_class]['save'];\n\t\t}", "public function Insert(){\n //Instancia conexao com o PDO\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcidade, cidade) VALUES (?, ?)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCidade());\n $consulta ->bindValue(2, $this->getCidade());\n $consulta ->execute();\n $last = $pdo->lastInsertId();\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 ajouterArticle($data){ \n global $connexion;\n $requete = $connexion -> prepare('\n INSERT INTO articles\n (title, created_at, modified_at, introduction, content, image_url, category_id) \n VALUES \n (:title, NOW(), NOW(), :introduction, :content, :image_url, :category_id)');\n $requete -> execute([\n ':title' => $data['title'],\n ':introduction' => $data['introduction'],\n ':content' => $data['content'],\n ':image_url' => $data['image_url'],\n ':category_id' => $data['category_id']\n ]);\n $idNewArticle = $connexion -> lastInsertId();\n return $idNewArticle;\n \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 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}", "public static function insert()\n {\n }", "function insert($table, $columns);", "private function getInsertMixQuery()\n {\n\n /* Prepare data to insert into mysql */\n $this->equipment_id = isset($this->equipment_id) ? $this->equipment_id : \"0\";\n $this->department_id = isset($this->department_id) ? $this->department_id : \"0\";\n $this->voc = isset($this->voc) ? $this->voc : \"0.00\";\n $this->voclx = isset($this->voclx) ? $this->voclx : \"0.00\";\n $this->vocwx = isset($this->vocwx) ? $this->vocwx : \"0.00\";\n $this->rule_id = isset($this->rule_id) ? $this->rule_id : \"0\";\n\n\n $creation_time = isset($this->creation_time) ? $this->db->sqltext($this->creation_time) : time();\n\n $spentTime = (!empty($this->spent_time)) ? $this->db->sqltext($this->spent_time) : \"NULL\";\n\n $apmethod_id = isset($this->apmethod_id) ? \"{$this->db->sqltext($this->apmethod_id)}\" : \"NULL\";\n $exempt_rule = !empty($this->exempt_rule) ? \"'{$this->db->sqltext($this->exempt_rule)}'\" : \"NULL\";\n $waste_percent = isset($this->waste_percent) ? \"{$this->db->sqltext($this->waste_percent)}\" : \"NULL\";\n $recycle_percent = isset($this->recycle_percent) ? \"{$this->db->sqltext($this->recycle_percent)}\" : \"NULL\";\n $notes = !empty($this->notes) ? \"'{$this->db->sqltext($this->notes)}'\" : \"NULL\";\n $parentID = ($this->parent_id !== null) ? $this->db->sqltext($this->parent_id) : \"NULL\";\n $repairOrderId = ($this->wo_id !== null) ? $this->db->sqltext($this->wo_id) : \"NULL\";\n $stepId = ($this->getStepId() !== null) ? $this->db->sqltext($this->getStepId()) : \"NULL\";\n $pfpId = ($this->getPfpId() !== null) ? $this->db->sqltext($this->getPfpId()) : \"NULL\";\n\n\n $query = \"INSERT INTO \" . TB_USAGE . \" (equipment_id, department_id, \" .\n \"description, voc, voclx, vocwx, creation_time, spent_time, \" .\n \"rule_id, apmethod_id, exempt_rule, notes, waste_percent, \" .\n \"recycle_percent, iteration, parent_id, last_update_time, wo_id, step_id, pfp_id) VALUES (\" .\n \"{$this->db->sqltext($this->equipment_id)}, \" .\n \"{$this->db->sqltext($this->department_id)}, \" .\n \"'{$this->db->sqltext($this->description)}', \" .\n \"{$this->db->sqltext($this->voc)}, \" .\n \"{$this->db->sqltext($this->voclx)}, \" .\n \"{$this->db->sqltext($this->vocwx)}, \" .\n \"{$creation_time}, \" .\n \"{$spentTime}, \" .\n \"{$this->db->sqltext($this->rule_id)}, \" .\n \"{$apmethod_id}, \" .\n \"{$exempt_rule}, \" .\n \"{$notes}, \" .\n \"{$waste_percent}, \" .\n \"{$recycle_percent}, \" .\n \"{$this->db->sqltext($this->iteration)}, \" .\n \"{$parentID}, \" .\n \" NOW(), \" .\n \" {$repairOrderId}, \" .\n \" {$stepId}, \" .\n \" {$pfpId} \" .\n \") \";\n\n return $query;\n }", "public function insert() {\n $sql = \"INSERT INTO contratos (numero_contrato, objeto_contrato, presupuesto, fecha_estimada_finalizacion)\n VALUES (:numero_contrato, :objeto_contrato, :presupuesto, :fecha_estimada_finalizacion)\";\n $args = array(\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n if ($stmt) {\n $this->id = $this->getConnection()->lastInsertId();\n }\n\n return !$stmt ? false : true;\n }", "abstract protected function platformInsertStatement($table, array $keys, array $values);", "protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}", "public function queryInsert($table, $data) : bool;" ]
[ "0.6872749", "0.67728776", "0.67582923", "0.6688224", "0.6675366", "0.6658894", "0.66362786", "0.6635277", "0.6621784", "0.6609458", "0.6496079", "0.6424179", "0.64119554", "0.64111173", "0.64111173", "0.63930553", "0.63766605", "0.63717014", "0.63514924", "0.63142633", "0.6287717", "0.62521434", "0.6247287", "0.62468386", "0.6223865", "0.62057894", "0.62005454", "0.61811495", "0.6176974", "0.6172556", "0.6156691", "0.6147595", "0.613801", "0.6131405", "0.6101066", "0.60871387", "0.60854584", "0.60843515", "0.6076859", "0.60653716", "0.60591686", "0.6045091", "0.602415", "0.60238665", "0.6019663", "0.6007282", "0.59833276", "0.5977935", "0.5963638", "0.5962311", "0.59565455", "0.5956377", "0.5955743", "0.5951694", "0.5943735", "0.59358215", "0.5930225", "0.5924231", "0.59103644", "0.59061325", "0.5902679", "0.59014654", "0.5901263", "0.5894224", "0.5884533", "0.58842224", "0.58842224", "0.58819944", "0.58815444", "0.5870435", "0.5861043", "0.5860757", "0.5856226", "0.5843896", "0.58383316", "0.5832936", "0.5830611", "0.58285296", "0.5822663", "0.5821403", "0.58197814", "0.5815181", "0.58109844", "0.58006585", "0.57993114", "0.5792791", "0.5780645", "0.5779707", "0.5779669", "0.57701737", "0.5766583", "0.5763561", "0.57608753", "0.5760156", "0.5758702", "0.575463", "0.5740184", "0.573869", "0.5737729", "0.5736663", "0.5731312" ]
0.0
-1
_select() Prepare UPDATE request
protected function _update() { // UPDATE 'table' SET $this->_query = 'UPDATE '.$this->_table.' SET '; // * / row1, row2 $first = true; $vals = ''; foreach($this->_set as $key => $value) { $this->_query .= ($first) ? ('') : (', '); $this->_query .= "$key = '$value'"; $first = false; } // foreach // WHERE foo = 'bar' $this->_query .= ' WHERE '; $imax = count($this->_where); $first = true; for($i=0; $i<$imax; $i++) { $this->_query .= ($first) ? ('') : (' AND '); $first = false; $this->_query .= $this->_where[$i]['row'].' '; $this->_query .= $this->_where[$i]['condition'].' \''; $this->_query .= $this->_where[$i]['value'].'\''; } // foreach // end ; $this->_query .= ';'; return $this->_query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function SQL_UPDATE() {\r\n\t}", "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "function doLimitedUpdate() {\n\t\t$sQuery = 'UPDATE ' . $this->_table() . ' SET ';\n\t\t$aParams = array();\n\t\t\n\t\t$blacklist = array(\n\t\t\t\"sPassword\" => 1,\n\t\t);\n\t\t\n\t\t$aParts = array(); // quick workaround to make the join less hurtful.\n\t\t\n\t\tforeach ($this->_aFieldToSelect as $attr => $column) {\n\t\t\tif (!array_key_exists($attr, $blacklist)) {\n\t\t\t\t$val = $this->$attr;\n\t\t\t\t$aParts[] = $column . ' = ?';\n\t\t\t\t$aParams[] = $val; \n\t\t\t} \n\t\t}\n\t\t$sQuery .= join(', ', $aParts);\n\t\t\n\t\t$sQuery .= ' WHERE id = ? ';\n\t\t$aParams[] = $this->getId();\n\t\t\n\t\t$res = DBUtil::runQuery(array($sQuery, $aParams));\n\n $group = sprintf(\"%s/%s\", get_class($this), 'id');\n $oCache =& KTCache::getSingleton();\n $oCache->remove($group, $this->iId);\n $this->clearCachedGroups();\n\n\t\treturn $res;\n\t}", "protected function prepareUpdateStatement() {\n $clauses = [];\n foreach ($this->uniqueColumns as $column) {\n $clauses[] = \"$column = :$column\";\n }\n\n $clauses = implode(' AND ', $clauses);\n\n // Fields to update.\n $fields = [];\n foreach (array_diff($this->columns, $this->uniqueColumns) as $field) {\n $fields[] = \"$field = :$field\";\n }\n $fields = implode(',', $fields);\n\n // Prepare our statement.\n return $this->connection->prepare(\"UPDATE {$this->table} SET $fields WHERE $clauses\");\n }", "public function update() {\n $Sql = \"UPDATE \" . $this->tableName[0] . \" SET \";\n foreach ($this->fieldListArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_', \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 2);\n $Sql = $Sql . \" WHERE \";\n foreach ($this->conditionArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_' AND \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 4);\n //echo $Sql;\n return mysqli_query($this->dataBaseConnect->getConnection(), $Sql);\n }", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "public function updateDbFromRequest()\n\t\t{\n\t\t\t$this->columnsInfo->data_seek(0);\n\t\t\t$pkExistsInRequest = true;\n\t\t\t$PK = \"1=1\";\n\t\t\t$upd = \"\";\n\t\t\twhile($column = $this->columnsInfo->fetch_assoc())//$info->fetch_row()\n\t\t\t{\n\t\t\t\tif($column[\"COLUMN_KEY\"] == \"PRI\")\n\t\t\t\t{\n\t\t\t\t\tif($pkExistsInRequest = $pkExistsInRequest && isset($_REQUEST[$column[\"COLUMN_NAME\"]]))\n\t\t\t\t\t\t$PK = \"$PK and \".$column[\"COLUMN_NAME\"].\"=\".$this->wherePkValue($_REQUEST[$column[\"COLUMN_NAME\"]], $column[\"DATA_TYPE\"]);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$upd = \"$upd, \".$column[\"COLUMN_NAME\"].\"=\".$this->insertColumnValue($_REQUEST[$column[\"COLUMN_NAME\"]], $column[\"IS_NULLABLE\"], $column[\"DATA_TYPE\"], $column[\"CHARACTER_MAXIMUM_LENGTH\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($pkExistsInRequest)\n\t\t\t{\n\t\t\t\t$query = \"update $this->table set \".substr($upd, 2, strlen($upd)).\" where $PK\";\n\t\t\t\techo \"<br>$query<br>\";\n\t\t\t}\n\t\t\telse\n\t\t\t\techo \"<br>PK dont exists in request<br>\";\n\t\t}", "function update($where_clause=null)\n {\n $db = $this->getDb();\n \n $sets = array();\n $values = array();\n// Kint::dump($this->fields);\n foreach( array_keys( $this->fields ) as $field )\n {\n //echo \"<br> field \".Kint::dump($field,'Field',false);\n if(!is_null($where_clause) && $field == $this->id_name){\n \techo \"Skipping primary key '$field' & $this->id_name since there is another WC '$where_clause' \";\n \tcontinue;\n }\t\n if('0'==$field ){\n \tcontinue;\n }\n elseif(is_int($field)){\n \t//Kint::dump($field);\n \t//Kint::dump(array_keys($this->fields));\n \tcontinue;\n }\n elseif (!isset($this->fields[$field]))\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n }\n elseif ($field == 'updated')\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n } \n else{\t\n \t$sets []= $field.'=?';\n \t$values []= $this->fields[ $field ];\n }\n }\n $set = join( \", \", $sets );\n \n if(is_null($where_clause)){\n \tif($this->id<0)\n \t\tdie(kint::dump('ERROR: this->id was not set on DBObject',$this));\n \t//$values []= $this->id;\n \t$where_clause = $this->id_name.'='.$this->id; \t\n }\n if(!str_contains($set, 'updated')){\n \t$set .= ',updated = null ';\n }\n\t$sql = 'UPDATE '.$this->table.' SET '.$set.\n \t' WHERE '.$where_clause;\n\t//$this->execute($sql,$values);\n\t//die ('SQL in Update<br/>'.$sql.'<br/>'.var_dump($values));\n //Kint::dump('UpdateSQL',$sql);\n //die('TEST');\n $cmd = 'prepare';\n\ttry{\n\t\t$sth = $db->prepare( $sql );\n\t\t$cmd = 'execute';\n\t\t$this->execute( $sth, $values );\n\t}\n catch(exception $e){\n \t$debug=Zend_Debug::dump('Statement with error',$sql);\t\n \tdie(__LINE__.'Exception in DBObject::'.$cmd.'() while cmd='.$cmd.' SQL='.$sql\n \t\t.' with values <br>'.$values\n \t\t.__LINE__.'Exception:<br>'.nl2br($e)\n \t\t.'<hr/>'.$debug);\n } \t\n }", "public function getForUpdateSQL();", "public function update() {\n global $db;\n $this->_preupdate();\n $sql_set = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_set .= \"`\".addslashes($key).\"`=\";\n $sql_set .= \"?,\";\n $data[] = $value;\n }\n $sql_set = substr($sql_set, 0, -1);\n\n $query = \"UPDATE {$this->table} SET $sql_set WHERE \".$this->id_field.\"=?;\";\n $data[] = $this->{'get'.$this->id_field}();\n\n $result = $db->query($query,$data);\n $this->_postupdate($result);\n return $result;\n }", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "public function update(){\n $set_param_cols_vals = $this->iniParamvalues($this->data, \",\");\n // check for extra set_column\n $extra_set = ($this->custom !== NULL) ? $this->custom : NULL ;\n if($this->custom !== NULL){\n if($this->data !== NULL){\n if(!empty($this->where)){\n $this->custom = \",$this->custom\"; \n }\n else{\n $this->custom = 'WHERE '.$this->custom; \n }\n }\n else{\n if(empty($this->where)){\n $this->custom = 'WHERE '.$this->custom; \n }\n else{\n $this->custom = $this->custom; \n }\n } \n }\n // set where cols param values\n $set_param_where = $this->update_iniParamvalues($this->where, \"and\", \"WHERE\");\n\n $sql = \"UPDATE \".self::$table.\" SET $set_param_cols_vals $this->custom $set_param_where\";\n\n // prepare sql statement\n $this->query = $this->conn->prepare($sql);\n\n // bind cols_vals param values\n $this->update_cusBindparam($this->data);\n \n // bind where param values\n if(!empty($this->data)){\n $this->cusBindparam($this->where,count($this->data)+1); \n }\n else if(!empty($this->where)){\n $this->cusBindparam($this->where); \n }\n // execute query\n $execute = $this->query->execute();\n\n if(!$execute){\n return false;\n }\n else{\n return true;\n }\n }", "function prepare_update($id = '', $data = []){\n // if there is no data to set, then return an empty string\n if($data == [] || $id == ''){\n return '';\n }\n $set_sql = '';\n $where_sql = '';\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\n $where_sql = $this->create_where($id, []);\n \n return \"UPDATE {$this->table_name} $set_sql $where_sql;\";\n }", "public function update() {\n\t\tif (isset($this->params['updated'])) {\n\t\t\t$this->params['updated'] = null;\n\t\t} // 'updated' is an auto timestamp\n\n\t\t$columns = array();\n\t\tforeach (array_keys($this->params) as $key) {\n\t\t\tarray_push($columns, $key . ' = ?');\n\t\t}\n\t\t$bindings = implode(', ', $columns);\n\t\t$sql = 'UPDATE ' . static::$table . ' SET ' . $bindings . ' WHERE id = ' . $this->get('id') . ' ;';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "public function updateQuestion()\r\n{\r\n $query_string = \"UPDATE questions \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"quizid = :quizid, \";\r\n $query_string .= \"question = :question, \";\r\n $query_string .= \"choice1 = :choice1, \";\r\n $query_string .= \"choice2 = :choice2, \";\r\n $query_string .= \"choice3 = :choice3, \";\r\n $query_string .= \"choice4 = :choice4, \";\r\n $query_string .= \"ans = :ans \";\r\n $query_string .= \"WHERE questionid = :questionid \";\r\n\r\n return $query_string;\r\n}", "function update($bd,$where,$data){\n$data_one = \"\";\n$contador = count($data);\n$i = 1;\nforeach ($data as $key => $value) {\n\n\t\tif($i < $contador){\n\t\t\t$data_one .= $key.\"=:\".$key.\",\";\n\t\t}else{\n\t\t\t$data_one .= $key.\"=:\".$key;\n\t\t}\n\t\t$i++;\n}\nforeach ($where as $key => $value) {\n\t$campo_where = $key;\n\t$value_where = $value;\n}\n $sql = \"UPDATE \".$bd.\" SET \".$data_one.\" WHERE \".$campo_where.\"=\".$value_where.\"\";\n $conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute($data);\n$stmt = null;\nreturn $dato;\n}", "public function update( $sql, $params=array());", "function test_update($urabe, $body)\n{\n $values = $body->update_params;\n $column_name = $body->column_name;\n $column_value = $body->column_value;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->update($table_name, $values, \"$column_name = $column_value\");\n}", "public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }", "private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }", "public function updateSql(){\n\n $sql = \"UPDATE {$this->table} SET \";\n $i = 0;\n $size = sizeof($this->requestUpdateValues);\n\n foreach ($this->requestUpdateValues as $key=>$value) {\n $sql .= \"{$key} = {$this->params['columnName_Pdo'][$key]} \";\n $i++;\n if($i < $size) { $sql .= ' , '; }\n }\n \n $sql .= \" WHERE id IN ({$this->updateIds}) \";\n \n return $sql;\n }", "protected function updateSql()\n {\n $sql = \"UPDATE \" . $this->dbName . \".\" . $this->table . \" SET \";\n $preparedPlaceholders = $this->prepareNamedPlaceholder();\n\n $sql.= $preparedPlaceholders . \" WHERE \" . $this->tablePK . \"=:id;\";\n\n $this->query = $sql;\n }", "public function updateSystemInformation()\r\n{\r\n $query_string = \"UPDATE voting_system \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"systemname = :systemname, \";\r\n $query_string .= \"systemtypeid = :systemtypeid, \";\r\n $query_string .= \"systemsummary = :systemsummary, \";\r\n $query_string .= \"systeminformation = :systeminformation \";\r\n $query_string .= \"WHERE systemid = :systemid\";\r\n\r\n return $query_string;\r\n}", "public function modifyRecords(){\n \n // Get the sql statement\n $sql = $this->updateSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->requestUpdateValues as $key => $value) {\n $stmt->bindParam($this->params['columnName_Pdo'][$key], $this->requestUpdateValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }", "public function db_update() {}", "public abstract function getUpdateSQL($table, $data, $where, $values, $order, $limit);", "function dbRowUpdate($table_name, $form_data, $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 key word\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // start the actual SQL statement\n $sql = \"UPDATE \".$table_name.\" SET \";\n\n // loop and build the column /\n $sets = array();\n foreach($form_data as $column => $value)\n {\n $sets[] = \"`\".$column.\"` = '\".$value.\"'\";\n }\n $sql .= implode(', ', $sets);\n\n // append the where statement\n $sql .= $whereSQL;\n\n // run and return the query result\n $q = $this->conn->prepare($sql);\n \n return $q->execute() or die(print_r($q->errorInfo()));\n}", "public function prepareUpdate() {\n $this->connection->update($this->mapTable)\n ->fields(array('needs_update' => MigrateMap::STATUS_NEEDS_UPDATE))\n ->execute();\n }", "function update() {\n $col_names = array('first_name', 'last_name', 'category_id', 'active');\n $dat_param = array(':fn', ':ln', ':ci', ':ac');\n $sani_type = array('str', 'str', 'int', 'flag');\n $sub_check = array(false, false, false, false);\n $dat_types = array(PDO::PARAM_STR, PDO::PARAM_STR, PDO::PARAM_INT, PDO::PARAM_INT);\n\n $any_sub = false;\n\n //make sure non-optional data is set\n if (!isset($this->id)) throw new Exception('id must be provided');\n if (!isset($this->updated_by)) throw new Exception('updated_by must be provided'); \n\n $update_string = \"updated_by=:ub\";\n \n //check if updateable data exists, sanitize it, build up the update string:\n //a) loop through the updateable parameters\n for ($i = 0; $i < count($col_names); $i++) {\n\n //b) if it is set, attempt to sanitize/check it for update\n if (isset($this->{$col_names[$i]})) {\n $any_sub = true;\n $sub_check[$i] = true;\n $update_string .= \", {$col_names[$i]}={$dat_param[$i]}\";\n\n //c) sanitize/check by type\n if ($sani_type[$i] === 'str') {\n $this->{$col_names[$i]} = htmlspecialchars(strip_tags($this->{$col_names[$i]}));\n\n } elseif ($sani_type[$i] === 'flag') {\n if ( !($this->{$col_names[$i]} === 0 || $this->{$col_names[$i]} === 1) ) {\n throw new Exception(\"{$col_names[$i]} must be either 0 or 1\");\n }\n } elseif ($sani_type[$i] === 'int') {\n if (filter_var($this->{$col_names[$i]}, FILTER_VALIDATE_INT) === false) {\n throw new Exception('category_id does not conform');\n }\n }\n }\n } \n\n if (!$any_sub) throw new Exception('no data was submitted for staff member update.');\n \n $sql = \"UPDATE \n {$this->table_name}\n SET\n {$update_string}\n WHERE\n id=:id\";\n\n $stmt = $this->conn->prepare($sql);\n \n //bind the non-optional data to the query\n $stmt->bindParam(':id', $this->id, PDO::PARAM_INT);\n $stmt->bindParam(':ub', $this->updated_by, PDO::PARAM_STR);\n\n //if the data was found and sanitized, then bind the data to the parameter\n for ($i=0; $i < count($col_names); $i++) { \n if ($sub_check[$i] === true) {\n $stmt->bindParam($dat_param[$i], $this->{$col_names[$i]}, $dat_types[$i]);\n }\n }\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "abstract public function prepareSelect();", "public function queryUpdateFields()\n {\n $statement = sprintf(\"SELECT %s, %s, %s FROM %s WHERE deleted = 0 ORDER BY %s\",\n static::FIELDS[0], static::FIELDS[1], static::FIELDS[4], static::TABLE, static::FIELDS[0]);\n $req = $this->db->query($statement);\n $response = $req->fetchAll(PDO::FETCH_ASSOC);\n\n return json_encode($response);\n }", "static function &QueryUpdate($id, $table, $values, $where_condition=NULL, $bind_vars=array()) {\n Profiler::StartTimer(\"DataManager::QueryUpdate()\");\n Profiler::StartTimer(\"DataManager::QueryUpdate($id)\", 3);\n $qstart = microtime(true);\n $rows_affected = NULL;\n $queryid = new DatamanagerQueryID($id);\n if ($source =& DataManager::PickSource($queryid)) {\n $rows_affected = $source->QueryUpdate($queryid, $table, $values, $where_condition, $bind_vars);\n if ($rows_affected > 0) {\n DataManager::CacheClear($id);\n }\n }\n Profiler::StopTimer(\"DataManager::QueryUpdate()\");\n Profiler::StopTimer(\"DataManager::QueryUpdate($id)\");\n self::log(\"update\", $id, $table, $qstart, microtime(true));\n return $rows_affected;\n }", "function update($table, $id, $data){\n global $conn;\n$sql = \"UPDATE $table SET \";\n\n$i = 0;\n foreach ($data as $key => $value){\n if($i === 0){\n $sql = $sql . \" $key=?\"; \n } else{\n $sql = $sql . \", $key=?\";\n }\n$i++;\n}\n\n$sql = $sql . \" WHERE id=?\";\n$data['id'] = $id;\n$stmt = executeQuery($sql, $data);\nreturn $stmt->affected_rows;\n}", "public function update(){\n\t\t$parametro = func_get_args();\n\t\t$resultado = $this->execSql($this->UPDATE,$parametro);\n\t\tif(!$resultado){\n\t\t\t$this->onError(\"COD_UPDATE\",$this->UPDATE);\n\t\t}\n\t\treturn $resultado;\n\t}", "protected function prepareSelectStatement() {}", "function dbupdate($table, $fields, $where = [1=>0], $funcs = null ) {\r\n\tglobal $msq;\r\n\t$parts = [];\r\n\tforeach ($fields as $k => $v)\r\n\t\t$parts []= $k.' = \"'.mysqli_real_escape_string($msq, $v).'\"';\r\n\tif ($funcs != null) {\r\n\t\tforeach ($funcs as $k => $v) {\r\n\t\t\t$parts []= $k.' = '.$v;\r\n\t\t}\r\n\t}\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\t$q = \"update \".$table.\" set \".implode(\", \",$parts).\" where \".implode(\" and \",$whparts);\r\n\treturn dbcommit($q);\r\n}", "function yy_r101(){\n $this->_retvalue = new SQL\\Update($this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -3]->minor);\n if ($this->yystack[$this->yyidx + -4]->minor) $this->_retvalue->joins($this->yystack[$this->yyidx + -4]->minor);\n if ($this->yystack[$this->yyidx + -2]->minor) $this->_retvalue->where($this->yystack[$this->yyidx + -2]->minor);\n if ($this->yystack[$this->yyidx + -1]->minor) $this->_retvalue->orderBy($this->yystack[$this->yyidx + -1]->minor);\n if ($this->yystack[$this->yyidx + 0]->minor) $this->_retvalue->limit($this->yystack[$this->yyidx + 0]->minor[0], $this->yystack[$this->yyidx + 0]->minor[1]);\n }", "public function update(){\n $sql = \"update \".self::$tablename.\" set correlativo=\\\"$this->correlativo\\\",nombre_instalador=\\\"$this->nombre_instalador\\\",nombre_proyecto=\\\"$this->nombre_proyecto\\\",localizacion=\\\"$this->localizacion\\\",contrato_orden_trabajo=\\\"$this->contrato_orden_trabajo\\\",sector_trabajo=\\\"$this->sector_trabajo\\\",area_aceptada=\\\"$this->area_aceptada\\\",fecha_proyecto=\\\"$this->fecha_proyecto\\\" where id_usuario=$this->id_usuario\";\n Executor::doit($sql);\n }", "function acceptRequest($requestID, $adminCode)\n{\n global $conn;\n\n $stmt = $conn->prepare(\"UPDATE request\n SET closed = true, approved = true, admincode = ?, submitiondate = CURRENT_TIMESTAMP \n WHERE requestid = ? AND closed = false\");\n\n try {\n $res = $stmt->execute(array($adminCode, $requestID));\n } catch (Exception $e) {\n return $e->getMessage();\n }\n return \"true\";\n}", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "public function get_update()\n {\n $table = self::quote_name($this->table);\n $alias = $this->alias ? $this->alias: '';\n $where = $this->get_where();\n $limit = $this->get_limit();\n $set = self::prepare_set($this->set);\n return \"update $table $alias set $set $where $limit\";\n }", "function adv_update($table, array $data, array $where);", "public function get_update_row($id){\n $database = new Database();\n $sql = \"SELECT * FROM \" . TABLE_NAME . \" WHERE \" . PRIMARY_KEY . \" = \"; \n $sql_bind = \":\" . PRIMARY_KEY;\n $sql .= $sql_bind; \n $database->query($sql);\n $database->bind($sql_bind,$id);\n $database->execute();\n $row = $database->single(); \t\n $this->mod_prep($row); // send the row to get preped\n }", "function QueryUpdate($table, $data, $where='1') {\r\n $q = \"UPDATE `\" . $this->pre . $table . \"` SET \";\r\n\r\n foreach ($data as $key => $val) {\r\n if (strtolower($val) == 'null')\r\n $q.= \"`$key` = NULL, \";\r\n elseif (strtolower($val) == 'now()')\r\n $q.= \"`$key` = NOW(), \";\r\n elseif (strtolower($val) == 'unix_timestamp()')\r\n $q.= \"`$key` = UNIX_TIMESTAMP(), \";\r\n else\r\n $q.= \"`$key`='\" . $this->escape($val) . \"', \";\r\n }\r\n\r\n $q = rtrim($q, ', ') . ' WHERE ' . $where . ';';\r\n\r\n //echoLine( $q );\r\n\r\n return $this->query($q);\r\n }", "function updateData($table, $where, $fields)\n {\n $sql = \"\";\n $condition = \"\";\n $val = \"\";\n foreach ($where as $key => $value) {\n $condition .= \"$key = ?\";\n }\n foreach ($fields as $key => $value) {\n $val .= \"$key = ? , \";\n }\n $val = substr($val, 0, -2);\n $sql .= \"update $table set $val where $condition\";\n // print_r($sql);\n // exit;\n $result = $this->conn->prepare($sql);\n $temp = array_merge(array_values($fields), array_values($where));\n if ($result->execute($temp)) {\n return true;\n } else {\n return false;\n }\n $this->conn = null;\n }", "abstract function update (\\Database\\Query\\Query $query);", "function exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields = FALSE) {\n\t\t$res = parent::exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->exec_UPDATEquery_postProcessAction($table, $where, $fields_values, $no_quote_fields, $this);\n\t\t}\n\t\treturn $res;\n\t}", "protected function _sql_update ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = 'UPDATE ';\n /*\n Which table ?\n */\n $sql .= $this->aTables[0] . \"\\nSET \";\n /*\n Fields and values.\n */\n foreach ($this->aFields as $k => $f)\n {\n $sql .= $f . ' = ' . $this->aValues[$k] . ', ';\n }\n $sql = rtrim($sql, ', ');\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 update($conn, $data, $where){\n\t\t$sql_update=\"\";\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$field_info=$this->fields[$field];\n\t\t\tif ($sql_update!=\"\"){\n\t\t\t\t$sql_update = $sql_update . \", \";\n\t\t\t}\n\t\t\t$sql_update = $sql_update . \"`\" . $field . \"` = \";\n $sql_update = $sql_update . $this->quote($conn, $val, $field_info[\"type\"]);\t\t\t\n\t\t}\n\t\t\n\t\t$sql_where=$this->getWhereClause($conn, $where);\n\t\t$sql=\"UPDATE `\" . $this->table_name . \"` SET \" . $sql_update;\n\t\tif ($sql_where!=\"\"){\n\t\t\t$sql = $sql . \" WHERE \" . $sql_where;\n\t\t} \n\t\treturn $conn->exec($sql);\n\t}", "public function DoUpdate()\n\t{\n\n\t\treturn db_update_records($this->fields, $this->tables, $this->values, $this->filters);\n\t}", "private function getSQLForUpdate()\n {\n $table = $this->_sqlParts['from']['table'] . ($this->_sqlParts['from']['alias'] ? ' ' . $this->_sqlParts['from']['alias'] : '');\n $query = 'UPDATE ' . $table\n . ' SET ' . implode(\", \", $this->_sqlParts['set'])\n . ($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 queryUpdate($table, $data, $where) : int;", "function UPDATEquery($table, $where, $fields_values, $no_quote_fields = FALSE) {\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->UPDATEquery_preProcessAction($table, $where, $fields_values, $no_quote_fields, $this);\n\t\t}\n\t\treturn parent::UPDATEquery($table, $where, $fields_values, $no_quote_fields);\n\t}", "private function update(){\n\t\t$q = Queries::update($this->authkey);\n\t\t$this->internalQuery($q);\n\t}", "function Update()\n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t$updateParam = \"\";\n\t\t$updateValue = \"\";\n\t\t$blobs = array();\n\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\t$command = 'if(isset($this->'.$fld['varname'].')) { ';\n\t\t\tif( $fld[\"key\"] )\n\t\t\t\t$command.= '$this->Param[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\telse\n\t\t\t\t$command.= '$this->Value[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\t$command.= ' }';\n\t\t\t\n\t\t\teval($command);\n\t\t\t\n\t\t\tif( !$fld[\"key\"] && !array_key_exists( strtoupper($fieldname), array_change_key_case($this->Param, CASE_UPPER) ) )\n\t\t\t{\n\t\t\t\tforeach($this->Value as $field => $value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateValue.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \", \";\n\t\t\t\t\t\n\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Oracle || $this->_connection->dbType == nDATABASE_DB2 || $this->_connection->dbType == nDATABASE_Informix )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( IsBinaryType( $fld[\"type\"] ) )\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Informix && IsTextType( $fld[\"type\"] ) )\t\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($this->Param as $field=>$value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateParam.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \" and \";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\tconstruct SQL and do update\t\n\t\tif ($updateParam)\n\t\t\t$updateParam = substr($updateParam, 0, -5);\n\t\tif ($updateValue)\n\t\t\t$updateValue = substr($updateValue, 0, -2);\n\t\t\t\n\t\tif ($updateValue && $updateParam)\n\t\t{\n\t\t\t$dalSQL = \"update \".$this->_connection->addTableWrappers( $this->m_TableName ).\" set \".$updateValue.\" where \".$updateParam;\n\t\t\t$this->Execute_Query($blobs, $dalSQL, $tableinfo);\n\t\t}\n\n\t\t//\tcleanup\n\t\t$this->Reset();\n\t}", "public final function update() {\n\t\t$properties = self::getProperties($this);\n\t\t$columns = array_keys($properties);\n\t\t$values = array_values($properties);\n\n\t\t$setArray = array();\n\t\tfor ($i = 0; $i < count($properties); $i++) {\n\t\t\t$column = $columns[$i];\n\t\t\tif (strcmp($column, $this->primaryField) == 0 ||\n\t\t\t\tin_array($column, $this->uniqueFields)\n\t\t\t) {\n\t\t\t\t// Remove the value for binding\n\t\t\t\tunset($values[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setArray[] = $column . \" = ?\";\n\t\t}\n\n\t\t$sql = \"\n\tUPDATE\n\t\t\" . $this->table . \"\n\tSET\n\t\t\" . implode(\", \", $setArray) . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\t\t// Adds the primary key binding\n\t\t$values[] = $this->{$this->primaryField};\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute($values);\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "public function update($sql) {\n return $this->datau($sql);\n }", "public function update() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"UPDATE \".$this->getTableName().\"\n\t\t\t\t SET \";\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 .= (($fl) ? \"\" : \", \").$column.\" = \".((is_bool($val)) ? (($val) ? \"TRUE\" : \"FALSE\") : ((is_null($val)||($val === \"\")) ? \"null\" : \"'\".$val.\"'\"));\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\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}", "function update() {\n\n global $conn;\n\n $stmt = $conn->prepare('\n UPDATE Del_Adr SET\n Addressln1 = :Addressln1,\n Addressln2 = :Addressln2,\n Customer_id = :Customer_id,\n Name = :Name,\n Postcode = :Postcode\n WHERE Del_id = :Del_id\n ');\n\n $stmt->bindParam(':Addressln1', $this->Addressln1);\n $stmt->bindParam(':Addressln2', $this->Addressln2);\n $stmt->bindParam(':Customer_id', $this->Customer_id);\n $stmt->bindParam(':Name', $this->Name);\n $stmt->bindParam(':Postcode', $this->Postcode);\n $stmt->bindParam(':Del_id', $this->Del_id);\n\n return $stmt->execute();\n }", "public function update($opt) {\n\t\t\t\n\t\t\t$statement = $this->buildUpdate($opt);\n\t\t\t$pdoStatement = $this->prepare($statement);\n\t\t\t$this->__bindValues($pdoStatement);\n\t\t\t\n\t\t\t$pdoStatement->execute();\n\t\t\t$pdoStatement->closeCursor();\n\t\t\t$this->__reset();\n\t\t}", "function updateRow($pairId, $question, $answer)\r\n{\r\n global $dbh;\r\n\r\n $select = \"UPDATE flashcard SET question = :question, answer = :answer WHERE pairId=:pairId\";\r\n\r\n // prepare statement\r\n $statement = $dbh->prepare($select);\r\n\r\n // bind parameters\r\n $statement->bindValue(':pairId', $pairId);\r\n $statement->bindValue(':answer', $answer);\r\n $statement->bindValue(':question', $question);\r\n\r\n // execute statement\r\n $success = $statement->execute();\r\n\r\n return $success;\r\n}", "public function querySharedUpdateFields()\n {\n $statement = sprintf(\"SELECT %s, %s, %s FROM %s WHERE %s = 1 AND deleted = 0 ORDER BY %s\",\n static::FIELDS[0], static::FIELDS[1], static::FIELDS[4], static::TABLE, static::FIELDS[3], static::FIELDS[0]);\n $req = $this->db->query($statement);\n $response = $req->fetchAll(PDO::FETCH_ASSOC);\n\n return json_encode($response);\n }", "public function update(){\n\n $sql = 'UPDATE fullorder SET ';\n $sql .= 'Status = \"' . $this->__get('Status') . '\"';\n if ($this->__get('Status') == 'Delivered') {\n $date = date('Y-m-d');\n $time = $date . '' . time();\n $sql .= ', OrderDeliverTime = NOW() ';\n }\n $sql .= 'WHERE OrderID =' . $this->__get('OrderID');\n $con = $this->openconnection();\n $stmt = $con->prepare($sql);\n $stmt = $stmt->execute(); \n $con = null;\n if(!$stmt){\n //echo \"FROM MODEL <br>\";\n return false;\n } else {\n //echo \"FROM MODELllll true<br>\" . $lastId;\n return true;\n \n }\n }", "public function updateUserDetailsNoPass()\r\n{\r\n $query_string = \"UPDATE users \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"username = :username, \";\r\n $query_string .= \"email = :email, \";\r\n $query_string .= \"firstname = :firstname, \";\r\n $query_string .= \"lastname = :lastname \";\r\n $query_string .= \"WHERE userid = :userid\";\r\n\r\n return $query_string;\r\n}", "function patch(String $tblname, array $where, array $data)\n {\n $cmd = \"UPDATE {$tblname} SET \";\n $cmd2 = \"\";\n $cmd3 = \"\";\n foreach ($data as $key => $value) {\n $value = $this->__sanitize($value);\n if ($value === '?') {\n $cmd2 .= strtoupper($key) . \"=!\" . strtoupper($key) . \", \";\n } else {\n $cmd2 .= strtoupper($key) . \"='{$value}'\" . \", \";\n }\n }\n foreach ($where as $key => $value) {\n $value = $this->__sanitize($value);\n $cmd3 .= strtoupper($key) . \"='{$value}'\" . \" AND \";\n }\n\n # The above (params/data) loops result in a trailing\n # (comma & a concatination operator) thus we remove them below..!\n $cmd2 = substr($cmd2, 0, strrpos($cmd2, \", \"));\n $cmd3 = substr($cmd3, 0, strrpos($cmd3, \" AND \"));\n $cmd .= \"{$cmd2} WHERE {$cmd3}\";\n\n // send query and Return Results:\n $this->send($cmd);\n return $this->result;\n }", "function update() {\n\n global $conn;\n\n $stmt = $conn->prepare('\n UPDATE Customer SET\n Name = :Name,\n Surname = :Surname,\n Email = :Email,\n Phone = :Phone\n WHERE Customer_id = :Customer_id\n ');\n\n $stmt->bindParam(':Name', $this->Name);\n $stmt->bindParam(':Surname', $this->Surname);\n $stmt->bindParam(':Email', $this->Email);\n $stmt->bindParam(':Phone', $this->Phone);\n $stmt->bindParam(':Customer_id', $this->Customer_id);\n\n return $stmt->execute();\n }", "public function fetch_update($param)\n\t{\n\t\t$query = \"SELECT * FROM tb_users WHERE id = :id\";\n\t\t$data = DB::connect()\n\t\t\t->query($query)\n\t\t\t->vars($param)\n\t\t\t->style(FETCH_ASSOC)\n\t\t\t->bind(BINDVAL)\n\t\t\t->fetch();\n\n\t\treturn $data;\n\t}", "public function updateQuery(): string\n {\n return 'UPDATE products \n SET name = :name, quantity = :quantity, price = :price, msrp = :msrp \n WHERE id = :id';\n }", "function my_update_record( $table_name , $primary_key , $data_id , $datas ){\r\n\r\n\tglobal $connection;\r\n\r\n\t$build_query = \" UPDATE `\".$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$query = rtrim( trim($build_query) , \",\" );\r\n\t\r\n\t$update_query = $query .\" WHERE `\".$primary_key.\"` = \". $data_id ; \r\n \r\n\t$result = my_query( $update_query );\r\n\t \r\n\treturn $connection->affected_rows ; \r\n\r\n}", "public function updateUserDetails()\r\n{\r\n $query_string = \"UPDATE users \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"username = :username, \";\r\n $query_string .= \"password = :password, \";\r\n $query_string .= \"email = :email, \";\r\n $query_string .= \"firstname = :firstname, \";\r\n $query_string .= \"lastname = :lastname \";\r\n $query_string .= \"WHERE userid = :userid\";\r\n\r\n return $query_string;\r\n}", "function _update ($table_name) {\n\t\treturn \"UPDATE `{$table_name}`\";\n\t}", "function test_update_by_field($urabe, $body)\n{\n $values = $body->update_params;\n $column_name = $body->column_name;\n $column_value = $body->column_value;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->update_by_field($table_name, $values, $column_name, $column_value);\n}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",short_name=\\\"$this->short_name\\\",is_active=\\\"$this->is_active\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update($request_data){\n $c_id = $request_data['c_id'];\n\n //getting data from $request_data\n $c_name = $request_data['c_name'];\n $c_cont_no = $request_data['c_cont_no'];\n $c_food_pref = $request_data['c_food_pref'];\n\n $dbs = new DatabaseControls();\n $qry = \"update \".$this->table_name.\" set c_name = '\".$c_name.\"',c_cont_no = '\".$c_cont_no.\"',c_food_preference = '\".$c_food_pref.\"' where c_id = \".$c_id;\n $result = $dbs->run_update_qry($qry); \n \n \n return json_encode($result);\n }", "public function updateBySql($table, $sql, $bind = []);", "function update(){\n $query = \"UPDATE\n \" . $this->table_name . \"\n SET\n email=:email, subject=:subject, message=:message \n\t\t\t\t\t WHERE\n\t\t\t\t\t\tid = :id\";\n \n // prepare query\n $stmt = $this->conn->prepare($query);\n \n // sanitize\n\t\t $this->id=htmlspecialchars(strip_tags($this->id));\n $this->name=htmlspecialchars(strip_tags($this->email));\n \n $this->description=htmlspecialchars(strip_tags($this->subject));\n $this->category_id=htmlspecialchars(strip_tags($this->message));\n \n \n \n // bind values\n\t\t $stmt->bindParam(\":id\", $this->id);\n $stmt->bindParam(\":email\", $this->email);\n \n $stmt->bindParam(\":subject\", $this->subject);\n $stmt->bindParam(\":message\", $this->message);\n \n // execute query\n if($stmt->execute()){\n return true;\n }else{\n return false;\n }\n }", "public function updateSQL() {\n $query = \"UPDATE TempRota SET e_id = %s WHERE shift_name = '%s' AND rdate = '%s'\";\n $q = \"\";\n if ($this->eid == \"-1\")\n $q = sprintf($query, \"NULL\", $this->shift_name, $this->rdate);\n else {\n $q = sprintf($query, $this->eid, $this->shift_name, $this->rdate);\n\n $quick_query = \"UPDATE Employees \"\n .\"SET fair_hours = fair_hours + (SELECT TIME_TO_SEC(TIMEDIFF(end_time, start_time))/3600 FROM ShiftType WHERE shift_name = '%s') \" \n .\"WHERE e_id = %s\";\n QFunc::getQuery(sprintf($quick_query, $this->shift_name, $this->eid));\n }\n QFunc::getQuery($q);\n }", "final protected function queryUpdate(CDFIDataConnection $db, $tableName = null, $whereColumn = null, $skipKeys = null)\n\t\t{\n\t\t\t// note: whereColumn can be null - be warned!\n\n\t\t\t// get the table name\n\t\t\t$tableName = $this->requireTableName($tableName);\n\n\t\t\t// build list of setters\n\t\t\t$sets = array();\n\t\t\tforeach($this->getColumnNames($skipKeys) as $key)\n\t\t\t\t$sets[] = $key . '=' . CDFIDataConnection_TokenCharacter; // foo=?\n\n\t\t\t// build sql\n\t\t\t$sql = sprintf('update `%s` set %s ', $tableName, implode(',', $sets));\n\n\t\t\t// append an additional parameter for the where clause\n\t\t\t$where = $this->findColumn($whereColumn);\n\t\t\tif($where != null)\n\t\t\t{\n\t\t\t\t$db->AddParameter($where->getDataType(), $where->getValue());\n\t\t\t\t$sql .= sprintf(' where `%s`=', $where->getName()) . CDFIDataConnection_TokenCharacter;\n\t\t\t}\n\n\t\t\t// pass query on to processor\n\t\t\t$db->Query($sql);\n\t\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",email1=\\\"$this->email1\\\",address1=\\\"$this->address1\\\",lastname=\\\"$this->lastname\\\",phone1=\\\"$this->phone1\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "protected function _update()\n\t{\n\t}", "private function formatUpdateCommand( $where = null )\n {\n $data_buffer_length = @ count( $this->data_buffer );\n if ( $data_buffer_length == 0 )\n return false;\n\n $sql = 'UPDATE ' . $this->table_name . ' SET ';\n $sql_clues = '';\n $this->quote( );\n $i = 0;\n\n foreach ( $this->data_buffer as $k => $v )\n {\n $sql_clues .= ' ' . $k . '=' . $v;\n if ( ( $i + 1 ) < $data_buffer_length )\n $sql_clues .= ',';\n $i++;\n }\n\n $sql .= $sql_clues;\n\n if ( $where != null )\n $sql .= ' WHERE ' . $where;\n return $sql;\n }", "public function executeUpdate($sql){\n $statement = $this->setQuery($sql);\n if(isset($statement)){\n $statement->execute($sql);\n } \n }", "public function update() {\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\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"UPDATE $this->sqlTable SET \";\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$sql .= \"lp_userid = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$sql .= \"lp_random = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$sql .= \"lp_deadline = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\r\n\t\t\t$sql = preg_replace ( '/, $/', '', $sql);\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\t\t\t$arrBindings[] = $this->id;\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\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: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set Origen='$this->Origen',Fechap='$this->Fechap',Horap='$this->Horap',Cod_Referencia='$this->Referencia',Nombre_Referencia='$this->Nombre',Ref_Tela='$this->Reftela',Pinta='$this->Pinta',Color='$this->Color',Proceso='$this->Proceso',Ubicacion='$this->Ubicacion',SKU='$this->Sku',Maquina='$this->Maquina',Longitud_Inicial='$this->Longitudini',Longitud_Final='$this->Longitudfin',Peso='$this->Peso',Grados_PFoAT800K='$this->Plancha',Grados_Plato='$this->Plato',Grados_Pie='$this->Pie',Grados_Aire_S='$this->Airesup',Grados_Aire_I='$this->Aireinf',Caudal_Sup='$this->Caudalsup',Caudal_Inf='$this->Caudalinf',Presion='$this->Presion',Velocidad='$this->Velocidad',Velocidad_Sup='$this->Velocidad_Sup',Velocidad_Inf='$this->Velocidad_Inf',Intensidad='$this->Intensidad',Tiempo_Exp='$this->Tiempo',Resultado='$this->Resultado',Dinamometro='$this->Dinamometro',Observaciones1='$this->Observaciones' where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function sql_update($table, $fields = array(), $where = null, $join = null, $limit = null, $offset = null) {\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 = 'UPDATE ' . sql_quote($prefix . $table, true);\n\t\n\t$sql_fields = array();\n\tforeach ($fields as $key => $value) {\n\t\tif( is_numeric($key) && is_string($value) ){\n\t\t\t$sql_fields[] = $value;\t\n\t\t}else{\n\t\t\t$sql_fields[] = $key . ' = ' . sql_quote($value);\n\t\t}\n\t}\n\t$query .= ' SET ' . implode(', ', $sql_fields) . ' ';\n\n\tif( $join ){\n\t\tif( is_string($join) ){\n\t\t\t$query .= ' ' . $join;\n\t\t}elseif( is_array($join) ){\n\t\t\t$query .= ' ' . sql_join($join, $table);\n\t\t}\n\t}\n\n\t$query .= !$where ? '' : ' WHERE ' . sql_logic($where);\n\n\t// LIMIT CLAUSE\n\tif( !is_null($limit) ){\n\t\t$query .= ' LIMIT ' . (int)$limit;\n\t\tif( !is_null($offset) ){\n\t\t\t$query .= ' OFFSET ' . (int)$offset;\n\t\t}\n\t}\n\n\tsql_dump($query);\n\n\t$q = $sql->prepare($query . ';');\n\treturn $q->execute();\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}", "public function updateData()\n {\n try {\n// echo \"<pre>\";\n// print_r($this->where);\n// print_r($this->insertUpdateArray);\n// exit;\n DB::table($this->dbTable)\n ->where($this->where)\n ->update($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n }", "protected function _update()\n {\n $hash = $this->hasChangedFields() ? $this->getChangedFields()\n : $this->getFields();\n\n $primary = array();\n\n // we should check if tabe has only one primary\n $keys = $this->_db->getPrimary();\n if (is_array($keys)) {\n foreach ($keys as $key) {\n $primary[\"{$key} = ?\"] = $this->_fields[$key];\n }\n }\n\n return $this->_db->update($hash, $primary);\n }", "function dataUpdatePublishStatus($p_id, $p_update_status)\n {\n $result_update = false;\n \n $sql = 'UPDATE user SET ';\n \n if ($p_update_status == 1)\n {\n $sql .= 'isactive = 1 ';\n } else {\n $sql .= 'isactive = 0 ';\n }\n\n $sql .= 'WHERE id = ? ';\n\n $paramtype = 'i';\n \n $paramdata = array(\n 'id' => $p_id \n );\n \n parent::stmtPrepare($sql); \n\n parent::stmtSetParamTypeString($paramtype);\n parent::stmtSetParamData($paramdata);\n parent::stmtBindParam();\n \n parent::stmtExecute();\n $result = parent::stmtGetTotalAffectedRows();\n \n if ($result > 0)\n {\n $result_update = '1';\n }\n\n parent::stmtReset(); \n parent::stmtClose(); \n \n return $result_update; \n }", "function dbUpdate($table, array $data, $where = null, $insertId = false){\n foreach ($data as $key => $value){ //Percorre os campos lendo o índice e o valor do array data\n $fields[] = \"{$key} = '{$value}'\"; //Atribui os índices e seus respectivos valor para um array\n }\n $fields = implode(', ', $fields); //Separa cada campo com vírgula\n //$table = DB_PREFIX.'_'.$table; //para pegar o prefixo da tabela caso use \n $where = ($where) ? \" WHERE {$where}\" : null; //Serve apenas para definir se haverá espaço entre fields e where\n $query = \"UPDATE $table SET {$fields}{$where}\"; //por isso, aqui não vai espaço\n return qExecute($query, $insertId);\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",lastname=\\\"$this->lastname\\\",username=\\\"$this->username\\\",email=\\\"$this->email\\\",kind=\\\"$this->kind\\\",status=\\\"$this->status\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update($modelData) {\n// codigoCliente = ? ,\n// codigoPedido = ?, \n// monto = ? WHERE codigo = ?\"; \n// \n// $stmt = $this->mysql->getStmt($sql);\n// $stmt->bind_param(\"iidi\", $modelData['codigoCliente'], \n// $modelData['codigoPedido'], \n// $modelData['monto'],\n// $modelData['codigo']);\n// $stmt->execute();\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function update() {\n\t\t$sql = \"UPDATE cost_detail \n\t\t\t\tSET\tcd_start_time=?, cd_end_time=?, cd_hour=?, cd_minute=?, cd_cost=?, cd_update=?, cd_user_update=? \n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\t\n\t\t$this->ffm->query($sql, array($this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update, $this->cd_fr_id, $this->cd_seq));\t\n\t}", "public function updateReserve(Request $request)\n { \n $data = $request -> json() -> all();\n $sql = \"update reserves set destino = ?, fechaReserva = ?, fechaSalida = ?, persona_id = ?\";\n $parameters = [$data['destino'], $data['fechaReserva'], $data['fechaSalida'], $data['persona_id']];\n $response = DB::select($sql, $parameters);\n return $response;\n }", "function update_query($table_name, $condition, $data = null, $unescaped_data = null) {\r\n\t\t$values = array();\r\n\r\n\t\tif (isset($data)) {\r\n\t\t\tforeach($data as $field => $value) {\r\n\t\t\t\t$values[$field] = \"`\".$field.\"` = '\".$this->escape($value).\"'\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (isset($unescaped_data)) {\r\n\t\t\tforeach($unescaped_data as $field => $value) {\r\n\t\t\t\t$values[$field] = \"`\".$field.\"` = \".$value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!count($values)) {\r\n\t\t\ttrigger_error(\"No data in update_query\", E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$sql = \"UPDATE `$table_name` SET \".implode(', ',$values).\" WHERE \".$condition;\r\n\r\n\t\treturn $this->query($sql);\r\n\r\n\t}", "public function updateQuiz()\r\n{\r\n $query_string = \"UPDATE quizzes \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"quizname = :quizname, \";\r\n $query_string .= \"quizdescription = :quizdescription \";\r\n $query_string .= \"WHERE quizid = :quizid\";\r\n\r\n return $query_string;\r\n}", "function editQuestionDB($update_arr=array(),$condition_arr=array()) {\r\n $this->db->where($condition_arr);\r\n $update = $this->db->update('dipp_question_master', $update_arr);\r\n if($update) {\r\n return TRUE;\r\n } else {\r\n return FALSE;\r\n }\r\n\t}", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "function update($where) {\n}" ]
[ "0.68319464", "0.6825938", "0.67059636", "0.66438085", "0.6542503", "0.64952064", "0.6487019", "0.645776", "0.6394323", "0.6340534", "0.6224786", "0.62000436", "0.61739296", "0.61639744", "0.6144187", "0.6143872", "0.61342597", "0.6132152", "0.6125644", "0.61115175", "0.6105398", "0.6096896", "0.6084256", "0.60802084", "0.6074741", "0.60469955", "0.6038129", "0.6022189", "0.6012744", "0.6009321", "0.6007178", "0.600717", "0.6002929", "0.5992133", "0.59845144", "0.5952919", "0.595101", "0.5941426", "0.5929399", "0.592751", "0.59254766", "0.59180796", "0.59177685", "0.5916103", "0.5901775", "0.58971924", "0.5894254", "0.589243", "0.5890545", "0.5887691", "0.5881413", "0.5879615", "0.58781856", "0.587269", "0.58708763", "0.5852302", "0.584541", "0.5822066", "0.5817226", "0.5807328", "0.57974726", "0.5786972", "0.5771818", "0.57716435", "0.57303774", "0.57281053", "0.5726932", "0.57241166", "0.57235485", "0.5715532", "0.5711746", "0.5710476", "0.5697176", "0.56897175", "0.5681241", "0.56809336", "0.56794864", "0.5671084", "0.56663966", "0.5665167", "0.56485975", "0.56481236", "0.5647602", "0.5646647", "0.5645721", "0.5645252", "0.5643136", "0.56357914", "0.5633896", "0.56313646", "0.5626674", "0.56116146", "0.5611058", "0.5610894", "0.560451", "0.56021404", "0.55918777", "0.5591827", "0.5591153", "0.55857867" ]
0.6381834
9
Returns the name of this type.
public function getName() { return 'international_transfer'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getName(): string {\n\t\t\treturn $this->type;\n\t\t}", "public function getTypeName()\n {\n return $this->type_name;\n }", "public function name() {\n\t\t\treturn $this->_name . ' ('.self::$type_name[$this->_type].')';\n\t\t}", "public function getTypeName()\n {\n return $this->type->getName();\n }", "public function getTypeName()\n {\n return $this->TypeName;\n }", "public function getNameType()\n {\n return $this->nameType;\n }", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function getTypeName()\n {\n return BalanceOperations::typeName($this->type_id);\n }", "protected function getTypeName(): string\n {\n if (isset($this->typeName)) {\n return $this->typeName;\n }\n\n return $this->getModelNameBasedOnClassName();\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public function get_name() {\n\n\t\treturn $this->post_type_name;\n\t}", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public static function name()\n {\n return isset(static::$name) ? static::$name : self::getClassShortName();\n }", "public function getName() {\n $path = explode('\\\\', get_class($this->object[\"data\"]));\n return array_pop($path);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n {\n return $this->get(self::_NAME);\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getName($type) {\n return $this->load($type)->getName();\n }", "public function getName()\n {\n $class = get_class($this);\n\n return str_replace($this->getObjectType(), '',\n str_replace(CADRE_appNameSpace.$this->getObjectTypePlural().'\\\\', '', $class));\n }", "function getName()\n {\n return get_class($this);\n }", "public function name()\n {\n return $this->getName();\n }", "public function name()\n {\n return $this->getName();\n }", "public function getName() {\n return self::NAME;\n }", "abstract public function getTypeName();", "function getName() {\n // $this is used to refer to an attribute of a class\n return $this->name;\n }", "public function type_name(){\r\n \r\n //sends back the name of the class running\r\n return $this->type_name;\r\n \r\n }", "public function getTypeName()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'typename'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'typename'];\n\t\t}\n\t}", "public function getTypeName(): string;", "public function getName() {\n return $this->__name;\n }", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public function getName()\n {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() {\n return $this->get(self::NAME);\n }", "public function getName() \n { \n return $this->getType().\"_\".substr(md5(implode($this->getParameters())), 0, 20);\n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function getName()\n {\n return $this->__get(\"name\");\n }", "public function name()\n {\n return $this->getFromCache(\n ['type' => 'name']\n );\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "public function getName()\n {\n $value = $this->get(self::NAME);\n return $value === null ? (string)$value : $value;\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "public function getName(): string\n {\n return self::NAME;\n }", "public function getName(): string\n {\n return self::NAME;\n }", "public function name() {\n\t\treturn $this->name;\n\t}", "public function getName ()\n {\n return $this->_name;\n }", "public function getName() {\n\t\treturn $this->_name;\n\t}", "public function getName() {\n\t\treturn $this->_name;\n\t}", "public function getName() {\n return $this->__name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n return $this->_name;\n }", "public function getName()\n {\n\t\treturn $this->_name;\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName() : string\n {\n return $this->_name;\n }", "public function name()\n\t{\n\t\treturn $this->_name;\n\t}", "public function getName(): string {\n return (string) $this->name;\n }", "public function name() {\n return $this->name;\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function getName()\n {\n return isset($this->name) ? $this->name : '';\n }", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "public function name()\n\t{\n\t\treturn $this->name;\n\t}", "function getName () {\n\t\treturn $this->name;\n\t}", "public function getName () {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}", "public function getName() {\n\t\treturn $this->name;\n\t}" ]
[ "0.8866213", "0.88208175", "0.8817157", "0.87542146", "0.855894", "0.8204096", "0.8155769", "0.8155769", "0.8136834", "0.8110998", "0.80263054", "0.8010495", "0.79981846", "0.79853827", "0.79727006", "0.79586303", "0.79586303", "0.79586303", "0.79586303", "0.79586303", "0.79586303", "0.79586303", "0.79364926", "0.7934683", "0.7927874", "0.7898144", "0.7886855", "0.78786373", "0.78786373", "0.78678817", "0.7842295", "0.7834188", "0.7827454", "0.78219575", "0.7812393", "0.7800831", "0.77814907", "0.77814907", "0.7780031", "0.7780031", "0.7780031", "0.775455", "0.77500206", "0.77445644", "0.77445644", "0.7734659", "0.7734592", "0.7734592", "0.7734592", "0.772114", "0.7705516", "0.7705516", "0.7701025", "0.7681991", "0.7672641", "0.7672641", "0.76702243", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.7665081", "0.76613384", "0.764533", "0.764533", "0.764366", "0.7630487", "0.7627439", "0.7625279", "0.76179457", "0.76179457", "0.76179457", "0.76179457", "0.761623", "0.761623", "0.761623", "0.76136446", "0.7610586", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116", "0.76099116" ]
0.0
-1
Load Sentry and set the current user (if logged in).
public function __construct($config, DB $db) { // config $this->config = $config; // injected dependencies $this->db = $db; // load Sentry $this->load_sentry(); // get user; Sentry::check() takes the longest time of the Sentry operations $this->user = Sentry::check() ? Sentry::getUser() : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _initAuth()\n {\n $dm = Registry::getInstance()->get('dm');\n $user = $dm->getRepository('Domain\\User\\Entity\\User')->find('4de999713eecad69a02e4145');\n \n // Simulate logged in User.\n Registry::getInstance()->set('user', $user);\n }", "private function __setUser() {\n // Create the (helper) user object from the authenticated subject if present\n $subject = \\Native5\\Identity\\SecurityUtils::getSubject();\n if ($subject->isAuthenticated()) {\n $this->user = \\Akzo\\User\\Service::getInstance()->getUser(\n $subject->getPrincipal()['username'],\n $subject\n );\n }\n }", "public function setUser()\n\t{\n\t\t$user = User::getInstance();\n\t\t\n\t\tif ( $this->session->get( 'user_id' ) ) {\n\t\t\t$user->set( 'id', $this->session->get( 'user_id' ) );\n\t\t\t$user->read();\n\t\t}\n\t}", "protected function set_current_user()\n\t{\n\t\tif (class_exists('Auth'))\n\t\t{\n\t\t\t// Load our current logged in user for convenience\n\t\t\tif ($this->auth->is_logged_in())\n\t\t\t{\n\t\t\t\t$this->current_user = clone $this->auth->user();\n\n\t\t\t\t$this->current_user->user_img = gravatar_link($this->current_user->email, 22, $this->current_user->email, \"{$this->current_user->email} Profile\");\n\n\t\t\t\t// if the user has a language setting then use it\n\t\t\t\tif (isset($this->current_user->language))\n\t\t\t\t{\n\t\t\t\t\t$this->config->set_item('language', $this->current_user->language);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Make the current user available in the views\n\t\t\tif (!class_exists('Template'))\n\t\t\t{\n\t\t\t\t$this->load->library('Template');\n\t\t\t}\n\t\t\tTemplate::set('current_user', $this->current_user);\n\t\t}\n\t}", "public function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\tSession::start();\n\n\t\ttry\n\t\t{\n\t\t\tSentry::register([\n\t 'email' => '[email protected]',\n\t 'password' => 'test'\n\t ], true);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t// Crappy catch all.\n\t\t}\n\n Sentry::authenticate([\n 'email' => '[email protected]',\n 'password' => 'test'\n ]);\t\t\n\t}", "private function __setAuthUser()\n {\n $authUser = $this->request->session()->read('Auth');\n\n $accountType = 'FREE';\n if (!empty($authUser)) {\n $accountType = $authUser['User']['account_type'];\n }\n\n $this->set(compact('authUser', 'accountType'));\n }", "public function __construct(){\n $user = Sentry::getUser();\n\n if($user && !$user->hasAccess('admin')){\n echo 'Giriş İzniniz yok';\n exit;\n }\n }", "public function init() {\n\t\twp_get_current_user();\n\t}", "public function setupUser() {\n parent::setupGlobalVariables();\n $session = (new SessionService())->getNewSession();\n if (!$session->isStarted()) $session->start();\n if ($session->get('user')) {\n $variables = array(\n 'username' => $session->get('user')['username'],\n 'role' => $session->get('user')['role']\n );\n $this->mergeToTemplateVariables($variables);\n }\n }", "public function checkSignedIn() {\n\t if (!empty($this->user) && $this->user !== 'anon.') {\n\t $this->addAlias($this->getIdentifier(), $this->user);\n\t }\n\t}", "public function __construct()\n\t{\n\t\t// set our login column to match Sentry's configured login value\n\t\tstatic::$login_column = Config::get('cartalyst/sentry::sentry.users.login_attribute');\n\t}", "public static function init()\n\t{\n\t\tself::$config = Kohana::$config->load('core')->as_array();\n\t\tself::$log = new Fusion_Log;\n\n\t\ttry\n\t\t{\n\t\t\t// Get the current active/logged in user\n\t\t\tself::$user = Sentry::getUser();\n\t\t}\n\t\tcatch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n\t\t{\n\t\t\t// User wasn't found, should only happen if the user was deleted\n\t\t\t// when they were already logged in or had a \"remember me\" cookie set\n\t\t\t// and they were deleted.\n\t\t\tself::$user = null;\n\t\t}\n\n\t\tself::$permissions = Permissions::instance();\n\t\tself::$mail = new Mail;\n\t\tself::$assets = new Assets;\n\t}", "public function __construct()\n {\n $this->initCurrentUser();\n }", "function user_init($env, $vars) {\n $user = UserFactory::current($env);\n // TODO: fix cookies.\n\t//setcookie('user', NULL, $env->getData('session_lifetime', 86400));\n}", "static function setupUser()\n {\n global $sugar_config;\n require_once 'modules/Users/User.php';\n $_SESSION['unique_key'] = $sugar_config['unique_key'];\n $user_id = $GLOBALS['db']->getOne(\"SELECT id FROM users WHERE user_name='{$GLOBALS['bob_config']['global']['admin_user_name']}' AND is_admin=1\");\n if(empty($user_id)) {\n throw new Exception(\"Can't find user \".$GLOBALS['bob_config']['global']['admin_user_name'], 1);\n }\n $_SESSION['authenticated_user_id'] = $user_id;\n $GLOBALS['current_user'] = new User();\n $GLOBALS['current_user'] = $GLOBALS['current_user']->retrieve($user_id); \n }", "private function init_user() {\n global $USER, $DB;\n\n $userdata = new stdClass;\n $userdata->username = 'user';\n $userid = user_create_user($userdata);\n $USER = $DB->get_record('user', array('id' => $userid));\n context_user::instance($USER->id);\n }", "static function logIn($user) {\n if (isset($user)) {\n session_start();\n $_SESSION['userId'] = $user->id;\n }\n }", "public function load_current_user()\n\t{\n\t\t$userid = $this->CI->session->userdata('userid');\n\t\tif($userid)\n\t\t{\n\t\t\t$userdata = $this->CI->user_model->get_by_id($userid);\n\t\t\tif($userdata !== NULL)\n\t\t\t{\n\t\t\t\t$this->set_current_user($userdata);\n\t\t\t}\n\t\t}\n\t}", "function onBeforeInit() {\n\t\tif(Permission::check(\"ADMIN\")) return;\n\t\t\n\t\t// Logged into vBulletin; should be logged into SilverStripe\n\t\tif($userID = $this->currentVBUserID()) {\n\t\t\tif(!Member::currentUserID()) {\n\t\t\t\t$member = $this->findUser($userID);\n\t\t\t\tif(!$member) $member = $this->createNewUser($userID);\n\t\t\t\t$member->logIn();\n\t\t\t}\n\t\t\t\n\t\t// Not logged into vBulletin; shoudln't be logged into SilverStripe\n\t\t} else {\n\t\t\tif($member = Member::currentUser()) {\n\t\t\t\t$member->logOut();\n\t\t\t}\n\t\t}\n\t}", "public function setLoggedUser(){\n\t\tif(isset($_SESSION['ccUser']) && !empty($_SESSION['ccUser'])){\n\t\t\t$id = $_SESSION['ccUser'];\n\n\t\t\t$sql = $this->db->prepare(\"SELECT * FROM users WHERE id = :id\");\n\t\t\t$sql->bindValue(':id', $id);\n\t\t\t$sql->execute();\n\n\t\t\tif($sql->rowCount() > 0){\n\t\t\t\t$this->userInfo = $sql->fetch();\n\t\t\t\t$this->permissions = new Permissions();\n\t\t\t\t$this->permissions->setGroup($this->userInfo['id_group']);\n\t\t\t}\n\t\t}\n\t}", "public function setLoggedUser(){\n\t\tif(isset($_SESSION['ccUser']) && !empty($_SESSION['ccUser'])){\n\t\t\t$id = $_SESSION['ccUser'];\n\n\t\t\t$sql = $this->db->prepare(\"SELECT * FROM users WHERE id = :id\");\n\t\t\t$sql->bindValue(':id', $id);\n\t\t\t$sql->execute();\n\n\t\t\tif($sql->rowCount() > 0){\n\t\t\t\t$this->userInfo = $sql->fetch();\n\t\t\t\t$this->permissions = new Permissions();\n\t\t\t\t$this->permissions->setGroup($this->userInfo['id_group']);\n\t\t\t}\n\t\t}\n\t}", "private function _setDefaultUser()\n {\n $user = User::getDefaultUser();\n Globals::setUser($user);\n Zend_Auth::getInstance()->clearIdentity();\n }", "public function setRequestUser(Request $request)\n {\n $request->addUserCallback('accounts', function (Request $request) {\n\n try {\n $session = $request->getSession();\n } catch (DataNotSet $e) {\n return null;\n }\n\n $userid = $session->get('catlab-user-id');\n\n if ($userid) {\n /** @var User $user */\n $user = MapperFactory::getUserMapper()->getFromId($userid);\n if ($user && !$user->isAnonymized()) {\n return $user;\n } else {\n $this->logout($request);\n }\n }\n\n return null;\n });\n }", "public function signIn($user)\n {\n $this->setAuthenticated(true);\n\n $this->setAttribute('loggedin', true, 'user');\n $this->setAttribute('remoteaddress', $_SERVER['REMOTE_ADDR'], 'user');\n $this->setAttribute('useragent', $_SERVER['HTTP_USER_AGENT'], 'user');\n\n $this->initializeUser($user);\n }", "private function setLoggedinUser($userId)\n {\n echo \"setting logged user\";\n $user = new User($userId, $this->db);\n $_SESSION['auth'] = $user->getUserObject();\n header(\"Refresh:0\");\n }", "protected function load_sentry() {\n // autoload script generated by Composer\n require_once __DIR__ . '/../vendor/autoload.php';\n\n // alias the Sentry class\n if (!class_exists('Refiler\\Sentry')) {\n class_alias('\\Cartalyst\\Sentry\\Facades\\Native\\Sentry', 'Refiler\\Sentry');\n }\n\n // connect the database to Sentry\n // the following call doesn't work with the table prefix argument due to a\n // Sentry issue: https://github.com/cartalyst/sentry/issues/210\n // Sentry::setupDatabaseResolver($db->get_PDO(), null, $table_prefix);\n $resolver = new \\Cartalyst\\Sentry\\Facades\\ConnectionResolver(\n $this->db->get_PDO(),\n $this->db->get_PDO()->getAttribute(\\PDO::ATTR_DRIVER_NAME)\n );\n $resolver->getConnection()->setTablePrefix(\n $this->config['sentry_table_prefix']\n );\n \\Illuminate\\Database\\Eloquent\\Model::setConnectionResolver($resolver);\n\n // disable the throttling feature; doing this has a nice side effect of\n // Sentry::check() taking a little less time\n Sentry::getThrottleProvider()->disable();\n }", "public function initialize() {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Auth');\n $userdata = $this->Auth->user();\n $this->set('loggeduser', $userdata);\n \n }", "public function set()\n\t{\n\t\t$this->created_at = date(TIMESTAMP_FORMAT);\n $user = new SessionUser();\n\t\t$this->created_by = $user->getID();\t\t\n\t}", "private function check_login()\n {\n if (self::exists('user_id')) {\n $this->user_id = self::get('user_id');\n $this->logged_in = true;\n } else {\n unset($this->user_id);\n $this->logged_in = false;\n }\n }", "protected function setupAdminUser()\n {\n $GLOBALS['current_user'] = \\BeanFactory::getBean('Users')->getSystemUser();\n }", "function setUser($usr) \n {\n\t\t\t$this->user = ((empty($usr)) ? \"root\" : $usr);\n\t\t}", "public function setUser($info)\n {\n self::set('_user', $info);\n }", "public function getCurrentUser()\n {\n $userId = Security::getUserId();\n if (!empty($userId)) {\n $this->uid = $userId;\n }\n }", "public function __loadUser()\n {\n\t$facebook = $this->fb;\n\t$this->user = $facebook->api(\"/me\", \"GET\");\n\t$this->userid = $facebook->getUser();\n\treturn;\n }", "public function __construct()\n {\n $this->current_user = Auth::getUser();\n }", "protected function init_session () {\n\t\t$Request = Request::instance();\n\t\t/**\n\t\t * If session exists\n\t\t */\n\t\tif ($Request->cookie('session')) {\n\t\t\t$this->user_id = $this->load();\n\t\t}\n\t\t$this->update_user_is();\n\t}", "public function init() {\r\n $this->_model = new Storefront_Model_User();\r\n\r\n $this->_authService = Storefront_Service_Authentication::getInstance(\r\n $this->_model\r\n );\r\n }", "private function _setIdentity(){\n $this->_setUserData($this->getClassUser()->getIdentity());\n }", "public function filterStartup() {\n // is user authenticated? account owner only\n try {\n $this->user = new User('admin');\n\n } catch (UserNotAuthenticatedException $e) {\n $this->redirectTo('/login/');\n\n } catch (UserNotAuthorizedException $e) {\n $this->renderTemplate('Error404/error404');\n\n }\n\n $this->accounts = new Accounts();\n\t}", "public static function SetUpUserBySession ();", "private function checkLogin() {\n if (!$this->checkConfig()) return;\n $config = $this->getConfig();\n\n if (isset($_SESSION['signin/twitter/status']) && $_SESSION['signin/twitter/status']=='verified') {\n\n $screenname = $_SESSION['signin/twitter/request_vars']['screen_name'];\n $twitterid = $_SESSION['signin/twitter/request_vars']['user_id'];\n $oauth_token = $_SESSION['signin/twitter/request_vars']['oauth_token'];\n $oauth_token_secret = $_SESSION['signin/twitter/request_vars']['oauth_token_secret'];\n\n $connection = new TwitterOAuth($config['consumer_key'], $config['consumer_secret'], $oauth_token, $oauth_token_secret);\n\n // check if we already have this Twitter user in our database\n $user = UserQuery::create()->findOneByOAuthSignIn('twitter::' . $twitterid);\n if (!$user) {\n // if not we create a new one\n $user = new User();\n $user->setCreatedAt(time());\n $user->setOAuthSignIn('twitter::' . $twitterid);\n // we use the email field to store the twitterid\n $user->setEmail('');\n $user->setRole(UserPeer::ROLE_EDITOR); // activate user rigth away\n $user->setName($screenname);\n $user->setSmProfile('https://twitter.com/'.$screenname);\n $user->save();\n }\n DatawrapperSession::login($user);\n }\n }", "public static function loadSettingsAfterLogin() {\r\n\t\t//try to load from DB\r\n\t\t$settings=UserSettings::model()->findByAttributes(array('userId'=>Yii::app()->user->getId()));\r\n\t\t\r\n\t\tif(is_null($settings)) {\r\n\t\t\t//if there is nothing in DB, keep what is in session data, if anything is there\r\n\t\t\t$settings=Yii::app()->user->getState('settings');\r\n\t\t\t\r\n\t\t\t//else just use new\r\n\t\t\tif(is_null($settings)) {\r\n\t\t\t\t$settings=new UserSettings();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tYii::app()->user->setState('settings', $settings);\r\n\t}", "function initUser(&$user) {\n $user->setName($this->getFasUsername());\n $user->mEmail = strtolower($user->getName()).\"@fedoraproject.org\";\n $user->mEmailAuthenticated = wfTimestampNow();\n $user->setToken();\n $user->saveSettings();\n //error_log(\"FAS [initUser]: \" . $user->getName() . \", \" . $this->getFasUsername(), 0);\n return true;\n }", "protected function setupUser()\n {\n $user = \\App\\Models\\User::first();\n\n if (empty($user)) {\n $this->user = \\App\\Models\\User::factory()->create();\n } else {\n $this->user = $user;\n }\n\n $this->actingAs($this->user);\n }", "function set($data) {\n\t\t// the contents of Auth::user().\n\t\tif (empty($data)) {\n\t\t\treturn false;\n\t\t}\n\t\tLogin::getInstance($data);\n\t}", "public function getCurrentUser(){\n $currentUser = $_SESSION['userdata'];\n\n // Sets the user object\n $this->setUser($currentUser->control);\n\n }", "public function init()\n {\n $this->_helper->viewRenderer->setNoRender();\n $this->_helper->layout->disableLayout();\n \n $this->_user = Ediary_Auth::getUser();\n if (null == $this->_user) {\n $this->getResponse()->setHttpResponseCode(403);\n exit(\"No Access.\");\n }\n }", "function signInAsUser($args, &$request) {\n\t\t$this->addCheck(new HandlerValidatorJournal($this));\n\t\t// only managers and admins have permission\n\t\t$this->addCheck(new HandlerValidatorRoles($this, true, null, null, array(ROLE_ID_SITE_ADMIN, ROLE_ID_JOURNAL_MANAGER)));\n\t\t$this->validate();\n\n\t\tif (isset($args[0]) && !empty($args[0])) {\n\t\t\t$userId = (int)$args[0];\n\t\t\t$journal =& $request->getJournal();\n\n\t\t\tif (!Validation::canAdminister($journal->getId(), $userId)) {\n\t\t\t\t$this->setupTemplate($request);\n\t\t\t\t// We don't have administrative rights\n\t\t\t\t// over this user. Display an error.\n\t\t\t\t$templateMgr =& TemplateManager::getManager();\n\t\t\t\t$templateMgr->assign('pageTitle', 'manager.people');\n\t\t\t\t$templateMgr->assign('errorMsg', 'manager.people.noAdministrativeRights');\n\t\t\t\t$templateMgr->assign('backLink', $request->url(null, 'manager', 'people', 'all'));\n\t\t\t\t$templateMgr->assign('backLinkLabel', 'manager.people.allUsers');\n\t\t\t\treturn $templateMgr->display('common/error.tpl');\n\t\t\t}\n\n\t\t\t$userDao =& DAORegistry::getDAO('UserDAO');\n\t\t\t$newUser =& $userDao->getUser($userId);\n\t\t\t$session =& $request->getSession();\n\n\t\t\t// FIXME Support \"stack\" of signed-in-as user IDs?\n\t\t\tif (isset($newUser) && $session->getUserId() != $newUser->getId()) {\n\t\t\t\t$session->setSessionVar('signedInAs', $session->getUserId());\n\t\t\t\t$session->setSessionVar('userId', $userId);\n\t\t\t\t$session->setUserId($userId);\n\t\t\t\t$session->setSessionVar('username', $newUser->getUsername());\n\t\t\t\t$request->redirect(null, 'user');\n\t\t\t}\n\t\t}\n\t\t$request->redirect(null, $request->getRequestedPage());\n\t}", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "function set_authenticated( $user ) {\n\t\n\t$_SESSION['GHOME'] = \"yes\";\n\t$_SESSION['GHOME_CUSER'] = $user;\n}", "public static function userLoggedIn()\n {\n //Hvis en bruker ikke er logget inn, vil han bli sent til login.php\n if (!isset($_SESSION['user'])) {\n //Lagrer siden brukeren er på nå slik at han kan bli redirigert hit etter han har logget inn\n $_SESSION['returnPage'] = $_SERVER['REQUEST_URI'];\n $alert = new Alert(Alert::ERROR, \"Du er nøtt til å være logget inn for å se den siden. Ikke prøv deg på noe.\");\n $alert->displayOnOtherPage('login.php');\n\n }\n }", "protected static function booted()\n {\n static::creating(function ($checkin) {\n $checkin->user_id = auth()->id();\n });\n }", "protected function init(Request $request)\n {\n $userId = $request->session()->get('userId');\n if(!isset($userId)){\n $this->user = new User();\n if(isset($this->user->userId)){\n Cache::put('user_'.$this->user->userId, serialize($this->user), 30);\n }\n $request->session()->put('userId' ,$this->user->userId);\n $request->session()->save();\n }else{\n $this->user = unserialize(Cache::get('user_' . $userId));\n if(empty($this->user)){\n $this->user = new User($userId);\n Cache::put('user_'.$this->user->userId, $this->user->serialize(), 30);\n }elseif(is_array($this->user)){\n $aUser = $this->user;\n $this->user = new User();\n $this->user->initFromArray($aUser);\n }\n }\n\n }", "public function init()\n {\n \t$auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity()){\n \t\t$this->identity = $auth->getIdentity();\n \t}\n }", "private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1258);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }", "protected static function persistCurrentUser()\n {\n // Black hole\n trigger_error(\n \"Method for remembering the current user isn't implemented. \" .\n \"You can use the Jasny\\Auth\\Sessions trait to store the current user in a session\",\n E_USER_NOTICE\n );\n }", "private function synchronize()\n {\n $_SESSION['user'] = $this->user;\n }", "public function signInAction()\n {\n $userData = $this->manager->findOneBy(['username' => $this->httpParameters['login']]);\n\n //If no user were found, redirects\n if(empty($userData))\n {\n $this->response->redirect('/auth',HttpResponse::WRONG_LOGIN);\n }\n\n //Instantiates the user\n $user = new User($userData);\n\n //Checks if typed password matches user's password\n if($this->passwordMatch($this->httpParameters['loginPassword'],$user,'/auth'))\n {\n //Sets the user instance as a the new $_SESSION['user']\n $_SESSION['user'] = $user;\n\n $this->response->redirect('/admin');\n }\n }", "public function check_login(){\n\t\t\tif( isset( $_SESSION['user_id'] ) ) {\n\t\t\t\t$this->user_id = $_SESSION['user_id'];\n\t\t\t\t$this->logged_in = true;\n\t\t\t} else {\n\t\t\t\tunset( $this->user_id );\n\t\t\t\t$this->logged_in = false;\n\t\t\t}\n\t\t}", "public function onUserLogin($event)\n {\n $user = $event->user;\n // lets save the last_login timestamp.\n $user->last_login = Carbon::now();\n $user->save();\n\n $this->setPermissions($user);\n }", "function setLoggedUser(pclib\\AuthUser $user)\n{\n\t$this->loggedUser = $user;\n\t$this->setSessionUser($user);\n}", "protected function before()\n\t{\n\t\tparent::before();\n\t\t$this->user = Auth::getUser();\n\t}", "private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }", "public function initialize()\n {\n $this->view->disable();\n\n // all API functions will require authentification\n $userEmail = $this->request->get('email');\n $user = User::findFirst([['email' => $userEmail]]);\n $userApiKey = $this->request->get('apiKey');\n if (empty($user) || $user->apiKey != $userApiKey) {\n echo '{\"result\": \"error\", \"message\": \"wrong credentials\"}';\n // API error management should be unified somehow\n die();\n }\n\n $this->user = $user;\n }", "public function run()\n\t{\n\t\tDB::table('users')->delete();\n\t\tSentry::getUserProvider()->create(array(\n\t 'email' => '[email protected]',\n\t 'password' => 'sentryadmin',\n\t 'activated' => 1,\n\t ));\n\t Sentry::getUserProvider()->create(array(\n\t 'email' => '[email protected]',\n\t 'password' => 'sentryuser',\n\t 'activated' => 1,\n\t ));\n\t}", "public static function entry(Model_User $user = null, Model_Blog_Entry $entry = null) {\n\t\tif ($user && $entry) {\n\t\t\tparent::add($user, 'blog', self::TYPE_ENTRY, array('entry_id' => (int)$entry->id));\n\t\t}\n\t}", "public static function LoggedIn() {\n\t\tif (empty($_SESSION['current_user'])) {\n\t\t\tnotfound();\n\t\t}\n\t}", "public function initializeBackendUser() {}", "public function initializeBackendUser() {}", "private function setUser()\n {\n return $this->user = Auth::check() ? Auth::user() : app(config('auth.model'));\n }", "protected static function bootUserLogger()\n {\n// parent::boot();\n\n static::creating(function ($model) {\n $user = Auth::user();\n\n if($user)\n $model->created_by = $user->id;\n });\n\n static::updating(function ($model) {\n $user = Auth::user();\n\n if($user)\n $model->updated_by = $user->id;\n });\n }", "protected function before()\r\n {\r\n parent::before();\r\n\r\n $this->user = Auth::getUser();\r\n }", "public function ual_activity_login() {\n\n\t\t// Prevent user ID returning as 0.\n\t\t$user_reset = apply_filters( 'determine_current_user', false );\n\n\t\twp_set_current_user( $user_reset );\n\n\t\t// Store user id.\n\t\t$user_id = get_current_user_id();\n\n\t\t// If we have the user id, continue.\n\t\tif ( ! empty( $user_id ) ) {\n\t\t\t// Get user data with id.\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Store a user name.\n\t\t\t$user_name = $user->display_name ? $user->display_name : $user->user_nicename;\n\n\t\t\t// Log this activity.\n\t\t\tdo_action( 'ual_log_action', $user->ID, $user_name . ' logged In', 'logged-in' );\n\t\t}\n\t}", "function auth_set($sess)\n{\n _app('auth', $sess);\n session_set(auth_namespace(), $sess, true);\n}", "protected function before()\n {\n parent::before();\n\n $this->user = Auth::getUser();\n }", "protected function before()\n {\n parent::before();\n\n $this->user = Auth::getUser();\n }", "public function hookUserAuthenticated(GDO_User $user)\n {\n \t$user->saveVar('user_timezone', $user->getTimezone());\n }", "protected function requireLogin()\n {\n if (!$this->simulateFb) {\n $this->fbUserId = $this->facebook->require_login();\n } else {\n $config = new Zend_Config_Ini(\n APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);\n $this->fbUserId = $config->facebook->testFbUserId;\n }\n\n $this->view->fbUserId = $this->fbUserId;\n\n // Initialise the user locale data.\n $this->initTimezone();\n\n }", "public function setUser(Authenticatable $user)\n {\n $this->session->put('google_guard_user', $user);\n $this->session->put('socialite_token', $user->token);\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n\n// Config::inst()->update(\n// 'PHPTek\\Sentry\\Adaptor\\SentryClientAdaptor',\n// 'opts',\n// ['dsn' => 'http://deacdf9dfedb24ccdce1b90017b39dca:[email protected]/44']\n// );\n }", "protected function before(): void {\n parent::before();\n\n $this->user = Auth::getUser();\n }", "function set_login_user_id( $user_id )\n\t{\n\t\t$this->login_user_id = $user_id;\n\t}", "protected function authenticated(Request $request, $user)\n {\n // Call user login event\n\t\tevent(new UserLoggedIn($user));\t\t\n }", "public function prePersist(LifecycleEventArgs $eventArgs): void\n {\n $user = $eventArgs->getObject();\n\n if (!$user instanceof User) {\n return;\n }\n\n $user\n ->setSalt($this->generator->generateSalt())\n ->setApiKey($this->generator->generateApiKey($user));\n }", "function setUser( $user )\r\n {\r\n if ( is_a( $user, \"eZUser\" ) )\r\n {\r\n $userID = $user->id();\r\n\r\n $this->UserID = $userID;\r\n }\r\n }", "private function _setGlobalsUser($userId)\n {\n $userTable = new User();\n $user = $userTable->find($userId)->current();\n Globals::setUser($user);\n }", "public function init()\n {\n if (!$_SESSION[$this->cookie_prefix . '_user']) {\n $email = '';\n $password = '';\n \n if ($_COOKIE[$this->cookie_prefix . '_email'] and $_COOKIE[$this->cookie_prefix . '_password']) {\n $email = $_COOKIE[$this->cookie_prefix . '_email'];\n $password = $_COOKIE[$this->cookie_prefix . '_password'];\n } elseif ($_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']) { //check for basic authentication\n $email = $_SERVER['PHP_AUTH_USER'];\n $password = md5($this->secret_phrase . $_SERVER['PHP_AUTH_PW']);\n }/* elseif ($_GET['auth_user'] and $_GET['auth_pw']) {\n $email = $_GET['auth_user'];\n $password = md5($this->secret_phrase . $_GET['auth_pw']);\n }*/\n \n if ($email and $password and table_exists($this->table)) {\n $result = sql_query('SELECT * FROM ' . $this->table . \" WHERE\n \t\t\t\temail='\" . escape($email) . \"'\n \t\t\t\", 1);\n \n if ($result && $password == md5($this->secret_phrase . $result['password'])) {\n $_SESSION[$this->cookie_prefix . '_email'] = $result['email'];\n $_SESSION[$this->cookie_prefix . '_password'] = $result['password'];\n }\n }\n }\n\n //check if logged in\n if ($_SESSION[$this->cookie_prefix . '_user'] and time() < $_SESSION[$this->cookie_prefix . '_expires']) {\n $this->user = $_SESSION[$this->cookie_prefix . '_user'];\n } elseif ($_SESSION[$this->cookie_prefix . '_email'] and $_SESSION[$this->cookie_prefix . '_password'] and table_exists($this->table)) {\n $this->load();\n }\n\n if ($_GET['u']) {\n $_SESSION['request'] = $_GET['u'];\n }\n }", "public function init()\n {\n \t$this->_CommonModel = new Application_Model_Common();\n \t$infoUser = $this->_CommonModel->loadInfoUser();\n \tif ($infoUser!=null) {\n \t\t$this->_username = $infoUser->username;\n \t}\n }", "public function __construct() {\n // Reason: Internal function call from Kernel cannot have an authenticated user\n }", "public function setUser($user)\n {\n $this->user = Auth::user();\n }", "private function setUserFromRequest($request)\n {\n $user = $request->user();\n\n if ($request->has('user'))\n {\n try \n {\n $user = User::findOrFail($request->user);\n }\n catch(\\Exception $e)\n {\n abort(404, 'User not found');\n }\n }\n\n return $user;\n }", "public function handleUserLogin($event) {\n //Log user login\n $activity = new Activity;\n $activity->activity_type = 'login';\n $activity->actor_id = $event->user->id;\n $activity->actor_type = 'user';\n $activity->activity_data = '';\n $activity->user_agent = $this->request->header('User-Agent');\n $activity->actor_ip = $this->request->ip();\n $activity->save();\n }", "public function logInUserChangesToLoggedInStatus() {\n\t\t$user = new Tx_Oelib_Model_FrontEndUser();\n\t\t$this->subject->logInUser($user);\n\n\t\t$this->assertTrue(\n\t\t\t$this->subject->isLoggedIn()\n\t\t);\n\t}", "public function instantiate() {\n\n // Checking if a user session already exists.\n if ($this->session->userData('loggedIn') === true) {\n\n // Set the identity\n $this->setIdentity($this->session->userData('id'));\n\n // Set isGuest to false.\n $this->isGuest = false;\n }\n }", "public function signIn() {\n\t\t\n\t\t$newVoucher = VoucherProvider::getVoucher();\n\t}", "private function assign_auth_values(){\n\t\t$is_authenticated = AuthManager::is_authenticated();\n\t\t$this->assign('batl_is_logged', $is_authenticated);\n\t\tif($is_authenticated && $this->is_db_available()){\n\t\t\t// check if logged in local server\n\t\t\t$this->assign('batl_is_admin', AuthManager::is_current_user_admin());\n\t\t\t$this->assign('batl_current_user', AuthManager::get_user_infos());\n\n\t\t}else{\n\t\t\t// check if logged in on FB\n\t\t\t/*$facebook_manager = new FacebookService();\n\t\t\t$batl_current_user = AuthManager::get_user_profile($facebook_manager);\n\t\t\t$this->assign('batl_current_user', $batl_current_user);\n\t\t\t$this->assign('fbloginouturl', AuthManager::get_loginout_url($facebook_manager,$batl_current_user));*/\n\t\t}\n\t}", "public static function boot()\n {\n parent::boot();\n\n static::creating(function ($user) {\n /* Our Default Referral Link if No Cookie Is Present */\n $user->sp_id = optional(self::first())->id;\n /* change this */\n $sponsorID = \\Cookie::get('sponsor');\n\n /* if cookie is present */\n if ($sponsorID) {\n $sponsor = self::find($sponsorID);\n $user->sp_id = $sponsor->id;\n }\n\n /* override cookie with current request */\n if ($sponsorID = request()->sponsor_id) {\n $sponsor = self::find($sponsorID);\n $user->sp_id = $sponsor->id;\n }\n });\n }", "public function saveSignIn()\n {\n $this->has_signed_in_once = true;\n $this->last_signin = date('Y-m-d H:i:s');\n $this->save();\n }", "function loggedin() {\n $this->checkAccess('user',false,false);\n\n $template = new Template;\n $user = new User($this->db);\n\n //get user details\n $user->getByEmail($this->f3->get('SESSION.email'));\n $this->f3->set('user', $user);\n\n //get user followers\n $this->f3->set('followers', $user->getUserFollowers($this->f3->get('SESSION.cid'))[0]);\n\n //get user waiting position\n $this->f3->set('waitrank', $user->getUserWaitPosition($this->f3->get('SESSION.cid'))[0]);\n\n echo $template->render('header.html');\n echo $template->render('user/user.html');\n echo $template->render('footer.html');\n }", "public static function setUsername($val) \n { \n emailSettings::$username = $val; \n }", "public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }" ]
[ "0.61850625", "0.60514975", "0.5884458", "0.58789784", "0.5803547", "0.5790105", "0.5765164", "0.5731039", "0.57177144", "0.57106185", "0.56393164", "0.5635627", "0.5614881", "0.56049716", "0.5587977", "0.5529825", "0.5433928", "0.54193777", "0.54134107", "0.5405607", "0.5405607", "0.5395885", "0.5347452", "0.53463465", "0.53399014", "0.5327436", "0.53225595", "0.53214014", "0.53204614", "0.53153175", "0.53133607", "0.5311166", "0.528049", "0.52532107", "0.5247526", "0.524177", "0.52378", "0.5230006", "0.52292687", "0.5207654", "0.52049726", "0.51942307", "0.5182702", "0.5176592", "0.5148001", "0.5145576", "0.5136872", "0.51360464", "0.5113038", "0.5109401", "0.51036954", "0.51006866", "0.50721276", "0.50626683", "0.50610554", "0.505749", "0.5036739", "0.50348336", "0.50301945", "0.50258625", "0.50217223", "0.50217116", "0.5009325", "0.5004297", "0.5003764", "0.50005937", "0.4995267", "0.49910423", "0.49887618", "0.49860272", "0.49750257", "0.4963572", "0.49605334", "0.49567437", "0.49546272", "0.49546272", "0.49537688", "0.49479854", "0.49479133", "0.49446642", "0.49395517", "0.493539", "0.4933248", "0.4933222", "0.49330467", "0.49315038", "0.4929026", "0.4925489", "0.49233642", "0.49220118", "0.49209622", "0.49208203", "0.4919906", "0.49196002", "0.4908794", "0.4905468", "0.4898065", "0.48968798", "0.48967415", "0.48931625", "0.48809734" ]
0.0
-1
Load the Sentry class. This is a helper method for the constructor.
protected function load_sentry() { // autoload script generated by Composer require_once __DIR__ . '/../vendor/autoload.php'; // alias the Sentry class if (!class_exists('Refiler\Sentry')) { class_alias('\Cartalyst\Sentry\Facades\Native\Sentry', 'Refiler\Sentry'); } // connect the database to Sentry // the following call doesn't work with the table prefix argument due to a // Sentry issue: https://github.com/cartalyst/sentry/issues/210 // Sentry::setupDatabaseResolver($db->get_PDO(), null, $table_prefix); $resolver = new \Cartalyst\Sentry\Facades\ConnectionResolver( $this->db->get_PDO(), $this->db->get_PDO()->getAttribute(\PDO::ATTR_DRIVER_NAME) ); $resolver->getConnection()->setTablePrefix( $this->config['sentry_table_prefix'] ); \Illuminate\Database\Eloquent\Model::setConnectionResolver($resolver); // disable the throttling feature; doing this has a nice side effect of // Sentry::check() taking a little less time Sentry::getThrottleProvider()->disable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function __classLoaded()\n {\n if (!self::$issuer) {\n self::$issuer = Site::getConfig('primary_hostname');\n }\n }", "public function __construct()\n\t{\n\t\t$this->beforeFilter('sentry');\n\t\tparent::__construct();\n\t}", "public static function boot()\n {\n parent::boot();\n static::setHasher(app()->make('sentry.hasher'));\n }", "public function __construct() {\n if(!file_exists(SYSPATH.\"load_class.php\")){\n\t\t\theader('HTTP/1.1 503 Service Unavailable.', TRUE, 503);\n\t\t\techo 'Your appication folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;\n\t\t\texit(3); // EXIT_CONFIG\n\t\t}\n\t\trequire_once(SYSPATH.\"load_class.php\");\n //Enable auto loading from the classes and libraries folders\n $classLoader = new ClassLoader(Array(APPPATH.'classes', APPPATH.'libraries'));\n $classLoader->register();\n $this->classLoader = $classLoader;\n }", "public static function init() {\n $class = __CLASS__;\n new $class;\n }", "protected function _loadEventClass() {\n\t\tApp::uses($this->plugin . 'Events', $this->plugin . '.Lib');\n\n\t\t$this->EventClass = $this->plugin . 'Events';\n\t\t$this->EventClass = new $this->EventClass();\n\t}", "public function __construct() {\n\t\tspl_autoload_register( array( $this, 'autoload_api_google_files' ) );\n\t}", "public function __construct() {\n\t\trequire_once FRONTEND_PATH.'../vendor/autoload.php';\n\n\t\tinclude FRONTEND_PATH.'system/classmap.php';\n\n\t\t$this->map = $CLASSMAP;\n\n\t\tspl_autoload_register( array($this, 'classmapLoader') );\n\t}", "function __construct()\n {\n spl_autoload_register(array($this, 'load'));\n }", "public static function init()\n\t{\n\t\tself::$config = Kohana::$config->load('core')->as_array();\n\t\tself::$log = new Fusion_Log;\n\n\t\ttry\n\t\t{\n\t\t\t// Get the current active/logged in user\n\t\t\tself::$user = Sentry::getUser();\n\t\t}\n\t\tcatch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n\t\t{\n\t\t\t// User wasn't found, should only happen if the user was deleted\n\t\t\t// when they were already logged in or had a \"remember me\" cookie set\n\t\t\t// and they were deleted.\n\t\t\tself::$user = null;\n\t\t}\n\n\t\tself::$permissions = Permissions::instance();\n\t\tself::$mail = new Mail;\n\t\tself::$assets = new Assets;\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\t$this->helpers_dir= ADDONPATH.'modules/streams_import/helpers/profiles';\n\n\t\t// load everything\n\t\t$this->load->library('streams_import');\n\t\t$this->load->library('unzip');\n\t\t$this->load->library('format');\n\t\t$this->load->config('streams_import_c');\n\t\t$this->load->helper(array('folder',\n 'file',\n 'directory',\n 'streams_import'\n ));\n\t\t\n\t\t$this->stream_slug = $this->streams_import->stream_slug;\n\t\t$this->namespace = $this->streams_import->namespace;\n\n\t}", "public function __construct() {\n spl_autoload_register(array($this, 'loader'));\n }", "public function init()\n {\n // Register the loader method\n spl_autoload_register(array(__CLASS__, '_loadClasses'));\n }", "public static function LOADER(){\n spl_autoload_register(array(__CLASS__, \"requireClass\"));\n }", "public static function _init() {\n // this is called upon loading the class\n }", "public static function init()\n {\n // Autoloader.\n spl_autoload_register(\n function ($class) {\n // Does the class use this namespace prefix?\n $found = false;\n $baseDir = '';\n $classLen = 0;\n\n foreach (Autoloader::$registeredNamespaces as $prefix => $path) {\n $len = mb_strlen($prefix);\n if (strncmp($prefix, $class, $len) == 0) {\n $found = true;\n $baseDir = $path;\n $classLen = $len;\n } //end if\n }//end foreach\n\n if ($found === false) {\n // The namespace is not registered for this autoloader.\n return;\n }//end if\n\n $relativeClass = mb_substr($class, $classLen);\n\n $endpath = str_replace('\\\\', '/', $relativeClass).'.php';\n $file = $baseDir.$endpath;\n\n // Try the public folders.\n if (file_exists($file) === true) {\n include $file;\n\n return;\n }\n\n // Try the admin folder.\n if (defined('ADMINPAGE') === true) {\n $file = $baseDir.ADMIN_FOLDER.$endpath;\n if (file_exists($file) === true) {\n include $file;\n\n return;\n }\n }\n\n throw new \\Exception('Class '.$class.' not found.');\n }\n );\n }", "static public function initialize()\r\n {\r\n spl_autoload_register(\"self::load\");\r\n }", "public function __construct(Kotakin $kotakin, Sentry $sentry)\n {\n parent::__construct($kotakin, $sentry);\n\n if ( ! $this->inSuperAdminGroup($sentry->getUser())) {\n App::abort(404);\n }\n\n $this->viewDir = __DIR__.'/../../../../views/';\n $this->cssDir = public_path().'/packages/sule/kotakin/css/';\n $this->jsDir = public_path().'/packages/sule/kotakin/js/';\n }", "public function __construct()\n\t{\n\t\t// set our login column to match Sentry's configured login value\n\t\tstatic::$login_column = Config::get('cartalyst/sentry::sentry.users.login_attribute');\n\t}", "private function loadClass() {\n $this->_instances = array();\n\n $this->_instances['log'] = new Log();\n if(ENVIRONMENT == self::ENVIRONMENT_DEV) {\n $this->_instances['debug'] = new Debug();\n $this->_instances['panel'] = new Panel();\n }\n $this->_instances['controller'] = null;\n $this->_instances['configuration'] = new Configuration();\n $this->_instances['routing'] = new Routing();\n }", "public function __construct()\n {\n $this->ts = &get_instance();\n $this->ts->load->library('email');\n }", "public function init($class)\n {\n if(isset(self::$psrIncluded[$class])) {\n return;\n }\n \n $this->composerGetMap($class);\n \n }", "function __construct() {\n require_once('src/Libraries/General.class.php');\n require_once('src/Libraries/ErrorHandler.class.php');\n require_once('src/Libraries/Cache.class.php');\n // init classes\n $this->classes['error'] = new \\Gluon\\Libraries\\ErrorHandler;\n $this->classes['cache'] = new \\Gluon\\Libraries\\Cache($this->classes['error']);\n $this->messages = $this->classes['cache']->get_cache_byfile('messages.yml.php');\n $GLOBALS['app'] = $this->classes['cache']->get_cache_byfile('app.yml.php');\n }", "public function __construct() {\n $this->loader();\n }", "public static function registerClassLoadingInformation() {}", "public function __construct()\n {\n self::autoload();\n }", "public function __construct() {\n\t\tset_include_path(get_include_path().PATH_SEPARATOR.CLASS_DIR);\n\n\t\t// You can use this trick to make autoloader look for commonly used filenames\n\t\tspl_autoload_extensions('.php');\n\n\t\t// Use default autoload implementation\n\t\tspl_autoload_register( function($className) {\n\t\t\techo 'Trying to load '. $className .' via '. __METHOD__ .\"()\\n\";\n \tinclude $className . '.php';\n\t\t});\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->app->loadClass('date');\n $this->loadModel('task');\n $this->loadModel('order', 'crm');\n $this->loadModel('customer');\n }", "public static function initRequest() {\n spl_autoload_register(function ($class) {\n require_once '/Users/Anders/Sites/tasty/classes/App/' . \\str_replace('\\\\', '/', $class) . '.php';\n });\n\n session_start();\n }", "public function __construct()\n {\n if (!class_exists('XMLSecurityDSig')) {\n include __DIR__ . self::XMLSECLIBS_PATH;\n }\n }", "public function __construct()\r\n {\r\n $configDir = ROOT . DS . \"config\" . DS;\r\n \r\n foreach(glob($configDir . \"*.php\") as $file)\r\n {\r\n $pathInfo = pathinfo($file);\r\n $GLOBALS[$pathInfo[\"filename\"]] = require($file);\r\n }\r\n\r\n // Include all PHP files from the config dir\r\n $libsDir = ROOT . DS . \"core\" . DS . \"utilities\" . DS . \"libs\" . DS . \"jwt\" . DS;\r\n \r\n foreach(glob($libsDir . \"*.php\") as $file)\r\n {\r\n ///echo $file.\"<br>\";\r\n $pathInfo = pathinfo($file);\r\n require($file);\r\n }\r\n \r\n spl_autoload_register(array($this, \"load\"));\r\n }", "function __construct(){\n spl_autoload_register(function ($className) {\n $ds = DIRECTORY_SEPARATOR;\n $dir = App::$param['path'];\n $className = strtr($className, '\\\\', $ds);\n $file = \"{$dir}{$className}.php\";\n if (is_readable($file)) {\n require_once $file;\n }\n });\n set_include_path(get_include_path() . PATH_SEPARATOR . App::$param['path'] . PATH_SEPARATOR . App::$param['path'] . \"app\" . PATH_SEPARATOR . App::$param['path'] . \"app/libs/PEAR/\");\n }", "public function __construct()\n {\n // validate compatibiliry with the system\n $this->_validate_compatibility();\n\n // load config file\n $this->config->load('auth');\n\n // load language file for messages\n $this->lang->load('auth', 'english');\n\n // load authentication model\n $this->load->model('auth_model');\n\n // load required libraries\n $this->load->library(['session', 'user_agent', 'encryption']);\n\n // load required helpers\n $this->load->helper(['cookie', 'string', 'auth']);\n\n // log message to debugger\n log_message('debug', 'Authentication library initialized.');\n }", "function __autoload($class)\n{\n\trequire_once $class . '.php';\n}", "private function load_classes() {\n\n\t\t\trequire_once ASCRIPTA_ENGINE_ADMIN_PATH . 'class-ae-settings.php';\n\n\t\t}", "static public function autoload() {\n spl_autoload_register(array(__CLASS__, 'loader'));\n }", "function guoClassLoader($class)\n{\n $path = str_replace('Jwt\\\\', '', $class);\n $file = __DIR__ . '/src/' . $path . '.php';\n if (file_exists($file)) {\n require_once $file;\n }\n}", "public static function init() {\n\n\t\t$class = new self();\n\t\t$class->setup();\n\n\t}", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n $this->staticDataConfigObj = new StaticDataConfig();\n \n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n $this->staticDataConfigObj = new StaticDataConfig();\n \n }", "public function __construct()\n {\n parent::__construct();\n\n $this->importPath = base_path('import');\n if (! is_dir($this->importPath)) {\n echo \"Import path does not exist.\\n\";\n exit;\n }\n if (! method_exists(Site::class, \"handleImport\")) {\n echo \"Site::handleImport is not declared. Aborting...\\n\";\n exit;\n }\n }", "public function __construct ()\n {\n $this->Sec = new Packages_Security();\n }", "function __autoload($class) {\n require ($class . '.php');\n}", "function wp_simplepie_autoload($class)\n {\n }", "public function __construct() {\n $this->registry = Registry::getInstance();\n }", "public static function autoload()\n {\n spl_autoload_register(array(__CLASS__,'load'));\n }", "function __construct() {\n\t\tConfigure::load(\"EnbakeAttach.s3\");\n\n\t\t$this->s3 = new S3(Configure::read(\"S3.access_key\"),\n\t\t\t\tConfigure::read(\"S3.secret_key\"));\n\t}", "public static function init_autoload() {\n spl_autoload_register(function ($class) {\n self::autoload_path($class);\n });\n }", "public function __construct($config = array())\n\t{\n\t\t// Append default auth configuration\n\t\t$config += Kohana::config('simple_auth');\n\t\t\n\t\t// Load Session\n\t\t$this->session = Session::instance();\n\n\t\t// Save the config in the object\n\t\t$this->config = $config;\n\n\t\t// set debug message\n\t\tKohana::log('debug', 'Simple_Auth Library loaded');\n\t}", "public function __construct()\n\t{\n\t\t$this->registry\t\t= ipsRegistry::instance();\n\t\t$this->DB\t\t\t= $this->registry->DB();\n\t\t$this->settings\t\t=& $this->registry->fetchSettings();\n\t\t$this->lang\t\t\t= $this->registry->getClass('class_localization');\n\t}", "function rum_class_loader() {\n $loader = new UniversalClassLoader();\n $loader->registerNamespace('Rum', __DIR__ . '/lib');\n $loader->register();\n}", "public static function load($class)\n {\n require_once str_replace(array('\\\\', '_'), DIRECTORY_SEPARATOR, ltrim($class, '\\\\_')) . '.php';\n return self::$_instance;\n }", "public function __construct()\n {\n $this->initClasses();\n }", "public function __construct() {\n\n $this->loadConfig();\n\n }", "protected function __construct()\n {\n $this->load();\n }", "public static function init() {\n static::registerSettings();\n }", "protected function _construct()\n {\n //$this->_init('OmniPro\\Blogv2\\Model\\blog', 'OmniPro\\Blogv2\\Model\\ResourceModel\\Blog');\n $this->_init(\\OmniPro\\Blogv2\\Model\\blog::class, \\OmniPro\\Blogv2\\Model\\ResourceModel\\Blog::class); // -- Constante que simboliza la ruta del string, como si fuera el namespace\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->apis[] = new DynatraceProblems();\n $this->apis[] = new Alarms();\n $this->apis[] = new Metric(env('CACHETHQ_METRIC'));\n }", "protected function _construct()\n {\n $this->_init('lookbook/influencer');\n }", "public function __construct()\n\t{\n\t\trequire_once Kohana::find_file('vendor', 'f1/f1_oauth');\n\t\trequire_once Kohana::find_file('vendor', 'f1/f1_util');\n\t\trequire_once Kohana::find_file('vendor', 'f1/f1_signer');\n\t}", "public static function initialize(){\n self::getInstance();\n }", "public static function load($class)\n\t{\n\t\tif (array_key_exists($class, Config::$items['application']['aliases']))\n\t\t{\n\t\t\treturn class_alias(Config::$items['application']['aliases'][$class], $class);\n\t\t}\n\n\t\tif ( ! is_null($path = static::find($class)))\n\t\t{\n\t\t\trequire $path;\n\t\t}\n\t}", "public static function load($class)\n\t{\n\t\tif (array_key_exists($class, Config::$items['application']['aliases']))\n\t\t{\n\t\t\treturn class_alias(Config::$items['application']['aliases'][$class], $class);\n\t\t}\n\n\t\tif ( ! is_null($path = static::find($class)))\n\t\t{\n\t\t\trequire $path;\n\t\t}\n\t}", "function __construct()\r\n\t{\r\n\t\trequire './configs/configs.php';\r\n\t}", "public function __construct()\n {\n $this->bootstrap();\n }", "public function loadForClass($class, $group = Security::DEFAULT_GROUP);", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n\n// Config::inst()->update(\n// 'PHPTek\\Sentry\\Adaptor\\SentryClientAdaptor',\n// 'opts',\n// ['dsn' => 'http://deacdf9dfedb24ccdce1b90017b39dca:[email protected]/44']\n// );\n }", "public function __construct(){\n\t\tsession_start();\n\t\tif(!self::$_singleton instanceof self){\n\t\t\t$this->setInstance();\n\t\t}\n\t}", "public function __construct () {\n $this->loadEnvironment();\n }", "public function __construct()\n {\t\n @include(SHIN_Core::isConfigExists('auth.php'));\n\t\t\n $this->_config_mapper($auth);\n\t\t\n\t\tif($auth['keeping_logic'] == 'db')\n\t\t{\n\t\t\t// db style\n\t\t\tSHIN_Core::loadModel(array('sys_session_model', 'session_model'));\n\t\t\t$this->sessionModel = SHIN_Core::$_models['session_model']->get_instance();\n\t\t\t$this->sessionModel->init($this->sh_Options['sess_expiration']/60, $this->sh_Options['sess_time_to_update']/60);\n\t\t}\n\t\t\n\t\tConsole::logSpeed('SHIN_Auth begin work, Time taken to get to line: '.__FILE__.'::'.__LINE__);\n\t\tConsole::logMemory($this, 'SHIN_Auth. Size of class: ');\t\t \n }", "public function __construct($class_loader) {\n parent::__construct('server');\n $this->classLoader = $class_loader;\n }", "function __autoload($class)\n\t{\n\t\trequire_once('class/'. strtolower($class) . '.class.php');\n\t}", "protected function __construct() {\r\n $types = Array('classes', isset($_SERVER['SHELL']) ? 'classes_shell' : 'classes_web');\r\n foreach($types as $type) {\r\n foreach(self::$config->$type as $class) {\r\n $class = __NAMESPACE__ . \"\\\\\" . $class;\r\n $this->add(new $class());\r\n }\r\n }\r\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n }", "public function __construct()\n\t{\n\t\trequire_once(APPPATH.'libraries/simplepie/SimplePieAutoloader.php');\n\t\trequire_once(APPPATH.'libraries/simplepie/idn/idna_convert.class.php');\n\t\trequire_once(APPPATH.'libraries/SimplePie_cache_driver.php');\n\t}", "public function init() {\n if (!class_exists(TableBuilderManager::class)) {\n $loader = new ClassLoader();\n $loader->addPsr4('Drush\\\\dmt_structure_export\\\\', __DIR__ . '/src');\n $loader->register();\n }\n }", "public function __autoload($class) {\n\t\tinclude $class.\".php\";\n\t}", "private function __construct() { // singleton\n }", "function loader($class)\n{\n\t$file = dirname(__DIR__) . DIRECTORY_SEPARATOR . $class . '.php';\n\tif (file_exists($file)) {\n\t\trequire $file;\n\t}\n}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n }", "public function init()\n {\n parent::init();\n $this->initClass();\n }", "function __autoload($class_name) {include $class_name . '.php';}", "public function __construct()\n {\n // Store the instance statically\n static::$instance = $this;\n\n // Load the app's config\n $this->loadConfig();\n\n // Register the error handler\n $this->registerErrorHandler();\n\n // Create our request and response objects\n $this->request = new Request;\n $this->response = new Response;\n\n // Bootstrap the database\n Database::bootstrap($this->config->db->toArray());\n\n // Convert relative store paths to absolute, and bootstrap the cache\n foreach ($this->config->cache as $instance => $config) {\n $cacheStorePath = $config->store_path;\n if ($cacheStorePath !== null) {\n if (!is_dir($cacheStorePath) && is_dir(APP_ROOT.$cacheStorePath)) {\n $this->config->cache->{$instance}->store_path = APP_ROOT.$cacheStorePath;\n }\n }\n }\n Cache::bootstrap($this->config->cache->toArray());\n\n // Convert relative store paths to absolute, and bootstrap the session\n $sessionStorePath = $this->config->session->store_path;\n if ($sessionStorePath !== null) {\n if (!is_dir($sessionStorePath) && is_dir(APP_ROOT.$sessionStorePath)) {\n $this->config->session->store_path = APP_ROOT.$sessionStorePath;\n }\n }\n Session::bootstrap($this->config->session);\n\n // Include the app routes\n require APP_ROOT.'routes.php';\n\n // Register global view variables\n View::addGlobal('appName', $this->config->app->name);\n View::addGlobal('app', $this);\n View::addGlobal('input', $this->request->input);\n\n $this->compileAssets();\n\n // Execute routes\n Router::execute();\n\n if (PHP_SAPI !== 'cli') {\n $this->checkRoute();\n }\n }", "private function __construct()\n {\n $this->loadConfigFiles($this->__config['imports']);\n $this->resolvePaths();\n }", "public function __construct(){\n $user = Sentry::getUser();\n\n if($user && !$user->hasAccess('admin')){\n echo 'Giriş İzniniz yok';\n exit;\n }\n }", "public function __construct()\n {\n $this->authentication = new Authentication(\n getenv('AUTH_DOMAIN'),\n getenv('AUTH_CLIENT_ID'),\n getenv('AUTH_CLIENT_SECRET'),\n getenv('AUTH_AUDIENCE')\n );\n }", "public function init() {\n\t\t$this->s = new Sanitizer;\n\t}", "function __construct() {\n self::add_extension();\n self::require_php_api();\n self::define_globals();\n self::require_subclasses();\n }", "public function load(string $class);", "function class_loader($class) {\n require('classes/' . $class . '.php');\n}", "public function __construct()\n {\n $this->settings = new Settings();\n }", "public function __construct()\n {\n $this->settings = new Settings();\n }", "public function __construct()\n {\n $this->settings = new Settings();\n }", "public static function load()\n {\n spl_autoload_register(array('AutoLoader', 'autoloadGenericClasses'));\n }", "function __autoload($class)\n{\n require(str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php');\n}" ]
[ "0.61902905", "0.5855134", "0.572969", "0.5682205", "0.56754714", "0.55780756", "0.5554887", "0.5509152", "0.54873896", "0.54734904", "0.54405946", "0.5427754", "0.54247457", "0.54032004", "0.54017866", "0.53900266", "0.53860384", "0.534856", "0.5335301", "0.5333027", "0.53195786", "0.53124094", "0.52909064", "0.52855074", "0.52793825", "0.526917", "0.52460736", "0.52343", "0.5225275", "0.5219705", "0.52193415", "0.52059674", "0.51535267", "0.5151322", "0.5145004", "0.5144324", "0.5141821", "0.5132955", "0.5128899", "0.5128899", "0.51263124", "0.511187", "0.51105803", "0.50950456", "0.5089048", "0.5086236", "0.50830364", "0.50701576", "0.50669277", "0.5061284", "0.5052577", "0.5052277", "0.5052242", "0.5049287", "0.5046411", "0.50424284", "0.5021661", "0.5017904", "0.5017904", "0.5017275", "0.50123906", "0.5011067", "0.50030696", "0.49950925", "0.49950925", "0.49946707", "0.49904788", "0.4990406", "0.4989869", "0.4989545", "0.4987154", "0.4983878", "0.49826768", "0.4981152", "0.49776298", "0.4976302", "0.4976302", "0.4976302", "0.4975729", "0.4970498", "0.49649882", "0.49466652", "0.4946273", "0.4945536", "0.4944491", "0.49409539", "0.4937322", "0.4936356", "0.49326423", "0.49296403", "0.49282694", "0.4925882", "0.49234545", "0.49186847", "0.4914863", "0.491292", "0.491292", "0.491292", "0.49097654", "0.49078646" ]
0.7536318
0
Use this method in cases where the user isn't already logged in.
public function set_user($user) { $this->user = $user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function LoggedIn() {\n\t\tif (empty($_SESSION['current_user'])) {\n\t\t\tnotfound();\n\t\t}\n\t}", "public static function already_logged_in() {\n\t\tif (self::logged_in()) {\n\t\t\tSession::setFlash(\"alert-danger\", \"You have already logged in.\");\n\t\t\theader(\"Location: index.php\");\n\t\t}\n\t}", "function is_already_authenticated()\n {\n /**\n * Checks is user already authenticated\n * If it's true, sends to main page\n */\n $session = Session::getInstance();\n $username = $session->username;\n $logged = $session->logged;\n if (self::check($username,$logged))\n {\n header(\"Location: /admin\");\n }\n }", "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "private function checkIfLoggedIn()\n {\n if (!session()->has('user')) {\n abort(403, 'You are not logged in.');\n }\n }", "private function check_login()\n {\n if (self::exists('user_id')) {\n $this->user_id = self::get('user_id');\n $this->logged_in = true;\n } else {\n unset($this->user_id);\n $this->logged_in = false;\n }\n }", "function userLoggedIn()\n{\n\tif(Auth::check()) {\n\t\t// Log::info('');\n\t\theader('Location: /users/account?id=' . Auth::id() );\n\t\tdie();\n\t}\n}", "function logged_user_check() {\n if(is_user_logged())\n launch_error(\"You are already logged in.\");\n}", "public function check_login(){\n\t\t\tif( isset( $_SESSION['user_id'] ) ) {\n\t\t\t\t$this->user_id = $_SESSION['user_id'];\n\t\t\t\t$this->logged_in = true;\n\t\t\t} else {\n\t\t\t\tunset( $this->user_id );\n\t\t\t\t$this->logged_in = false;\n\t\t\t}\n\t\t}", "public static function userLoggedIn()\n {\n //Hvis en bruker ikke er logget inn, vil han bli sent til login.php\n if (!isset($_SESSION['user'])) {\n //Lagrer siden brukeren er på nå slik at han kan bli redirigert hit etter han har logget inn\n $_SESSION['returnPage'] = $_SERVER['REQUEST_URI'];\n $alert = new Alert(Alert::ERROR, \"Du er nøtt til å være logget inn for å se den siden. Ikke prøv deg på noe.\");\n $alert->displayOnOtherPage('login.php');\n\n }\n }", "private function user_already_logged() {\n echo \"Entro por user_already_logged\";\n return isset($this->session->userdata['logged_in']);\n }", "public function loggedIn()\n {\n if ($this->userId) {\n return true;\n } else {\n return false;\n }\n }", "public static function check_log_in ()\n {\n session_start();\n\n if (!$_SESSION['user_data']) {\n header('Location: ./../index.php');\n exit;\n }\n }", "public function check_login()\n\t{\n\t\tif(isset($_SESSION[\"user_id\"]))\n\t\t{\n\t\t $this->_user_id = $_SESSION[\"user_id\"];\n\t\t\t$this->_client = $_SESSION[\"client\"];\n\t\t\t$this->_loged_in = true;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_loged_in = false;\n\t\t\t$this->_client = false;\n\t\t\tunset($this->_user_id);\n\t\t}\n\t}", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "private function _userLoggedIn()\n {\n $this->utility->redirect('write');\n }", "private function isLoggedIn()\n {\n return isset($_SESSION['user']); \n }", "public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }", "private function checkLogin()\n {\n if ($this->verifySession()) {\n $this->userId = $this->session['id'];\n }\n if ($this->userId === 0) {\n if ($this->verifyCookie()) {\n $this->userId = $this->cookie['userid'];\n $this->createSession();\n }\n }\n }", "public static function isLoggedIn(){\n if(!self::exists('is_logged_in')&& self::get('is_logged_in')!==true){\n \n header('location:' . URL . 'user/login.php');\n exit;\n }\n }", "protected function checkUser() {\n if(!$this->session->userdata(\"usuario_id\")) {\n redirect(\"/login\");\n }\n }", "function login() {\n // Check is already a user is logged in or not.\n if (!isset ($_SESSION['user_id'])) {\n include('blog/site/VIEW/Login.php');\n }\n else {\n header(\"location: /index.php/User/home\");\n }\n }", "public function checkAccess() {\n $this->maybeStartSession();\n\n //If user is not logged in, redirect to login page\n if(!isset($_SESSION['userID'])) {\n header('Location: login.php');\n die();\n }\n\n //if user doesn't exist in database, redirect to logout page to clear session\n $repo = $this->getRepository();\n if($repo && !$repo->getUser($_SESSION['userID'])) {\n header('Location: logout.php');\n die();\n }\n }", "public function isLoggedIn()\n {\n if (isset($this->user) === false) {\n throw new \\Exception('Please log-in first!');\n }\n }", "protected function check_logged_in(){\n\n\t\t$this->load->model('patoauth/patoauth_model', 'patoauth');\n\n\t/*\n\t\tTRY TO AUTOLOGIN */\n\n\t\tif(! $this->patoauth->is_logged_in())\n\t\t\t$this->patoauth->autologin();\n\n\t/*\n\t\tIF STILLS NO LOGGED IN GET OUT OF HERE */\n\n\t\tif(! $this->patoauth->is_logged_in())\n\t\t\tredirect(site_url('auth/login'));\n\t}", "function requires_login()\n {\n $user = user();\n \n if ( empty( $user ) )\n {\n // no user id found, send to login\n Utility::redirect( Utility::login_url() );\n }\n }", "public function loggedIn()\n {\n if($this->di->session->get('user'))\n {\n return true;\n }\n return false;\n }", "function has_logged_in()\n\t{\n\t\tif( $this->session->userdata('usir_nim') )\n\t\t{\n\t\t\tredirect('reminders');\n\t\t}\n\t\t\n\t}", "public function loggedIn()\n {\n if(isset($_SESSION['user']) && !empty($_SESSION['user'])) {\n return true;\n }\n\n return false;\n }", "private function handleJustLoggedIn() {\n $this->authenticatedView->setViewMessage(\"Welcome\");\n\n $keepLoggedIn = $this->userRequest->wantsToStayLoggedIn();\n \n if ($keepLoggedIn) {\n $userCredentials = $this->getUserCredentials();\n $cookieHandler = new CookieHandler();\n $cookieHandler->serveCookie($userCredentials);\n }\n }", "public function checkLoggedIn() {\n\t\t\tif (isset($_SESSION['username'])) {\n\t\t\t\t// Get User object from the database\n\t\t\t\t$this->dao = new UserDAO();\n\t\t\t\treturn $this->dao->getUser($_SESSION['username']);\n\t\t\t}\n\t\t\t//redirect to login page\n\t\t\theader('Location: ./');\n\t\t}", "function isUserLogged() {\r\n return isset($_SESSION['user']);\r\n }", "public function isLoggedIn()\n {\n if(Session::get('user_id') != '') {\n $this->user_id=Session::get('user_id');\n $this->role_id=Session::get('role_id');\n return true;\n }else {\n return false;\n }\n }", "public function isLoggedIn()\n {\n return isset($_SESSION['user']);\n }", "public function isLoggedIn()\n {\n return true;\n }", "public function logged_in()\n {\n if (isset($_SESSION['user_data'])) {\n return true;\n } else {\n return false;\n }\n }", "public function checkSignedIn() {\n\t if (!empty($this->user) && $this->user !== 'anon.') {\n\t $this->addAlias($this->getIdentifier(), $this->user);\n\t }\n\t}", "public function logged_in() {\n return !empty($this->session->userdata('user_id'));\n }", "public static function check() {\n session_start();\n if (!isset($_SESSION['user'])) {\n header('Location: /');\n exit;\n }\n }", "public function checkLoggedIn()\n\t\t{\n\t\t\t\n\t\t\ttry {\n\t\t\t \n\t\t\t\t$query = $this->_db->prepare( \"SELECT username FROM login WHERE username=:username\" );\n \n \n\t\t\t\t$query->bindParam( \":username\", $_SESSION[ 'username' ], PDO::PARAM_STR );\n\n\t\t\t\t$query->execute();\n\t\t\t\n\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\n\t\t\t$row = $query->fetch();\n\t\t\t\n \n\t\t\t$loggedInUser = $row[ 'username' ];\n \n //if the user is not logged in\n\t\t\tif( !isset( $loggedInUser ) )\n\t\t\t{\n //head to the log in page\n\t\t\t\theader( 'Location: login.php' );\n\n\t\t\t}\n\t\t\t\n\t\t}", "private function if_user_logged_in()\n {\n\n session_start();\n\n if(!empty($_SESSION)){\n\n if(isset($_SESSION[\"user_id\"]) && isset($_SESSION[\"user_type\"])){\n \n return true;\n\n }else{\n\n return false;\n }\n\n }else{\n\n return false;\n }\n }", "public function must_be_logged_in()\n {\n Session::_start();\n if(!isset($_SESSION['user']))\n {\n Session::_destroy();\n header('location: ' . URL_WITH_INDEX_FILE . 'login/index');\n exit();\n }\n }", "public function is_logged_in() {\n\n\t}", "function user_logged_in($user_id) {\n \n }", "public function isCurrentlyLoggedIn() {}", "protected function loginIfRequested() {}", "static public function isLoggedIn(){\n \treturn (self::getInstance()->getId()>1);\n }", "public function checkLoggedIn()\n {\n if(!isset($_SESSION['user_id']))\n {\n redirect('pages/view/home');\n exit;\n }\n else\n {\n return $user_id=$_SESSION['user_id'];\n }\n }", "static function checkForLogIn()\n {\n if (isset($_SESSION['username'])) {\n return true;\n }\n\n return false;\n }", "public function loggedIn()\n {\n $CI = &get_instance();\n if ($CI->session->has_userdata('user_id')) {\n return true;\n } else {\n return false;\n }\n }", "public function isUserLoggedIn()\n {\n return (isset($this->session->sUserId) && !empty($this->session->sUserId));\n }", "private function check_is_user_login()\n\t{\n\t\tif($this->session->userdata('logged_in') != FALSE)\n\t\t{\n\t\t\tredirect('home');\n\t\t}\n\t}", "static function isLoggedIn() {\n $user = self::currentUser();\n return isset($user) && $user != null;\n }", "public function isLoggedIn()\n {\n $userId = $this->session->offsetGet('sUserId');\n\n return !empty($userId);\n }", "public function isLoggedIn()\n {\n $userId = $this->session->offsetGet('sUserId');\n\n return !empty($userId);\n }", "public function loggedIn ()\r\n {\r\n\r\n if (isset($_SESSION['userID'])) {\r\n return true;\r\n } else {\r\n header('Location: login');\r\n exit;\r\n }\r\n }", "public function isLogined()\n {\n return isset($_SESSION['userLogin']);\n }", "function logged_in() \n {\n return isset($_SESSION['current_username']);\n }", "private function checkUser()\n {\n $session = $this->di->get(\"session\");\n\n if (!$session->get(\"activeUser\") && !$session->get(\"username\")) {\n return $this->di->response->redirect(\"user/login\");\n }\n }", "function ensure_logged_in() {\n\t\tif(!isset($_SESSION[\"user\"])) {\n\t\t\tredirect(\"start\", \"You must log in before you can view the page.\");\n\t\t}\n\t}", "private function _logged_in()\n {\n /*if(someone is logged in)\n RETURN TRUE;*/\n }", "abstract protected function isUserLoggedIn() ;", "private function checkLogin() {\n\t\t\n\t\tif ( ! $this->user_model->isLoggedIn() )\n\t\t\tredirect( base_url() . 'admin' );\n\n\t}", "function logged_in() {\n\t\treturn isset($_SESSION['USERID']);\n \n\t}", "public function ual_activity_login() {\n\n\t\t// Prevent user ID returning as 0.\n\t\t$user_reset = apply_filters( 'determine_current_user', false );\n\n\t\twp_set_current_user( $user_reset );\n\n\t\t// Store user id.\n\t\t$user_id = get_current_user_id();\n\n\t\t// If we have the user id, continue.\n\t\tif ( ! empty( $user_id ) ) {\n\t\t\t// Get user data with id.\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Store a user name.\n\t\t\t$user_name = $user->display_name ? $user->display_name : $user->user_nicename;\n\n\t\t\t// Log this activity.\n\t\t\tdo_action( 'ual_log_action', $user->ID, $user_name . ' logged In', 'logged-in' );\n\t\t}\n\t}", "public function loggedIn()\n {\n return $this->user() != null;\n }", "public function loggedIn(){\r\n if (isset($_SESSION['user_session']))\r\n return true;\r\n else\r\n return false;\r\n }", "private function valUserExisting(){\n if($this->_personDB->getActive()){\n if($this->logIn()){\n $this->addUserHttpSession();\n $this->_response = 'ok';\n }\n }else{\n $this->_response = '104';\n }\n }", "public function isLoggedIn() {\n\t\tif($this->session->userdata('isLoggedIn') == false) {\n\t\t\tif(empty($this->session->userdata('position_id'))) { //kapag destroyed na ung session\n\t\t\t\theader(\"location:\".base_url('Main/logout'));\n\t\t\t\texit();\n\t\t\t}\n\t\t}else{\n\t\t\tif(empty($this->session->userdata('position_id'))) { //kapag destroyed na ung session\n\t\t\t\theader(\"location:\".base_url('Main/logout'));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}", "function IsLoggedIn() {\t\tif( Member::currentUserID() ) {\r\n\t\t return true;\r\n\t\t}\r\n }", "function isLoggedIn(){\r\n APP::import('Component','Auth');\r\n $auth = new AuthComponent;\r\n $auth ->Session = $this->Session;\r\n $user = $auth->user();\r\n return !empty($user);\r\n \r\n }", "public function is_user_logged_in(){\n\t\treturn $this->session->userdata('current_user_id') != FALSE;\n\t}", "protected function _authenticated()\n\t{\n\t\tif(!$this->_logged_in()){\n\t\t\t\n\t\t\t$this->session->set('alert',array('type' => 'danger', 'message' => 'Please login'));\n\t\t\t\t\n\t\t\turl::redirect(Kohana::config('admin.url').'/account/login', 301);\n\t\t}\n\t}", "private function isSingIn()\n\t{\n\t\tif ($this->session->isLoggon && $this->session->isAdmin) {\n\t\t\treturn true;\n\t\t}\n\t\tredirect('service/sign-out', 'refresh');\n\t}", "function getUserIsLoggedIn() {\r\n\r\n // For now, just return false\r\n return false;\r\n}", "private function checkCurrentUser(){\n return isset($_SESSION['user']);\n }", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "public function UserIsSignedInOrRecirectToSignIn() {\n\t\t\n\t\tif(!isset($_SESSION['accountUser'])) { \n\t\t\trequire(TP_PAGESPATH . '/pages_login/PLogin.php');\n\t\t}\n\t}", "function is_logged_in() \n {\n return (empty($this->userID) || $this->userID == \"\") ? false : true;\n }", "protected function _isAlreadyLoggedIn(){\n debug($_SESSION);\n die();\n if ($this->Session->read('Auth.User')) {\n $role = $this->Role->read(null, $this->Auth->user('role_id'));\n CakeSession::write('Auth.User.role', $role['Role']['alias']);\n\n $url = null;\n switch ($role['Role']['alias']) {\n case 'admin':\n case 'manager':\n $this->Session->setFlash(__('If you pretend to register an other person, user \"Add Register (Consolidate)\" at Administrative Panel.'), 'default', array('class' => 'notice'));\n $url = array('plugin' => false, 'controller' => 'systems', 'action' => 'dashboard', 'prefix' => 'admin', 'admin' => true);\n break;\n case 'registered':\n $this->Session->setFlash(__('You has already registered!'), 'default', array('class' => 'notice'));\n $url = array('plugin' => false, 'controller' => 'systems', 'action' => 'dashboard', 'prefix' => 'profile', 'profile' => true);\n break;\n default:\n $url = $this->Auth->redirect();\n break;\n }\n $this->redirect($url);\n }\n return array('success' => true);\n \n }", "private function checkUserLoggedIn(): bool\n {\n $user = JFactory::getUser();\n if ($user->id > 0) {\n return true;\n } else {\n return false;\n }\n }", "private function isSingIn()\n {\n if ($this->session->isLoggon && $this->session->isAdmin) {\n return true;\n }\n redirect('logout', 'refresh');\n }", "function loggedIn() {\n\t\treturn isset($_SESSION['username']);\n\t}", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "public function loggedIn() {\r\n //if userID is not proper then return False.\r\n if (intval($this->id) <= 0) {\r\n return False;\r\n }\r\n // if we last checked for login under a second ago then return true.\r\n if (($this->id == $_SESSION['id']) && $_SESSION['lastLoginCheckTime'] > microtime(true) - 1) {\r\n return True;\r\n } elseif (isset($_SESSION['switched_user'])) {\r\n $checkID = $_SESSION['switched_user'];\r\n } else {\r\n $checkID = $this->id;\r\n }\r\n $thisUserInfo = $this->dbConn->queryFirstRow(\"SELECT `ip` FROM `usermap` WHERE `user_id` = \".intval($checkID).\" ORDER BY `last_date` DESC LIMIT 1\");\r\n if (!$thisUserInfo || $thisUserInfo['ip'] != $_SERVER['REMOTE_ADDR']) {\r\n return False;\r\n }\r\n $_SESSION['lastLoginCheckTime'] = microtime(true);\r\n return True;\r\n }", "private function isLoggedin()\n\t{\n\t\t$this->idletime = 18000;\n\n\t\tif ((time()-$_SESSION['timestamp'])>$this->idletime)\n\t\t{\n\t\t\t$message = \"You are signed out from the previous session ! Please try sign in again!\";\n\t\t\t$this->logout($message);\n\t\t}\n\t\telseif($this->logged_in() == false)\n\t\t{\n\t\t\t$message = \"Invalid session !! Please try sign in again.\";\n\t\t\t$this->logout($message);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['timestamp'] = time();\n\t\t}\n\t}", "public function customerIsAlreadyLoggedIn()\n {\n return (bool)$this->httpContext->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_AUTH);\n }", "function loggedin() {\n $this->checkAccess('user',false,false);\n\n $template = new Template;\n $user = new User($this->db);\n\n //get user details\n $user->getByEmail($this->f3->get('SESSION.email'));\n $this->f3->set('user', $user);\n\n //get user followers\n $this->f3->set('followers', $user->getUserFollowers($this->f3->get('SESSION.cid'))[0]);\n\n //get user waiting position\n $this->f3->set('waitrank', $user->getUserWaitPosition($this->f3->get('SESSION.cid'))[0]);\n\n echo $template->render('header.html');\n echo $template->render('user/user.html');\n echo $template->render('footer.html');\n }", "public function isLoggedIn()\n {\n return $this->customerSession->getCustomerGroupId() != \\Magento\\Customer\\Model\\Group::NOT_LOGGED_IN_ID;\n }", "function logged_in() {\r\n\t\treturn isset($_SESSION[\"admin_id\"]);\r\n\t}", "public function isLogged(){\n return isset($_SESSION[\"user\"]);\n }", "function checkLogin() { //Determine status of the user in current session\n\n\t//If a user is currently logged in\n\tif(isset($_SESSION['userID'])) {\n\n\t\tlogout(); //Display components to allow user to logout\n\n\t} else {\n\n\t\tlogin(); //Otherwise display components to allow a guest to login\n\n\t}\n\n}", "public function isLoggedIn()\n {\n return $this->session->has('user');\n }", "function isLoggedIn() {\n\treturn isset($_SESSION['user_id']);\n}", "private function check_login() {\n\t\t\t// If we have a cookie, but the session variables are not set,\n\t\t\t// then we need to get the data and set the proper variables.\n\t\t\tif (!empty($_COOKIE['fauth'])) {\n\t\t\t\t$this->uid = $_COOKIE['fauth'];\n\t\t\t\n\t\t\t\tif (!isset($_SESSION['uid']) || \n\t\t\t\t\t\t!isset($_SESSION['username']) || \n\t\t\t\t\t\t$_SESSION['uid'] != $_COOKIE['fauth']) {\n\t\t\t\t\t// Find the user's object.\n\t\t\t\t\t$user = User::find_by_id($_COOKIE['fauth']);\n\t\t\t\t\t\n\t\t\t\t\t// Set the session variables.\n\t\t\t\t\t$_SESSION['uid'] = $user->id;\n\t\t\t\t\t$_SESSION['username'] = $user->username;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t// Log the user in.\n\t\t\t\t$this->logged_in = true;\n\t\t\t} else {\n\t\t\t\tunset($this->uid);\n\t\t\t\t$this->logged_in = false;\n\t\t\t}\n\t\t}", "private function checkLogged() {\r\n if (isset($_SESSION['user'])) {\r\n return $_SESSION['user'];\r\n }\r\n header('Location: /login');\r\n }", "function logged_in(){\n\t\tif((isset($_SESSION['user_id']) || isset($_SESSION['username'])) && (!empty($_SESSION['user_id']) || !empty($_SESSION['username']))){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "protected function _logged_in()\n\t{\n\t\t$authentic = Auth::instance();\n\t\t\n\t\tif ($authentic->logged_in())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\t\n\t\t}\n\t}", "private function check_login(){\n if (isset($_SESSION['email'])){\n $this->email=$_SESSION['email'];\n\t\t\t$this->role=$_SESSION['role'];\n\t\t\t$this->id=$_SESSION['id'];\n $this->signed_in=true;\n }\n else{\n unset($this->email);\n $this->signed_in=false;\n }\n }", "public function isnotloggedin()\n {\n if (!$this->hasuser())\n {\n return TRUE;\n }\n }" ]
[ "0.76916116", "0.7543212", "0.7242442", "0.7195002", "0.7195002", "0.71808183", "0.71346706", "0.71233416", "0.711542", "0.70456046", "0.7024871", "0.69646275", "0.692456", "0.6911619", "0.6880006", "0.68608034", "0.68314445", "0.6817769", "0.6799506", "0.679175", "0.6790527", "0.6772883", "0.6752151", "0.6744709", "0.6722092", "0.6713335", "0.67079306", "0.6700824", "0.66892797", "0.6681986", "0.66774124", "0.667318", "0.66709375", "0.66602826", "0.66595316", "0.6648991", "0.66342914", "0.6629139", "0.6626757", "0.6626392", "0.66084015", "0.6579217", "0.65770906", "0.65725404", "0.6568739", "0.6567632", "0.65550596", "0.65547425", "0.65384805", "0.65297353", "0.6528436", "0.6524871", "0.6523958", "0.6519307", "0.6518668", "0.6518668", "0.65090597", "0.65073186", "0.6507207", "0.65070164", "0.65007603", "0.65003586", "0.64848536", "0.64841694", "0.64824206", "0.6481857", "0.64780325", "0.6476695", "0.6470325", "0.64672685", "0.64644766", "0.64613616", "0.6461306", "0.64530593", "0.64500463", "0.6446799", "0.64424586", "0.64422286", "0.64415145", "0.6437737", "0.64342546", "0.6429354", "0.6427106", "0.6418406", "0.641778", "0.6415983", "0.64153355", "0.6410189", "0.64052695", "0.6402015", "0.64010626", "0.63981605", "0.63977474", "0.63960975", "0.63901347", "0.63867044", "0.6383121", "0.6374676", "0.63657534", "0.6365143", "0.63571024" ]
0.0
-1
Sentry stores 1 for allow and 1 for deny. We convert these values for JSON output.
public static function encode_permissions($permissions) { return array_map(function ($permission) { return $permission === 1 ? true : false; }, $permissions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllowSpecific();", "public function getExplicitlyAllowAndDeny() {}", "public function getAllow() {\r\n return $this->allow;\r\n }", "public static function allows ()\r\n {\r\n $acl = Session::get('acl');\r\n return $acl['allows'];\r\n }", "public function getAllow(): string\n {\n return $this->allow;\n }", "public function getAllow() {\r\n\t\treturn $this -> allow;\r\n\t}", "public function setAllow($value) {\r\n $this->allow = $value;\r\n }", "public function getAccessAllowableValues()\n {\n return [\n self::ACCESS_MAILBOX,\nself::ACCESS_ACCOUNT,\nself::ACCESS_PUB,\nself::ACCESS_OFFICIAL,\nself::ACCESS_SHARED, ];\n }", "function setAcceptType(\n $strAcceptType = '', \n $arrDenyTypes = array()\n ) {\n if (! isset($arrDenyTypes[$strAcceptType])) {\n $this->arrAcceptTypes[$strAcceptType] = 2;\n }\n if (2 > $this->intPrefAcceptType) {\n $this->intPrefAcceptType = 2;\n $this->strPrefAcceptType = $strAcceptType;\n }\n return $this->intPrefAcceptType;\n }", "function getDenyReasons() {\n return $this->denied_reasons;\n }", "public function getDeny(): string\n {\n return $this->deny;\n }", "private function setSpecialBits() {\n if (Request::has(\"include-setuid\") && Request::input(\"include-setuid\") === \"true\") { $permissionSetuid = 4; } else { $permissionSetuid = 0; }\n if (Request::has(\"include-setgid\") && Request::input(\"include-setgid\") === \"true\") { $permissionSetgid = 2; } else { $permissionSetgid = 0; }\n if (Request::has(\"include-sticky\") && Request::input(\"include-sticky\") === \"true\") { $permissionSticky = 1; } else { $permissionSticky = 0; }\n return $permissionSetuid + $permissionSetgid + $permissionSticky;\n }", "public function isAllow()\n {\n return $this->allow;\n }", "public function authorize()\n {\n return true; //[ *1. default=false ]\n }", "protected function _isAllowed()\n {\n \treturn true;\n }", "public function allowUser() {\n \t$level = -1;\n\t if ($this->userData !== null){\n\n\t $level = $this->userData->level;\n\n\t\t}\n\t\treturn $level;\n\t \n\t}", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_LOCKED,\nself::STATUS_AVAILABLE, ];\n }", "public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "public function getUsageAllowableValues()\n {\n return [\n self::USAGE_PRIV,\n self::USAGE_ORGA,\n ];\n }", "public function actionCanOnshelve()\n {\n $code = 1; //can not\n $accountId = $this->getAccountId();\n $bar = ActivityBar::findOne(['status'=>'Y', 'isDeleted'=>false, 'accountId'=>$accountId]);\n\n if (empty($bar)) {\n $code = 0;\n }\n\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return ['code'=>$code];\n\n }", "public function getTraceRatingAllowableValues()\r\n {\r\n return [\r\n self::TRACE_RATING_NORMAL,\r\n self::TRACE_RATING_WARNING,\r\n self::TRACE_RATING_INCIDENT,\r\n ];\r\n }", "function getReviewTypePermissibleValues() {\r\n\t\t$result = array();\r\n\r\n\t\tforeach($this->find('all', array('conditions' => array('SpecimenReviewControl.flag_active' => 1))) as $new_control) {\r\n\t\t\t$result[$new_control['SpecimenReviewControl']['review_type']] = __($new_control['SpecimenReviewControl']['review_type']);\r\n\t\t}\r\n\t\t\t\t\r\n\t\treturn $result;\r\n\t}", "function getIsDisapproved() {\n return (integer) $this->isDisapproved;\n }", "protected function allow() {\n\t\t\n\t\treturn true;\n\t}", "function wac_allowed_bids(){\n\t$allowed = wac_setting_field('allowed_bids');\n\treturn (empty($allowed) || $allowed <= 0)? 0 : $allowed;\n}", "public function isDenied() {\n return $this->denied;\n }", "function rest_send_allow_header( $response, $server, $request ) {\n\t$matched_route = $response->get_matched_route();\n\n\tif ( ! $matched_route ) {\n\t\treturn $response;\n\t}\n\n\t$routes = $server->get_routes();\n\n\t$allowed_methods = array();\n\n\t// Get the allowed methods across the routes.\n\tforeach ( $routes[ $matched_route ] as $_handler ) {\n\t\tforeach ( $_handler['methods'] as $handler_method => $value ) {\n\n\t\t\tif ( ! empty( $_handler['permission_callback'] ) ) {\n\n\t\t\t\t$permission = call_user_func( $_handler['permission_callback'], $request );\n\n\t\t\t\t$allowed_methods[ $handler_method ] = true === $permission;\n\t\t\t} else {\n\t\t\t\t$allowed_methods[ $handler_method ] = true;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Strip out all the methods that are not allowed (false values).\n\t$allowed_methods = array_filter( $allowed_methods );\n\n\tif ( $allowed_methods ) {\n\t\t$response->header( 'Allow', implode( ', ', array_map( 'strtoupper', array_keys( $allowed_methods ) ) ) );\n\t}\n\n\treturn $response;\n}", "public function authorize()\n {\n return Gate::allows('store', $this->getMarkType());\n }", "private function setOther() {\n if (Request::has(\"include-other-read\") && Request::input(\"include-other-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-other-write\") && Request::input(\"include-other-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-other-execute\") && Request::input(\"include-other-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_0,\nself::STATUS_1,\nself::STATUS_2, ];\n }", "public function getAuthAllowableValues()\n {\n return [\n self::AUTH_INTERNAL,\n self::AUTH_EXTERNAL,\n ];\n }", "public function getItemStatusAllowableValues()\n {\n $baseVals = [\n self::ITEM_STATUS_ACTIVE,\n self::ITEM_STATUS_CANCELLED,\n self::ITEM_STATUS_SHIPPED,\n self::ITEM_STATUS_DELIVERED,\n ];\n\n // This is necessary because Amazon does not consistently capitalize their\n // enum values, so we do case-insensitive enum value validation in ObjectSerializer\n return array_map(function ($val) { return strtoupper($val); }, $baseVals);\n }", "public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }", "function getSpecimenTypePermissibleValues() {\r\n\t\t$result = array();\r\n\r\n\t\tforeach($this->find('all', array('conditions' => array('SpecimenReviewControl.flag_active' => 1))) as $new_control) {\r\n\t\t\t$result[$new_control['SpecimenReviewControl']['sample_control_id']] = __($new_control['SampleControl']['sample_type']);\r\n\t\t}\r\n\t\t\t\t\r\n\t\treturn $result;\r\n\t}", "public function getAccessPolicyTypeAllowableValues()\n {\n return [\n self::ACCESS_POLICY_TYPE__8021X,\n self::ACCESS_POLICY_TYPE_MAC_AUTHENTICATION_BYPASS,\n self::ACCESS_POLICY_TYPE_HYBRID_AUTHENTICATION,\n ];\n }", "public function getDenyMessage()\n {\n return $this->denyMessage;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/mfb_myflyingbox/offer');\n }", "static function denied()\n {\n\n }", "public function saveAllowance($request, $action, $allowance, $timestamp)\n {\n return false;\n }", "public function setAuthorized() {}", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_RECEIVED,\nself::STATUS_COMPLETED,\nself::STATUS_CANCELLED, ];\n }", "public function getHandlingInstructionsAllowableValues()\n {\n $baseVals = [\n self::HANDLING_INSTRUCTIONS_OVERSIZED,\n self::HANDLING_INSTRUCTIONS_FRAGILE,\n self::HANDLING_INSTRUCTIONS_FOOD,\n self::HANDLING_INSTRUCTIONS_HANDLE_WITH_CARE,\n ];\n\n // This is necessary because Amazon does not consistently capitalize their\n // enum values, so we do case-insensitive enum value validation in ObjectSerializer\n return array_map(function ($val) { return strtoupper($val); }, $baseVals);\n }", "function show_deny() {\n\t\t\tshow_error(\n\t\t\t\t'403 Forbidden',\n\t\t\t\t'You do not have sufficient clearance to view this page.'\n\t\t\t);\n\t\t}", "public function allowCustomResponseCode()\n {\n $this->allowCustomResponseCode = \\true;\n }", "function egsr_staff_cap(){\n \n return Array ( \n 'read' => true,\n );\n}", "public function getSalesChannelsAllowableValues()\n {\n return [\n self::SALES_CHANNELS_WWW,\nself::SALES_CHANNELS_CALL, ];\n }", "public function authorize()\n {\n // return true;\n return access()->allow('store-monthly-meter-unit');\n }", "public function getAutocreateAllowedStatusCodes()\n {\n $path = 'intraship/autocreate/autocreate_allowed-status-codes';\n $statusCodes = Mage::getStoreConfig($path);\n if (null === $statusCodes) {\n $statusCodes = '';\n }\n return $statusCodes;\n }", "public function getSaasSubscriptionStatusAllowableValues()\n {\n return [\n self::SAAS_SUBSCRIPTION_STATUS_NOT_STARTED,\nself::SAAS_SUBSCRIPTION_STATUS_PENDING_FULFILLMENT_START,\nself::SAAS_SUBSCRIPTION_STATUS_SUBSCRIBED,\nself::SAAS_SUBSCRIPTION_STATUS_SUSPENDED,\nself::SAAS_SUBSCRIPTION_STATUS_UNSUBSCRIBED, ];\n }", "public static function getAccessValues(): array {\n return array(\n self::ACCESS_ADMIN => 'admin',\n self::ACCESS_SELLER => 'seller',\n self::ACCESS_BUYER => 'buyer',\n self::ACCESS_GUEST => 'guest',\n );\n }", "static function getPermission()\n {\n return [self::BULLETIN => 'article_createBulletin'];\n }", "public function allow()\n {\n ++$this->allowed;\n\n if (NODE_ACCESS_DENY !== $this->result) {\n $this->result = NODE_ACCESS_ALLOW;\n }\n }", "function Generic_deny($message = \"An error has occured\")\n{\n exit(\n json_encode(\n array(\n \"message\"=>$message,\n \"tracking_id\"=>LoggingEngine::$TRACKING_ID\n )\n )\n );\n}", "protected function setRequiredAccessLevelsForPost() {\n $this->post_required_access_levels = array(\"owner\",\"admin\",\"collaborator\");\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "public function acceptOrDenyAction(Request $request)\n {\n $ad = (int)$request->attributes->get('ad');\n $offer = (int)$request->attributes->get('offer');\n $type = $request->attributes->get('action');\n $userAttr = $this->user->getAttributes();\n $isTest = (int)$request->attributes->get('test');\n $testResult = (int)$request->attributes->get('result');\n $validCSRF = $this->validateCSRF();\n if($isTest == 1 && $testResult == 0)\n {\n $userAttr = array('id' => (int)$request->attributes->get('user'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($isTest == 1 && $testResult == 1)\n {\n $userAttr = array('id' => (int)$request->attributes->get('elUser1'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($this->isTest)\n {\n $userAttr = array('id' => 2);\n $validCSRF = true;\n }\n $data = $this->enMan->getRepository('AdItemsBundle:AdsOffersPropositions')->propositonExists($ad, $offer, (int)$userAttr['id']);\n if($validCSRF === true && ($type == 'accepter' || $type == 'refuser') && isset($data['id_ad']) && $data['id_ad'] == $ad && isset($data['id_of']) && $offer == $data['id_of'])\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 1), 200);\n }\n $this->enMan->getConnection()->beginTransaction();\n try\n {\n $tplVals = array('{AD_TITLE}', '{OFFER_NAME}', '{LOGIN}');\n $realVals = array($data['adName'], $data['offerName'], $this->user->getUser());\n switch($type)\n {\n case 'accepter':\n // add offer to ads_offers table\n $aofEnt = new AdsOffers;\n $aofEnt->setAdsIdAd($this->enMan->getReference('Ad\\ItemsBundle\\Entity\\Ads', $ad));\n $aofEnt->setOffersIdOf($this->enMan->getReference('Catalogue\\OffersBundle\\Entity\\Offers', $offer));\n $aofEnt->setAddedDate('');\n $this->enMan->persist($aofEnt);\n $this->enMan->flush();\n\n $i = 1;\n\n // notify ad's author about the new offer\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_accepted.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_accepted.maildoc'));\n $title = \"Proposition a été acceptée\";\n $message = \"Proposition a été correctement acceptée\";\n\n // update ads_modified table with the last modification\n $this->enMan->getRepository('AdItemsBundle:AdsModified')->adModified($ad, 'offer_accepted');\n break;\n case 'refuser':\n $i = -1;\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_denied.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_denied.maildoc'));\n $title = \"Proposition a été réfusée\";\n $message = \"Proposition a été correctement supprimée\";\n break;\n }\n $q = $this->enMan->createQueryBuilder()->delete('Ad\\ItemsBundle\\Entity\\AdsOffersPropositions', 'aop')\n ->where('aop.ads_id_ad = ?1 AND aop.offers_id_of = ?2 AND aop.users_id_us = ?3')\n ->setParameter(1, $ad)\n ->setParameter(2, $offer)\n ->setParameter(3, $userAttr['id'])\n ->getQuery();\n $p = $q->execute();\n\n // update offers quantity for this ad\n $this->enMan->getRepository('AdItemsBundle:Ads')->updateOffersQuantity($i, $ad);\t\t\n\n // Send private message\n $author = $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', (int)$userAttr['id']);\n $messageVals = array(\n 'title' => $title,\n 'content' => $template,\n 'type' => 2,\n 'state' => 1\n );\n $this->enMan->getRepository('MessageMessagesBundle:Messages')->sendPm($author, $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', $data['id_us']), $messageVals);\n\n $emtEnt = new EmailsTemplates;\n $mail = \\Swift_Message::newInstance()\n ->setSubject($title)\n ->setFrom($this->from['mail'])\n ->setTo($data['email'])\n ->setContentType(\"text/html\")\n ->setBody($emtEnt->getHeaderTemplate().$template.$emtEnt->getFooterTemplate());\n $this->get('mailer')->send($mail);\n\n // commit SQL transaction\n $this->enMan->getConnection()->commit();\n if($this->isTest)\n {\n return new Response('accepted_successfully');\n }\n $ret['isError'] = 0;\n $ret['message'] = $message;\n }\n catch(Exception $e)\n {\n $this->enMan->getConnection()->rollback();\n $this->enMan->close();\n throw $e;\n }\n }\n elseif($validCSRF === false)\n {\n $ret['isError'] = 1;\n $ret['message'] = \"Votre session a expiré. Veuillez réessayer\";\n }\n else\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 0), 200);\n }\n $ret['isError'] = 1;\n $ret['message'] = \"Une erreur s'est produite\";\n }\n echo json_encode($ret);\n\tdie();\n }", "public function getlimitation() {\n return['1' => 'Limitation 1', '2' => 'Limitation 2', '3' => 'Limitation 3', '4' => 'Limitation 4'];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_APPROVAL_PENDING,\n self::STATUS_ATM_WITHDRAWAL,\n self::STATUS_ATM_WITHDRAWAL_REVERSAL_PENDING,\n self::STATUS_ATM_WITHDRAWAL_REVERSED,\n self::STATUS_AUTH_ADJUSTMENT_AUTHORISED,\n self::STATUS_AUTH_ADJUSTMENT_ERROR,\n self::STATUS_AUTH_ADJUSTMENT_REFUSED,\n self::STATUS_AUTHORISED,\n self::STATUS_BANK_TRANSFER,\n self::STATUS_BANK_TRANSFER_PENDING,\n self::STATUS_BOOKED,\n self::STATUS_BOOKING_PENDING,\n self::STATUS_CANCELLED,\n self::STATUS_CAPTURE_PENDING,\n self::STATUS_CAPTURE_REVERSAL_PENDING,\n self::STATUS_CAPTURE_REVERSED,\n self::STATUS_CAPTURED,\n self::STATUS_CAPTURED_EXTERNALLY,\n self::STATUS_CHARGEBACK,\n self::STATUS_CHARGEBACK_EXTERNALLY,\n self::STATUS_CHARGEBACK_PENDING,\n self::STATUS_CHARGEBACK_REVERSAL_PENDING,\n self::STATUS_CHARGEBACK_REVERSED,\n self::STATUS_CREDITED,\n self::STATUS_DEPOSIT_CORRECTION,\n self::STATUS_DEPOSIT_CORRECTION_PENDING,\n self::STATUS_DISPUTE,\n self::STATUS_DISPUTE_CLOSED,\n self::STATUS_DISPUTE_EXPIRED,\n self::STATUS_DISPUTE_NEEDS_REVIEW,\n self::STATUS_ERROR,\n self::STATUS_EXPIRED,\n self::STATUS_FAILED,\n self::STATUS_FEE,\n self::STATUS_FEE_PENDING,\n self::STATUS_INTERNAL_TRANSFER,\n self::STATUS_INTERNAL_TRANSFER_PENDING,\n self::STATUS_INVOICE_DEDUCTION,\n self::STATUS_INVOICE_DEDUCTION_PENDING,\n self::STATUS_MANUAL_CORRECTION_PENDING,\n self::STATUS_MANUALLY_CORRECTED,\n self::STATUS_MATCHED_STATEMENT,\n self::STATUS_MATCHED_STATEMENT_PENDING,\n self::STATUS_MERCHANT_PAYIN,\n self::STATUS_MERCHANT_PAYIN_PENDING,\n self::STATUS_MERCHANT_PAYIN_REVERSED,\n self::STATUS_MERCHANT_PAYIN_REVERSED_PENDING,\n self::STATUS_MISC_COST,\n self::STATUS_MISC_COST_PENDING,\n self::STATUS_OPERATION_AUTHORIZED,\n self::STATUS_OPERATION_BOOKED,\n self::STATUS_OPERATION_PENDING,\n self::STATUS_OPERATION_RECEIVED,\n self::STATUS_PAYMENT_COST,\n self::STATUS_PAYMENT_COST_PENDING,\n self::STATUS_RECEIVED,\n self::STATUS_REFUND_PENDING,\n self::STATUS_REFUND_REVERSAL_PENDING,\n self::STATUS_REFUND_REVERSED,\n self::STATUS_REFUNDED,\n self::STATUS_REFUNDED_EXTERNALLY,\n self::STATUS_REFUSED,\n self::STATUS_RESERVE_ADJUSTMENT,\n self::STATUS_RESERVE_ADJUSTMENT_PENDING,\n self::STATUS_RETURNED,\n self::STATUS_SECOND_CHARGEBACK,\n self::STATUS_SECOND_CHARGEBACK_PENDING,\n self::STATUS_UNDEFINED,\n ];\n }", "public function deny()\n {\n ++$this->denied;\n\n $this->result = NODE_ACCESS_DENY;\n\n // Where the actual magic happens please read the README.md file.\n if (!$this->byVote) {\n $this->stopPropagation();\n }\n }", "public function setAllow($allow) {\r\n\t\treturn $this -> allow = (array)$allow;\r\n\t}", "function rest_send_allow_header($response, $server, $request)\n {\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_REQUESTED,\n self::STATUS_RESERVED,\n self::STATUS_IN_HOUSE,\n self::STATUS_CANCELLED,\n self::STATUS_CHECKED_OUT,\n self::STATUS_NO_SHOW,\n self::STATUS_WAIT_LIST,\n self::STATUS_UNKNOWN,\n ];\n }", "public function formatForbiddenError();", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_TEMPORARY,\n self::STATUS_SAVED,\n self::STATUS_POSTED,\n self::STATUS_COMMITTED,\n self::STATUS_CANCELLED,\n self::STATUS_ADJUSTED,\n self::STATUS_QUEUED,\n self::STATUS_PENDING_APPROVAL,\n self::STATUS_ANY,\n ];\n }", "public function getEnabledGrantTypes();", "private function setUser() {\n if (Request::has(\"include-user-read\") && Request::input(\"include-user-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-user-write\") && Request::input(\"include-user-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-user-execute\") && Request::input(\"include-user-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }", "public function getChatSecurityAllowableValues()\n {\n return [\n self::CHAT_SECURITY_GROUP,\n self::CHAT_SECURITY_ADMINS,\n ];\n }", "public function authorize()\n {\n return true; // I do not know how to create authorisation for the back-end and the time constraints of the project did not allow me to get to this stage either. It is something I would like to learn to do in the future however.\n }", "public function getAllowCheck()\n {\n return $this->allow_check;\n }", "public function getSandboxTypeAllowableValues()\n {\n return [\n self::SANDBOX_TYPE_NONE,\nself::SANDBOX_TYPE_CSP, ];\n }", "function storage_can_set($sv_user) {\n $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id()));\n if (!$allowed) {\n print \"ERROR : Not allowed\";\n }\n return $allowed;\n}", "protected function get_restricted_cap() {\n\t\tif ( ! empty( $this->data->post_password ) ) {\n\t\t\treturn isset( $this->post_type_object->cap->edit_others_posts ) ? $this->post_type_object->cap->edit_others_posts : 'edit_others_posts';\n\t\t}\n\n\t\tswitch ( $this->data->post_status ) {\n\t\t\tcase 'trash':\n\t\t\t\t$cap = isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts';\n\t\t\t\tbreak;\n\t\t\tcase 'draft':\n\t\t\tcase 'future':\n\t\t\tcase 'pending':\n\t\t\t\t$cap = isset( $this->post_type_object->cap->edit_others_posts ) ? $this->post_type_object->cap->edit_others_posts : 'edit_others_posts';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$cap = '';\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $cap;\n\n\t}", "public function getStatusDenomAllowableValues()\n {\n return [\n self::STATUS_DENOM_PENDIENTE,\n ];\n }", "public function getAllowedValues();", "public function getAllowedValues();", "public function getAccountingSystemAllowableValues()\n {\n return [\n self::ACCOUNTING_SYSTEM_VINCERE_INVOICE,\nself::ACCOUNTING_SYSTEM_XERO,\nself::ACCOUNTING_SYSTEM_ASTUTE,\nself::ACCOUNTING_SYSTEM_OTHER, ];\n }", "protected function _setApprovedFlag()\n {\n $user = $this->getUser();\n\n if (!empty($user['id'])) {\n $settings = $this->getSettings();\n if ($settings['enable_listings_approval']) {\n return 0;\n }\n else if ($user['listing_approval']) {\n return 0;\n }\n }\n\n return 1;\n }", "function egsr_author_cap(){\n return Array ( \n 'delete_posts' => true,\n 'delete_published_posts' => true,\n 'edit_posts' => true,\n 'edit_published_posts' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'upload_files' => true,\n );\n}", "public function allowance() {\n $allowance = $this->db2->table('hr_allowances')->select('id', 'fkcoa_id', 'allowance', 'default_amount')->orderby('id')->get();\n return View::make('settings/allowance.allowance')->with(array('allowances' => $allowance));\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_MEETING,\n self::STATUS_WAITING_ROOM,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PENDING_APPROVAL,\n self::STATUS_DIRTY,\n self::STATUS_APPROVED_TO_FILE,\n self::STATUS_PENDING_FILING,\n self::STATUS_PENDING_FILING_ON_BEHALF,\n self::STATUS_FILED,\n self::STATUS_FILED_ON_BEHALF,\n self::STATUS_RETURN_ACCEPTED,\n self::STATUS_RETURN_ACCEPTED_ON_BEHALF,\n self::STATUS_PAYMENT_REMITTED,\n self::STATUS_VOIDED,\n self::STATUS_PENDING_RETURN,\n self::STATUS_PENDING_RETURN_ON_BEHALF,\n self::STATUS_DO_NOT_FILE,\n self::STATUS_RETURN_REJECTED,\n self::STATUS_RETURN_REJECTED_ON_BEHALF,\n self::STATUS_APPROVED_TO_FILE_ON_BEHALF,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_PENDING_APPROVAL,\n self::STATUS_DIRTY,\n self::STATUS_APPROVED_TO_FILE,\n self::STATUS_PENDING_FILING,\n self::STATUS_PENDING_FILING_ON_BEHALF,\n self::STATUS_FILED,\n self::STATUS_FILED_ON_BEHALF,\n self::STATUS_RETURN_ACCEPTED,\n self::STATUS_RETURN_ACCEPTED_ON_BEHALF,\n self::STATUS_PAYMENT_REMITTED,\n self::STATUS_VOIDED,\n self::STATUS_PENDING_RETURN,\n self::STATUS_PENDING_RETURN_ON_BEHALF,\n self::STATUS_DO_NOT_FILE,\n self::STATUS_RETURN_REJECTED,\n self::STATUS_RETURN_REJECTED_ON_BEHALF,\n self::STATUS_APPROVED_TO_FILE_ON_BEHALF,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_ACTIVE,\n self::STATUS_EXPIRED,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_WON,\n self::STATUS_ELIMINATED,\n self::STATUS_PLAYING,\n ];\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::ASIN,\n self::SELLER_SKU\n ];\n }", "public function getMethodAllowableValues()\n {\n return [\n self::METHOD_APPROVE,\n self::METHOD_DENY,\n ];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_NOT_SUBSCRIBED,\n self::STATUS_SUBSCRIBED,\n self::STATUS_IN_PROGRESS,\n self::STATUS_COMPLETED,\n ];\n }", "public function it_has_correct_set_of_allowed_values(): void\n {\n $allowed = [\n ChannelNotificationSeverity::INFO,\n ChannelNotificationSeverity::WARNING,\n ChannelNotificationSeverity::ERROR,\n ];\n self::assertEquals($allowed, ChannelNotificationSeverity::getAllowableEnumValues());\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_DRAFT,\n self::STATUS_IN_PROGRESS,\n self::STATUS_APPROVED,\n self::STATUS_REJECTED,\n self::STATUS_FEEDBACK,\n ];\n }", "public function getAllowedTypes()\n {\n return ['substition', 'protected', 'disabled', 'formatting'];\n }", "public function getStatusAllowableValues()\n {\n return [\n self::STATUS_INITIALIZED,\n self::STATUS_CHALLENGE_REQUIRED,\n self::STATUS_CHALLENGE_ONGOING,\n self::STATUS_AUTHENTICATED,\n self::STATUS_AUTHORIZED,\n self::STATUS_SETTLED,\n self::STATUS_CANCELED,\n self::STATUS_TRANSMITTED,\n self::STATUS_FAILED,\n ];\n }", "public function postChangeprivacysAction(Request $request) {\n $freq_obj = $request->get('reqObj');\n $fde_serialize = $this->decodeObjectAction($freq_obj);\n\n if (isset($fde_serialize)) {\n $de_serialize = $fde_serialize;\n } else {\n $de_serialize = $this->getAppData($request);\n }\n $object_info = (object) $de_serialize; //convert an array into object.\n\n $required_parameter = array('user_id', 'type', 'type_id', 'privacy_setting');\n $data = array();\n\n //checking for parameter missing.\n $chk_error = $this->checkParamsAction($required_parameter, $object_info);\n if ($chk_error) {\n $data = array('code' => 300, 'message' => 'YOU_HAVE_MISSED_A_PARAMETER ' . $this->miss_param, 'data' => $data);\n echo json_encode($data);\n exit;\n }\n \n //extract parameters.\n $item_type = $object_info->type;\n $item_id = $object_info->type_id;\n $privacy_setting = $object_info->privacy_setting;\n $user_id = $object_info->user_id;\n \n //check for rating type\n if (!in_array($item_type, $this->privacy_type_item)) {\n return array('code' => 176, 'message' => 'PRIVACY_TYPE_NOT_SUPPPORTED', 'data' => $data);\n }\n \n //check for privacy setting..\n if (!in_array($privacy_setting, $this->privacy_setting_numbers)) {\n return array('code' => 177, 'message' => 'PRIVACY_VALUE_NOT_SUPPPORTED', 'data' => $data);\n }\n switch ($item_type) {\n case 'dashboard_post':\n $this->changeDashboardPostPrivacy($item_type, $item_id, $privacy_setting, $user_id);\n break;\n \n }\n }", "public function isAuthorized($user)\n{\n if (isset($user['role']) && $user['role'] === 'admin') {\n return true;\n }\n\n // Default deny\n return false;\n}", "public function getEntryMethodAllowableValues()\n {\n return [\n self::ENTRY_METHOD_MANUAL,\n self::ENTRY_METHOD_SCANNED,\n self::ENTRY_METHOD_SQUARE_CASH,\n self::ENTRY_METHOD_SQUARE_WALLET,\n self::ENTRY_METHOD_SWIPED,\n self::ENTRY_METHOD_WEB_FORM,\n self::ENTRY_METHOD_OTHER,\n ];\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/enterprise_rma_rma_statistics');\n }", "function _wp_privacy_action_request_types()\n {\n }", "public function getAllowed() {\n return $this->_allowed;\n }", "function isAllowedPermission()\n {\n $retObj = array();\n try {\n\n if (isset($_REQUEST['user_id']) && isset($_REQUEST['is_backend']) && isset($_REQUEST['method']))\n {\n $retObj['allowed'] = false;\n\n $params = array(\n 'user_id' => $_REQUEST['user_id'],\n 'is_backend' => $_REQUEST['is_backend'],\n 'method' => $_REQUEST['method']\n );\n\n $aclObj = new AclManager();\n $permissions = $aclObj->getUserPermissions($params);\n\n //c. check if method valid\n foreach($permissions as $permission)\n {\n if($permission['title'] == $params['method']) {\n $retObj['allowed'] = true;\n }\n }\n\n } else {\n\n throw new \\Exception('Unsupported Request: missing critical parameter(s).');\n\n }\n\n } catch (\\Exception $e) {\n\n Api::invalidResponse(\n $e->getMessage(),\n 400,\n Constants::STATUS_INVALID,\n $e,\n true,\n true\n );\n\n }\n\n return Api::apiResponse($retObj, Constants::STATUS_SUCCESSFUL);\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_sched/schedule');\n }", "public function authorize()\n {\n $status = request()->post('status');\n if (!empty($status) && !in_array($status, [\n LoanApplicationService::PENDING_STATUS, LoanApplicationService::APPOVED_STATUS, LoanApplicationService::REJECTED_STATUS])) {\n return false;\n }\n return true;\n }", "public static function getAllowableEnumValues()\n {\n return [\n self::USER,\n self::BILLING,\n self::ENGINEER,\n self::SUPERUSER\n ];\n }" ]
[ "0.5738114", "0.55978864", "0.5468351", "0.54662156", "0.53759736", "0.53389734", "0.5172044", "0.51574486", "0.5147866", "0.512583", "0.5124828", "0.50300676", "0.5029726", "0.50255734", "0.49913794", "0.49835142", "0.49746922", "0.49701563", "0.49554238", "0.4940942", "0.49245876", "0.49165264", "0.49058047", "0.48957914", "0.48938033", "0.4861843", "0.4850728", "0.48496103", "0.48438802", "0.47842303", "0.4781148", "0.478065", "0.47733322", "0.47706527", "0.47679645", "0.47625867", "0.47612128", "0.47483614", "0.4743861", "0.4740907", "0.47329286", "0.47311416", "0.47304738", "0.47228548", "0.4717412", "0.471449", "0.47066084", "0.46983337", "0.4698276", "0.46894976", "0.4687054", "0.468102", "0.46801862", "0.46744287", "0.4672827", "0.464593", "0.46429685", "0.46359", "0.4630576", "0.46245724", "0.4620611", "0.46176335", "0.46105865", "0.46090588", "0.46064273", "0.46040696", "0.45950034", "0.45935452", "0.45905998", "0.45902258", "0.45891872", "0.45878002", "0.45842683", "0.458361", "0.458361", "0.45758778", "0.4575184", "0.45749658", "0.4574103", "0.45738053", "0.4570016", "0.4570016", "0.45689833", "0.4563411", "0.45597008", "0.4557515", "0.4555772", "0.45453736", "0.45421672", "0.45343822", "0.45280153", "0.4526591", "0.45257074", "0.45234945", "0.45216468", "0.4520729", "0.4520652", "0.45173725", "0.4516819", "0.4514387", "0.45122793" ]
0.0
-1
Should be called only by admins.
public function get_user_arrays() { $users = Sentry::findAllUsers(); $user_arrays = array(); foreach ($users as $user) { $user_array = array( 'id' => $user->getId(), 'email' => $user->email, 'permissions' => self::encode_permissions($user->getMergedPermissions()) ); if (!$user->isActivated()) { // getActivationCode() generates a new activation code; an existing // activation code is stored in $user->activation_code $user_array['activationCode'] = !empty($user->activation_code) ? $user->activation_code : $user->getActivationCode(); } $user_arrays[] = $user_array; } return $user_arrays; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function adminOnly();", "public function adminOnly();", "public function relatorio4(){\n $this->isAdmin();\n }", "public function admin_page()\n {\n }", "public function admin_page()\n {\n }", "function admin_member() {\n\n\t\t}", "public function admin_action() {\n\t}", "public function admin_action() {\n\t}", "function visible_to_admin_user()\n\t{\n\t\treturn true;\n\t}", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "private function metodo_privado() {\n }", "public function admin_setup()\n\t{\n\t\t\n\t}", "public function isAdmin(){\n\t\tparent::isAdmin();\n\t}", "public function admin_init() {}", "protected function executeAdminCommand() {}", "protected function executeAdminCommand() {}", "protected function executeAdminCommand() {}", "public function isAdmin()\n {\n }", "protected function ensureAdminRoleIfRequested() {}", "public function onWpAdminMenu() {\n\t}", "public function admin() {\n\t\tinclude_once(\"paywithafacebookpost_admin.php\");\n\t}", "public function mustbeadmin()\n {\n if (!$this->hasadmin())\n {\n $this->web()->noaccess();\n }\n }", "public function admin_load()\n {\n }", "public function displayAdminPanel() {}", "public function admin_init(){\n\n\t}", "public function isAdmin() {}", "public function adminPermisionListing()\n\t\t\t{\n\t\t\t\t$cls\t\t\t=\tnew adminUser();\n\t\t\t\t$cls->unsetSelectionRetention(array($this->getPageName()));\n\t\t\t\t $_SESSION['pid']\t=\t$_GET['id'];\n\t\t\t\t \n\t\t\t}", "protected function isAdminUser() {}", "public function is_admin_only()\n\t{\n\t\treturn false;\n\t}", "public function getAdministrator() {}", "function Admin_authetic(){\n\t\t\t\n\t\tif(!$_SESSION['adminid']) {\n\t\t\t$this->redirectUrl(\"login.php\");\n\t\t}\n\t}", "protected static function isAdminUser() {\r\n throw new \\Excpetion('yet to implement');\r\n }", "public function requireAdmin(){\n if( ! Authentifiacation::isAdmin()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to have admin status to access this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "protected function setupAdminUser()\n {\n $GLOBALS['current_user'] = \\BeanFactory::getBean('Users')->getSystemUser();\n }", "function mod_core_admin() {\n\t\tglobal $NeptuneCore;\n\t\tglobal $NeptuneSQL;\n\t\tglobal $NeptuneAdmin;\n\t\t\n\t\tif (!isset($NeptuneCore)) {\n\t\t\t$NeptuneCore = new NeptuneCore();\n\t\t}\t\n\t\tif (!isset($NeptuneSQL)) {\n\t\t\t$NeptuneSQL = new NeptuneSQL();\n\t\t}\t\n\t\tif (!isset($NeptuneAdmin)) {\n\t\t\t$NeptuneAdmin = new NeptuneAdmin();\n\t\t}\t\n\t\t\n\t\t\n\t\tif (neptune_get_permissions() >= 3) {\n\t\t\t$query = $NeptuneCore->var_get(\"system\",\"query\");\n\t\t\tif (@isset($query[1]) && @isset($query[2])) {\n\t\t\t\t$AdminFunction = \"acp_\" . $query[1] . \"_\" . $query[2];\n\t\t\t\t\n\t\t\t\t$AdminFunction();\n\t\t\t} else {\n\t\t\t\t$NeptuneAdmin->run();\n\t\t\t}\n\t\t} else {\n\t\t\t$NeptuneCore->title($NeptuneCore->var_get(\"locale\",\"accessdenied\"));\n\t\t\t$NeptuneCore->neptune_echo(\"<p>\" . $NeptuneCore->var_get(\"locale\",\"nopermission\") . \"</p>\");\n\t\t\t\n\t\t\theader(\"HTTP/1.1 403 Forbidden\");\n\t\t}\n\t}", "protected function beforeUpdating()\n {\n }", "private function notAdmin() : void\n {\n if( intval($this->law) === self::CREATOR_LAW_LEVEL)\n {\n (new Session())->set('user','error','Impossible d\\'effectuer cette action');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }\n }", "public function adminPanel()\n {\n $userManager = new UserManager;\n $infoUser = $userManager->getInfo($_SESSION['id_user']);\n if ($_SESSION['id_user'] == $infoUser['id'] and $infoUser['rank_id'] == 1) {\n $postManager = new PostManager;\n $commentManager = new CommentManager;\n $findPost = $postManager->getPosts();\n $commentReport = $commentManager->getReport();\n $unpublished = $commentManager->getUnpublished();\n require('Views/Backend/panelAdminView.php');\n } else {\n throw new Exception('Vous n\\'êtes pas autorisé à faire cela');\n }\n }", "public function administrador()\n {\n return false;\n }", "function admin_init()\n {\n }", "public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}", "function IsAdmin()\n{\n\treturn false;\n}", "public function require_admin()\n {\n //{\n // Errors::show_404();\n //}\n }", "public static function adminLoggedIn(){\n //Hvis en bruker ikke er logget inn eller han ikke er admin, vil han bli sent til login.php\n if (!isset($_SESSION['user']) || !$_SESSION['user']->isAdmin()) {\n //Lagrer siden brukeren er på nå slik at han kan bli redirigert hit etter han har logget inn\n $alert = new Alert(Alert::ERROR, \"Du er nødt til å være administrator for å se den siden. Du er ikke administrator.\");\n $alert->displayOnIndex();\n\n }\n }", "function in_admin_header()\n {\n }", "public function adminMethod(){\n return 'ok';\n }", "private function __allowSuperAdminOnly() {\n\t\t$isSuperAdmin = $this->_isSuperAdmin();\n\t\tif ($isSuperAdmin === false) {\n\t\t\t$this->redirect('/admin/users/accessDenied');\n\t\t}\n\t}", "public function adminHead ()\r\n {\r\n \tif ($GLOBALS['editing']) {\r\n \t\t$this->printScripts();\r\n \t}\r\n }", "static function adminGateKeeper() {\n if (!loggedIn() || !adminLoggedIn()) {\n new SystemMessage(translate(\"system_message:not_allowed_to_view\"));\n forward(\"home\");\n }\n }", "public function isAdmin()\n\t{\n\t\t$this->reply(true);\n\t}", "public function initializeAdminPanel() {}", "public function adminMatters(){\n\n }", "public function isAdministrador(){ return false; }", "function is_user_admin()\n {\n }", "public function principal()\n\t {\n\t\t require_once('../../site_media/html/cursos/cu_Admin.php');\n\t }", "protected function fixPermission() {}", "function input_admin_head()\n\t{\n\t\t// Note: This function can be removed if not used\n\n\t\t\n\t\t\n\t}", "public function userbyLocationsAction() {\n $this->_helper->content->setEnabled();\n }", "function has_admin()\n\t{\n\t\treturn false;\n\t}", "function authorizedAdminOnly(){\n global $authenticatedUser;\n if(!$authenticatedUser['admin']){\n header(\"HTTP/1.1 403 Forbidden\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-403\");\n exit();\n }\n }", "function VisibleToAdminUser()\n {\n\tinclude (\"dom.php\");\n return $this->CheckPermission($pavad.' Use');\n }", "protected function afterUpdating()\n {\n }", "public function admin() {\n\n\t\t\tif ( ! is_admin() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trequire_once $this->includes_path() . 'admin/class-cyprus-admin.php';\n\t\t}", "public function beforeAdminLoad(): void {\n global $url;\n global $media_admin;\n\n // Trigger on 'Media' View\n if(strpos($url->slug(), \"media\") !== 0) {\n return;\n }\n checkRole(array(\"admin\"));\n\n // Change Layout\n if(isset($_GET[\"layout\"]) && in_array($_GET[\"layout\"], [\"table\", \"grid\"])) {\n $this->setField(\"layout\", $_GET[\"layout\"]);\n }\n\n // Init Administration\n $media_admin->path = trim($url->slug(), \"/\");\n $media_admin->view = \"media\";\n $media_admin->method = explode(\"/\", $media_admin->path)[1] ?? \"index\";\n $media_admin->query = $_GET;\n\n // Handle Request\n if($media_admin->method !== \"index\") {\n $media_admin->submit();\n }\n }", "protected function get_admin_url()\n {\n }", "function before_edit_configuration() { }", "public function isAdmin();", "public static function adminPage(){\n\t\tif(!self::isAdmin()){\n\t\t\theader(\"Location: index.php\");\n\t\t\texit;\n\t\t}\n\t}", "function onAfterWrite() {\n\t\t$bt = defined('DB::USE_ANSI_SQL') ? \"\\\"\" : \"`\";\n\n\t\tif(!$this->owner->ApproverGroups()->Count() && $this->owner->CanApproveType == 'OnlyTheseUsers') {\n\t\t\t$SQL_group = Convert::raw2sql('site-content-approvers');\n\t\t\t$groupCheckObj = DataObject::get_one('Group', \"{$bt}Code{$bt} = '{$SQL_group}'\");\n\t\t\tif($groupCheckObj) $this->owner->ApproverGroups()->add($groupCheckObj);\n\t\t}\n\t\t\n\t\tif(!$this->owner->PublisherGroups()->Count() && $this->owner->CanPublishType == 'OnlyTheseUsers') {\n\t\t\t$SQL_group = Convert::raw2sql('site-content-publishers');\n\t\t\t$groupCheckObj = DataObject::get_one('Group', \"{$bt}Code{$bt} = '{$SQL_group}'\");\n\t\t\tif($groupCheckObj) $this->owner->PublisherGroups()->add($groupCheckObj);\n\t\t}\n\t}", "function get_super_admins()\n {\n }", "public function before()\n\t{\n\t\t// Inform tht we're in admin section for themers/developers\n\t\tTheme::$is_admin = TRUE;\n\n\t\tif($this->request->action() != 'login')\n\t\t{\n\t\t\tACL::redirect('administer site', 'admin/login');\n\t\t}\n\n\t\tparent::before();\n\t}", "protected function beforeUpdate()\n {\n }", "private function manageButtons()\n {\n if (!$this->user->hasPermissionTo(BackpackUser::PERMISSION_EVENTS_CREATE)) {\n $this->crud->denyAccess('create');\n }\n\n if ($this->user->hasPermissionTo(BackpackUser::PERMISSION_EVENTS_ADMIN_VIEW)) {\n $this->crud->allowAccess('show');\n }\n\n if (!$this->user->hasPermissionTo(BackpackUser::PERMISSION_EVENTS_EDIT)) {\n $this->crud->denyAccess('update');\n }\n\n if (!$this->user->hasPermissionTo(BackpackUser::PERMISSION_EVENTS_DELETE)) {\n $this->crud->denyAccess('delete');\n }\n }", "public function checkAdmin();", "protected function isAdmin()\n\t{\n\t\treturn is_admin();\n\t}", "public function GetAdmin ();", "public function admin()\n {\n $this->template_admin->displayad('admin');\n }", "function adminSpecial() {\n\t\t$this->adminDefault();\n\t\t$this->baseLink = CMS_WWW_URI.'admin/special.php?module=picture_gallery';\n\t\t$this->setView('admin_list');\n\t}", "protected function admin_page_action() {\n\n\t\tif ( $this->is_admin_request_for_users_forget() ) {\n\t\t\t$this->users_forget();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_send_email() ) {\n\t\t\t$this->users_send_email();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_remove() ) {\n\t\t\t$this->users_remove_from_list();\n\t\t}\n\n\t\t/* Default settings page */\n\t\t$this->add_view_option( 'data', $this->get_all_requested_users_data( $confirmed_only = true ) );\n\n\t}", "function beforeRender() {\n\t\t $this->set('currentAdmin', $this->Auth->user());\n\t\t\t$this->set('cssName',$this->Cookie->read('css_name'));\n\t\t\t$this->set('groupDetail',$this->common->adminDetails());\n\t\t\t$this->set('common',$this->common);\n\t\t\t//$this->Ssl->force();\n\t }", "public function checkAccess()\n {\n // need to be modified for security\n }", "function onView () {\n\n switch (parent::getAction()) {\n \n case \"edit\":\n $this->printEditView();\n break;\n default:\n $userId = $this->getModeUserId();\n $user = UsersModel::getUser($userId);\n if (RolesModel::hasModuleRole($userId,\"user.files.owner\")) {\n if (empty($user->directoryid)) {\n $user->directoryid = UsersModel::setupUserDirectory($userId);\n }\n parent::onView($user->directoryid);\n }\n }\n }", "function new_user_email_admin_notice()\n {\n }", "function admin_index()\n\t{\n\t \n\t}", "function mmf_admin() {\n\t\tinclude('mmf_admin_page.php');\n\t}", "public function principal()\n\t {\n\t\t require_once('../../site_media/html/asignar_cursos/ac_Admin.php');\n\t }", "function permissions() {\r\n\t\treturn false;\r\n\t}", "function ValidateAdmin()\n\t{\n\t}", "function check_admin() {\n\t\t// check session exists\n\t\tif(!$this->Session->check('Admin')) {\n\t\t\t$this->Session->setFlash(__('ERROR: You must be logged in for that action.', true));\n\t\t\t$this->redirect(array('controller'=>'contenders', 'action'=>'index', 'admin'=>false));\n\t\t}\n\t}", "function admin_load()\n {\n }", "protected function status()\n {\n }", "public function before()\n {\n parent::requireAdmin();\n $this->user = Authentifiacation::getCurrentUser(); // get current user\n Booking::automaticBookingsDeletion(); // automatically delete all old bookings\n\n }", "public function adminmenu() {\n\t\n\t\tglobal $current_screen;\n\t\tglobal $parent_file;\n\n\t\tif ( $current_screen->base == 'settings_page_schedule-a-visit-to-sherpa' ) {\n\t\t\t// We have to reset this after the Menu is generated so Settings Errors still appear\n\t\t\t$parent_file = 'options-general.php';\n\t\t}\n\n\t}", "public function ensureAdministratorAccess() {\r\n /** @var modUserGroup $adminGroup */\r\n $adminGroup = $this->modx->getObject('modUserGroup',array('name' => 'Administrator'));\r\n /** @var modAccessPolicy $adminContextPolicy */\r\n $adminContextPolicy = $this->modx->getObject('modAccessPolicy',array('name' => 'Context'));\r\n if ($adminGroup) {\r\n if ($adminContextPolicy) {\r\n /** @var modAccessContext $adminAdminAccess */\r\n $adminAdminAccess = $this->modx->newObject('modAccessContext');\r\n $adminAdminAccess->set('principal',$adminGroup->get('id'));\r\n $adminAdminAccess->set('principal_class','modUserGroup');\r\n $adminAdminAccess->set('target',$this->object->get('key'));\r\n $adminAdminAccess->set('policy',$adminContextPolicy->get('id'));\r\n $adminAdminAccess->save();\r\n }\r\n }\r\n }", "public static function es_admin_option() {\n\t}", "public function adminAjax()\r\n\t{\r\n\t\treturn;\r\n\t}", "protected function editLockPermissions() {}", "function setAdmin() {\n\t\t$this->_extension_high = \"\";\n\t\t$this->_extension_low = \"\";\n\t\t$this->_deptname = \"\";\n\t\t$this->_sections = array(\"*\");\n\t}", "function printAdminPage() {\n require ('adminPage.php');\n adminPage($this);\n }", "function admin_index()\n {\n if(!$this->Session->check('Admin'))\n {\n $this->redirect('/admin/login');\n }\n\n\n }" ]
[ "0.69889283", "0.69889283", "0.67946607", "0.66623074", "0.66623074", "0.66188973", "0.6580513", "0.6580513", "0.6517171", "0.64882946", "0.6481027", "0.64737976", "0.6446926", "0.6443373", "0.64427257", "0.6364176", "0.6364176", "0.6364176", "0.63623494", "0.6339837", "0.6335253", "0.6328801", "0.6328388", "0.6312875", "0.6295813", "0.6293807", "0.62937665", "0.6272351", "0.62497365", "0.62480646", "0.6209808", "0.6199734", "0.6192876", "0.61637974", "0.6161054", "0.6160381", "0.61513877", "0.61428624", "0.6136401", "0.6125001", "0.6110927", "0.6108161", "0.60963947", "0.608192", "0.6081012", "0.60741365", "0.606667", "0.6055715", "0.60540783", "0.60470545", "0.60285205", "0.60217583", "0.5993471", "0.59895176", "0.59867", "0.5979167", "0.59791654", "0.5978643", "0.5977694", "0.5972589", "0.5948913", "0.5943629", "0.5941787", "0.5933848", "0.59276253", "0.59162736", "0.5916072", "0.5910936", "0.5906186", "0.59039545", "0.58865356", "0.5886249", "0.58852017", "0.58850455", "0.5880967", "0.5877847", "0.5877095", "0.58752847", "0.58658844", "0.58612615", "0.58606213", "0.5858216", "0.5855511", "0.58527935", "0.5845162", "0.58429164", "0.5840353", "0.5838337", "0.5835045", "0.58315957", "0.5825467", "0.5823202", "0.58201283", "0.58175457", "0.5815384", "0.5809476", "0.58076423", "0.5800554", "0.579951", "0.5795152", "0.57942235" ]
0.0
-1
Transform the resource into an array.
public function toArray($request) { $center = Center::where(['code' => $this->center_code])->first(); $disaster = Disaster::find($this->disaster_id); $household = Household::where(['center_code' => $this->code])->get(); return [ 'code' => $this->code, 'population' => $this->population . " (" . $household->count(). " family)", 'capacity' => $this->capacity, 'center' => $center->name, 'disaster' => $disaster->name, 'city' => $center->cityLocation(), 'barangay' => $center->barangayLocation(), 'duration' => $this->support_duration . " day(s)", 'water' => ($center->has_water_supply == true) ? "Available" : "Not Available", 'electricity' => ($center->has_electricity_supply == true) ? "Available" : "Not Available", 'network' => ($center->has_network_coverage == true) ? "Available" : "Not Available", 'status' => ($this->status == true) ? "Active" : "Not Active", ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function asArray() {\n return $this->resource;\n }", "public function transform($resource)\n {\n return [];\n }", "public function toArray()\n {\n if ($this->resource instanceof ArrayableInterface) {\n\n return $this->resource->toArray();\n } else {\n\n return null;\n }\n }", "public function parse($resource)\n {\n return $resource->toArray();\n }", "public function transform($resource)\n {\n return [\n 'id' => $resource['id'],\n 'item' => $resource['item'],\n 'qty' => $resource['qty'],\n\n ];\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "abstract protected function toArray();", "public function getAsArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function transform($resource)\n {\n return [\n\n 'id' => (int) $resource->id,\n\t\t\t'name' => $resource->name,\n\t\t\t'description' => $resource->description,\n 'seat_count' => $resource->seat_count,\n\t\t\t'is_active' => $resource->is_active,\n\t\t\t'status' => $resource->status,\n\t\t\t'created_at' => $resource->created_at->toDateTimeString(),\n\t\t\t'updated_at' => $resource->updated_at->toDateTimeString(),\n\t\t\t\n ];\n }", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray(): array\n {\n return [\n 'users' => HiUserResource::collection($this->resource),\n ];\n }", "public function toArray()\n {\n return $this->transform();\n }", "function toArray() ;", "function toArray() ;", "public function convertItemArray() {}", "public function toArray(): array\n {\n $content = $this->getContent();\n\n if (\\is_array($content)) {\n return $this instanceof Filterable\n ? (array) $this->filterResponse($content)\n : $content;\n }\n\n return [];\n }", "protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}", "public function arr() {\n\t\t\treturn \\uri\\generate::to_array($this->object);\n\t\t}", "public function toArray()\n {\n return $this->getContent();\n }", "public function toArray()\n {\n\n }", "public function asArray(): array\n {\n return json_decode($this->result, true);\n }", "public function toArray()\n {\n return $this->cast('array');\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "private function arrayify(): array\n {\n return $this->toArray();\n }", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "public function toArray() // untested\n {\n return $this->data;\n }", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;" ]
[ "0.7750928", "0.7750928", "0.7715773", "0.75906307", "0.7310379", "0.7138024", "0.7134791", "0.7096877", "0.7096877", "0.70968604", "0.70968604", "0.70968604", "0.70968604", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.6959165", "0.69560915", "0.68910366", "0.68910366", "0.68910366", "0.68910366", "0.68910366", "0.68910366", "0.6881386", "0.6868011", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6852651", "0.6851924", "0.6790647", "0.674651", "0.674651", "0.67363435", "0.6720337", "0.6712338", "0.67115825", "0.6710179", "0.666141", "0.66587526", "0.6656767", "0.6655622", "0.66545117", "0.6648871", "0.6648871", "0.6648871", "0.6648871", "0.6648871", "0.66377884", "0.6637001", "0.6629", "0.6629", "0.6629", "0.6629", "0.6629", "0.6629", "0.6629" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('hotels_images')->insert([ 'image_url' => "/img/Airbnb.jpeg", 'hotel_id' => 1, ]); DB::table('hotels_images')->insert([ 'image_url' => "/img/Airbnb_building.jpeg", 'hotel_id' => 1, ]); DB::table('hotels_images')->insert([ 'image_url' => "/img/Airbnb2.jpeg", 'hotel_id' => 2, ]); DB::table('hotels_images')->insert([ 'image_url' => "/img/Airbnb2_building.jpeg", 'hotel_id' => 2, ]); DB::table('hotels_images')->insert([ 'image_url' => "/img/Airbnb3.jpeg", 'hotel_id' => 3, ]); DB::table('hotels_images')->insert([ 'image_url' => "/img/Airbnb3_building.jpeg", 'hotel_id' => 3, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Initialize properties before running the controller methods (actions), so they are available to our action.
public function before() { // Run anything that needs to run before this. parent::before(); if ($this->auto_render) { // Initialize empty values $this->template->title = ''; $this->template->meta_keywords = ''; $this->template->meta_description = ''; $this->template->meta_copywrite = ''; $this->template->header = ''; $this->template->content = ''; $this->template->footer = ''; $this->template->styles = array(); $this->template->scripts = array(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeController() {}", "public function __construct() {\n\t\t\t$this->init_globals();\n\t\t\t$this->init_actions();\n\t\t}", "public static function init() {\n\t\tself::setup_actions();\n\t}", "protected function initAction()\n {\n }", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function init()\n {\n /* Initialize action controller here */\n }", "public function init()\n {\n /* Initialize action controller here */\n }", "public function initializeAction() {\n\n\t}", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('uploadUri', $this->getController()->buildUriPath(uploadController::ACTION_UPLOAD));\n\t\t$this->getEngine()->assign('doUploadUri', $this->getController()->buildUriPath(uploadController::ACTION_DO_UPLOAD));\n\t\t$this->getEngine()->assign('doMovieSave', $this->getController()->buildUriPath(uploadController::ACTION_MOVIE_SAVE));\n\t}", "public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "protected function initializeAction()\n {\n parent::initializeAction();\n $this->customer = SubjectResolver::get()\n ->forClassName(Customer::class)\n ->forPropertyName('user')\n ->resolve();\n }", "public function init() {\n\t\t$this->load_actions();\n\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->resolution_summary = \"\";\n\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}", "public function setup_actions() {}", "public function init() {\n\n $this->jobs = new Hb_Jobs();\n if ($this->_request->getActionName() == 'view') {\n\n $this->_request->setActionName('index');\n }\n\n $this->searchParams = $this->_request->getParams();\n $this->view->searchParams = $this->searchParams;\n\n $this->view->actionName = $this->_request->getActionName();\n }", "public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->media_values = array(\n\t\t\t101 => Kohana::lang('ui_main.all'),\n\t\t\t102 => Kohana::lang('actionable.actionable'),\n\t\t\t103 => Kohana::lang('actionable.urgent'),\n\t\t\t104 => Kohana::lang('actionable.action_taken')\n\t\t);\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }", "public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }", "public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }", "protected function initializeAction()\n {\n $this->extKey = GeneralUtility::camelCaseToLowerCaseUnderscored('BwrkOnepage');\n /** @var LanguageAspect $languageAspect */\n $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');\n $this->languageUid = $languageAspect->getId();\n }", "public function init()\n {\n if (isset($this->_server['REQUEST_METHOD'])) {\n $this->_properties = $this->_request;\n\n if (array_key_exists('parameters', $this->_get)\n && gettype($this->_get['parameters']) != 'array'\n && strlen(trim($this->_get['parameters'])) > 0\n ) {\n $paramData = explode('/', $this->_get['parameters']);\n for ($index = 0, $maxCount = sizeof($paramData); $index < $maxCount; $index += 2) {\n if (isset($paramData[$index+1])) {\n if ($paramData[$index+1] == \"_\") {\n $value = \"\";\n } else {\n $value = $paramData[$index+1];\n }\n $this->setProperty(\n $paramData[$index], $value\n );\n }\n }\n } elseif (isset($this->_get['parameters'])\n && gettype($this->_get['parameters']) == 'array'\n && count($this->_get['parameters']) > 0) {\n\n $paramData = $this->_get['parameters'];\n\n foreach ($paramData as $index => $value) {\n $this->setProperty($index, $value);\n }\n }\n\n return;\n }\n\n if (isset($this->_server['argv'])) {\n foreach ($this->_server['argv'] as $arg) {\n if (strpos($arg, '=')) {\n list($key, $val) = explode(\"=\", $arg);\n $this->setProperty($key, $val);\n }\n }\n }\n }", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }", "protected function _initialize()\n {\n // 客户资料\n $CustId = I('CustId');\n $this->customer = M('Customer')->find($CustId);\n\n // 操作者资料\n $this->user = session('user');\n }", "public function init()\n {\n $actionName = Yii::$app->controller->action->id;\n $function = new \\ReflectionClass($this->model->className());\n $modelName = $function->getShortName();\n $this->permissionSave = PermissionHelper::findPermissionModelAction($modelName, $actionName);\n\n parent::init();\n\n $this->initVariablesI18n();\n }", "protected function initializeActionEntries() {}", "public function init()\n {\n // setting current view class name\n $this->_sThisAction = strtolower(get_class($this));\n\n if (!$this->_blIsComponent) {\n // assume that cached components does not affect this method ...\n $this->addGlobalParams();\n }\n }", "public function init()\n {\n parent::init();\n\n static::$tcCommon = $this->tcModule;\n\n $properties = array_keys(Yii::getObjectVars($this));\n $params = $this->module->params;\n foreach ($params as $property => $value) {\n if (in_array($property, $properties)) {\n $this->$property = $value;\n }\n }\n }", "protected function initializeAction() {\n\t\t$this->feusers = $this->feusersRepository->findByUid( $GLOBALS['TSFE']->fe_user->user['uid'] ) ;\n\t\t$this->schule = $this->feusers->getSchule();\n\t\n\t\t$this->extKey = $this->request->getControllerExtensionKey();\n\t\t$this->extPath = t3lib_extMgm::extPath($this->extKey);\n\t\n\t\t$this->importClassFile = $this->extPath.'Classes/tmp/class.importtext.php';\n\t\t$this->importClass = 'ImportText';\n\t \n\t\tif ( $this->settings[pidAjaxContainerKlassenuebersicht] > 0) $this->pidAjaxContainerKlassenuebersicht = (int) $this->settings[pidAjaxContainerKlassenuebersicht];\n\t\n\t}", "protected function setUp() {\n $this->_request = Request::createFromGlobals();\n $this->object = new LoginController($this->_request);\n }", "public function __construct(){\r\n parent::__construct();\r\n \r\n $this->defineProperties( [ \r\n \"sAction\" => \"\",\r\n \"asActionsMap\" => [],\r\n \"oModel\" => null,\r\n \"oView\" => null\r\n ] ); // $this->defineProperties( [ \r\n }", "protected function initializeAction() {\n\t\t$this->frontendUserRepository = t3lib_div::makeInstance('Tx_GrbFeusermanager_Domain_Repository_FrontendUserRepository');\n\t}", "public function init()\n {\n $this->modelClass = $this->module->categoryModelClass;\n $this->modelSearchClass = $this->module->categoryModelSearchClass;\n $this->indexView = $this->module->categoryIndexView;\n $this->viewView = $this->module->categoryViewView;\n $this->createView = $this->module->categoryCreateView;\n $this->updateView = $this->module->categoryUpdateView;\n parent::init();\n }", "function setupInitialVars() {\n\t\tparent::setupInitialVars();\n\t\t\n\t\t$this->getEngine()->assign('daoUriView', $this->buildUriPath(grantsController::ACTION_SEARCH));\n\t}", "public function init()\n {\n $this->ctrlActionModel = new Admin_Model_Acl_ControllersActions();\n $this->dbController = new Admin_Model_DbTable_Acl_ModuleController();\n $this->dbAction = new Admin_Model_DbTable_Acl_Action();\n }", "public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Configure::read('App'));\n \t\t\n \t}", "public function init()\n {\n $this->sysConfig = Zend_Registry::get('sysConfig');\n\t\t$this->view->sysConfig = $this->sysConfig;\n\t\t\n\t\t$this->config = Zend_Registry::get('config');\n\t\t$this->view->config = $this->config;\n\t\t\n\t\t$this->db=Zend_Registry::get('db');\n\t\t\n\t\t//controller and action names\n\t\t$this->controllerName = $this->getRequest()->getControllerName();\n\t\t$this->view->controllerName = $this->controllerName;\n\t\t\n\t\t$this->actionName = $this->getRequest()->getActionName();\n\t\t$this->view->actionName = $this->actionName;\n\t\t\n\t\t$this->view->baseurl=$this->config->common->baseUrl.\"/\";\n\t\t$this->view->cssurl=$this->config->common->cssPath;\n\t\t$this->view->jsurl=$this->config->common->jsPath;\n\n $this->view->items = \"\";\n $this->view->dashboard = \"\";\n $this->view->cnews = \"\";\n $this->view->expenditure = \"\";\n \n \n }", "public function __construct()\n {\n $this->paths('app/Actions');\n $this->loadedActions = collect();\n }", "function collectPropertiesAndActions()\n\t{\n\n\t}", "public function _initialize()\n {\n $this->cate=CONTROLLER_NAME;\n }", "public function init()\n {\n $this->ctrlModel = new Admin_Model_Acl_ControllersActions();\n $this->dbCtrl = new Admin_Model_DbTable_Acl_ModuleController();\n }", "public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }", "function __construct() {\n\t\t\n\t\tparent::__construct();\n\t\t\n\t\t// skip the timestamp check for this app\n\t\tSession::check(true);\n\t\t$this->data[\"showActions\"] = true;\n\t\t$this->data[\"csrfToken\"] = CSRF::generateToken();\n\t\t\n\t}", "function __construct()\n {\n include(__DIR__.'/lucid_controller.php');\n\n $this->actions = [\n 'pre-request'=>[],\n 'request'=>[],\n 'post-request'=>[],\n ];\n\n $this->config = [\n 'default_position'=>'body',\n 'paths'=>[],\n 'view_params' =>[],\n 'view_returns'=>[],\n ];\n }", "protected function initializeActionMethodArguments() {}", "public static function initialize()\n {\n //Can be used to setup things before the execution of the action\n return true;\n }", "public function init()\n {\n $this->rootPageUid = $this->filterConfig->getSettings('rootPageUid');\n $this->respectEnableFields = $this->filterConfig->getSettings('respectEnableFields');\n $this->respectDeletedField = $this->filterConfig->getSettings('respectDeletedField');\n }", "protected function initializeProcessAction() {}", "public function init()\n {\n $this->projectController->init();\n }", "protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}", "public function initialize()\n {\n parent::initialize();\n\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n //$this->loadComponent('Security');\n //$this->loadComponent('Csrf');\n }", "protected function _init() {\n\t\t$this->user = SessionUser::user();\n\n\t\t// Might come in handy sometimes: direct access to the DBAL:\n\t\t$this->db = $GLOBALS['db'];\n\n\t\t// Initialize Output/Views (used in 90% of controller actions):\n\t\t$this->tpl = new Output($this);\n\t\t$this->tpl->viewLayout = '_layout';\n\t\t$this->tpl->assign('app', $this);\n\t}", "public function init()\r\n {\r\n\r\n /* Initialize action controller here */\r\n\r\n //=====================================must add in all Controller class constructor ===================================//\r\n if(defined('SITEURL')) $this->site_url = SITEURL;\r\n if(defined('SITEASSET')) $this->site_asset = SITEASSET;\r\n $this->view->site_url = $this->site_url;\r\n $this->view->site_asset = $this->site_asset;\r\n Zend_Loader::loadClass('Signup');\r\n Zend_Loader::loadClass('User');\r\n Zend_Loader::loadClass('Request');\r\n //Zend_Loader::loadClass('mailerphp');\r\n\t\t//Zend_Loader::loadClass('Permission');\r\n\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n Zend_Loader::loadClass('LoginAuth');\r\n $this->view->ob_LoginAuth = $this->sessionAuth = new LoginAuth();\r\n\r\n $this->sessionAuth->login_user_check();\r\n\r\n $this->sessionAuth->cookie_check();\r\n $this->view->server_msg = $this->sessionAuth->msg_centre();\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n unset($_SESSION['tranzgo_session']['export_list']);\r\n $this->view->ControllerName = $this->_request->getControllerName();\r\n $this->view->page_id = ($_SESSION['tranzgo_session']['role_id']==1)?'5':'7';\r\n //______________________________________must add in all Controller class constructor _____________________________________//\r\n\r\n\r\n }", "function startup(&$controller) {\n $this->setVars();\n }", "protected function initVars() {\n\n\t\t}", "public function init()\r\n {\r\n $this->admin = Shopware()->Modules()->Admin();\r\n $this->basket = Shopware()->Modules()->Basket();\r\n $this->session = Shopware()->Session();\r\n $this->db = Shopware()->Db();\r\n $this->moduleManager = Shopware()->Modules();\r\n $this->eventManager = Shopware()->Events();\r\n }", "public function initialize() {\n // set the default properties for the sekugManageAlbumItemsController class\n $loadjquery = $this->modx->getOption('sekusergalleries.load_jquery');\n $this->setDefaultProperties(array(\n 'gallery' => '',\n 'tplGallery' => 'users.gallery.view',\n 'tplAlbumList' => 'users.gallery.albumlist',\n 'customcss' => '',\n 'loadjquery' => $loadjquery,\n ));\n // if the gallery id is in the request, set it in the properties\n //if (!empty($_REQUEST['gallery'])) {\n $this->setProperty('gallery', ($_REQUEST['gallery']>'') ? $_REQUEST['gallery'] : $this->modx->user->get('id') );\n //}\n }", "public function init()\n {\n $this->vars['CRUD']['Object'] = $this;\n $this->kernel = kernel();\n\n // Dynamic initialization\n if (! $this->modelName) {\n $modelRefl = new ReflectionClass($this->modelClass);\n $this->modelName = $modelRefl->getShortName();\n }\n\n\n if (! $this->crudId) {\n $this->crudId = \\Phifty\\Inflector::getInstance()->underscore($this->modelName);;\n }\n if (! $this->templateId) {\n $this->templateId = $this->crudId;\n }\n\n // Derive options from request\n if ($request = $this->getRequest()) {\n if ($useFormControls = $request->param('_form_controls')) {\n $this->actionViewOptions['submit_btn'] = true;\n $this->actionViewOptions['_form_controls'] = true;\n }\n }\n\n $this->reflect = new ReflectionClass($this);\n $this->namespace = $ns = $this->reflect->getNamespaceName();\n\n // XXX: currently we use FooBundle\\FooBundle as the main bundle class.\n $bundleClass = \"$ns\\\\$ns\";\n if (class_exists($bundleClass)) {\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n } else {\n $bundleClass = \"$ns\\\\Application\";\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n }\n\n $this->vars['Handler'] = $this;\n $this->vars['Controller'] = $this;\n\n // anyway, we have the model classname, and the namespace, \n // we should be able to registerRecordAction automatically, so we don't have to write the code.\n if ($this->registerRecordAction) {\n $self = $this;\n $this->kernel->event->register('phifty.before_action',function() use($self) {\n $self->kernel->action->registerAction('RecordActionTemplate', array(\n 'namespace' => $self->namespace,\n 'model' => $self->modelName,\n 'types' => (array) $self->registerRecordAction\n ));\n });\n }\n\n\n $this->initPermissions();\n\n /*\n * TODO: Move this to before render CRUD page, keep init method simple\n\n if ( $this->isI18NEnabled() ) {\n $this->primaryFields[] = 'lang';\n }\n */\n $this->initNavBar();\n }", "protected function init()\n {\n if (in_array('users', Mongez::getStored('modules'))) {\n $this->isUserModuleExits = true;\n }\n\n $this->info('Preparing data...');\n $this->initController();\n $this->initModel();\n $this->initResource();\n $this->initRepository();\n $this->initData();\n }", "public function __construct() {\r\n $this->template = new Template();\r\n $this->settingsModel = new settingsModel();\r\n $this->dbUtil = new DBUtil();\r\n $this->combovalue = $this->settingsModel->populatetypeValues();\r\n $this->logger = Logger::getLogger(\"========= Metadata Controller =========== \");\r\n }", "public function __construct() {\n $this->urlValues = $_GET;\n if (!isset($this->urlValues['c'])) {\n $this->controllerName = \"home\";\n $this->controllerClass = \"HomeController\";\n } else {\n $this->controllerName = strtolower($this->urlValues['c']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['c'])) . \"Controller\";\n }\n \n if (!isset($this->urlValues['a'])) {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['a']; \n }\n }", "function init() {\n $this->properties = array();\n if(isset($_SERVER['REQUEST_METHOD'])) {\n $urlPieces = explode(\"/\", $_GET['q']);\n array_shift($urlPieces);// the way our mod_rewrite does this, it adds an empty string as an extra element on the beginning\n if($urlPieces[0] === \"a\") {// something like foo/bar/test\n $this->setProperty(\"app\", \"true\");\n $this->setProperty(\"cmd\", $urlPieces[1]);\n $this->setProperty(\"action\", $urlPieces[2]);\n } else {\n $this->setProperty(\"cmd\", $urlPieces[0]);\n $this->setProperty(\"action\", $urlPieces[1]);\n\n if(count($urlPieces) > 2) {\n for($i = 2; $i < count($urlPieces); ++$i) {\n $this->extras[] = $urlPieces[$i];\n }\n }\n }\n }\n\n if(isset($_SERVER['argv'][0])) {\n $argPieces = explode(\"&\", $_SERVER['argv'][0]);\n } else {\n $argPieces = array();\n }\n\n foreach($argPieces as $arg) {\n if(strpos($arg, '=')) {\n list($key, $val) = explode(\"=\", $arg);// a=login <- a = 'cmd' in CommandResolver\n $this->setProperty($key, $val);\n }\n }\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public function init()\n\t{\n\t\t$acl = Zend_Controller_Front::getInstance()->getParam('acl');\n\t\t$role = Zend_Auth::getInstance()->getIdentity()->role;\n\t\t\n\t\tif ($role == \"administrator\") {\n\t\t\t//$this->_models[] = 'Default_Model_Sources';\n\t\t}\t\n\t\t\n\t\t// find if a page have been set\n\t\t$params = $this->getRequest()->getParams();\n\t\tif (isset($params['page'])) {\n\t\t\t$this->page = $params['page'];\n\t\t}\t\n\t}", "public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }", "public function initialize()\n {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie');\n $this->cors();\n\n $currentController = $this->request->getParam('controller');\n // pr($currentController); die();\n if($currentController == 'Tenants'){\n $currentController = 'TenantUsers';\n }\n if($currentController == 'CorporateClients'){\n $currentController = 'CorporateClientUsers';\n // pr($currentController);die();\n }\n // $currentController = $this->request->params['controller'];\n $loginAction = $this->Cookie->read('loginAction');\n if(!$loginAction){\n $loginAction = ['controller' => $currentController,'action' => 'login'];\n }\n // pr($loginAction);die;\n $this->loadComponent('Auth',[\n 'loginAction' => ['controller' => $currentController,'action' => 'login'],\n 'authenticate' => [\n 'Form' =>\n [\n 'userModel' => $currentController,\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ],\n 'authorize'=> ['Controller'],\n 'loginAction' => $loginAction,\n 'loginRedirect' => $loginAction,\n 'logoutRedirect' => $loginAction \n\n ]);\n // $this->loadComponent('Auth', [\n\n // 'unauthorizedRedirect' => false,\n // 'checkAuthIn' => 'Controller.initialize',\n\n // // If you don't have a login action in your application set\n // // 'loginAction' to false to prevent getting a MissingRouteException.\n // 'loginAction' => false\n // ]);\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n }", "function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}", "public function initializeAction() {\n parent::initializeAction();\n $this->umDiv = new Tx_Magenerator_Domain_UserManagement_Div();\n }", "protected function __construct() {\n\t\t\tadd_action( 'init', array( $this, 'action__init' ), 11 );\n\t\t}", "protected function setAcoVariables() {\n\n $this->set('plugin',\n isset($this->params['named']['plugin']) ? $this->params['named']['plugin'] : '');\n $this->set('controller_name', $this->params['named']['controller']);\n $this->set('action', $this->params['named']['action']);\n }", "public function __construct()\n {\n $this->controller = new Controller;\n $this->error_message = 'bad request or duplicate data';\n }", "public function __construct() {\n\n\t\t$this->actions = [];\n\t\t$this->filters = [];\n\t\t\n\t\t# Components\n\t\t$this->nav = new Nav ();\n\t\t$this->api = new API ();\n\t\t$this->admin = new Admin ();\n\t\t\n\t\t# Define hooks\n\t\t$this->enqueue ();\n\t\t$this->admin_hooks ();\n\t\t$this->admin_ajax_routing ();\n\t\t$this->public_hooks ();\n\t}", "protected function setUp() {\n $this->object = new Controller;\n }", "public function initialize()\n {\n parent::initialize();\n\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Auth', [\n 'authorize' => 'Controller',\n 'loginAction' => [\n 'controller' => 'Users',\n 'action' => 'login',\n ],\n 'loginRedirect' => [\n 'controller' => 'Users',\n 'action' => 'index/',\n ],\n 'logoutRedirect' => [\n 'controller' => 'Booking',\n 'action' => 'index',\n ],\n 'authError' => 'Enregistrez-vous ou Connectez-vous',\n 'authenticate' => [\n 'Form' => [\n 'fields' => ['username' => 'Email', 'password' => 'Password']\n ]\n ]\n ]\n );\n\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n //$this->loadComponent('Security');\n //$this->loadComponent('Csrf');\n }", "function setup()\r\n {\r\n $this->logger = Logger::getLogger( CART_CONVERTER );\r\n //$this->logger->debug(\"main controller setup \" + current_time( \"timestamp\" ) );\r\n $this->cartController = CartController::getInstance();\r\n \r\n // create options panel\r\n $cartOptions = new CartOptionsController();\r\n $cartOptions->init();\r\n\r\n // init cron\r\n $cron = new CronController();\r\n\r\n // init report\r\n $report = new ReportController();\r\n\r\n do_action( 'cart_converter_setup_action' );\r\n }", "public function initialize()\n {\n parent::initialize();\n\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Auth', ['authenticate' =>\n ['ADmad/JwtAuth.Jwt' => [\n 'parameter' => 'token',\n 'userModel' => 'Sessions',\n 'fields' => [\n 'username' => 'username'\n ],\n 'scope' => ['Sessions.status' => 1],\n 'queryDatasource' => true\n ]\n ],'storage' => 'Memory',\n 'checkAuthIn' => 'Controller.initialize',\n 'loginAction' => false,\n 'unauthorizedRedirect' => false]);\n $this->loadComponent('Paginator');\n $this->loadComponent('BryanCrowe/ApiPagination.ApiPagination',[\n 'visible' => [\n 'page',\n 'current',\n 'count',\n 'perPage',\n 'prevPage',\n 'nextPage'\n ]\n ]);\n }", "public function init() {\n\n // Set required classes for import.\n $this->setImport(array(\n $this->id . '.components.*',\n $this->id . '.components.behaviors.*',\n $this->id . '.components.dataproviders.*',\n $this->id . '.controllers.*',\n $this->id . '.models.*',\n ));\n\n // Set the required components.\n $this->setComponents(array(\n 'authorizer' => array(\n 'class' => 'RAuthorizer',\n 'superuserName' => $this->superuserName,\n ),\n 'generator' => array(\n 'class' => 'RGenerator',\n ),\n ));\n }", "public function start()\n\t{\n\t\t// Get contoller and action names\n\t\t$this->getControllerName();\n\t\t$this->getActionName();\n\n\t\t// Set Names of executing class and action names\n\t\t$this->class_Name = ucfirst($this->controllerName);\n\t\t$this->action_Name = ucfirst($this->actionName);\n\n\t\t// Set globals variable\n\t\t$this->setGlobalsData();\n\n\t\t// Run action\n\t\t$this->getControllerAction();\n\t}", "function setUp() {\r\n // call the setUp() method of the superclass\r\n TechDivision_Controller_TestSetup::setUp();\r\n // instanciate the container\r\n $this->actionForwards = new TechDivision_Controller_Action_Forwards();\r\n }", "public function init()\n {\n // Prestashop does not support json responses in case of authentication error so I must check it here.\n if (!$this->checkAccess()) {\n http_response_code(401);\n $this->ajaxRenderJson(['error' => 'Invalid Token']);\n }\n\n // This is necessary to avoid rendering html templates, as we want a json response\n $this->ajax = true;\n $this->content_only = true;\n\n // Prestashop does not support custom urls with slash\n // This trick allows Prestashop to handle requests with slash in \"action\" parameter\n // /module/marmiads/endpoint?action=/feed/products will call displayAjaxFeedProducts()\n $_GET['action'] = str_replace('/', '_', $_GET['action']);\n\n parent::init();\n }", "public function init() {\n $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t\t$this->_helper->acl->allow('public',null);\n\t\t$this->_helper->contextSwitch()\n\t\t\t ->setAutoDisableLayout(true)\n\t\t\t ->addActionContext('index', array('xml','json'))\n ->initContext();\n\t}", "public function initialize()\n {\n $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"refund\");\n }", "protected function initializeAction()\n {\n parent::initializeAction();\n\n $query = GeneralUtility::_GET('q');\n if ($query !== null) {\n $this->request->setArgument('q', $query);\n }\n }", "public function initialize() \n {\n $this->setEngine(RequestEngine::class);\n $this->setStorage(SessionStorage::class);\n }", "function beforeFilter()\n {\n parent::beforeFilter();\n $this->Listing->controller = $this->name;\n $this->Listing->action = $this->action;\n\n # Make configuration available in models\n $this->Listing->Config = &$this->Config;\n }", "public function initializeAction() {\t\t\n\t\t$this->contactRepository = t3lib_div::makeInstance('Tx_Addresses_Domain_Repository_ContactRepository');\t\n\t}", "protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\n }", "protected function _init(){\n\t\tparent::_init();\n\t\t$this->applyFilter('__invoke', function($self, $params, $chain) {\n\t\t\textract($params);\n\t\t\t$action = $request->action;\n\t\t\t$config = $configKey = null;\n\t\t\tif (!empty($request->params['config'])) {\n\t\t\t\t$configKey = $request->params['config'];\n\t\t\t\t$self->runtime = Registry::get(\"sli_users.{$configKey}\");\n\t\t\t}\n\t\t\tif (!$self->runtime) {\n\t\t\t\t$actionKey = \"sli_users.{$configKey}.controller.actions.{$action}\";\n\t\t\t\t$handledAction = Registry::get($actionKey);\n\t\t\t\tif (isset($handledAction)) {\n\t\t\t\t\t$class = get_class($self);\n\t\t\t\t\t$exception = \"{$class}::{$action} cannot be run without a runtime config.\";\n\t\t\t\t\tthrow new \\RuntimeException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($self->runtime) {\n\t\t\t\t$self->_user =& Authorized::instance($self->runtime['name'], false, $self->runtime['class']);\n\t\t\t\t$library = Libraries::get('sli_users');\n\t\t\t\tMedia::setDefaults('html');\n\t\t\t\tMedia::addPaths('html', array(\n\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\"{:library}/views/{$configKey}/{:template}.{:type}.php\",\n\t\t\t\t\t\t$library['path'] . '/views/{:controller}/{:template}.{:type}.php',\n\t\t\t\t\t)\n\t\t\t\t), false);\n\t\t\t\t$self->set(array('sliUserConfig' => $configKey));\n\t\t\t}\n\t\t\treturn $chain->next($self, $params, $chain);\n\t\t});\n\t}", "public function initializeAction()\n {\n $this->totalItems = $this->widgetConfiguration['totalItems'];\n $this->itemsOffset = $this->widgetConfiguration['itemsOffset'];\n $this->itemsPerPage = $this->widgetConfiguration['itemsPerPage'];\n $this->maxPaginationLinks = $this->widgetConfiguration['maxPaginationLinks'];\n\n $this->currentPage = intval($this->itemsOffset / $this->itemsPerPage + 1);\n $this->numberOfPages = $this->itemsPerPage > 0 ? ceil($this->totalItems / $this->itemsPerPage) : 0;\n\n ArrayUtility::mergeRecursiveWithOverrule($this->linkConfiguration, $this->widgetConfiguration['linkConfiguration']);\n }", "public function __construct() {\n\n list($null,$controller, $action, $id) = explode(\"/\", $_SERVER['PATH_INFO']);\n \n $this->urlValues['base'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n $this->urlValues['controller'] = $controller ? $controller : \"home\";\n $this->urlValues['action'] = $action;\n $this->urlValues['id'] = $id;\n\n $this->controllerName = strtolower($this->urlValues['controller']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['controller'])) . \"Controller\";\n\n if ($this->urlValues['action'] == \"\") {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['action'];\n }\n }", "protected function setUp()\n {\n $serviceManager = Bootstrap::getServiceManager();\n $this->request = new Request();\n $this->routeMatch = new RouteMatch(array('controller' => 'index'));\n $this->event = new MvcEvent();\n $config = $serviceManager->get('Config');\n $routerConfig = isset($config['router']) ? $config['router'] : array();\n $router = HttpRouter::factory($routerConfig);\n $this->event->setRouter($router);\n $this->event->setRouteMatch($this->routeMatch);\n $this->controller->setEvent($this->event);\n $this->controller->setServiceLocator($serviceManager);\n $this->em = $this->controller->getEntityManager();\n }" ]
[ "0.751365", "0.751365", "0.7513643", "0.73645747", "0.73176324", "0.7315663", "0.7208361", "0.72070694", "0.72070694", "0.72070694", "0.72070694", "0.72070694", "0.7187216", "0.7187216", "0.71402794", "0.7129818", "0.7116813", "0.71034473", "0.7092001", "0.707154", "0.7015991", "0.70078903", "0.6972964", "0.6849142", "0.683614", "0.675718", "0.6729972", "0.667308", "0.66384345", "0.661329", "0.65867335", "0.6566625", "0.65272945", "0.6519025", "0.6483323", "0.6481504", "0.6477091", "0.6474045", "0.64663297", "0.64618814", "0.64587307", "0.64492285", "0.6433553", "0.6387814", "0.63870937", "0.6381467", "0.6377631", "0.6373558", "0.6372831", "0.636947", "0.6363806", "0.6359178", "0.6356064", "0.63543123", "0.6351504", "0.63377357", "0.633613", "0.6318091", "0.6309953", "0.6309727", "0.6299723", "0.62712145", "0.62711966", "0.62700486", "0.62629825", "0.62606484", "0.62575006", "0.62474436", "0.6244097", "0.62330645", "0.62323433", "0.62314916", "0.6229439", "0.6229302", "0.6221917", "0.6221568", "0.62200344", "0.62093097", "0.6208679", "0.6201", "0.6183617", "0.6180314", "0.6178286", "0.6176595", "0.6173483", "0.6169909", "0.6169236", "0.6166146", "0.616078", "0.61548054", "0.6153543", "0.61312085", "0.61308503", "0.61278373", "0.6127487", "0.61229837", "0.6119635", "0.6112742", "0.61084664", "0.610737", "0.6103153" ]
0.0
-1
Fill in default values for our properties before rendering the output.
public function after() { if ($this->auto_render) { // Define defaults $styles = array('assets/css/main.css' => 'screen'); $scripts = array('assets/js/jquery-1.10.1.js'); // Add defaults to template variables. $this->template->styles = array_reverse(array_merge($this->template->styles, $styles)); $this->template->scripts = array_reverse(array_merge($this->template->scripts, $scripts)); } // Run anything that needs to run after this. parent::after(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function applyDefaultValues()\n\t{\n\t\t$this->points = '0';\n\t\t$this->type = 0;\n\t\t$this->hidden = 0;\n\t\t$this->relationship_status = 0;\n\t\t$this->show_email = 1;\n\t\t$this->show_gender = 1;\n\t\t$this->show_hometown = 1;\n\t\t$this->show_home_phone = 1;\n\t\t$this->show_mobile_phone = 1;\n\t\t$this->show_birthdate = 1;\n\t\t$this->show_address = 1;\n\t\t$this->show_relationship_status = 1;\n\t\t$this->credit = 0;\n\t\t$this->login = 0;\n\t}", "private function setDefaults()\n {\n /** @var Property $property */\n foreach($this->properties as $name => $property)\n {\n $property->applyDefault();\n }\n }", "protected function buildPropertyDefaults() {\n }", "public function applyDefaultValues()\n {\n $this->phadtype = '';\n $this->phadid = '';\n $this->phadsubid = '';\n $this->phadsubidseq = 0;\n $this->phadcont = '';\n }", "public function setDefaultValues()\r\n {\r\n foreach ($this->defaultValues as $property => $value) {\r\n if (is_null($this->$property)) {\r\n $this->$property = $value;\r\n }\r\n }\r\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->type = 1;\n\t\t$this->total_index = 0;\n\t\t$this->is_published = true;\n\t\t$this->is_featured = false;\n\t\t$this->comments_count = 0;\n\t}", "public function applyDefaultValues()\n {\n $this->pothnbr = '';\n $this->pothstat = 'N';\n $this->pothrcptdate = '';\n $this->intbwhse = '';\n $this->pothglpd = 0;\n $this->pothairship = 'N';\n $this->potherinreview = 'N';\n $this->pothexchctry = '';\n $this->pothexchrate = '0.0000000';\n $this->intbwhseorig = '';\n $this->pothlandcost = '0.0000000';\n $this->pothrcptnbr = 0;\n $this->pothlandbasedon = '';\n $this->pothinvcnbr = '';\n $this->pothinvcdate = '';\n $this->pothfrtamt = '0.00';\n $this->pothmiscamt = '0.00';\n $this->dateupdtd = '';\n $this->timeupdtd = '';\n $this->dummy = 'P';\n }", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "public function initProps()\n {\n foreach ($this->cmds as $key => $parseValues) {\n $this->props[$key] = false;\n }\n\n foreach ($this->flags as $key => $parseValues) {\n $this->props[$key] = false;\n }\n }", "function _setDefaults()\n {\n $this->type = $this->rs['type'] = \"unknown\";\n $this->parent = $this->rs['parent'] = 0;\n $this->lecture_id = $this->rs['lecture_id'] = SessionDataBean::getLectureId();\n $this->title = $this->rs['title'] = \"\";\n $this->mtitle = $this->rs['mtitle'] = \"\";\n $this->text = $this->rs['text'] = \"<p></p>\";\n $this->position = $this->rs['position'] = 0;\n $this->redirect = $this->rs['redirect'] = \"\";\n $this->ival1 = $this->rs['ival1'] = 0;\n $this->copy_parent = $this->rs['copy_parent'] = false;\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 setDefaultValues() {\n $this->effective_date = \"1970-1-1\";\n $this->end_date = \"9999-12-31\";\n $this->pu_percentage = 100;\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 applyDefaultValues()\n\t{\n\t\t$this->platform = 'pc';\n\t\t$this->experience_score = 0;\n\t\t$this->up_votes = 0;\n\t\t$this->down_votes = 0;\n\t\t$this->is_guest = 0;\n\t\t$this->is_admin = 0;\n\t\t$this->today_votes = 0;\n\t\t$this->email_on = 1;\n\t}", "public function setMemberDefaults(){\n parent::setMemberDefaults();\n \n $this->id = $this->id ? $this->id : UniqId::get(\"rbn-\");\n if (!$this->collarTriangleWidth) {\n $this->collarTriangleWidth = StyleUtil::getHalf($this->collarWidth);\n }\n if (!$this->collarColor) {\n if ($this->barColor){\n $this->collarColor = $this->barColor;\n }\n else if( $this->barGradient ){\n $this->collarColor = GradientInfo::getLastColor($this->barGradient);\n }\n }\n }", "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 setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "function SetInitialValues()\n\t{\n\t\t$this->id = -1;\n\t\t$this->title = '';\n\t\t$this->url = '';\n\t\t$this->user_id = -1;\n\t\t$this->timestamp = -1;\n\t}", "public function set_default_data() {\n\t\t$this->button_text_color = '#FFFFFF';\n\t\t$this->button_background_color = '#6699CC';\n\n\t\t$this->header_text_color = '#FFFFFF';\n\t\t$this->header_background_color = '#6699CC';\n\n\t\t$this->button_text = 'Do Not Sell My Data';\n\n\t\t$this->publish_status = 'Draft';\n\t\t$this->last_published = '';\n\n\t\t$this->ot_logo = '';\n\t\t$this->display_position = 'right';\n\t\t$this->floating_button\t= '';\n\t\t$this->isLinkEnabled \t= 'textlink';\n\t}", "public function populateDefaults() {\n\t\t$this->owner->ShowInMenus = false;\n\t\t$this->owner->ShowInSearch = false;\n\t\t$this->owner->SubmitButtonText = \"Show my results\";\n \t}", "protected function resetProperties() {}", "protected function _fillAvailableProperties()\n {\n $properties = array(\n __(\"Special Properties\") => array(\n 0 => __(\"<Unmapped>\"),\n -1 => __(\"Tags\"),\n -2 => __(\"File\"),\n -3 => __(\"Item Type\"),\n -4 => __(\"Collection\"),\n -5 => __(\"Public\"),\n -6 => __(\"Featured\"),\n )\n );\n $elementSets = $this->_helper->db->getTable('ElementSet')->findAll();\n foreach ($elementSets as $elementSet)\n {\n $idNamePairs = array();\n $elementTexts = $elementSet->getElements();\n foreach ($elementTexts as $elementText)\n {\n $idNamePairs[$elementText->id] = $elementText->name;\n }\n $properties[$elementSet->name] = $idNamePairs;\n }\n $this->view->available_properties = $properties;\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->setName('');\n\t\t$this->setFullName('');\n\t\t$this->setEntriesCount(0);\n\t\t$this->setDirectEntriesCount(0);\n\t\t$this->setMembersCount(0);\n\t\t$this->setPendingMembersCount(0);\n\t\t$this->setDisplayInSearch(DisplayInSearchType::PARTNER_ONLY);\n\t\t$this->setPrivacy(PrivacyType::ALL);\n\t\t$this->setInheritanceType(InheritanceType::MANUAL);\n\t\t$this->setUserJoinPolicy(UserJoinPolicyType::NOT_ALLOWED);\n\t\t$this->setDefaultPermissionLevel(CategoryKuserPermissionLevel::MEMBER);\n\t\t$this->setContributionPolicy(ContributionPolicyType::ALL);\n\t\t$this->setStatus(CategoryStatus::ACTIVE);\n\t}", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n\t}", "private function setDefaultValues()\n {\n // Set default payment action.\n if (empty($this->paymentAction)) {\n $this->paymentAction = 'Sale';\n }\n\n // Set default locale.\n if (empty($this->locale)) {\n $this->locale = 'en_US';\n }\n\n // Set default value for SSL validation.\n if (empty($this->validateSSL)) {\n $this->validateSSL = false;\n }\n }", "function setDefaultValues() {}", "public function applyDefaultValues()\n {\n $this->is_active = false;\n $this->is_closed = false;\n }", "public function applyDefaultValues()\n {\n $this->create_date = '2020-04-16 09:40:03';\n $this->last_update = '2020-04-16 09:40:03';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "function resetProperties()\n {\n $this->fullremyears = 0;\n $this->fullremmonths = 0;\n $this->fullremdays = 0;\n $this->fullremhours = 0;\n $this->fullremminutes = 0;\n $this->fullremseconds = 0;\n $this->years = 0;\n $this->months = 0;\n $this->days = 0;\n $this->hours = 0;\n $this->minutes = 0;\n $this->seconds = 0;\n }", "function setDefaults() {\r\n\t\t$this->border='1px solid #46b0ee';\r\n\t\t$this->fgColor='#ff9000';\r\n\t\t$this->bgColor='#FFFFFF';\r\n\t}", "function _setDefaults()\n {\n $this->subtask_id = $this->rs['subtask_id'] = 0;\n $this->student_id = $this->rs['student_id'] = 0;\n $this->assignment_id = $this->rs['assignment_id'] = 0;\n $this->file_id = $this->rs['file_id'] = 0;\n }", "protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->is_archived = 0;\n\t\t$this->google_analytics_enabled = false;\n\t}", "public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }", "public function init() {\n\t\t// use this method to initialize default values.\n\t}", "protected function setDefaults()\n {\n return;\n }", "public function set_default_properties(){\n\t\t$this->properties = array(\n\t\t\t'apply_adjacent_buffer' => __( 'Apply_adjacent_buffer', 'woocommerce-bookings' ),\n\t\t\t'availability' => __( 'Availability', 'woocommerce-bookings' ),\n\t\t\t'block_cost' => __( 'Block_cost', 'woocommerce-bookings' ),\n\t\t\t'buffer_period' => __( 'Buffer_period', 'woocommerce-bookings' ),\n\t\t\t'calendar_display_mode' => __( 'Calendar_display_mode', 'woocommerce-bookings' ),\n\t\t\t'cancel_limit_unit' => __( 'Cancel_limit_unit', 'woocommerce-bookings' ),\n\t\t\t'cancel_limit' => __( 'Cancel_limit', 'woocommerce-bookings' ),\n\t\t\t'check_start_block_only' => __( 'Check_start_block_only', 'woocommerce-bookings' ),\n\t\t\t'cost' => __( 'Cost', 'woocommerce-bookings' ),\n\t\t\t'default_date_availability' => __( 'Default_date_availability', 'woocommerce-bookings' ),\n\t\t\t'display_cost' => __( 'Display_cost', 'woocommerce-bookings' ),\n\t\t\t'duration_type' => __( 'Duration_type', 'woocommerce-bookings' ),\n\t\t\t'duration_unit' => __( 'Duration_unit', 'woocommerce-bookings' ),\n\t\t\t'duration' => __( 'Duration', 'woocommerce-bookings' ),\n\t\t\t'enable_range_picker' => __( 'Enable_range_picker', 'woocommerce-bookings' ),\n\t\t\t'first_block_time' => __( 'First_block_time', 'woocommerce-bookings' ),\n\t\t\t'has_person_cost_multiplier' => __( 'Has_person_cost_multiplier', 'woocommerce-bookings' ),\n\t\t\t'has_person_qty_multiplier' => __( 'Has_person_qty_multiplier', 'woocommerce-bookings' ),\n\t\t\t'has_person_types' => __( 'Has_person_types', 'woocommerce-bookings' ),\n\t\t\t'has_persons' => __( 'Has_persons', 'woocommerce-bookings' ),\n\t\t\t'has_resources' => __( 'Has_resources', 'woocommerce-bookings' ),\n\t\t\t'has_restricted_days' => __( 'Has_restricted_days', 'woocommerce-bookings' ),\n\t\t\t'max_date_unit' => __( 'Max_date_unit', 'woocommerce-bookings' ),\n\t\t\t'max_date_value' => __( 'Max_date_value', 'woocommerce-bookings' ),\n\t\t\t'max_duration' => __( 'Max_duration', 'woocommerce-bookings' ),\n\t\t\t'max_persons' => __( 'Max_persons', 'woocommerce-bookings' ),\n\t\t\t'min_date_unit' => __( 'Min_date_unit', 'woocommerce-bookings' ),\n\t\t\t'min_date_value' => __( 'Min_date_value', 'woocommerce-bookings' ),\n\t\t\t'min_duration' => __( 'Min_duration', 'woocommerce-bookings' ),\n\t\t\t'min_persons' => __( 'Min_persons', 'woocommerce-bookings' ),\n\t\t\t'person_types' => __( 'Person_types', 'woocommerce-bookings' ),\n\t\t\t'pricing' => __( 'Pricing', 'woocommerce-bookings' ),\n\t\t\t'qty' => __( 'Qty', 'woocommerce-bookings' ),\n\t\t\t'requires_confirmation' => __( 'Requires_confirmation', 'woocommerce-bookings' ),\n\t\t\t'resource_label' => __( 'Resource_label', 'woocommerce-bookings' ),\n\t\t\t'resource_base_costs' => __( 'Resource_base_costs', 'woocommerce-bookings' ),\n\t\t\t'resource_block_costs' => __( 'Resource_block_costs', 'woocommerce-bookings' ),\n\t\t\t'resource_ids' => __( 'Resource_ids', 'woocommerce-bookings' ),\n\t\t\t'resources_assignment' => __( 'Resources_assignment', 'woocommerce-bookings' ),\n\t\t\t'restricted_days' => __( 'Restricted_days', 'woocommerce-bookings' ),\n\t\t\t'user_can_cancel' => __( 'User_can_cancel', 'woocommerce-bookings' ),\n\t\t);\n\t}", "public function populateDefaults()\n {\n // Populate Defaults (from parent):\n \n parent::populateDefaults();\n \n // Populate Defaults:\n \n $this->FeedTitle = _t(\n __CLASS__ . '.DEFAULTFEEDTITLE',\n 'Latest News Articles'\n );\n \n $this->FeedDescription = _t(\n __CLASS__ . '.DEFAULTFEEDDESCRIPTION',\n 'The latest news articles from our site.'\n );\n }", "protected function initialize()\n {\n // load the driver\n static::getDriver();\n\n // add in the default ID property\n if (static::$ids == [self::DEFAULT_ID_PROPERTY] && !isset(static::$properties[self::DEFAULT_ID_PROPERTY])) {\n static::$properties[self::DEFAULT_ID_PROPERTY] = self::$defaultIDProperty;\n }\n\n // generates created_at and updated_at timestamps\n if (property_exists($this, 'autoTimestamps')) {\n $this->installAutoTimestamps();\n }\n\n // fill in each property by extending the property\n // definition base\n foreach (static::$properties as &$property) {\n $property = array_replace(self::$propertyDefinitionBase, $property);\n }\n\n // order the properties array by name for consistency\n // since it is constructed in a random order\n ksort(static::$properties);\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n $this->applyDefaultValues();\n }", "private function setDefaults()\n {\n $defaults = config('sevDeskApi.defaults.'.lcfirst($this->objectName));\n\n foreach($defaults as $attribute => $defaultValue)\n {\n if (!isset($this->$attribute))\n $this->$attribute = $defaultValue;\n }\n }", "function __construct($defaultProperties = array ())\r\n {\r\n $this->defaultProperties = $defaultProperties;\r\n }", "function _setDefaults() {}", "protected function reset_properties() {\n\t\t$this->author = false;\n\t\t$this->readme = array();\n\t\t$this->theme = false;\n\t\t$this->theme_post = false;\n\t\t$this->theme_slug = '';\n\t\t$this->theme_dir = '';\n\t\t$this->theme_name = '';\n\t\t$this->tmp_svn_dir = '';\n\t\t$this->trac_changeset = 0;\n\t\t$this->trac_ticket = (object) array(\n\t\t\t'id' => 0,\n\t\t\t'resolution' => '',\n\t\t\t'summary' => '',\n\t\t\t'keywords' => [],\n\t\t\t'parent_link' => '',\n\t\t\t'priority' => '',\n\t\t\t'diff_line' => '',\n\t\t\t'description' => '',\n\t\t);\n\t\t$this->version_status = 'new';\n\t\t$this->importing_from = 'upload';\n\t\t$this->commit_msg = '';\n\n\t\t// $this->tmp_dir = ''; // Temporary folder per each instance of this class. Doesn't need to be reset each time.\n\t\t// $this->trac = false; // This can stay active, Trac access won't change between calls.\n\t}", "function set_defaults()\n {\n $mapper = $this->get_mapper();\n if ($mapper->has_method('set_defaults')) {\n $mapper->set_defaults($this);\n }\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->closed = 0;\n\t\t$this->lastfmid = 0;\n\t\t$this->hasphotos = 0;\n\t}", "public static function add_standard_properties() {\n\n\t\t// Set properties.\n\t\tself::$field->id = rgar( self::$nf_field, 'id' );\n\t\tself::$field->label = rgar( self::$nf_field, 'label' );\n\t\tself::$field->adminLabel = rgar( self::$nf_field, 'admin_label' );\n\t\tself::$field->isRequired = rgar( self::$nf_field, 'req' );\n\t\tself::$field->cssClass = rgar( self::$nf_field, 'class' );\n\t\tself::$field->defaultValue = rgar( self::$nf_field, 'default_value_type' ) === '_custom' || rgar( self::$nf_field, 'default_value_type' ) === '' ? rgar( self::$nf_field, 'default_value' ) : null;\n\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n {\n parent::__construct();\n $this->applyDefaultValues();\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->applyDefaultValues();\n\t}", "public function __construct() {\n\t\t$this->overrideDefaults( $this->loadDefaults() );\n\t}", "private function _setDefaults() {\r\n\t\t$checked = $selected = '';\r\n\t\t$isAdmin = $hasCart = false;\r\n\t\tif($this->isAdmin()) {\r\n\t\t\t$isAdmin = true;\r\n\t\t}\r\n\t\tif($this->Session->check('Order.id')) {\r\n\t\t\t$hasCart = true;\r\n\t\t}\r\n\t\t$this->set(compact('checked', 'selected', 'isAdmin', 'hasCart'));\r\n\t\t\r\n\t\t$this->layout = 'shop';\r\n\t\tif(isset($this->params['admin'])) {\r\n\t\t\t$this->layout = 'admin';\r\n\t\t}\r\n\t}", "public function onBeforeWrite()\n {\n foreach (self::$defaults as $field => $value) {\n if (empty($this->$field)) {\n $this->$field = $value;\n }\n }\n //TODO: prevent non-heirarichal entries, eg country = '*', then state = 'blah'\n parent::onBeforeWrite();\n }", "function get_default_properties()\r\n {\r\n return $this->defaultProperties;\r\n }", "protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function setProperties() {\n\t\t$this->public_prop = 'public';\n\t\t$this->protected_prop = 100;\n\t\t$this->private_prop = true;\n\n\t\t// Set a non-predefined property.\n\t\t$this->dynamic = new self();\n\t}", "public static function set_default_values() {\n\t\t?>\n\t\tcase \"nu_phone\" :\n\t\t\tfield.label = \"Phone\";\n\t\t\tfield.isRequired = true;\n\t\t\tfield.description = \"Numbers only. e.g. 8885551212\";\n\t\t\tbreak;\n\t\t<?php\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 function applyDefaultValues()\n {\n $this->create_date = '2021-06-07 11:49:57';\n $this->last_update = '2021-06-07 11:49:57';\n $this->last_sync = '1901-01-01 00:00:00';\n $this->jml_jamban_l_g = '0';\n $this->jml_jamban_l_tg = '0';\n $this->jml_jamban_p_g = '0';\n $this->jml_jamban_p_tg = '0';\n $this->jml_jamban_lp_g = '0';\n $this->jml_jamban_lp_tg = '0';\n $this->tipe_jamban = '9';\n $this->a_sedia_pembalut = '0';\n $this->a_tempat_sampah_kelas = '0';\n $this->a_tempat_sampah_tutup_p = '0';\n $this->a_cermin_jamban_p = '0';\n $this->a_memiliki_tps = '0';\n $this->a_tps_angkut_rutin = '0';\n $this->a_anggaran_sanitasi = '0';\n $this->a_melibatkan_sanitasi_siswa = '0';\n }", "public function populateDefaults()\n {\n // Populate Defaults (from parent):\n \n parent::populateDefaults();\n \n // Populate Defaults:\n \n $this->Title = _t(__CLASS__ . '.DEFAULTTITLE', 'Share via Email');\n }", "protected function fill()\n {\n array_map(function ($field) {\n $defaultValue = isset($this->defaultFields[$field]['defaultValue']) ?\n $this->defaultFields[$field]['defaultValue'] :\n null;\n\n $this->values[$field] = (new $this->defaultFields[$field]['format']($defaultValue))\n ->setPosition($this->defaultFields[$field]['position'])\n ->setLength($this->defaultFields[$field]['length']);\n }, array_keys($this->defaultFields));\n }", "public function initializeDefaults()\n {\n }", "function initialize($mapper = NULL, $properties = FALSE)\n {\n $this->_mapper = $mapper;\n $this->_stdObject = $properties ? (object) $properties : new stdClass();\n parent::initialize();\n if (!$this->has_default_values()) {\n $this->set_defaults();\n $this->_stdObject->__defaults_set = TRUE;\n }\n }", "protected function loadDefaultOptions()\r\n {\r\n $this->options = [\r\n 'offsettop' => 0,\r\n 'offsetleft' => 0,\r\n 'merge' => false,\r\n 'backcolor' => 0xffffff,\r\n ];\r\n }", "function init()\n {\n $this->defineAttribute('data', true, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('stru', false, '', COMPONENT_TYPE_STRING);\n parent::init();\n }", "public function set_defaults()\n {\n $this->dir = null;\n $this->out = 'a';\n $this->mod = false;\n $this->err = false;\n $this->nort = false;\n $this->nostd = false;\n $this->quiet = false;\n $this->werror = false;\n $this->run = false;\n $this->format = false;\n $this->check = false;\n $this->version = false;\n $this->lib_paths = [ realpath(__DIR__ . '/../lib') ]; // install dir\n $this->log_dest = null; // stderr\n $this->log_time = false;\n $this->log_width = 80;\n $this->log_level = LOG_LEVEL_WARNING;\n $this->pack = null; // defaults to \"zip\"\n $this->stub = null; // defaults to \"none\"\n }", "public function applyDefaultValues()\n {\n $this->active = false;\n }", "public function applyDefaultValues()\n {\n $this->setregis = 0;\n }", "public function Initialize()\n\t\t{\n\t\t\t$this->intIdOrganization = Organization::IdOrganizationDefault;\n\t\t\t$this->strName = Organization::NameDefault;\n\t\t\t$this->strPhone = Organization::PhoneDefault;\n\t\t\t$this->strQrCode = Organization::QrCodeDefault;\n\t\t\t$this->strOrganizationImage = Organization::OrganizationImageDefault;\n\t\t\t$this->strLatitude = Organization::LatitudeDefault;\n\t\t\t$this->strLongitude = Organization::LongitudeDefault;\n\t\t\t$this->strCountry = Organization::CountryDefault;\n\t\t\t$this->strCity = Organization::CityDefault;\n\t\t\t$this->strAddress = Organization::AddressDefault;\n\t\t\t$this->intIdOrganizationType = Organization::IdOrganizationTypeDefault;\n\t\t\t$this->intIdOwner = Organization::IdOwnerDefault;\n\t\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}", "protected function get_default_item_props() {\n\t\treturn (object) array(\n\t\t\t'object' => null,\n\t\t\t'tax_class' => '',\n\t\t\t'taxable' => false,\n\t\t\t'quantity' => 0,\n\t\t\t'product' => false,\n\t\t\t'price_includes_tax' => false,\n\t\t\t'subtotal' => 0,\n\t\t\t'subtotal_tax' => 0,\n\t\t\t'total' => 0,\n\t\t\t'total_tax' => 0,\n\t\t\t'taxes' => array(),\n\t\t);\n\t}", "protected function assignDefaults() {\n\t\t$this->view->assignMultiple(\n\t\t\tarray(\n\t\t\t\t'timestamp'\t\t\t=> time(),\n\t\t\t\t'submission_date'\t=> date('d.m.Y H:i:s', time()),\n\t\t\t\t'randomId'\t\t\t=> Tx_Formhandler_Globals::$randomID,\n\t\t\t\t'fieldNamePrefix'\t=> Tx_Formhandler_Globals::$formValuesPrefix,\n\t\t\t\t'ip'\t\t\t\t=> t3lib_div::getIndpEnv('REMOTE_ADDR'),\n\t\t\t\t'pid'\t\t\t\t=> $GLOBALS['TSFE']->id,\n\t\t\t\t'currentStep'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('currentStep'),\n\t\t\t\t'totalSteps'\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('totalSteps'),\n\t\t\t\t'lastStep'\t\t\t=> Tx_FormhandlerFluid_Util_Div::getSessionValue('lastStep'),\n\t\t\t\t// f:url(absolute:1) does not work correct :(\n\t\t\t\t'baseUrl'\t\t\t=> t3lib_div::locationHeaderUrl('')\n\t\t\t)\n\t\t);\n\t\t\n\t\tif ($this->gp['generated_authCode']) {\n\t\t\t$this->view->assign('authCode', $this->gp['generated_authCode']);\n\t\t}\n\t\t\n\t\t/*\n\t\tStepbar currently removed - probably this should move in a partial\n\t\t$markers['###step_bar###'] = $this->createStepBar(\n\t\t\tTx_FormhandlerFluid_Session::get('currentStep'),\n\t\t\tTx_FormhandlerFluid_Session::get('totalSteps'),\n\t\t\t$prevName,\n\t\t\t$nextName\n\t\t);\n\t\t*/\n\t\t\n\t\t/*\n\t\tNot yet realized\n\t\t$this->fillCaptchaMarkers($markers);\n\t\t$this->fillFEUserMarkers($markers);\n\t\t$this->fillFileMarkers($markers);\n\t\t*/\n\t}", "public function Initialize()\n\t\t{\n\t\t\t$this->intId = Person::IdDefault;\n\t\t\t$this->strFirstName = Person::FirstNameDefault;\n\t\t\t$this->strLastName = Person::LastNameDefault;\n\t\t}", "public function applyDefaultValues()\n {\n $this->is_not = false;\n $this->rank = 0;\n }", "public function applyDefaultValues()\n {\n $this->sessionid = '';\n $this->recno = 0;\n $this->type = '';\n $this->custid = '';\n $this->shiptoid = '';\n $this->custname = '';\n $this->orderno = '';\n $this->custpo = '';\n $this->custref = '';\n $this->status = '';\n $this->orderdate = '';\n $this->careof = '';\n $this->quotdate = '';\n $this->invdate = '';\n $this->shipdate = '';\n $this->revdate = '';\n $this->expdate = '';\n $this->hasdocuments = '';\n $this->hastracking = '';\n $this->subtotal = '0.00';\n $this->salestax = '0.00';\n $this->freight = '0.00';\n $this->misccost = '0.00';\n $this->ordertotal = '0.00';\n $this->hasnotes = '';\n $this->editord = '';\n $this->error = '';\n $this->errormsg = '';\n $this->sconame = '';\n $this->shipname = '';\n $this->shipaddress = '';\n $this->shipaddress2 = '';\n $this->shipcity = '';\n $this->shipstate = '';\n $this->shipzip = '';\n $this->shipcountry = '';\n $this->contact = '';\n $this->phintl = '';\n $this->phone = '';\n $this->extension = '';\n $this->faxnbr = '';\n $this->email = '';\n $this->releasenbr = '';\n $this->shipviacd = '';\n $this->shipviadesc = '';\n $this->pricecode = '';\n $this->pricecodedesc = '';\n $this->pricedisp = '';\n $this->taxcode = '';\n $this->taxcodedesc = '';\n $this->taxcodedisp = '';\n $this->termcode = '';\n $this->termtype = '';\n $this->termcodedesc = '';\n $this->rqstdate = '';\n $this->shipcom = '';\n $this->sp1 = '';\n $this->sp1name = '';\n $this->sp2 = '';\n $this->sp2name = '';\n $this->sp2disp = '';\n $this->sp3 = '';\n $this->sp3name = '';\n $this->sp3disp = '';\n $this->fob = '';\n $this->deliverydesc = '';\n $this->whse = '';\n $this->cardnumber = '';\n $this->cardexpire = '';\n $this->cardcode = '';\n $this->cardapproval = '';\n $this->totalcost = '';\n $this->totaldiscount = '';\n $this->paymenttype = '';\n $this->srcdatefrom = '';\n $this->srcdatethru = '';\n $this->billname = '';\n $this->billaddress = '';\n $this->billaddress2 = '';\n $this->billaddress3 = '';\n $this->billcountry = '';\n $this->billcity = '';\n $this->billstate = '';\n $this->billzip = '';\n $this->prntfmt = '';\n $this->prntfmtdisp = '';\n $this->dummy = 'x';\n }", "public function init() {\n parent::init();\n\n $formatters = [];\n foreach ($this->propertyFormatters as $key => $property) {\n if (array_key_exists($key, Yii::$app->params)) {\n $formatters[Yii::$app->params[$key]] = $property;\n } else {\n $formatters[$key] = $property;\n }\n }\n $this->propertyFormatters = $formatters;\n\n // must be not null\n if ($this->uri === null) {\n throw new \\Exception(\"URI isn't set\");\n }\n\n if ($this->properties === null) {\n throw new \\Exception(\"Properties aren't set\");\n }\n\n // must be an array\n if (!is_array($this->properties)) {\n throw new \\Exception(\"Property list is not an array\");\n }\n\n $props = $this->properties;\n\n // Get alias from properties if specified and remove corresponding property\n if ($this->aliasProperty !== null) {\n foreach ($props as $i => $property) {\n\n if ($property->relation === $this->aliasProperty) {\n $this->alias = $property->value;\n\n array_splice($props, $i, 1);\n break;\n }\n }\n }\n\n // Construct fields attribute depending on relation order if specified\n if (is_array($this->relationOrder)) {\n foreach ($props as $i => $property) {\n $relationIndex = array_search($property->relation, $this->relationOrder);\n if ($relationIndex !== false) {\n $this->fields = $this->constructFields($this->fields, $property, $relationIndex);\n unset($props[$i]);\n }\n }\n }\n \n // Construct extra fields attribute based on unknown remaing properties\n foreach ($props as $i => $property) {\n $this->extraFields = $this->constructFields($this->extraFields, $property, $property->relation);\n }\n }", "public function useDefaults()\n\t{\n\t\t$this->use_defaults = true;\n\t}", "protected function setDefaultValues()\n {\n $this->setFieldValue(self::FIELD_CREATED, time());\n }" ]
[ "0.7141274", "0.70977855", "0.69782597", "0.68649", "0.68430555", "0.6833718", "0.6804665", "0.6772497", "0.6706307", "0.66837925", "0.66685295", "0.6579958", "0.65132457", "0.6499797", "0.649743", "0.64423496", "0.642506", "0.6388732", "0.63874006", "0.63778687", "0.6369626", "0.6366324", "0.6336411", "0.63070774", "0.6279917", "0.62653786", "0.62553483", "0.62541527", "0.62498647", "0.62485814", "0.6238335", "0.6222566", "0.6212802", "0.62016815", "0.6166906", "0.6160009", "0.6158291", "0.612386", "0.6106887", "0.6098026", "0.6098026", "0.6098026", "0.6098026", "0.6098026", "0.60863703", "0.6082481", "0.606736", "0.60284984", "0.6023273", "0.6020837", "0.60097426", "0.60031676", "0.60031676", "0.60031676", "0.6002433", "0.6002433", "0.6002433", "0.6002433", "0.6002433", "0.6002433", "0.6002433", "0.6002433", "0.6002433", "0.59983337", "0.59983337", "0.59983337", "0.59983337", "0.59983337", "0.59983337", "0.59983337", "0.59983337", "0.59983337", "0.59983337", "0.5989588", "0.598592", "0.5962889", "0.5954092", "0.5953818", "0.5910972", "0.5898196", "0.5886637", "0.58682853", "0.5862692", "0.584928", "0.5840217", "0.5832108", "0.5828717", "0.5815356", "0.58073986", "0.5804039", "0.57902247", "0.57819986", "0.5765764", "0.5751486", "0.5737042", "0.5729611", "0.57282525", "0.5718947", "0.571488", "0.56975937", "0.56934893" ]
0.0
-1
endregion This function converts to a UTF8 string, removes all redundant spaces, tabs, etc. and returns all usable code after the closing head tag.
protected static function cleanCode($html) { $html = str_replace(Parser::REMOVE_HTML, '', $html); $html = preg_replace('!\s+!', ' ', $html); $html = iconv("UTF-8", "UTF-8//IGNORE", utf8_decode($html)); $html = trim(preg_replace('/.*<\/head>/', '', $html)); return $html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeEncodingDeclaration() {\n\t\t$this->processedClassCode = preg_replace(self::PATTERN_ENCODING_DECLARATION, '', $this->processedClassCode);\n\t}", "function html_to_utf8 ($data)\r\n {\r\n return preg_replace(\"/\\\\&\\\\#([0-9]{3,10})\\\\;/e\", '_html_to_utf8(\"\\\\1\")', $data);\r\n }", "function _convert()\n {\r\n \t$badStr = $this->html;\n\t //remove PHP if it exists\r\n\t while( substr_count( $badStr, '<'.'?' ) && substr_count( $badStr, '?'.'>' ) && strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) > strpos( $badStr, '<'.'?' ) ) {\r\n\t $badStr = substr( $badStr, 0, strpos( $badStr, '<'.'?' ) ) . substr( $badStr, strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) + 2 ); }\r\n\t //remove comments\r\n\t while( substr_count( $badStr, '<!--' ) && substr_count( $badStr, '-->' ) && strpos( $badStr, '-->', strpos( $badStr, '<!--' ) ) > strpos( $badStr, '<!--' ) ) {\r\n\t $badStr = substr( $badStr, 0, strpos( $badStr, '<!--' ) ) . substr( $badStr, strpos( $badStr, '-->', strpos( $badStr, '<!--' ) ) + 3 ); }\r\n\t //now make sure all HTML tags are correctly written (> not in between quotes)\r\n\r\n\t \r\n\t //TODO: here is any problem, because in some cases happens loop and mail is never parsed\r\n\t //\t for( $x = 0, $goodStr = '', $is_open_tb = false, $is_open_sq = false, $is_open_dq = false; strlen( $chr = $badStr{$x} ); $x++ ) {\r\n//\t //take each letter in turn and check if that character is permitted there\r\n//\t switch( $chr ) {\r\n//\t case '<':\r\n//\t if( !$is_open_tb && strtolower( substr( $badStr, $x + 1, 5 ) ) == 'style' ) {\r\n//\t $badStr = substr( $badStr, 0, $x ) . substr( $badStr, strpos( strtolower( $badStr ), '</style>', $x ) + 7 ); $chr = '';\r\n//\t } elseif( !$is_open_tb && strtolower( substr( $badStr, $x + 1, 6 ) ) == 'script' ) {\r\n//\t $badStr = substr( $badStr, 0, $x ) . substr( $badStr, strpos( strtolower( $badStr ), '</script>', $x ) + 8 ); $chr = '';\r\n//\t } elseif( !$is_open_tb ) { $is_open_tb = true; } else { $chr = '&lt;'; }\r\n//\t break;\r\n//\t case '>':\r\n//\t if( !$is_open_tb || $is_open_dq || $is_open_sq ) { $chr = '&gt;'; } else { $is_open_tb = false; }\r\n//\t break;\r\n//\t case '\"':\r\n//\t if( $is_open_tb && !$is_open_dq && !$is_open_sq ) { $is_open_dq = true; }\r\n//\t elseif( $is_open_tb && $is_open_dq && !$is_open_sq ) { $is_open_dq = false; }\r\n//\t else { $chr = '&quot;'; }\r\n//\t break;\r\n//\t case \"'\":\r\n//\t if( $is_open_tb && !$is_open_dq && !$is_open_sq ) { $is_open_sq = true; }\r\n//\t elseif( $is_open_tb && !$is_open_dq && $is_open_sq ) { $is_open_sq = false; }\r\n//\t } $goodStr .= $chr;\r\n//\t }\r\n$goodStr = $badStr;\r\n\t \r\n\t //now that the page is valid (I hope) for strip_tags, strip all unwanted tags\r\n\t $goodStr = strip_tags( $goodStr, '<title><hr><h1><h2><h3><h4><h5><h6><div><p><br><pre><sup><ul><ol><dl><dt><table><caption><tr><li><dd><th><td><a><area><img><form><input><textarea><button><select><option>' );\r\n\t //strip extra whitespace except between <pre> and <textarea> tags\r\n\t $badStr = preg_split( \"/<\\/?pre[^>]*>/i\", $goodStr );\r\n\t for( $x = 0; is_string( $badStr[$x] ); $x++ ) {\r\n\t if( $x % 2 ) { $badStr[$x] = '<pre>'.$badStr[$x].'</pre>'; } else {\r\n\t $goodStr = preg_split( \"/<\\/?textarea[^>]*>/i\", $badStr[$x] );\r\n\t for( $z = 0; is_string( $goodStr[$z] ); $z++ ) {\r\n\t if( $z % 2 ) { $goodStr[$z] = '<textarea>'.$goodStr[$z].'</textarea>'; } else {\r\n\t $goodStr[$z] = preg_replace( \"/\\s+/\", ' ', $goodStr[$z] );\r\n\t } }\r\n\t $badStr[$x] = implode('',$goodStr);\r\n\t } }\r\n\t $goodStr = implode('',$badStr);\r\n\r\n\t\t$search = array(\r\n\t\t \"/\\r/\", // Non-legal carriage return\r\n\t\t \"/[\\n\\t]+/\", // Newlines and tabs\r\n\t\t '/<br[^>]*>/i', // <br>\r\n\t\t '/&nbsp;/i',\r\n\t\t '/&quot;/i',\r\n\t\t '/&gt;/i',\r\n\t\t '/&lt;/i',\r\n\t\t '/&amp;/i',\r\n\t\t '/&copy;/i',\r\n\t\t '/&trade;/i',\r\n\t\t '/&#8220;/',\r\n\t\t '/&#8221;/',\r\n\t\t '/&#8211;/',\r\n\t\t '/&#8217;/',\r\n\t\t '/&#38;/',\r\n\t\t '/&#169;/',\r\n\t\t '/&#8482;/',\r\n\t\t '/&#151;/',\r\n\t\t '/&#147;/',\r\n\t\t '/&#148;/',\r\n\t\t '/&#149;/',\r\n\t\t '/&reg;/i',\r\n\t\t '/&bull;/i',\r\n\t\t '/&[&;]+;/i'\r\n\t\t );\r\n\r\n\t\t\t$replace = array(\r\n\t\t '', // Non-legal carriage return\r\n\t\t ' ', // Newlines and tabs\r\n\t\t \"\\n\", // <br>\r\n\t\t ' ',\r\n\t\t '\"',\r\n\t\t '>',\r\n\t\t '<',\r\n\t\t '&',\r\n\t\t '(c)',\r\n\t\t '(tm)',\r\n\t\t '\"',\r\n\t\t '\"',\r\n\t\t '-',\r\n\t\t \"'\",\r\n\t\t '&',\r\n\t\t '(c)',\r\n\t\t '(tm)',\r\n\t\t '--',\r\n\t\t '\"',\r\n\t\t '\"',\r\n\t\t '*',\r\n\t\t '(R)',\r\n\t\t '*',\r\n\t\t ''\r\n\t\t );\r\n\t \r\n\t \r\n\t $goodStr = preg_replace( $search, $replace, $goodStr );\r\n\t \r\n\t //remove all options from select inputs\r\n\t $goodStr = preg_replace( \"/<option[^>]*>[^<]*/i\", '', $goodStr );\r\n\t //replace all tags with their text equivalents\r\n\t $goodStr = preg_replace( \"/<(\\/title|hr)[^>]*>/i\", \"\\n --------------------\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(h|div|p)[^>]*>/i\", \"\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<sup[^>]*>/i\", '^', $goodStr );\r\n\t $goodStr = preg_replace( \"/<(ul|ol|dl|dt|table|caption|\\/textarea|tr[^>]*>\\s*<(td|th))[^>]*>/i\", \"\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<li[^>]*>/i\", \"\\n· \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<dd[^>]*>/i\", \"\\n\\t\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(th|td)[^>]*>/i\", \"\\t\", $goodStr );\r\n\t $goodStr = preg_replace('/<br[^>]*>/i', \"\\n\", $goodStr);\r\n\t $goodStr = preg_replace( \"/<a[^>]* href=(\\\"((?!\\\"|#|javascript:)[^\\\"#]*)(\\\"|#)|'((?!'|#|javascript:)[^'#]*)('|#)|((?!'|\\\"|>|#|javascript:)[^#\\\"'> ]*))[^>]*>/i\", \"[LINK: $2$4$6] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<img[^>]* alt=(\\\"([^\\\"]+)\\\"|'([^']+)'|([^\\\"'> ]+))[^>]*>/i\", \"[IMAGE: $2$3$4] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<form[^>]* action=(\\\"([^\\\"]+)\\\"|'([^']+)'|([^\\\"'> ]+))[^>]*>/i\", \"\\n[FORM: $2$3$4] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(input|textarea|button|select)[^>]*>/i\", \"[INPUT] \", $goodStr );\r\n\t //strip all remaining tags (mostly closing tags)\r\n\t $goodStr = strip_tags( $goodStr );\r\n\t //convert HTML entities\r\n\t $goodStr = strtr( $goodStr, array_flip( get_html_translation_table( HTML_ENTITIES ) ) );\r\n\t preg_replace( \"/&#(\\d+);/me\", \"chr('$1')\", $goodStr );\r\n\t //wordwrap\r\n\t //$goodStr = wordwrap( $goodStr );\r\n\t //make sure there are no more than 3 linebreaks in a row and trim whitespace\r\n\t $this->text = preg_replace( \"/^\\n*|\\n*$/\", '', preg_replace( \"/[ \\t]+(\\n|$)/\", \"$1\", preg_replace( \"/\\n(\\s*\\n){2}/\", \"\\n\\n\\n\", preg_replace( \"/\\r\\n?|\\f/\", \"\\n\", str_replace( chr(160), ' ', $goodStr ) ) ) ) );\r\n }", "static function deflate($s){\r\n $s = preg_replace(\"|/\\*+.*?\\*/|s\", '', $s); // remove block comments\r\n $s = preg_replace(\"|//.*$|m\", \"\\n\", $s); // remove inline comments\r\n $s = preg_replace(\"/[\\r\\n]+/\", \"\\n\", $s); // remove empty lines\r\n return trim($s);\r\n }", "function strip_html_tags($str){\n $str = preg_replace('/(<|>)\\1{2}/is', '', $str);\n $str = preg_replace(\n array(// Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n ),\n \"\", //replace above with nothing\n $str );\n $str = replaceWhitespace($str);\n $str = strip_tags($str);\n return $str;\n}", "function non_DOM_stripme($opening_tag_string) {\r\n\t\tpreg_match_all('/' . $opening_tag_string . '/is', $this->code, $matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\t//print(\"matches[0][size][0]: \");var_dump($matches[0][$size][0]);\r\n\t\t\tpreg_match('/<(\\w+)/is', $matches[0][$size][0], $tagname_matches);\r\n\t\t\t$tagname = $tagname_matches[1];\r\n\t\t\t$OString = OM::getOString($this->code, '<' . $tagname, '</' . $tagname . '>', $matches[0][$size][1]);\r\n\t\t\t//print(\"strlen(matches[0][size][0]): \");var_dump(strlen($matches[0][$size][0]));\r\n\t\t\t$substr = substr($OString, strlen($matches[0][$size][0]), strlen($OString) - strlen($matches[0][$size][0]) - (strlen($tagname) + 3));\r\n\t\t\t//print(\"OString: \");var_dump($OString);\r\n\t\t\t//print(\"substr: \");var_dump($substr);\r\n\t\t\t//$this->code = str_replace($OString, $substr, $this->code);\r\n\t\t\t$this->code = substr($this->code, 0, $matches[0][$size][1]) . $substr . substr($this->code, $matches[0][$size][1] + strlen($OString));\r\n\t\t\t$size--;\r\n\t\t}\r\n\t}", "public static function cleanOut($s) {\n $s = str_replace('//<?php', '//', $s);\n $s = str_replace('<?php', '', $s);\n return $s;\n }", "function strip_all_tags($content)\n{\n\t$content = preg_replace('/\\n/',' ',$content);\n\t$content = preg_replace('/<script.*<\\/script>/U',' ',$content);\n\t$content = preg_replace('/<style.*<\\/style>/U',' ',$content);\n\t$content = strip_tags($content);\n\treturn $content;\n}", "function remove_tags_intra_tags() {\r\n\t\t$ct_intra_tags = 0;\r\n\t\t$ct2 = -1;\r\n\t\twhile($ct2 != 0) {\r\n\t\t\t/*preg_match_all('/(<[^>]*)<[^<>]+?>/is', $this->code, $debug_matches);\r\n\t\t\tprint('$debug_matches: ');var_dump($debug_matches);*/\r\n\t\t\t$this->code = preg_replace('/(<(![^\\-][^<>]+|[^!<>]+))<[^<>]+?>/is', '$1', $this->code, -1, $ct2); // changed (2012-01-25)\r\n\t\t\t$ct_intra_tags += $ct2;\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags intra tags removed\", $ct_intra_tags);\r\n\t\t// we must also ignore the <head>!\r\n\t\t// the only tag that has content in the head that I can think of is <title>, so:\r\n\t\tpreg_match_all('/<title>(.*?)<\\/title>/is', $this->code, $title_matches);\r\n\t\tif(sizeof($title_matches[0]) > 1) {\r\n\t\t\tprint(\"Well, that's not good; found more than one (\" . sizeof($title_matches[0]) . \") &lt;title&gt; tags on this page!\");exit(0);\r\n\t\t}\r\n\t\tif(sizeof($title_matches[0]) === 0) {\r\n\t\t\t// nothing to do\r\n\t\t} else {\r\n\t\t\t$ct_title = 0;\r\n\t\t\t$initial_title_string = $title_string = $title_matches[0][0];\r\n\t\t\t$ct1 = -1;\r\n\t\t\r\n\t\t\twhile($ct1 != 0) {\r\n\t\t\t\t$title_string = preg_replace('/<title>(.*?)<[^<>]+?>(.*?)<\\/title>/is', '<title>$1$2</title>', $title_string, -1, $ct1);\r\n\t\t\t\t$ct_title += $ct1;\r\n\t\t\t}\r\n\t\t\t$this->code = str_replace($initial_title_string, $title_string, $this->code);\r\n\t\t}\r\n\t\t$this->logMsgIf(\"tags removed from title tag\", $ct_title);\r\n\t\t// this should only happen if something exists in both the acronyms and abbr files (erroneously) or if\r\n\t\t// an bbreviation is a substring of another abbreviation but we'll still clean it up\r\n\t\t//$this->code = preg_replace('/<(abbr|acronym) title=\"([^\"]*?)\"><(abbr|acronym) title=\"([^\"]*?)\">(.*?)<\\/(abbr|acronym)><\\/(abbr|acronym)>/is', '<$1 title=\"$2\">$4</$5>', $this->code, -1, $ct_redundant_acro);\r\n\t\t$ct_redundant_acro = 0;\r\n\t\t$array_tags = array('abbr', 'acronym');\r\n\t\t$tagNamesString = implode('|', $array_tags);\r\n\t\tforeach($array_tags as $tagName) {\r\n\t\t\t$OStrings = OM::getAllOStrings($this->code, '<' . $tagName, '</' . $tagName . '>');\r\n\t\t\t//var_dump($OStrings);exit(0);\r\n\t\t\t$counter = sizeof($OStrings) - 1;\r\n\t\t\twhile($counter >= 0) {\r\n\t\t\t\t$OString = $OStrings[$counter][0];\r\n\t\t\t\t$opening_tag = substr($OString, 0, strpos($OString, '>') + 1);\r\n\t\t\t\t$closing_tag = substr($OString, ReTidy::strpos_last($OString, '<'));\r\n\t\t\t\t$code_to_clean = substr($OString, strlen($opening_tag), strlen($OString) - strlen($opening_tag) - strlen($closing_tag));\r\n\t\t\t\t$needs_to_be_cleaned = false;\r\n\t\t\t\tforeach($array_tags as $tagName2) {\r\n\t\t\t\t\tif(strpos($code_to_clean, '<' . $tagName2) !== false) {\r\n\t\t\t\t\t\t$needs_to_be_cleaned = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif($needs_to_be_cleaned) {\r\n\t\t\t\t\t$offset = $OStrings[$counter][1];\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<(' . $tagNamesString . ')[^<>]*?>/is', '', $code_to_clean);\r\n\t\t\t\t\t$code_to_clean = preg_replace('/<\\/(' . $tagNamesString . ')>/is', '', $code_to_clean);\r\n\t\t\t\t\t$new_OString = $opening_tag . $code_to_clean . $closing_tag;\r\n\t\t\t\t\t$this->code = substr($this->code, 0, $offset) . $new_OString . substr($this->code, $offset + strlen($OString));\r\n\t\t\t\t\t$ct_redundant_acro += 1;\r\n\t\t\t\t}\r\n\t\t\t\t$counter--;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->logMsgIf(\"redundant acronyms applications removed\", $ct_redundant_acro);\r\n\t}", "function yt_rip_tags( $string ) {\n\t\t$string = preg_replace ( '/<[^>]*>/', ' ', $string ); \n\t\t\n\t\t/*\n\t\t * remove control characters\n\t\t */\n\t\t$string = str_replace( \"\\r\", '', $string ); // --- replace with empty space\n\t\t$string = str_replace( \"\\n\", ' ', $string ); // --- replace with space\n\t\t$string = str_replace( \"\\t\", ' ', $string ); // --- replace with space\n\t\t\n\t\t/*\n\t\t * remove multiple spaces\n\t\t */\n\t\t$string = trim( preg_replace( '/ {2,}/', ' ', $string ) );\n\t\t\n\t\treturn $string; \n\t\n\t}", "function convert_to($charset) {\r\n\t\t// rather than simply stopping processing at a character it cannot convert.\r\n\t\t// revision (2011-08-15): use the XML declaration (if it exists) preferentially over the meta content type tag to determine the encoding\r\n\t\t$declared_charset = ReTidy::find_charset_from_XML_tag();\r\n\t\tif($declared_charset === false) {\r\n\t\t\t/*$this->code = '<?xml version=\"1.0\" encoding=\"' . $charset . '\"?>\r\n' . $this->code;*/\r\n\t\t} else {\r\n\t\t\t$this->code = preg_replace('/<\\?xml([^<>]*?) version=\"1.0\"([^<>]*?) encoding=\"[^<>]*?\"([^<>]*?)\\?>/is', '<?xml$1 version=\"1.0\"$2 encoding=\"' . $charset . '\"$3?>', $this->code);\r\n\t\t}\r\n\t\tif($declared_charset === false) {\r\n\t\t\t$declared_charset = ReTidy::find_charset_from_meta_tag();\r\n\t\t\tif($declared_charset === false) {\r\n\t\t\t\t// at this point we're pretty desperate; although we shouldn't get here often\r\n\t\t\t\t$declared_charset = ReTidy::detectCharset();\r\n\t\t\t\t//$declared_charset = \"iso-8859-1\";\r\n\t\t\t\t//$declared_charset = \"utf-8\";\r\n\t\t\t\tif(ReTidy::is_HTML5()) {\r\n\t\t\t\t\t$this->code = preg_replace('/<head([^<>]*?)>/is', '<head$1>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=' . $charset . '\" />\r\n', $this->code);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->code = preg_replace('/<head([^<>]*?)>/is', '<head$1>\r\n<meta charset=\"' . $charset . '\" />\r\n', $this->code);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->code = preg_replace('/<meta http\\-equiv=[\\'\"]{0,1}[Cc]ontent\\-[Tt]ype[\\'\"]{0,1} content=\"text\\/html;\\s*charset\\s*=\\s*[^<>]*?\\s*\"/is', '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=' . $charset . '\"', $this->code);\r\n\t\t$this->code = preg_replace('/<meta charset=\"[^\"]*?\"/is', '<meta charset=\"' . $charset . '\"', $this->code);\r\n\t\t$temp_code = $this->code;\r\n\t\t$this->code = iconv($declared_charset, $charset . \"//TRANSLIT\", $this->code);\r\n\t\tif($this->code === false) {\r\n\t\t\t$this->code = mb_convert_encoding($temp_code, $charset, $declared_charset);\r\n\t\t\tif(strlen($this->code) === 0) {\r\n\t\t\t\t//print('$this->code5.5: ');var_dump($this->code);\r\n\t\t\t\tprint('<span style=\"color: red;\">Failed to convert from ' . $declared_charset . ' to ' . $charset . '.</span>');exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//$this->code = $temp_code;\r\n\t\t//print('$this->code6: ');var_dump($this->code);\r\n\t\t//ReTidy::updateEncoding($charset);\r\n\t}", "function newenglish_remove_self_closing_tags($input) {\n return str_replace(' />', '>', $input);\n}", "function sloodle_clean_for_output($str)\n {\n return sloodle_strip_new_lines(strip_tags(stripcslashes(@html_entity_decode($str, ENT_QUOTES, 'UTF-8'))));\n }", "function _cleanup_header_comment($str)\n {\n }", "function utf8_to_iso_8859_1() {\r\n\t\t$result = preg_match('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', $this->code, $encoding_matches);\r\n\t\tif($result) {\r\n\t\t\t$this->code = iconv(\"UTF-8\", \"CP1252\" . \"//TRANSLIT\", $this->code);\r\n\t\t\t$this->code = htmlspecialchars($this->code);\r\n\t\t\t$this->code = htmlentities($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = preg_replace('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"', $this->code);\r\n\t\t}\r\n\t}", "function strip_html_tags( $text )\r\n{\r\n $text = preg_replace(\r\n array(\r\n // Remove invisible content\r\n '@<head[^>]*?>.*?</head>@siu',\r\n '@<style[^>]*?>.*?</style>@siu',\r\n '@<script[^>]*?.*?</script>@siu',\r\n '@<object[^>]*?.*?</object>@siu',\r\n '@<embed[^>]*?.*?</embed>@siu',\r\n '@<applet[^>]*?.*?</applet>@siu',\r\n '@<noframes[^>]*?.*?</noframes>@siu',\r\n '@<noscript[^>]*?.*?</noscript>@siu',\r\n '@<noembed[^>]*?.*?</noembed>@siu',\r\n // Add line breaks before and after blocks\r\n '@</?((address)|(blockquote)|(center)|(del))@iu',\r\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\r\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\r\n '@</?((table)|(th)|(td)|(caption))@iu',\r\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\r\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\r\n '@</?((frameset)|(frame)|(iframe))@iu',\r\n ),\r\n array(\r\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\r\n $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\", $nl.\"\\$0\",\r\n $nl.\"\\$0\", $nl.\"\\$0\",\r\n ),\r\n $text );\r\n return strip_tags( $text );\r\n}", "function stringStripTags ($string) {\n $string = preg_replace(\"/<del[^>]*>.+<\\/del[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<script[^>]*>.+<\\/script[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<style[^>]*>.+<\\/style[^>]*>/isU\", '', $string);\n $string = str_replace('>', '> ', $string);\n $string = str_replace('<', ' <', $string);\n $string = strip_tags($string);\n $string = preg_replace(\"/\\s+/\", \" \", $string);\n $string = trim($string);\n return $string;\n}", "static function strip_html_tags($string){\n return preg_replace(array('/\\<(script)(.+)>/i', '/\\<(.+)(script)>/i', '/\\<(style)(.+)>/i', '/\\<(.+)(style)>/i'), '', $string);\n }", "function stripHTMLTags( $content ) {\r\n \r\n $search = array (\"'<script[^>]*?>.*?</script>'si\", // Strip out javascript\r\n \"'<\\s*br\\s*(\\/)?>'i\", // Replace brs to spaces\r\n \"'<[\\/\\!]*?[^<>]*?>'si\", // Strip out html tags\r\n \"'([\\r\\n])[\\s]+'\", // Strip out white space\r\n \"'&(quot|#34);'i\", // Replace html entities\r\n \"'&(amp|#38);'i\",\r\n \"'&(lt|#60);'i\",\r\n \"'&(gt|#62);'i\",\r\n \"'&(nbsp|#160);'i\",\r\n \"'&(iexcl|#161);'i\",\r\n \"'&(cent|#162);'i\",\r\n \"'&(pound|#163);'i\",\r\n \"'&(copy|#169);'i\",\r\n \"'&#(\\d+);'\");\r\n \r\n $replace = array (\"\",\r\n \" \",\r\n \"\",\r\n \"\\\\1\",\r\n \"\\\"\",\r\n \"&\",\r\n \"<\",\r\n \">\",\r\n \" \",\r\n chr(161),\r\n chr(162),\r\n chr(163),\r\n chr(169),\r\n \"chr(\\\\1)\");\r\n \r\n $content = preg_replace ($search, $replace, $content);\r\n \r\n return $content;\r\n}", "function lesson_importppt_clean_text($string) {\n $chop = 1; // default: just a single char infront of the content\n\n // look for any other crazy things that may be infront of the content\n if (strstr($string, '&lt;') and strpos($string, '&lt;') == 0) { // look for the &lt; in the sting and make sure it is in the front\n $chop = 4; // increase the $chop\n }\n // may need to add more later....\n\n $string = substr($string, $chop);\n\n if ($string != '&#13;') {\n return $string;\n } else {\n return false;\n }\n}", "function removecomments_html($string) {\n\n //strpos of the opening tag\n $start_position = 0;\n\n //number of tags \"deep\" we are\n $current_count = 0;\n\n //go through the string and remove the tags:\n for ( $p = 0; $p < strlen($string); $p++ ) {\n //find opening tags\n if ( $string[$p] == \"<\" && $string[$p+1] == \"!\"\n && $string[$p+2] == \"-\" && $string[$p+3] == \"-\" )\n {\n $current_count++;\n if ( $current_count == 1 )\n {\n $start_position = $p;\n }\n }\n //find closing tags if applicable.\n if ( $current_count > 0 && $string[$p] == \"-\"\n && $string[$p+1] == \"-\" && $string[$p+2] == \">\")\n {\n $current_count--;\n if ( $current_count == 0 )\n {\n $p = $p + 3;\n $string = substr($string, 0, $start_position) . substr($string, $p);\n $start_position = 0;\n $p = 0;\n }\n }\n }\n\n //handle any uneven tags at the end.\n return substr($string, 0, (strpos($string, \"<!--\") == 0 ? strlen($string) : strpos($string, \"<!--\"))) . \"\\n\";\n }", "function StripHTML($s_str,$s_line_feed = \"\\n\")\n{\n\t\t//\n\t\t// strip HTML comments (s option means include new lines in matches)\n\t\t//\n\t$s_str = preg_replace('/<!--([^-]*([^-]|-([^-]|-[^>])))*-->/s','',$s_str);\n\t\t//\n\t\t// strip any scripts (i option means case-insensitive)\n\t\t//\n\t$s_str = preg_replace('/<script[^>]*?>.*?<\\/script[^>]*?>/si','',$s_str);\n\t\t//\n\t\t// replace paragraphs with new lines (line feeds)\n\t\t//\n\t$s_str = preg_replace('/<p[^>]*?>/i',$s_line_feed,$s_str);\n\t\t//\n\t\t// replace breaks with new lines (line feeds)\n\t\t//\n\t$s_str = preg_replace('/<br[[:space:]]*\\/?[[:space:]]*>/i',$s_line_feed,$s_str);\n\t\t//\n\t\t// overcome this bug: http://bugs.php.net/bug.php?id=21311\n\t\t//\n\t$s_str = preg_replace('/<![^>]*>/s','',$s_str);\n\t\t//\n\t\t// get rid of all HTML tags\n\t\t//\n\t$s_str = strip_tags($s_str);\n\treturn ($s_str);\n}", "function clean_evil_tags( $t )\n {\n \t$t = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $t );\n\t\t$t = preg_replace( \"/alert/i\" , \"&#097;lert\" , $t );\n\t\t$t = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $t );\n\t\t$t = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $t );\n\t\t$t = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $t );\n\t\t$t = preg_replace( \"/onload/i\" , \"&#111;nload\" , $t );\n\t\t$t = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $t );\n\t\t$t = preg_replace( \"/<body/i\" , \"&lt;body\" , $t );\n\t\t$t = preg_replace( \"/<html/i\" , \"&lt;html\" , $t );\n\t\t$t = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $t );\n\t\t\n\t\treturn $t;\n }", "function getHtmlUtf8 ($url, $input_encoding = \"\") {\n $fp = fopen($url, \"r\");\n $meta_data = stream_get_meta_data($fp);\n $html = stream_get_contents($fp);\n fclose($fp);\n $charset_pattern = \"/charset=([^;\\\\s]+)/i\";\n # Get encoding from response header entries\n if (! $input_encoding) {\n foreach ($meta_data[\"wrapper_data\"] as $line) {\n if (count(($keyval = preg_split(\"/\\\\s*:\\\\s*/\", $line, 2)) == 2)) {\n $key = $keyval[0];\n $val = $keyval[1];\n if ($key == \"Content-Type\" &&\n preg_match($charset_pattern, $val, $matches) ) {\n $input_encoding = trim($matches[1]);\n }\n }\n }\n }\n # Otherwise, get from the HTML meta tag\n if (! $input_encoding) {\n # 2nd byte of SJIS (ISO-2022 incompatible encoding) can be [<>]\n if (($html_utf8 = iconv(\"SJIS\", \"UTF-8\", $html)) &&\n stristr($html_utf8, \"</html>\") ) {\n $html_to_be_checked = $html_utf8;\n } else {\n $html_to_be_checked = $html;\n }\n $html_ascii = preg_replace(\"/[^ -~]/\", \"\", $html_to_be_checked);\n $html_ascii = preg_replace(\"@<body\\\\>.*</body>@\", \"<body/>\",\n $html_ascii );\n $html_ascii = preg_replace(\"@<title\\\\>.*</title>@\", \"<title/>\",\n $html_ascii );\n echo $html_ascii;\n $doc = new DOMDocument();\n $doc->loadHTML($html_ascii);\n $xpath = new DOMXPath($doc);\n $elems = $xpath->query(\"./head/meta[@http-equiv='Content-Type']\");\n foreach ($elems as $elem) {\n if (preg_match($charset_pattern, $elem->getAttribute(\"content\"),\n $matches )) {\n $input_encoding = trim($matches[1]);\n }\n }\n }\n # Failed to get\n if (! $input_encoding) {\n exit(1);\n }\n $input_encoding = strtoupper($input_encoding);\n # Some EUC-JP pages contain OMAJINAI character. Bad habit\n if ($input_encoding == \"EUCJP\" || $input_encoding == \"EUC-JP\") {\n $html = str_replace(\"\\xFD\\xFE\", \"\", $html);\n }\n return iconv($input_encoding, \"UTF-8\", $html);\n }", "function unconvertHTML($strInput)//Convert html special code to standart form\n{\n\t//$strInput = html_entity_decode($strInput);\n\t$strInput = str_replace('&quot;', '\"', $strInput);\n\t$strInput = str_replace(\"&#039;\", \"'\", $strInput);\n\treturn $strInput;\n}", "public static function sanitizeUTF8($string)\n\t{\n\t\t$output = preg_replace('/[^\\x{0009}\\x{000a}\\x{000d}\\x{0020}-\\x{D7FF}\\x{E000}-\\x{FFFD}]+/u', '', $string);\n\t\tif (is_null($output))\n\t\t{\n\t\t\t$output = \"\";\n\t\t\tif (empty($string))\n\t\t\t{\n\t\t\t\treturn $output;\n\t\t\t}\n\n\t\t\t$length = strlen($string);\n\t\t\tfor ($i = 0; $i < $length; $i++)\n\t\t\t{\n\t\t\t\t$current = ord($string{$i});\n\t\t\t\tif (($current == 0x9) ||\n\t\t\t\t\t($current == 0xA) ||\n\t\t\t\t\t($current == 0xD) ||\n\n\t\t\t\t\t(($current >= 0x28) && ($current <= 0xD7FF)) ||\n\t\t\t\t\t(($current >= 0xE000) && ($current <= 0xFFFD)) ||\n\t\t\t\t\t(($current >= 0x10000) && ($current <= 0x10FFFF))\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$output .= chr($current);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$output .= \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "function phpTrafficA_cleanTextBasic($text) {\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}", "function strip_html_tags( $text )\n{\n\t// PHP's strip_tags() function will remove tags, but it\n\t// doesn't remove scripts, styles, and other unwanted\n\t// invisible text between tags. Also, as a prelude to\n\t// tokenizing the text, we need to insure that when\n\t// block-level tags (such as <p> or <div>) are removed,\n\t// neighboring words aren't joined.\n\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t\t// Remove invisible content\n\t\t\t\t\t'@<head[^>]*?>.*?</head>@siu',\n\t\t\t\t\t'@<style[^>]*?>.*?</style>@siu',\n\t\t\t\t\t'@<script[^>]*?.*?</script>@siu',\n\t\t\t\t\t'@<object[^>]*?.*?</object>@siu',\n\t\t\t\t\t'@<embed[^>]*?.*?</embed>@siu',\n\t\t\t\t\t'@<applet[^>]*?.*?</applet>@siu',\n\t\t\t\t\t'@<noframes[^>]*?.*?</noframes>@siu',\n\t\t\t\t\t'@<noscript[^>]*?.*?</noscript>@siu',\n\t\t\t\t\t'@<noembed[^>]*?.*?</noembed>@siu',\n\t\t\t\t\t/*'@<input[^>]*?>@siu',*/\n\t\t\t\t\t'@<form[^>]*?.*?</form>@siu',\n\n\t\t\t\t\t// Add line breaks before & after blocks\n\t\t\t\t\t'@<((br)|(hr))>@iu',\n\t\t\t\t\t'@</?((address)|(blockquote)|(center)|(del))@iu',\n\t\t\t\t\t'@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n\t\t\t\t\t'@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n\t\t\t\t\t'@</?((table)|(th)|(td)|(caption))@iu',\n\t\t\t\t\t'@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n\t\t\t\t\t'@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n\t\t\t\t\t'@</?((frameset)|(frame)|(iframe))@iu',\n\t),\n\tarray(\n\t\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \",\n\t\" \", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n\t\"\\n\\$0\", \"\\n\\$0\",\n\t),\n\t$text );\n\n\t// remove empty lines\n\t$text = preg_replace(\"/(^[\\r\\n]*|[\\r\\n]+)[\\s\\t]*[\\r\\n]+/\", \"\\n\", $text);\n\t// remove leading spaces\n\t$text = preg_replace(\"/\\n( )*/\", \"\\n\", $text);\n\n\t// Remove all remaining tags and comments and return.\n\treturn strip_tags( $text );\n}", "function amazon_xml_encoding( $String )\n\t\t{\n\t\t\tif(substr_count($String, \"<?xml\"))\n\t\t\t{\n\t\t\t\t$Start = strpos($String, \"<?xml\")+5;\n\t\t\t\t$End = strpos( $String, \">\", $Start );\n\t\t\t\t$Content = substr( $String, $Start, $End-$Start );\n\t\t\t\t$EncodingStart = strpos( $Content, \"encoding=\\\"\" )+10;\n\t\t\t\t$EncodingEnd = strpos( $Content, \"\\\"\", $EncodingStart );\n\t\t\t\t$Encoding = substr( $Content, $EncodingStart, $EncodingEnd-$EncodingStart );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$Encoding = \"\";\n\t\t\t}\n\t\t\treturn $Encoding;\n\t\t}", "function rc_utf8_clean($input)\n{\n // handle input of type array\n if (is_array($input)) {\n foreach ($input as $idx => $val)\n $input[$idx] = rc_utf8_clean($val);\n return $input;\n }\n \n if (!is_string($input) || $input == '')\n return $input;\n\n // iconv/mbstring are much faster (especially with long strings)\n if (function_exists('mb_convert_encoding') && ($res = mb_convert_encoding($input, 'UTF-8', 'UTF-8')) !== false)\n return $res;\n\n if (function_exists('iconv') && ($res = @iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false)\n return $res;\n\n $regexp = '/^('.\n// '[\\x00-\\x7F]'. // UTF8-1\n '|[\\xC2-\\xDF][\\x80-\\xBF]'. // UTF8-2\n '|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|[\\xE1-\\xEC][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xED[\\x80-\\x9F][\\x80-\\xBF]'. // UTF8-3\n '|[\\xEE-\\xEF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xF0[\\x90-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n '|[\\xF1-\\xF3][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'.// UTF8-4\n '|\\xF4[\\x80-\\x8F][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n ')$/';\n \n $seq = '';\n $out = '';\n\n for ($i = 0, $len = strlen($input); $i < $len; $i++) {\n $chr = $input[$i];\n $ord = ord($chr);\n // 1-byte character\n if ($ord <= 0x7F) {\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n $out .= $chr;\n // first (or second) byte of multibyte sequence\n } else if ($ord >= 0xC0) {\n if (strlen($seq)>1) {\n\t$out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n } else if ($seq && ord($seq) < 0xC0) {\n $seq = '';\n }\n $seq .= $chr;\n // next byte of multibyte sequence\n } else if ($seq) {\n $seq .= $chr;\n }\n }\n\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n\n return $out;\n}", "protected function cleanupContent($string)\n {\n $string = trim(str_replace(' ', ' ', str_replace('&nbsp;', ' ', $string)));\n\n $vueJsDebugStrings = ['<!--v-start-->', '<!--v-end-->', '<!--v-component-->'];\n $string = str_replace($vueJsDebugStrings, '', $string);\n\n return trim($string);\n }", "function _cut_html($str) {\n $str=preg_replace(\"'<[\\/\\!]*?[^<>]*?>'si\",\"\",$str);\n return $str;\n }", "function restore_pre_code_tags( $p_string, $p_multiline = true ) {\n\t\t\t$t_string = $p_string;\n\t\t\t$tags = '';\n\t\t\t$t_html_pre_code_tags = \"br, pre, code\";\n\n\t\t\tif( is_blank( $t_html_pre_code_tags ) ) {\n\t\t\t\treturn $t_string;\n\t\t\t}\n\n\t\t\t$tags = explode( ',', $t_html_pre_code_tags );\n\t\t\tforeach( $tags as $key => $value ) {\n\t\t\t\tif( !is_blank( $value ) ) {\n\t\t\t\t\t$tags[$key] = trim( $value );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tags = implode( '|', $tags );\n\t\t\n\t\t\t$t_string = preg_replace_callback('/&lt;(' . $tags . ')(.*?)&gt;/ui',\n\t\t\tcreate_function('$m', '\n\t\t\t\treturn \"<\" . $m[1] . str_replace(\"&quot;\", \"\\\"\", $m[2]) . \">\";\n\t\t\t')\n\t\t\t, $t_string);\n\t\t\t\n\t\t\t$t_string = preg_replace( '/&lt;\\/(' . $tags . ')\\s*&gt;/ui', '</\\\\1>', $t_string );\t\t\t\n\t\t\t$t_string = preg_replace( '/&lt;a\\shref=&quot;(\\S+)&quot;&gt;.+&lt;\\/a&gt;\\s\\[&lt;a\\shref=&quot;(\\S+)&quot;\\starget=&quot;_blank&quot;&gt;\\^&lt;\\/a&gt;\\]/ui', '<a href=\"\\\\1\">\\\\1</a> [<a href=\"\\\\1\" target=\"_blank\">^</a>]', $t_string );\n\n\t\t\treturn $t_string;\n\t\t}", "function xss_html_clean( $html )\n\t{\n\t\t//-----------------------------------------\n\t\t// Opening script tags...\n\t\t// Check for spaces and new lines...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"#<(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\" , \"&lt;script\" , $html );\n\t\t$html = preg_replace( \"#<(\\s+?)?/(\\s+?)?s(\\s+?)?c(\\s+?)?r(\\s+?)?i(\\s+?)?p(\\s+?)?t#is\", \"&lt;/script\", $html );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Basics...\n\t\t//-----------------------------------------\n\t\t\n\t\t$html = preg_replace( \"/javascript/i\" , \"j&#097;v&#097;script\", $html );\n\t\t$html = preg_replace( \"/alert/i\" , \"&#097;lert\" , $html );\n\t\t$html = preg_replace( \"/about:/i\" , \"&#097;bout:\" , $html );\n\t\t$html = preg_replace( \"/onmouseover/i\", \"&#111;nmouseover\" , $html );\n\t\t$html = preg_replace( \"/onclick/i\" , \"&#111;nclick\" , $html );\n\t\t$html = preg_replace( \"/onload/i\" , \"&#111;nload\" , $html );\n\t\t$html = preg_replace( \"/onsubmit/i\" , \"&#111;nsubmit\" , $html );\n\t\t$html = preg_replace( \"/<body/i\" , \"&lt;body\" , $html );\n\t\t$html = preg_replace( \"/<html/i\" , \"&lt;html\" , $html );\n\t\t$html = preg_replace( \"/document\\./i\" , \"&#100;ocument.\" , $html );\n\t\t\n\t\treturn $html;\n\t}", "function newenglish_head_cleanup() {\n // Originally from http://wpengineer.com/1438/wordpress-header/\n remove_action('wp_head', 'feed_links_extra', 3);\n add_action('wp_head', 'ob_start', 1, 0);\n add_action('wp_head', function () {\n $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\\r\\n]+/';\n echo preg_replace($pattern, '', ob_get_clean());\n }, 3, 0);\n remove_action('wp_head', 'rsd_link');\n remove_action('wp_head', 'wlwmanifest_link');\n remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10);\n remove_action('wp_head', 'wp_generator');\n remove_action('wp_head', 'wp_shortlink_wp_head', 10);\n remove_action('wp_head', 'print_emoji_detection_script', 7);\n remove_action('admin_print_scripts', 'print_emoji_detection_script');\n remove_action('wp_print_styles', 'print_emoji_styles');\n remove_action('admin_print_styles', 'print_emoji_styles');\n remove_action('wp_head', 'wp_oembed_add_discovery_links');\n remove_action('wp_head', 'wp_oembed_add_host_js');\n remove_action('wp_head', 'rest_output_link_wp_head', 10);\n remove_filter('the_content_feed', 'wp_staticize_emoji');\n remove_filter('comment_text_rss', 'wp_staticize_emoji');\n remove_filter('wp_mail', 'wp_staticize_emoji_for_email');\n add_filter('use_default_gallery_style', '__return_false');\n add_filter('emoji_svg_url', '__return_false');\n add_filter('show_recent_comments_widget_style', '__return_false');\n}", "function utf8_sanitize($str, &$errors = null) {\n if ($errors !== null) {\n $errors = array();\n }\n $utf8 = '';\n $bytesNeeded = 0;\n $bytesSeen = 0;\n $lowerBoundary = 0x80;\n $upperBoundary = 0xBF;\n $char = '';\n for ($pos = 0, $length = strlen($str); $pos < $length; $pos++) {\n $byte = ord($str[$pos]);\n if ($bytesNeeded == 0) {\n if ($byte >= 0x00 and $byte <= 0x7F) {\n $utf8 .= $str[$pos];\n } elseif ($byte >= 0xC2 and $byte <= 0xDF) {\n $bytesNeeded = 1;\n } elseif ($byte >= 0xE0 and $byte <= 0xEF) {\n if ($byte == 0xE0) {\n $lowerBoundary = 0xA0;\n }\n if ($byte == 0xED) {\n $upperBoundary = 0x9F;\n }\n $bytesNeeded = 2;\n } elseif ($byte >= 0xF0 and $byte <= 0xF4) {\n if ($byte == 0xF0) {\n $lowerBoundary = 0x90;\n }\n if ($byte == 0xF4) {\n $upperBoundary = 0x8F;\n }\n $bytesNeeded = 3;\n } else {\n $utf8 .= UTF8_REPLACEMENT_CHARACTER;\n if ($errors !== null) $errors[] = $pos;\n }\n $char = $str[$pos];\n } elseif ($byte < $lowerBoundary or $byte > $upperBoundary) {\n $char = '';\n $bytesNeeded = 0;\n $bytesSeen = 0;\n $lowerBoundary = 0x80;\n $upperBoundary = 0xBF;\n $utf8 .= UTF8_REPLACEMENT_CHARACTER;\n if ($errors !== null) $errors[] = $pos;\n $pos--;\n } else {\n $lowerBoundary = 0x80;\n $upperBoundary = 0xBF;\n $bytesSeen++;\n $char .= $str[$pos];\n if ($bytesSeen == $bytesNeeded) {\n $utf8 .= $char;\n $char = '';\n $bytesNeeded = 0;\n $bytesSeen = 0;\n }\n }\n }\n if ($bytesNeeded > 0) {\n $utf8 .= UTF8_REPLACEMENT_CHARACTER;\n if ($errors !== null) $errors[] = $length;\n }\n return $utf8;\n}", "public function ToHtml()\n {\n // we first precache whole content in buffer, because if there were some exceptions, we don't want to get only partial html text\n $_header = $this->getHeader();\n $_body = $this->getBody();\n $_footer = $this->getFooter();\n if ($this->UseTidy)\n {\n $tidy = new tidy;\n $config = array( 'indent' => true, 'wrap' => 800 );\n $tidy->parseString($_header . $_body . $_footer, $config, 'utf8');\n return tidy_get_output($tidy);\n } else\n {\n return ($_header . $_body . $_footer);\n }\n }", "function strip_cdata($string) {\n preg_match_all('/<!\\[cdata\\[(.*?)\\]\\]>/is', $string, $matches); \n return str_replace($matches[0], $matches[1], $string); \n}", "function get_pre($string, $offset = false) {\r\n\t\tif($offset === false) {\r\n\t\t\t$offset = strlen($string);\r\n\t\t}\r\n\t\t$pre_code = substr($string, 0, $offset);\r\n\t\t$ancestryArray = OM::getAncestryArray($pre_code, strlen($pre_code));\r\n\t\tif(sizeof($ancestryArray) > 0) {\r\n\t\t\t//print('here834954950<br>');\r\n\t\t\t$pre = substr($pre_code, 0, $ancestryArray[sizeof($ancestryArray) - 1][2] + strlen($ancestryArray[sizeof($ancestryArray) - 1][1]));\r\n\t\t\treturn $pre;\r\n\t\t} else {\r\n\t\t\t//print('here834954951<br>');\r\n\t\t\t// get the code up to the first tag\r\n\t\t\tpreg_match('/(.*?)<\\w/is', $string, $pre_first_tag_matches);\r\n\t\t\t$pre_first_tag = $pre_first_tag_matches[1];\r\n\t\t\treturn $pre_first_tag;\r\n\t\t\t//return \"\";\r\n\t\t}\r\n\t}", "function cleanEvilTags($t){\r\n\t\t$t = preg_replace(\"/javascript/i\" , \"j&#097;v&#097;script\", $t);\r\n\t\t$t = preg_replace(\"/alert/i\" , \"&#097;lert\" , $t);\r\n\t\t$t = preg_replace(\"/about:/i\" , \"&#097;bout:\" , $t);\r\n\t\t$t = preg_replace(\"/onmouseover/i\", \"&#111;nmouseover\" , $t);\r\n\t\t$t = preg_replace(\"/onclick/i\" , \"&#111;nclick\" , $t);\r\n\t\t$t = preg_replace(\"/onload/i\" , \"&#111;nload\" , $t);\r\n\t\t$t = preg_replace(\"/onsubmit/i\" , \"&#111;nsubmit\" , $t);\r\n\t\t$t = preg_replace(\"/<body/i\" , \"&lt;body\" , $t);\r\n\t\t$t = preg_replace(\"/<html/i\" , \"&lt;html\" , $t);\r\n\t\t$t = preg_replace(\"/document\\./i\" , \"&#100;ocument.\" , $t);\r\n\t\treturn $t;\r\n\t}", "function clean_encode_message($yourmessage)\n{\n\n require_once('class.UBBCodeN.php');\n $myUBB = new UBBCodeN();\n\n $yourmessage = $myUBB->encode($yourmessage);\n\n // $yourmessage = str_replace('\"','&#34;', $yourmessage);\n $yourmessage = entify_nonprinting_chars($yourmessage);\n\n return $yourmessage;\n}", "function tidy_repair_string($data, $config = null, $encoding = null) {}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "function topTagHtml(){\n echo\n '<!DOCTYPE html>\n <html>';\n}", "function singleCharactersify($string) {\r\n\t\t// but this function is only currently being used for headings determination (in table of contents and content)\r\n\t\t$trimmed_tagless_string = $string;\r\n\t\tprint('maybe this function (singleCharactersify) should not be used');exit(0);\r\n\t\t$trimmed_tagless_string = ReTidy::trim_nbsp(ReTidy::tagless($trimmed_tagless_string));\r\n\t\t$trimmed_tagless_string = preg_replace('/&[^&;\\s]+;/is', '*', $trimmed_tagless_string);\r\n\t\t$trimmed_tagless_string = preg_replace('/\\s{1,}/is', ' ', $trimmed_tagless_string);\r\n\t\treturn $trimmed_tagless_string;\r\n\t}", "function getHtmlWithoutWordBlankSpaces($file)\n {\n $contents = file_get_contents($file);\n $search = \"<p class=MsoNormal><span lang=EN-GB \" .\n \"style='mso-ansi-language:EN-GB'>&nbsp;</span></p>\";\n return str_replace($search, '', $contents);\n }", "function seems_utf8($str)\n {\n }", "private function tidyUpData($string)\n {\n return preg_replace('/[\\x00-\\x1F\\x7F]/u', '', $string); \n }", "function string_to_finalmessage($message) {\n $finalmessage = \"\";\n $sss = \"\";\n for ($i = 0; $i < mb_strlen($message, \"UTF-8\"); $i++) {\n $sss = mb_substr($message, $i, 1, \"utf-8\");\n $a = 0;\n $abc = \"&#\" . ordutf8($sss, $a) . \";\";\n $finalmessage .= $abc;\n }\n return $finalmessage;\n}", "function unescape_invalid_shortcodes($content)\n {\n }", "protected function makeTextHtmlContentTransferEncodingHeaderString() {\n\t\treturn 'Content-transfer-encoding: ' . $this->_mailTextHtmlContentTransferEncoding . $this->_endString;\n\t}", "function displayTagTopHtml(){\n echo\n '<!DOCTYPE html>\n <html lang=\"fr\">';\n}", "function strip_cdata( $html )\n\t{\n\t\tpreg_match_all( '/<!\\[cdata\\[(.*?)\\]\\]>/is', $html, $matches );\n\n\t\treturn str_replace( $matches[ 0 ], $matches[ 1 ], $html );\n\t}", "function javascript_collector($buffer) {\r\n\r\n\r\n $from=strpos ( $buffer,\"<script\",0);\r\n $xhtml=substr ( $buffer,0,$from);\r\n if ($from===False)\r\n return $buffer;\r\n while ($from) {\r\n\r\n $to=strpos ($buffer,\"</script>\",$from+1);\r\n //echo \"Cortar desde $from hasta $to\";\r\n $script.=substr ( $buffer,$from,$to-$from+strlen(\"</script>\")).\"\\n\";\r\n $from=strpos ( $buffer,\"<script\",$to+1);\r\n if ($from===False)\r\n $xhtml.=substr ( $buffer,$to+strlen(\"</script>\"),-1);\r\n else\r\n $xhtml.=substr ( $buffer,$to+strlen(\"</script>\"),$from-($to+strlen(\"</script>\")));\r\n }\r\n\r\n $jpos=str_replace(\"<!--_JAVASCRIPTCODE-->\",$script,$xhtml);\r\n \r\n return $jpos.\"\";\r\n}", "public function get_header_html()\n\t{\n\t return '';\n\t}", "function qa_xml($string)\n{\n\treturn htmlspecialchars(preg_replace('/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]/', '', (string)$string));\n}", "function win_utf8($s) {\n $utf = \"\";\n for ($i = 0; $i < strlen($s); $i++) {\n $donotrecode = false;\n $c = ord(substr($s, $i, 1));\n if ($c == 0xA8) {\n $res = 0xD081;\n } elseif ($c == 0xB8) {\n $res = 0xD191;\n } elseif ($c < 0xC0) {\n $donotrecode = true;\n } elseif ($c < 0xF0) {\n $res = $c + 0xCFD0;\n } else {\n $res = $c + 0xD090;\n }\n $c = ($donotrecode) ? chr($c) : (chr($res >> 8) . chr($res & 0xff));\n $utf .= $c;\n }\n return $utf;\n }", "function scrappy_unzip($html) {\n return (0 === mb_strpos( $html , \"\\x1f\" . \"\\x8b\" . \"\\x08\" )) ? gzdecode($html) : $html;\n}", "private function getMiniContents($strFilePath)\r\n\t{\r\n\t\t// contents\r\n\t\t$strCode = file_get_contents($strFilePath);\r\n\t\t\r\n\t\t// BOM del\r\n\t\t$strCode = preg_replace('#^\\xEF\\xBB\\xBF#', '', $strCode);\r\n\t\t\r\n\t\t// lines (simpli/uni)fication\r\n\t\t$strCode = preg_replace(array(\"#\\r\\n#\", \"#\\r#\"), \"\\n\", $strCode);\r\n\t\t\r\n\t\t// remove in-line comments without removing any vertical whitespace\r\n\t\t// TODO: A different aproach? Preserve strings and then match comments...\r\n\t\tif ($this->isRemoveInlineComments)\r\n\t\t{\r\n\t\t\t$strCode = preg_replace(\"#[ \\t]*//[^\\\"\\'\\n]*[^\\\\\\\\\\\"\\'\\n](?=\\n)#\", '', $strCode);\r\n\r\n\t\t\t// not working: $strCode = preg_replace(\"#\\n//[^'\\n]*(['\\\"])[^'\\n]*\\1(?=\\n)#\", \"\\n\", $strCode);\r\n\t\t\t$strCode = preg_replace(\"#\\n//[^\\\"\\n]*\\\"[^\\\"\\n]*\\\"[^\\\"\\n]*(?=\\n)#\", \"\\n\", $strCode);\r\n\t\t\t$strCode = preg_replace(\"#\\n//[^'\\n]*'[^'\\n]*'[^'\\n]*(?=\\n)#\", \"\\n\", $strCode);\r\n\r\n\t\t\t$strCode = preg_replace(\"#\\n//(?=\\n)#\", \"\\n\", $strCode);\r\n\t\t}\r\n\t\t\r\n\t\t// remove horizontal whitespace from EOL\r\n\t\t$strCode = preg_replace(\"#[ \\t]+\\n#\", \"\\n\", $strCode);\r\n\t\t\r\n\t\t// remove multi-line comments, add in-line comment in format: \"// EOC@line#X\".\r\n\t\tif ($this->isRemoveMultiComments)\r\n\t\t{\r\n\t\t\t$strCode = $this->parseMultiCom($strCode);\r\n\t\t}\r\n\t\t\r\n\t\t// add semicolon if not present\r\n\t\t$strCode = preg_replace(\"#([^\\s};])\\s*$#\", \"$1;\\n\", $strCode);\r\n\t\t\r\n\t\treturn $strCode;\r\n\t}", "function cleanStyleInformation($string) {\r\n\t\t$string = str_replace('&nbsp;', ' ', $string);\r\n\t\t$string = str_replace('&quot;', \"'\", $string);\r\n\t\t$string = ReTidy::decode_for_DOM_character_entities($string);\r\n\t\t/* // 2011-11-28\r\n\t\tpreg_match_all('/&[\\w#x0-9]+;/is', $string, $character_entity_matches);\r\n\t\tforeach($character_entity_matches[0] as $character_entity_match) {\r\n\t\t\t//$decoded = html_entity_decode($character_entity_match);\r\n\t\t\tif(strpos($decoded, \";\") === false) {\r\n\t\t\t\t$string = str_replace($character_entity_match, $decoded, $string);\r\n\t\t\t} else { // then we still have a problem\r\n\t\t\t\tprint(\"did not properly decode HTML character entity in style attribute4892589435: <br>\\r\\n\");var_dump($decoded);print(\"<br>\\r\\n\");var_dump($string);print(\"<br>\\r\\n\");exit(0);\r\n\t\t\t}\r\n\t\t}*/\r\n\t\t$string = preg_replace('/\\/\\*.*\\*\\//s', '', $string);\r\n\t\t// the above could already be taken care of\r\n\t\t$string = preg_replace('/\\s*;\\s*/s', '; ', $string);\r\n\t\t$string = preg_replace('/\\s*:\\s*/s', ': ', $string);\r\n\t\t// pseudo-elements...\r\n\t\t$string = preg_replace('/\\s*:\\s*(\\w*)\\s*\\{([^\\{\\}]*)\\}/s', ' :$1 {$2};', $string);\r\n\t\t// we would probably like to force a format on things like media rules here also\r\n\t\t$string = preg_replace('/\\r\\n/', ' ', $string);\r\n\t\t$string = preg_replace('/\\s+/', ' ', $string);\r\n\t\t$string = trim($string);\r\n\t\t$string = ReTidy::delete_empty_styles($string);\r\n\t\t$string = ReTidy::ensureStyleInformationBeginsProperly($string);\r\n\t\t$string = ReTidy::ensureStyleInformationEndsProperly($string);\r\n\t\treturn $string;\r\n\t}", "function sanitize_output($buffer) {\n $search = ['/\\>[^\\S ]+/s', '/[^\\S ]+\\</s', '/(\\s)+/s'];\n $replace = ['>', '<', '\\\\1'];\n $buffer = preg_replace($search, $replace, $buffer);\n return $buffer;\n }", "protected function strip_non_utf8( $string ) {\n\t\tini_set( 'mbstring.substitute_character', 'none' );\n\n\t\treturn mb_convert_encoding( $string, 'UTF-8', 'UTF-8' );\n\t}", "function wxr_cdata( $str ) {\n\t\tif ( seems_utf8( $str ) == false )\n\t\t\t$str = utf8_encode( $str );\n\n\t\t// $str = ent2ncr(esc_html($str));\n\t\t$str = \"<![CDATA[$str\" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '' ) . ']]>';\n\n\t\treturn $str;\n\t}", "function charset_decode_utf_8 ($string) {\r\n\t /* avoid using 0xA0 (\\240) in ereg ranges. RH73 does not like that */\r\n\t if (! ereg(\"[\\200-\\237]\", $string) and ! ereg(\"[\\241-\\377]\", $string))\r\n\t return $string;\r\n\r\n\t // decode three byte unicode characters\r\n\t $string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\",\r\n\t \"'&#'.((ord('\\\\1')-224)*4096 + (ord('\\\\2')-128)*64 + (ord('\\\\3')-128)).';'\",\r\n\t $string);\r\n\r\n\t // decode two byte unicode characters\r\n\t $string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\",\r\n\t \"'&#'.((ord('\\\\1')-192)*64+(ord('\\\\2')-128)).';'\",\r\n\t $string);\r\n\r\n\t return $string;\r\n\t}", "function user_removeChr($content,$conf) {\r\n\t//$content = str_replace('\\r', '2', $content);\r\n\t$content = str_replace(chr(13), '/', $content);\r\n\t$content = str_replace(chr(10), '', $content);\r\n\treturn $content;\r\n}", "function uniencode($s)\n{\n $r = \"\";\n for ($i=0;$i<strlen($s);$i++) $r.= \"&#\".ord(substr($s,$i,1)).\";\";\n return $r;\n}", "function mc_admin_strip_tags() {\n\n\treturn '<strong><em><i><b><span><a><code><pre>';\n}", "function removeBOM($str = '') {\n if (substr($str, 0, 3) == pack(\"CCC\", 0xef, 0xbb, 0xbf)) {\n $str = substr($str, 3);\n }\n return $str;\n}", "public static function encode_javascript($string) {\n $string = str_replace('\\\\', '\\\\\\\\', $string);\n $string = str_replace('\"', '\\\\\"', $string);\n $string = str_replace(\"'\", \"\\\\'\", $string);\n $string = str_replace(\"\\n\", \"\\\\n\", $string);\n $string = str_replace(\"\\r\", \"\\\\r\", $string);\n $string = str_replace(\"\\t\", \"\\\\t\", $string);\n\n $len = strlen($string);\n $pos = 0;\n $out = '';\n\n while ($pos < $len) {\n $ascii = ord(substr($string, $pos, 1));\n\n if ($ascii >= 0xF0) {\n $byte[1] = ord(substr($string, $pos, 1)) - 0xF0;\n $byte[2] = ord(substr($string, $pos + 1, 1)) - 0x80;\n $byte[3] = ord(substr($string, $pos + 2, 1)) - 0x80;\n $byte[4] = ord(substr($string, $pos + 3, 1)) - 0x80;\n\n $char_code = ($byte[1] << 18) + ($byte[2] << 12) + ($byte[3] << 6) + $byte[4];\n $pos += 4;\n } elseif (($ascii >= 0xE0) && ($ascii < 0xF0)) {\n $byte[1] = ord(substr($string, $pos, 1)) - 0xE0;\n $byte[2] = ord(substr($string, $pos + 1, 1)) - 0x80;\n $byte[3] = ord(substr($string, $pos + 2, 1)) - 0x80;\n\n $char_code = ($byte[1] << 12) + ($byte[2] << 6) + $byte[3];\n $pos += 3;\n } elseif (($ascii >= 0xC0) && ($ascii < 0xE0)) {\n $byte[1] = ord(substr($string, $pos, 1)) - 0xC0;\n $byte[2] = ord(substr($string, $pos + 1, 1)) - 0x80;\n\n $char_code = ($byte[1] << 6) + $byte[2];\n $pos += 2;\n } else {\n $char_code = ord(substr($string, $pos, 1));\n $pos += 1;\n }\n\n if ($char_code < 0x80)\n $out .= chr($char_code);\n else\n $out .= '\\\\u' . str_pad(dechex($char_code), 4, '0', STR_PAD_LEFT);\n }\n\n return $out;\n }", "public static function removeClosingTags(string $text)\n {\n foreach (self::$selfClosing as $tag)\n {\n if (strpos($text, '</'.$tag.'>') !== false)\n {\n $text = str_replace('</'.$tag.'>', '', $text);\n }\n }\n\n return html_entity_decode($text);\n }", "function head_cleanup() {\n\t// Originally from http://wpengineer.com/1438/wordpress-header/\n\tremove_action( 'wp_head', 'feed_links_extra', 3 );\n\tadd_action( 'wp_head', 'ob_start', 1, 0 );\n\tadd_action( 'wp_head', function () {\n\t\t$pattern = '/.*' . preg_quote( esc_url( get_feed_link( 'comments_' . get_default_feed() ) ), '/' )\n\t\t . '.*[\\r\\n]+/';\n\t\techo preg_replace( $pattern, '', ob_get_clean() );\n\t}, 3, 0 );\n\tremove_action( 'wp_head', 'rsd_link' );\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\tremove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10 );\n\tremove_action( 'wp_head', 'wp_generator' );\n\tremove_action( 'wp_head', 'wp_shortlink_wp_head', 10 );\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n\tremove_action( 'wp_head', 'wp_oembed_add_host_js' );\n\tremove_action( 'wp_head', 'rest_output_link_wp_head', 10 );\n\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n\tremove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\tadd_filter( 'use_default_gallery_style', '__return_false' );\n\tadd_filter( 'emoji_svg_url', '__return_false' );\n\n\tglobal $wp_widget_factory;\n\n\tif ( isset( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'] ) ) {\n\t\tremove_action( 'wp_head',\n\t\t [ $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ] );\n\t}\n\n\tif ( ! class_exists( 'WPSEO_Frontend' ) ) {\n\t\tremove_action( 'wp_head', 'rel_canonical' );\n\t\tadd_action( 'wp_head', __NAMESPACE__ . '\\\\rel_canonical' );\n\t}\n}", "function filterHTMLTags( $text )\n{\n $text = preg_replace(\n array(\n // Remove invisible content\n '@<head[^>]*?>.*?</head>@siu',\n '@<style[^>]*?>.*?</style>@siu',\n '@<script[^>]*?.*?</script>@siu',\n '@<object[^>]*?.*?</object>@siu',\n '@<embed[^>]*?.*?</embed>@siu',\n '@<applet[^>]*?.*?</applet>@siu',\n '@<noframes[^>]*?.*?</noframes>@siu',\n '@<noscript[^>]*?.*?</noscript>@siu',\n '@<noembed[^>]*?.*?</noembed>@siu',\n // Add line breaks before and after blocks\n '@</?((address)|(blockquote)|(center)|(del))@iu',\n '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',\n '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu',\n '@</?((table)|(th)|(td)|(caption))@iu',\n '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu',\n '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',\n '@</?((frameset)|(frame)|(iframe))@iu',\n ),\n array(\n ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',\n \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\", \"\\n\\$0\",\n \"\\n\\$0\", \"\\n\\$0\",\n ),\n $text );\n return strip_tags( $text );\n}", "protected function _from_cdata($data)\n\t{\n\t\t// Get the HTML translation table and reverse it\n\t\t$trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES));\n\n\t\t// Translate all the entities out.\n\t\t$data = preg_replace_callback('~&#(\\d{1,4});~', function ($match) {\n\t\t\treturn $this->_from_cdata_callback($match);\n\t\t}, $data);\n\t\t$data = strtr($data, $trans_tbl);\n\n\t\treturn $this->trim ? trim($data) : $data;\n\t}", "public function uncut($str)\n {\n return str_replace('&#8203;', '', str_replace('​', '', $str) );\n }", "function phpTrafficA_cleanText($text) {\n$text = str_replace(\"&\", \"&amp;\", $text);\n$text = str_replace(\"\\'\", \"&#39;\", $text);\n$text = str_replace(\"'\", \"&#39;\", $text);\n$text = str_replace(\"\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\\\"\", \"&#34;\", $text);\n$text = str_replace(\"\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\\\\\\\\", \"&#92;\", $text);\n$text = str_replace(\"\\n\", \"\", $text);\n$text = str_replace(\"\\r\", \"\", $text);\n$text = str_replace(\"<\", \"&#060;\", $text);\n$text = str_replace(\">\", \"&#062;\", $text);\nreturn $text;\n}", "function tidyClean() \n { \n if(!class_exists('tidy')){ \n if(function_exists('tidy_parse_string')){ \n tidy_set_encoding(\"{$this->_options[\"Encoding\"]}\"); \n foreach($this->_tidy_config as $k => $v) { \n tidy_setopt($k, $v); \n } \n tidy_parse_string($this->_html); \n tidy_clean_repair(); \n $this->_html = tidy_get_output(); \n } \n else { \n error_log(\"Tidy is not supported on this platform. Basic Cleaning is applied.\"); \n } \n } \n else { \n $tidy = new tidy; \n $tidy -> parseString($this->_html, $this->_tidy_config, \"{$this->_options[\"Encoding\"]}\"); \n $tidy -> cleanRepair(); \n $this -> html = $tidy; \n } \n }", "function string_prepare_header( $p_string ) {\r\n\t$t_string = $p_string;\r\n\r\n\t$t_truncate_pos = strpos($p_string, \"\\n\");\r\n\tif ($t_truncate_pos !== false ) {\r\n\t\t$t_string = substr($t_string, 0, $t_truncate_pos);\r\n\t}\r\n\r\n\t$t_truncate_pos = strpos($p_string, \"\\r\");\r\n\tif ($t_truncate_pos !== false ) {\r\n\t\t$t_string = substr($t_string, 0, $t_truncate_pos);\r\n\t}\r\n\r\n\treturn $t_string;\r\n}", "function convFromOutputCharset($str,$pagecodeto='UTF-8')\n\t{\n\t\tglobal $conf;\n\t\tif ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);\n\t\tif ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str);\n\t\treturn $str;\n\t}", "private static function getHtmlHead ($text) {\r\n\t\t/* strip everything before <head> */\r\n\t\t$start_pos\t= stripos($text, '<head');\r\n\t\tif ($start_pos !== false) {\r\n\t\t\t$start_pos\t+= strlen('<head');\r\n\t\t\t$end_pos\t= stripos($text, '>', $start_pos);\r\n\t\t\t$end_pos\t+= strlen('>');\r\n\t\r\n\t\t\t$text = substr($text, $end_pos);\r\n\t\t}\r\n\t\r\n\t\t/* strip everything after </head> */\r\n\t\t$end_pos\t= stripos($text, '</head');\r\n\t\tif ($end_pos !== false) {\r\n\t\t\t$text = trim(substr($text, 0, $end_pos));\r\n\t\t}\r\n\t\treturn $text;\r\n\t}", "function get_html_pre_page_end();", "function comcode_text_to_tempcode($comcode,$source_member,$as_admin,$wrap_pos,$pass_id,$connection,$semiparse_mode,$preparse_mode,$is_all_semihtml,$structure_sweep,$check_only,$highlight_bits=NULL,$on_behalf_of_member=NULL)\n{\n\tglobal $ADVERTISING_BANNERS,$ALLOWED_ENTITIES,$POTENTIALLY_EMPTY_TAGS,$CODE_TAGS,$REVERSABLE_TAGS,$PUREHTML_TAGS,$DANGEROUS_TAGS,$VALID_COMCODE_TAGS,$BLOCK_TAGS,$POTENTIAL_JS_NAUGHTY_ARRAY,$TEXTUAL_TAGS,$LEET_FILTER,$IMPORTED_CUSTOM_COMCODE,$REPLACE_TARGETS;\n\n\t$wml=false; // removed feature from ocPortal now\n\t$print_mode=get_param_integer('wide_print',0)==1;\n\n\t$len=strlen($comcode);\n\n\tif ((function_exists('set_time_limit')) && (ini_get('max_execution_time')!='0')) @set_time_limit(300);\n\n\t$allowed_html_seqs=array('<table>','<table class=\"[^\"]*\">','<table class=\"[^\"]*\" summary=\"[^\"]*\">','<table summary=\"[^\"]*\">','</table>','<tr>','</tr>','<td>','</td>','<th>','</th>','<pre>','</pre>','<br />','<br/>','<br >','<br>','<p>','</p>','<p />','<b>','</b>','<u>','</u>','<i>','</i>','<em>','</em>','<strong>','</strong>','<li>','</li>','<ul>','</ul>','<ol>','</ol>','<del>','</del>','<dir>','</dir>','<s>','</s>','</a>','</font>','<!--','<h1 id=\"main_page_title\">','<h1 class=\"main_page_title\">','<h1 id=\"main_page_title\" class=\"main_page_title\">','</h1>','<img (class=\"inline_image\" )?alt=\"[^\"]*\" src=\"[^\"]*\" (complete=\"true\" )*/>','<img src=[\"\\'][^\"\\'<>]*[\"\\']( border=[\"\\'][^\"\\'<>]*[\"\\'])?( alt=[\"\\'][^\"\\'<>]*[\"\\'])?( )?(/)?'.'>','<a href=[\"\\'][^\"\\'<>]*[\"\\']( target=[\"\\'][^\"\\'<>]*[\"\\'])?'.'>'); // HTML tag may actually be used in very limited conditions: only the following HTML seqs will come out as HTML. This is, unless the blacklist filter is used instead.\n\tif ($as_admin)\n\t{\n\t\t$comcode_dangerous=true;\n\t\t$comcode_dangerous_html=true;\n\t} else\n\t{\n\t\t$comcode_dangerous=($GLOBALS['MICRO_BOOTUP']==0) && (has_specific_permission($source_member,'comcode_dangerous'));\n\t\t$comcode_dangerous_html=false;\n\t\tif ((has_specific_permission($source_member,'allow_html')) && (($is_all_semihtml) || (strpos($comcode,'[html')!==false) || (strpos($comcode,'[semihtml')!==false)))\n\t\t{\n\t\t\t$comcode_dangerous_html=true;\n\t\t\t/*foreach (array_keys($POTENTIALLY_EMPTY_TAGS) as $tag) // Find whether we really need to enable the computational-expensive filtering. Code disabled, not sure why this would have ever worked!\n\t\t\t{\n\t\t\t\tif (($tag!='html') && ($tag!='semihtml') && (strpos($comcode,'['.$tag)!==false))\n\t\t\t\t{\n\t\t\t\t\t$comcode_dangerous_html=false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}*/\n\t\t}\n\t}\n\tif (is_null($pass_id)) $pass_id=strval(mt_rand(0,32000)); // This is a unique ID that refers to this specific piece of comcode\n\tglobal $COMCODE_ATTACHMENTS;\n\tif (!array_key_exists($pass_id,$COMCODE_ATTACHMENTS)) $COMCODE_ATTACHMENTS[$pass_id]=array();\n\n\t// Tag level\n\t$current_tag='';\n\t$attribute_map=array();\n\t$tag_output=new ocp_tempcode();\n\t$continuation='';\n\t$close=mixed();\n\n\t// Properties that come from our tag\n\t$white_space_area=true;\n\t$textual_area=true;\n\t$formatting_allowed=true;\n\t$in_html=false;\n\t$in_semihtml=$is_all_semihtml;\n\t$in_separate_parse_section=false; // Not escaped because it has to be passed to a secondary filter\n\t$in_code_tag=false;\n\t$code_nest_stack=0;\n\n\t// Our state\n\t$status=CCP_NO_MANS_LAND;\n\t$lax=$GLOBALS['LAX_COMCODE'] || function_exists('get_member') && $source_member!=get_member() || count($_POST)==0; // if we don't want to produce errors for technically invalid Comcode\n\t$tag_stack=array();\n\t$pos=0;\n\t$line_starting=true;\n\t$just_ended=false;\n\t$none_wrap_length=0;\n\t$just_new_line=true; // So we can detect lists starting right away\n\t$just_title=false;\n\tglobal $NUM_LINES;\n\t$NUM_LINES=0;\n\t$queued_tempcode=new ocp_tempcode();\n\t$mindless_mode=false; // If we're doing a semi parse mode and going over a tag we don't actually process\n\t$tag_raw='';\n\n\tif ((!is_null($wrap_pos)) && (strtolower(get_charset())=='utf-8'))\n\t\t$wrap_pos*=2;\n\n\t$b_all=(get_option('admin_banners',true)==='1');\n\n\t$stupidity_mode=get_value('stupidity_mode'); // bork or leet\n\tif ($comcode_dangerous) $stupidity_mode=get_param('stupidity_mode','');\n\tif ($stupidity_mode=='leet')\n\t{\n\t\t$LEET_FILTER=array(\n\t\t'B'=>'8',\n\t\t'C'=>'(',\n\t\t'E'=>'3',\n\t\t'G'=>'9',\n\t\t'I'=>'1',\n\t\t'L'=>'1',\n\t\t'O'=>'0',\n\t\t'P'=>'9',\n\t\t'S'=>'5',\n\t\t'U'=>'0',\n\t\t'V'=>'\\/',\n\t\t'Z'=>'2'\n\t\t);\n\t}\n\n\t$smilies=$GLOBALS['FORUM_DRIVER']->find_emoticons(); // We'll be needing the smiley array\n\t$shortcuts=array('(EUR-)'=>'&euro;','{f.}'=>'&fnof;','-|-'=>'&dagger;','=|='=>'&Dagger;','{%o}'=>'&permil;','{~S}'=>'&Scaron;','{~Z}'=>'&#x17D;','(TM)'=>'&trade;','{~s}'=>'&scaron;','{~z}'=>'&#x17E;','{.Y.}'=>'&Yuml;','(c)'=>'&copy;','(r)'=>'&reg;','---'=>'&mdash;','--'=>'&ndash;','...'=>'&hellip;','-->'=>'&rarr;','<--'=>'&larr;');\n\n\t// Text syntax possibilities, that get maintained as our cursor moves through the text block\n\t$list_indent=0;\n\t$list_type='ul';\n\n\tif ($is_all_semihtml) filter_html($as_admin,$source_member,$pos,$len,$comcode,false,false); // Pre-filter the whole lot (note that this means during general output we do no additional filtering)\n\n\twhile ($pos<$len)\n\t{\n\t\t$next=$comcode[$pos];\n\t\t++$pos;\n\n\t\t// State machine\n\t\tswitch ($status)\n\t\t{\n\t\t\tcase CCP_NO_MANS_LAND:\n\t\t\t\tif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\t// Look ahead to make sure it's a valid tag. If it's not then it's considered normal user input, not a tag at all\n\t\t\t\t\t$dif=(($pos<$len) && ($comcode[$pos]=='/'))?1:0;\n\t\t\t\t\t$ahead=substr($comcode,$pos+$dif,MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH);\n\t\t\t\t\t$equal_pos=strpos($ahead,'=');\n\t\t\t\t\t$space_pos=strpos($ahead,' ');\n\t\t\t\t\t$end_pos=strpos($ahead,']');\n\t\t\t\t\t$lax_end_pos=strpos($ahead,'[');\n\t\t\t\t\t$cl_pos=strpos($ahead,chr(10));\n\t\t\t\t\tif ($equal_pos===false) $equal_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($space_pos===false) $space_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($end_pos===false) $end_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($lax_end_pos===false) $lax_end_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\tif ($cl_pos===false) $cl_pos=MAX_COMCODE_TAG_LOOK_AHEAD_LENGTH+3;\n\t\t\t\t\t$use_pos=min($equal_pos,$space_pos,$end_pos,$lax_end_pos,$cl_pos);\n\n\t\t\t\t\t$potential_tag=strtolower(substr($ahead,0,$use_pos));\n\t\t\t\t\tif (($use_pos!=22) && ((!$in_semihtml) || ($dif==1) || (($potential_tag!='html') && ($potential_tag!='semihtml'))) && ((!$in_html) || (($dif==1) && ($potential_tag=='html'))) && ((!$in_code_tag) || ((isset($CODE_TAGS[$potential_tag])) && ($potential_tag==$current_tag))) && ((!$structure_sweep) || ($potential_tag!='contents')))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($in_code_tag)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($dif==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$code_nest_stack--;\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$code_nest_stack++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$ok=($code_nest_stack==-1);\n\t\t\t\t\t\t} else $ok=true;\n\n\t\t\t\t\t\tif ($ok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!isset($VALID_COMCODE_TAGS[$potential_tag]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!$IMPORTED_CUSTOM_COMCODE)\n\t\t\t\t\t\t\t\t\t_custom_comcode_import($connection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ((isset($VALID_COMCODE_TAGS[$potential_tag])) && (strtolower(substr($ahead,0,2))!='i ')) // The \"i\" bit is just there to block a common annoyance: [i] doesn't take parameters and we don't want \"[i think]\" (for example) being parsed.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($comcode[$pos]!='/') || (count($tag_stack)==0))\n\t\t\t\t\t\t\t\t\t$mindless_mode=($semiparse_mode) && /*(!isset($CODE_TAGS[$potential_tag])) && */((!isset($REVERSABLE_TAGS[$potential_tag])) || ((is_string($REVERSABLE_TAGS[$potential_tag])) && (preg_match($REVERSABLE_TAGS[$potential_tag],substr($comcode,$pos,100))!=0))) && (!isset($PUREHTML_TAGS[$potential_tag]));\n\t\t\t\t\t\t\t\telse $mindless_mode=$tag_stack[count($tag_stack)-1][7];\n\n\t\t\t\t\t\t\t\t$close=false;\n\t\t\t\t\t\t\t\t$current_tag='';\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\tif ((/*(($potential_tag=='html') || ($potential_tag=='semihtml')) && */($just_new_line)) || (isset($BLOCK_TAGS[$potential_tag])))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$status=CCP_STARTING_TAG;\n\t\t\t\t\t\t\t\tif ($mindless_mode)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($comcode[$pos]!='/')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (array_key_exists($potential_tag,$BLOCK_TAGS))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_raw='&#8203;<kbd title=\"'.escape_html($potential_tag).'\" class=\"ocp_keep_block\">[';\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_raw='&#8203;<kbd title=\"'.escape_html($potential_tag).'\" class=\"ocp_keep\">[';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$tag_raw='[';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tag_raw='';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif (($use_pos!=22) && ((($in_semihtml) || ($in_html)) && (($potential_tag=='html') || ($potential_tag=='semihtml'))) && (!$in_code_tag))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ahc=strpos($ahead,']');\n\t\t\t\t\t\t\tif ($ahc!==false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$pos+=$ahc+1;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((($in_html) || ((($in_semihtml) && (!$in_code_tag)) && (($next=='<') || ($next=='>') || ($next=='\"')))))\n\t\t\t\t{\n\t\t\t\t\tif ($next==chr(10)) ++$NUM_LINES;\n\n\t\t\t\t\tif ((!$comcode_dangerous_html) && ($next=='<')) // Special filtering required\n\t\t\t\t\t{\n\t\t\t\t\t\t$close=strpos($comcode,'>',$pos-1);\n\t\t\t\t\t\t$portion=substr($comcode,$pos-1,$close-$pos+2);\n\t\t\t\t\t\t$seq_ok=false;\n\t\t\t\t\t\tforeach ($allowed_html_seqs as $allowed_html_seq)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (preg_match('#^'.$allowed_html_seq.'$#',$portion)!=0) $seq_ok=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$seq_ok)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// $next='&lt;'; //OLD STYLE\n\t\t\t\t\t\t\tif ($close!==false) $pos=$close+1; // NEW STYLE\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (substr($comcode,$pos-1,4)=='<!--') // To stop shortcut interpretation\n\t\t\t\t\t{\n\t\t\t\t\t\t$continuation.='<!--';\n\t\t\t\t\t\t$pos+=3;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$continuation.=($mindless_mode && $in_code_tag)?escape_html($next):$next;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse // Not in HTML\n\t\t\t\t{\n\t\t\t\t\t// Text-format possibilities\n\t\t\t\t\tif (($just_new_line) && ($formatting_allowed) && (!$wml))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($continuation!='')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// List\n\t\t\t\t\t\t$found_list=false;\n\t\t\t\t\t\t$old_list_indent=$list_indent;\n\t\t\t\t\t\tif (($pos+2<$len) && (is_numeric($next)) && (((is_numeric($comcode[$pos])) && ($comcode[$pos+1]==')') && ($comcode[$pos+2]==' ')) || (($comcode[$pos]==')') && ($comcode[$pos+1]==' '))) && ((($list_type=='1') && ($list_indent!=0)) || (preg_match('#^[^\\n]*\\n\\d+\\) #',substr($comcode,$pos+1))!=0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($list_indent!=0) && ($list_type!='1'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$list_indent=1;\n\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t$list_type='1';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($pos+2<$len) && (ord($next)>=ord('a')) && (ord($next)<=ord('z')) && ($comcode[$pos]==')') && ($comcode[$pos+1]==' ') && ((($list_type=='a') && ($list_indent!=0)) || (preg_match('#^[^\\n]*\\n[a-z]+\\) #',substr($comcode,$pos+1))!=0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($list_indent!=0) && ($list_type!='a'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$list_indent=1;\n\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t$list_type='a';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($next==' ')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($old_list_indent!=0) && ($list_type!='ul'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlist($temp_tpl,$old_list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$scan_pos=$pos-1;\n\t\t\t\t\t\t\t$list_indent=0;\n\t\t\t\t\t\t\twhile ($scan_pos<$len)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$scan_next=$comcode[$scan_pos];\n\t\t\t\t\t\t\t\tif (($scan_next=='-') && ($scan_pos+1<$len) && ($comcode[$scan_pos+1]==' '))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$found_list=true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($scan_next==' ') ++$list_indent; else break;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t++$scan_pos;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!$found_list) $list_indent=0; else $list_type='ul';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Rule?\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t\t$old_list_indent=0;\n\n\t\t\t\t\t\t\tif (($next=='-') && (!$just_title))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$scan_pos=$pos;\n\t\t\t\t\t\t\t\t$found_rule=true;\n\t\t\t\t\t\t\t\twhile ($scan_pos<$len)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$scan_next=$comcode[$scan_pos];\n\t\t\t\t\t\t\t\t\tif ($scan_next!='-')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($scan_next==chr(10))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t++$NUM_LINES;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t} else $found_rule=false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t++$scan_pos;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($found_rule)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$_temp_tpl=do_template('COMCODE_TEXTCODE_LINE');\n\t\t\t\t\t\t\t\t\t$tag_output->attach($_temp_tpl);\n\t\t\t\t\t\t\t\t\t$pos=$scan_pos+1;\n\t\t\t\t\t\t\t\t\t$just_ended=true;\n\t\t\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t\t\tcontinue;\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// List handling\n\t\t\t\t\t\tif (($list_indent==$old_list_indent) && ($old_list_indent!=0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor ($i=$list_indent;$i<$old_list_indent;++$i) // Close any ended\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t$temp_tpl=($list_type=='ul')?'</ul>':'</ol>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (($list_indent<$old_list_indent) && ($list_indent!=0)) // Go down one final level, because the list tag must have been nested within an li tag (we closed open li tags recursively except for the final one)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='</li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($found_list)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((($list_indent-$old_list_indent)>1) && (!$lax))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_LIST_JUMPYNESS'),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor ($i=$old_list_indent;$i<$list_indent;++$i) // Or open any started\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tswitch ($list_type)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tcase 'ul':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ul><li>'; else $temp_tpl='<ul>';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase '1':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ol type=\"1\"><li>'; else $temp_tpl='<ol type=\"1\">';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 'a':\n\t\t\t\t\t\t\t\t\t\tif ($i<$list_indent-1) $temp_tpl='<ol type=\"a\"><li>'; else $temp_tpl='<ol type=\"a\">';\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$temp_tpl='<li>';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t$just_ended=true;\n\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t$next='';\n\t\t\t\t\t\t\t$pos=$scan_pos+2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (($next==chr(10)) && ($white_space_area) && ($print_mode) && ($list_indent==0)) // We might need to put some queued up stuff here: when we print, we can't float thumbnails\n\t\t\t\t\t{\n\t\t\t\t\t\t$tag_output->attach($queued_tempcode);\n\t\t\t\t\t\t$queued_tempcode=new ocp_tempcode();\n\t\t\t\t\t}\n\t\t\t\t\tif (($next==chr(10)) && ($white_space_area) && (!$in_semihtml) && ((!$just_ended) || ($semiparse_mode) || (substr($comcode,$pos,3)==' - '))) // Hard-new-lines\n\t\t\t\t\t{\n\t\t\t\t\t\t++$NUM_LINES;\n\t\t\t\t\t\t$line_starting=true;\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t$just_new_line=true;\n\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\tif (($list_indent==0) && (!$just_ended))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$temp_tpl='<br />';\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\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$just_new_line=false;\n\n\t\t\t\t\t\tif (($next==' ') && ($white_space_area) && (!$in_semihtml))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($line_starting) || (($pos>1) && ($comcode[$pos-2]==' '))) // Hard spaces\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$next='&nbsp;';\n\t\t\t\t\t\t\t\t++$none_wrap_length;\n\t\t\t\t\t\t\t} else $none_wrap_length=0;\n\t\t\t\t\t\t\t$continuation.=($mindless_mode && $in_code_tag)?escape_html($next):$next;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (($next==\"\\t\") && ($white_space_area) && (!$in_semihtml))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t$tab_tpl=do_template('COMCODE_TEXTCODE_TAB');\n\t\t\t\t\t\t\t$_tab_tpl=$tab_tpl->evaluate();\n\t\t\t\t\t\t\t$none_wrap_length+=strlen($_tab_tpl);\n\t\t\t\t\t\t\t$tag_output->attach($tab_tpl);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($next==' ') || ($next==\"\\t\") || ($just_ended)) $none_wrap_length=0; else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ((!is_null($wrap_pos)) && ($none_wrap_length>=$wrap_pos) && ((strtolower(get_charset())!='utf-8') || (preg_replace(array('#[\\x09\\x0A\\x0D\\x20-\\x7E]#','#[\\xC2-\\xDF][\\x80-\\xBF]#','#\\xE0[\\xA0-\\xBF][\\x80-\\xBF]#','#[\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2}#','#\\xED[\\x80-\\x9F][\\x80-\\xBF]#','#\\xF0[\\x90-\\xBF][\\x80-\\xBF]{2}#','#[\\xF1-\\xF3][\\x80-\\xBF]{3}#','#\\xF4[\\x80-\\x8F][\\x80-\\xBF]{2}#'),array('','','','','','','',''),$continuation)=='')) && ($textual_area) && (!$in_semihtml))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t$temp_tpl='<br />';\n\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t\t\t\t\t$none_wrap_length=0;\n\t\t\t\t\t\t\t\t} elseif ($textual_area) ++$none_wrap_length;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$line_starting=false;\n\t\t\t\t\t\t\t$just_ended=false;\n\n\t\t\t\t\t\t\t$differented=false; // If somehow via lookahead we've changed this to HTML and thus won't use it in raw form\n\n\t\t\t\t\t\t\t// Variable lookahead\n\t\t\t\t\t\t\tif ((!$in_code_tag) && (($next=='{') && (isset($comcode[$pos])) && (($comcode[$pos]=='$') || ($comcode[$pos]=='+') || ($comcode[$pos]=='!'))))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($comcode_dangerous)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ((!$in_code_tag) && ((!$semiparse_mode) || (in_tag_stack($tag_stack,array('url','img','flash')))))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\tif ($comcode[$pos]=='+')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_end=$pos+5;\n\t\t\t\t\t\t\t\t\t\t\twhile ($p_end<$len)\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$p_portion=substr($comcode,$pos-1,$p_end-($pos-1)+5);\n\t\t\t\t\t\t\t\t\t\t\t\tif (substr_count($p_portion,'{+START')==substr_count($p_portion,'{+END')) break;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_end++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$p_len=1;\n\t\t\t\t\t\t\t\t\t\t\twhile ($pos+$p_len<$len)\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$p_portion=substr($comcode,$pos-1,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t\tif (substr_count(str_replace('{',' { ',$p_portion),'{')==substr_count(str_replace('}',' } ',$p_portion),'}')) break; // str_replace is to workaround a Quercus bug #4494\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$p_len--;\n\t\t\t\t\t\t\t\t\t\t\t$p_portion=substr($comcode,$pos+$p_len,$p_end-($pos+$p_len));\n\t\t\t\t\t\t\t\t\t\t\trequire_code('tempcode_compiler');\n\t\t\t\t\t\t\t\t\t\t\t$ret=template_to_tempcode(substr($comcode,$pos-1,$p_len+1).'{DIRECTIVE_EMBEDMENT}'.substr($comcode,$p_end,6));\n\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t$ret->singular_bind('DIRECTIVE_EMBEDMENT',comcode_text_to_tempcode($p_portion,$source_member,$as_admin,$wrap_pos,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\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$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=$pos+$p_len;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_end+6;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif ($comcode[$pos]=='!')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_len=$pos;\n\t\t\t\t\t\t\t\t\t\t\t$balance=1;\n\t\t\t\t\t\t\t\t\t\t\twhile (($p_len<$len) && ($balance!=0))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($comcode[$p_len]=='{') $balance++; elseif ($comcode[$p_len]=='}') $balance--;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$ret=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$less_pos=$pos-1;\n\t\t\t\t\t\t\t\t\t\t\t$ret->parse_from($comcode,$less_pos,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_len;\n\t\t\t\t\t\t\t\t\t\t\tif (($ret->parameterless(0)) && ($pos<$len)) // We want to take the lang string reference as Comcode if it's a simple lang string reference with no parameters\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$matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#\\{\\!([\\w\\d\\_\\:]+)(\\}|$)#U',substr($comcode,$less_pos,$p_len-$less_pos),$matches)!=0) // Hacky code to extract the lang string name\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$temp_lang_string=$matches[1];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ret=comcode_lang_string($temp_lang_string); // Recreate as a Comcode lang string\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$p_len=$pos;\n\t\t\t\t\t\t\t\t\t\t\t$balance=1;\n\t\t\t\t\t\t\t\t\t\t\twhile (($p_len<$len) && ($balance!=0))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($comcode[$p_len]=='{') $balance++; elseif ($comcode[$p_len]=='}') $balance--;\n\t\t\t\t\t\t\t\t\t\t\t\t$p_len++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$ret=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$less_pos=$pos-1;\n\t\t\t\t\t\t\t\t\t\t\t$ret->parse_from($comcode,$less_pos,$p_len);\n\t\t\t\t\t\t\t\t\t\t\t$pos=$p_len;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\tif (($pos<=$len) || (!$lax))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($ret);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($comcode[$pos]=='$') && ($pos<$len-2) && ($comcode[$pos+1]==',') && (strpos($comcode,'}',$pos)!==false))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$pos=strpos($comcode,'}',$pos)+1;\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Escaping of comcode tag starts lookahead\n\t\t\t\t\t\t\tif (($next=='\\\\') && (!$in_code_tag)) // We are changing \\[ to [ with the side-effect of blocking a tag start. To get \\[ literal, we need the symbols \\\\[... and add extra \\-pairs as needed. We are only dealing with \\ and [ (update: and now {) here, it's not a further extended means of escaping.\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($pos!=$len) && (($comcode[$pos]=='\"') || (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\tif ($comcode[$pos]=='\"')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.=$mindless_mode?'&quot;':'\"';\n\t\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.='&quot;';\n\t\t\t\t\t\t\t\t\t\t$pos+=6;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos!=$len) && ($comcode[$pos]=='['))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='[';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos!=$len) && ($comcode[$pos]=='{'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='{';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telseif (($pos==$len) || ($comcode[$pos]=='\\\\'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($semiparse_mode) $continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t$continuation.='\\\\';\n\t\t\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t\t\t\t$differented=true;\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 (!$differented)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ((($textual_area) || ($in_semihtml)) && (trim($next)!='') && (!$wml))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Emoticon lookahead\n\t\t\t\t\t\t\t\t\tforeach ($smilies as $smiley=>$imgcode)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ($in_semihtml) $smiley=' '.$smiley.' ';\n\n\t\t\t\t\t\t\t\t\t\tif ($next==$smiley[0]) // optimisation\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (substr($comcode,$pos-1,strlen($smiley))==$smiley)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($smiley)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_emoticon($imgcode));\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ((trim($next)!='') && (!$in_code_tag) && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// CEDI pages\n\t\t\t\t\t\t\t\tif (($pos<$len) && ($next=='[') && ($pos+1<$len) && ($comcode[$pos]=='[') && (!$semiparse_mode) && (addon_installed('cedi')))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\tif (preg_match('#^\\[([^\\[\\]]*)\\]\\]#',substr($comcode,$pos,200),$matches)!=0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$cedi_page_name=$matches[1];\n\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t$hash_pos=strpos($cedi_page_name,'#');\n\t\t\t\t\t\t\t\t\t\tif ($hash_pos!==false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$jump_to=substr($cedi_page_name,$hash_pos+1);\n\t\t\t\t\t\t\t\t\t\t\t$cedi_page_name=substr($cedi_page_name,0,$hash_pos);\n\t\t\t\t\t\t\t\t\t\t} else $jump_to='';\n\t\t\t\t\t\t\t\t\t\t$cedi_page_url=build_url(array('page'=>'cedi','type'=>'misc','find'=>$cedi_page_name),get_module_zone('cedi'));\n\t\t\t\t\t\t\t\t\t\tif ($jump_to!='')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$cedi_page_url->attach('#'.$jump_to);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_CEDI_LINK',array('_GUID'=>'ebcd7ba5290c5b2513272a53b4d666e5','URL'=>$cedi_page_url,'TEXT'=>$cedi_page_name)));\n\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[1])+3;\n\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Usernames\n\t\t\t\t\t\t\t\tif (($pos<$len) && ($next=='{') && ($pos+1<$len) && ($comcode[$pos]=='{') && (!$in_code_tag) && (!$semiparse_mode))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\tif (preg_match('#^\\{([^\"{}&\\'\\$<>]+)\\}\\}#',substr($comcode,$pos,80),$matches)!=0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$username=$matches[1];\n\n\t\t\t\t\t\t\t\t\t\tif ($username[0]=='?')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$username_info=true;\n\t\t\t\t\t\t\t\t\t\t\t$username=substr($username,1);\n\t\t\t\t\t\t\t\t\t\t} else $username_info=false;\n\t\t\t\t\t\t\t\t\t\t$this_member_id=$GLOBALS['FORUM_DRIVER']->get_member_from_username($username);\n\t\t\t\t\t\t\t\t\t\tif ((!is_null($this_member_id)) && (!is_guest($this_member_id)))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\n\t\t\t\t\t\t\t\t\t\t\t$poster_url=$GLOBALS['FORUM_DRIVER']->member_profile_url($this_member_id,false,true);\n\t\t\t\t\t\t\t\t\t\t\tif ((get_forum_type()=='ocf') && ($username_info))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\trequire_lang('ocf');\n\t\t\t\t\t\t\t\t\t\t\t\trequire_code('ocf_members2');\n\t\t\t\t\t\t\t\t\t\t\t\t$details=ocf_show_member_box($this_member_id);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('HYPERLINK_TOOLTIP',array('_GUID'=>'d8f4f4ac70bd52b3ef9ee74ae9c5e085','TOOLTIP'=>$details,'CAPTION'=>$username,'URL'=>$poster_url,'NEW_WINDOW'=>false)));\n\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(hyperlink($poster_url,$username));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[1])+3;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (($textual_area) && (!$in_code_tag) && (trim($next)!='') && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Shortcut lookahead\n\t\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($in_semihtml) && (substr($comcode,$pos-1,3)=='-->')) // To stop shortcut interpretation\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.='-->';\n\t\t\t\t\t\t\t\t\t\t$pos+=2;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tforeach ($shortcuts as $code=>$replacement)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (($next==$code[0]) && (substr($comcode,$pos-1,strlen($code))==$code))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($code)-1;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($replacement);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($replacement);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (($textual_area) && (!$in_code_tag) && (trim($next)!='') && (!$differented))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Table syntax\n\t\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($pos<$len) && ($comcode[$pos]=='|'))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$end_tbl=strpos($comcode,chr(10).'|}',$pos);\n\t\t\t\t\t\t\t\t\t\tif ($end_tbl!==false)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$end_fst_line_pos=strpos($comcode,chr(10),$pos);\n\t\t\t\t\t\t\t\t\t\t\t$caption=substr($comcode,$pos+2,max($end_fst_line_pos-$pos-2,0));\n\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($caption)+1;\n\n\t\t\t\t\t\t\t\t\t\t\t$rows=preg_split('#(\\|-|\\|\\})#Um',substr($comcode,$pos,$end_tbl-$pos));\n\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)floats($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$caption=preg_replace('#(^|\\s)floats($|\\s)#','',$caption);\n\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios=array();\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios_matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)([\\d\\.]+%(:[\\d\\.]+%)*)($|\\s)#',$caption,$ratios_matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ratios=explode(':',$ratios_matches[2]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$caption=str_replace($ratios_matches[0],'',$caption);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $h=>$row)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($h!=0) $tag_output->attach(do_template('BLOCK_SEPARATOR'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cells=preg_split('/(\\n\\! | \\!\\! |\\n\\| | \\|\\| )/',$row,-1,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray_shift($cells); // First one is non-existant empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$num_cells_in_row=count($cells)/2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$inter_padding=3.0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$total_box_width=(100.0-$inter_padding*($num_cells_in_row-1));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Find which to float\n\t\t\t\t\t\t\t\t\t\t\t\t\t$to_float=NULL;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!$spec)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((strpos($cell,'!')!==false) || (is_null($to_float))) $to_float=$i;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=!$spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WRAP_START'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Do floated one\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i_dir_1=(($to_float==1)?'left':'right');\n\t\t\t\t\t\t\t\t\t\t\t\t\t$i_dir_2=(($to_float!=1)?'left':'right');\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($num_cells_in_row===1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount='0';\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount=float_to_raw_string($inter_padding,2);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=($to_float===1)?0:(count($cells)-1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (array_key_exists($cell_i,$ratios))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=$ratios[$cell_i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=float_to_raw_string($total_box_width/$num_cells_in_row,2).'%';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WIDE_START',array('_GUID'=>'ced8c3a142f74296a464b085ba6891c9','WIDTH'=>$width,'FLOAT'=>$i_dir_1,'PADDING'=>($to_float==1)?'':'-left','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_START',array('_GUID'=>'90be72fcbb6b9d8a312da0bee5b86cb3','WIDTH'=>array_key_exists($to_float,$ratios)?$ratios[$to_float]:'','FLOAT'=>$i_dir_1,'PADDING'=>($to_float==1)?'':'-left','PADDING_AMOUNT'=>$padding_amount)));\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(comcode_text_to_tempcode(isset($cells[$to_float])?rtrim($cells[$to_float]):'',$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cells[$to_float],$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t// Do non-floated ones\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($i%2==1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($i!=$to_float)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$padding_amount=float_to_raw_string($inter_padding,2);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (array_key_exists($cell_i,$ratios))\n\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\t\t$width=$ratios[$cell_i];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$width=float_to_raw_string($total_box_width/$num_cells_in_row,2).'%';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\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\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WIDE2_START',array('_GUID'=>'9bac42a1b62c5c9a2f758639fcb3bb2f','WIDTH'=>$width,'PADDING_AMOUNT'=>$padding_amount,'FLOAT'=>$i_dir_1,'PADDING'=>(($to_float==1)||($cell_i!=0))?'-left':'')));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_2_START',array('_GUID'=>'0f15f9d5554635ed7ac154c9dc5c72b8','WIDTH'=>array_key_exists($cell_i,$ratios)?$ratios[$cell_i]:'','FLOAT'=>$i_dir_1,'PADDING'=>(($to_float==1)||($cell_i!=0))?'-left':'','PADDING_AMOUNT'=>$padding_amount)));\n\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\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(comcode_text_to_tempcode(rtrim($cell),$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\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\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cell,$pos);\n\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\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_FAKE_TABLE_WRAP_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else\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$ratios=array();\n\t\t\t\t\t\t\t\t\t\t\t\t$ratios_matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)([\\d\\.]+%(:[\\d\\.]+%)*)($|\\s)#',$caption,$ratios_matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ratios=explode(':',$ratios_matches[2]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$caption=str_replace($ratios_matches[0],'',$caption);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#(^|\\s)wide($|\\s)#',$caption)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_START',array('SUMMARY'=>preg_replace('#(^|\\s)wide($|\\s)#','',$caption))));\n\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_START_SUMMARY',array('_GUID'=>'0c5674fba61ba14b4b9fa39ea31ff54f','CAPTION'=>$caption)));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $table_row)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_ROW_START'));\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cells=preg_split('/(\\n\\! | \\!\\! |\\n\\| | \\|\\| )/',$table_row,-1,PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tarray_shift($cells); // First one is non-existant empty\n\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$c_type='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($cells as $i=>$cell)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($spec)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$c_type=(strpos($cell,'!')!==false)?'th':'td';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$attaches_before=count($COMCODE_ATTACHMENTS[$pass_id]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$_mid=comcode_text_to_tempcode(rtrim($cell),$source_member,$as_admin,60,$pass_id,$connection,$semiparse_mode,$preparse_mode,$in_semihtml,$structure_sweep,$check_only,$highlight_bits,$on_behalf_of_member);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($attach_inspect=$attaches_before;$attach_inspect<count($COMCODE_ATTACHMENTS[$pass_id]);$attach_inspect++)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$COMCODE_ATTACHMENTS[$pass_id][$attach_inspect]['marker']+=strpos($comcode,$cell,$pos);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_CELL',array('_GUID'=>'6640df8b503f65e3d36f595b0acf7600','WIDTH'=>array_key_exists($cell_i,$ratios)?$ratios[$cell_i]:'','C_TYPE'=>$c_type,'MID'=>$_mid,'PADDING'=>($cell_i==0)?'':'-left','PADDING_AMOUNT'=>(count($cells)==2)?'0':float_to_raw_string(5.0/(floatval(count($cells)-2)/2.0),2))));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cell_i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$spec=!$spec;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_ROW_END'));\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach(do_template('COMCODE_REAL_TABLE_END'));\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$pos=$end_tbl+3;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Advertising\n\t\t\t\t\t\t\t\tif ((!$differented) && (!$semiparse_mode) && (!$in_code_tag) && (addon_installed('banners')) && (($b_all) || (!has_specific_permission($source_member,'banner_free'))))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// Pick up correctly, including permission filtering\n\t\t\t\t\t\t\t\t\tif (is_null($ADVERTISING_BANNERS))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ADVERTISING_BANNERS=array();\n\n\t\t\t\t\t\t\t\t\t\t$rows=$GLOBALS['SITE_DB']->query('SELECT * FROM '.get_table_prefix().'banners b LEFT JOIN '.get_table_prefix().'banner_types t ON b.b_type=t.id WHERE t_comcode_inline=1 AND '.db_string_not_equal_to('b_title_text',''),NULL,NULL,true);\n\t\t\t\t\t\t\t\t\t\tif (!is_null($rows))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Filter out what we don't have permission for\n\t\t\t\t\t\t\t\t\t\t\tif (get_option('use_banner_permissions',true)=='1')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\trequire_code('permissions');\n\t\t\t\t\t\t\t\t\t\t\t\t$groups=_get_where_clause_groups($source_member);\n\t\t\t\t\t\t\t\t\t\t\t\tif (!is_null($groups))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$perhaps=collapse_1d_complexity('category_name',$GLOBALS['SITE_DB']->query('SELECT category_name FROM '.get_table_prefix().'group_category_access WHERE '.db_string_equal_to('module_the_name','banners').' AND ('.$groups.')'));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$new_rows=array();\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $row)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (in_array($row['name'],$perhaps)) $new_rows[]=$row;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t$rows=$new_rows;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tforeach ($rows as $row)\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$trigger_text=$row['b_title_text'];\n\t\t\t\t\t\t\t\t\t\t\t\tforeach (explode(',',$trigger_text) as $t)\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (trim($t)!='') $ADVERTISING_BANNERS[trim($t)]=$row;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Apply\n\t\t\t\t\t\t\t\t\tif (!is_null($ADVERTISING_BANNERS))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($ADVERTISING_BANNERS as $ad_trigger=>$ad_bits)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (strtolower($next)==strtolower($ad_trigger[0])) // optimisation\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif (strtolower(substr($comcode,$pos-1,strlen($ad_trigger)))==strtolower($ad_trigger))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('banners');\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ad_text=show_banner($ad_bits['name'],$ad_bits['b_title_text'],get_translated_tempcode($ad_bits['caption']),$ad_bits['img_url'],'',$ad_bits['site_url'],$ad_bits['b_type']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('tooltip',array('param'=>$ad_text,'url'=>(url_is_local($ad_bits['site_url']) && ($ad_bits['site_url']!=''))?(get_custom_base_url().'/'.$ad_bits['site_url']):$ad_bits['site_url']),substr($comcode,$pos-1,strlen($ad_trigger)),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($ad_trigger)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Search highlighting lookahead\n\t\t\t\t\t\t\t\tif ((!$differented) && (!is_null($highlight_bits)))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach ($highlight_bits as $highlight_bit)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (strtolower($next)==strtolower($highlight_bit[0])) // optimisation\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (strtolower(substr($comcode,$pos-1,strlen($highlight_bit)))==strtolower($highlight_bit))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('highlight',array(),escape_html(substr($comcode,$pos-1,strlen($highlight_bit))),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($highlight_bit)-1;\n\t\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Link lookahead\n\t\t\t\t\t\t\t\tif ((!$differented) && (!$in_code_tag))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ((!$in_semihtml) && ($next=='h') && ((substr($comcode,$pos-1,strlen('http://'))=='http://') || (substr($comcode,$pos-1,strlen('https://'))=='https://') || (substr($comcode,$pos-1,strlen('ftp://'))=='ftp://')))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$link_end_pos=strpos($comcode,' ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_2=strpos($comcode,chr(10),$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_3=strpos($comcode,'[',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_4=strpos($comcode,')',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_5=strpos($comcode,'\"',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_6=strpos($comcode,'>',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_7=strpos($comcode,'<',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_8=strpos($comcode,'.'.chr(10),$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_9=strpos($comcode,', ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_10=strpos($comcode,'. ',$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_11=strpos($comcode,\"'\",$pos-1);\n\t\t\t\t\t\t\t\t\t\t$link_end_pos_12=strpos($comcode,'&nbsp;',$pos-1);\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_2!==false) && (($link_end_pos===false) || ($link_end_pos_2<$link_end_pos))) $link_end_pos=$link_end_pos_2;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_3!==false) && (($link_end_pos===false) || ($link_end_pos_3<$link_end_pos))) $link_end_pos=$link_end_pos_3;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_4!==false) && (($link_end_pos===false) || ($link_end_pos_4<$link_end_pos))) $link_end_pos=$link_end_pos_4;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_5!==false) && (($link_end_pos===false) || ($link_end_pos_5<$link_end_pos))) $link_end_pos=$link_end_pos_5;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_6!==false) && (($link_end_pos===false) || ($link_end_pos_6<$link_end_pos))) $link_end_pos=$link_end_pos_6;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_7!==false) && (($link_end_pos===false) || ($link_end_pos_7<$link_end_pos))) $link_end_pos=$link_end_pos_7;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_8!==false) && (($link_end_pos===false) || ($link_end_pos_8<$link_end_pos))) $link_end_pos=$link_end_pos_8;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_9!==false) && (($link_end_pos===false) || ($link_end_pos_9<$link_end_pos))) $link_end_pos=$link_end_pos_9;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_10!==false) && (($link_end_pos===false) || ($link_end_pos_10<$link_end_pos))) $link_end_pos=$link_end_pos_10;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_11!==false) && (($link_end_pos===false) || ($link_end_pos_11<$link_end_pos))) $link_end_pos=$link_end_pos_11;\n\t\t\t\t\t\t\t\t\t\tif (($link_end_pos_12!==false) && (($link_end_pos===false) || ($link_end_pos_12<$link_end_pos))) $link_end_pos=$link_end_pos_12;\n\t\t\t\t\t\t\t\t\t\tif ($link_end_pos===false) $link_end_pos=strlen($comcode);\n\t\t\t\t\t\t\t\t\t\t$auto_link=preg_replace('#(keep|for)_session=[\\d\\w]*#','filtered=1',substr($comcode,$pos-1,$link_end_pos-$pos+1));\n\t\t\t\t\t\t\t\t\t\tif (substr($auto_link,-3)!='://')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (substr($auto_link,-1)=='.')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$auto_link=substr($auto_link,0,strlen($auto_link)-1);\n\t\t\t\t\t\t\t\t\t\t\t\t$link_end_pos--;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$auto_link_tempcode=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\t$auto_link_tempcode->attach($auto_link);\n\t\t\t\t\t\t\t\t\t\t\tif (!$check_only)\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$link_captions_title=$GLOBALS['SITE_DB']->query_value_null_ok('url_title_cache','t_title',array('t_url'=>$auto_link));\n\n\t\t\t\t\t\t\t\t\t\t\t\tif ((is_null($link_captions_title)) || (substr($link_captions_title,0,1)=='!'))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['COMCODE_PARSE_URLS_CHECKED']++;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (($GLOBALS['NO_LINK_TITLES']) || ($GLOBALS['COMCODE_PARSE_URLS_CHECKED']>=MAX_URLS_TO_READ))\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=$auto_link;\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title='';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$downloaded_at_link=http_download_file($auto_link,3000,false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((is_string($downloaded_at_link)) && ($GLOBALS['HTTP_DOWNLOAD_MIME_TYPE']!==NULL) && (strpos($GLOBALS['HTTP_DOWNLOAD_MIME_TYPE'],'html')!==false) && ($GLOBALS['HTTP_MESSAGE']=='200'))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (preg_match('#\\s*<title[^>]*\\s*>\\s*(.*)\\s*\\s*<\\s*/title\\s*>#miU',$downloaded_at_link,$matches)!=0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('character_sets');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=trim(str_replace('&ndash;','-',str_replace('&mdash;','-',@html_entity_decode(convert_to_internal_encoding($matches[1]),ENT_QUOTES,get_charset()))));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (((strpos(strtolower($link_captions_title),'login')!==false) || (strpos(strtolower($link_captions_title),'log in')!==false)) && (substr($auto_link,0,strlen(get_base_url()))==get_base_url()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$link_captions_title=''; // don't show login screen titles for our own website. Better to see the link verbatim\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$GLOBALS['SITE_DB']->query_insert('url_title_cache',array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t't_url'=>substr($auto_link,0,255),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t't_title'=>substr($link_captions_title,0,255),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t),false,true); // To stop weird race-like conditions\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=mixed();\n\t\t\t\t\t\t\t\t\t\t\t\t$link_handlers=find_all_hooks('systems','comcode_link_handlers');\n\t\t\t\t\t\t\t\t\t\t\t\tforeach (array_keys($link_handlers) as $link_handler)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\trequire_code('hooks/systems/comcode_link_handlers/'.$link_handler);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$link_handler_ob=object_factory('Hook_comcode_link_handler_'.$link_handler,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (is_null($link_handler_ob)) continue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=$link_handler_ob->bind($auto_link,$link_captions_title,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!is_null($embed_output)) break;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (is_null($embed_output))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$page_link=url_to_pagelink($auto_link,true);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($link_captions_title=='') $link_captions_title=$auto_link;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($page_link!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('page',array('param'=>$page_link),make_string_tempcode(escape_html($link_captions_title)),$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode('url',array('param'=>$link_captions_title),$auto_link_tempcode,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,$highlight_bits);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else $embed_output=new ocp_tempcode();\n\t\t\t\t\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($continuation);\n\t\t\t\t\t\t\t\t\t\t\t$continuation='';\n\t\t\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t\t\t$pos+=$link_end_pos-$pos;\n\t\t\t\t\t\t\t\t\t\t\t$differented=true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!$differented)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($stupidity_mode!='') && ($textual_area))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (($stupidity_mode=='leet') && (mt_rand(0,1)==1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (array_key_exists(strtoupper($next),$LEET_FILTER)) $next=$LEET_FILTER[strtoupper($next)];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telseif (($stupidity_mode=='bork') && (mt_rand(0,60)==1))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$next.='-bork-bork-bork-';\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\tif ((!$in_separate_parse_section) && ((!$in_semihtml) || ((!$comcode_dangerous_html)/*If we don't support HTML and we haven't done the all_semihtml pre-filter at the top*/ && (!$is_all_semihtml)))) // Display char. We try and support entities\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($next=='&')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$ahead=substr($comcode,$pos,20);\n\t\t\t\t\t\t\t\t\t\t$ahead_lower=strtolower($ahead);\n\t\t\t\t\t\t\t\t\t\t$matches=array();\n\t\t\t\t\t\t\t\t\t\t$entity=preg_match('#^(\\#)?([\\w]*);#',$ahead_lower,$matches)!=0; // If it is a SAFE entity, use it\n\n\t\t\t\t\t\t\t\t\t\tif (($entity) && (!$in_code_tag))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif (($matches[1]=='') && (($in_semihtml) || (isset($ALLOWED_ENTITIES[$matches[2]]))))\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$pos+=strlen($matches[2])+1;\n\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&'.$matches[2].';';\n\t\t\t\t\t\t\t\t\t\t\t} elseif ((is_numeric($matches[2])) && ($matches[1]=='#'))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$matched_entity=intval(base_convert($matches[2],16,10));\n\t\t\t\t\t\t\t\t\t\t\t\tif (($matched_entity<127) && (array_key_exists(chr($matched_entity),$POTENTIAL_JS_NAUGHTY_ARRAY)))\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation.=escape_html($next);\n\t\t\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$pos+=strlen($matches[2])+2;\n\t\t\t\t\t\t\t\t\t\t\t\t\t$continuation.='&#'.$matches[2].';';\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t} else\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$continuation.='&amp;';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$continuation.='&amp;';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$continuation.=escape_html($next);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$continuation.=$next;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_NAME:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='=')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\t\t$current_attribute_name='param';\n\t\t\t\t}\n\t\t\t\telseif (trim($next)=='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t}\n\t\t\t\telseif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$next=']';\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\tif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ($close)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($formatting_allowed)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (count($tag_stack)==0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($lax)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE',$current_tag),strrpos(substr($comcode,0,$pos),'['),$comcode,$check_only);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$has_it=false;\n\t\t\t\t\t\tforeach (array_reverse($tag_stack) as $t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($t[0]==$current_tag)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$has_it=true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (($in_semihtml) && (($current_tag=='html') || ($current_tag=='semihtml'))) // Only search one level for this\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($has_it)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\tif ($_last[0]!=$current_tag)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!$lax)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE_MATCH',$current_tag,$_last[0]),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,NULL,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t\t\t\t\t\t$in_code_tag=false;\n\t\t\t\t\t\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t\t\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t\t\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t\t\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t\t\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t\t\t\t$mindless_mode=$_last[7];\n\t\t\t\t\t\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t\t\t\t\t\t$comcode_dangerous_html=$_last[9];\n\n\t\t\t\t\t\t\t\t\tif (count($tag_stack)==0) // Hmm, it was never open. So let's pretend this tag close never happened\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twhile ($_last[0]!=$current_tag);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extraneous_semihtml=((!$is_all_semihtml) && (!$in_semihtml)) || (($current_tag!='html') && ($current_tag!='semihtml'));\n\t\t\t\t\t\t\tif ((!$lax) && ($extraneous_semihtml))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_NO_CLOSE_MATCH',$current_tag,$_last[0]),$pos,$comcode,$check_only);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Do the comcode for this tag\n\t\t\t\t\t\tif ($in_semihtml) // We need to perform some magic to clean up the Comcode sections\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ($_last[1] as $index=>$conv)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_last[1][$index]=@html_entity_decode(str_replace('<br />',chr(10),$conv),ENT_QUOTES,get_charset());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$mindless_mode=$_last[7];\n\n\t\t\t\t\t\tif ($mindless_mode)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$embed_output=$tag_output;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif (!$check_only)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$_structure_sweep=false;\n\t\t\t\t\t\t\tif ($structure_sweep)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_structure_sweep=!in_tag_stack($tag_stack,array('title'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$_structure_sweep,$semiparse_mode,$highlight_bits,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t\t\t} else $embed_output=new ocp_tempcode();\n\n\t\t\t\t\t\t$in_code_tag=false;\n\t\t\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t\t\t$comcode_dangerous_html=$_last[9];\n\t\t\t\t\t\tif (($print_mode) && ($_last[0]=='exp_thumb'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$queued_tempcode->attach($embed_output);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$just_ended=isset($BLOCK_TAGS[$current_tag]);\n\n\t\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ((strlen($comcode)>$pos+1) && ($comcode[$pos]==chr(10)) && ($comcode[$pos+1]==chr(10))) // Linux newline\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$NUM_LINES+=2;\n\t\t\t\t\t\t\t\t$pos+=2;\n\t\t\t\t\t\t\t\t$just_new_line=true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($current_tag=='html') $in_html=false;\n\t\t\t\t\t\telseif ($current_tag=='semihtml') $in_semihtml=false;\n\t\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\t\t\t\t\t}\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\n\t\t\t\t\tif (($close) && ($mindless_mode))\n\t\t\t\t\t{\n\t\t\t\t\t\t$temp_tpl='</kbd>&#8203;';\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($temp_tpl);\n\t\t\t\t\t\t$tag_output->attach($temp_tpl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($status==CCP_IN_TAG_NAME) $current_tag.=strtolower($next);\n\t\t\t\tbreak;\n\t\t\tcase CCP_STARTING_TAG:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ($next==']') // Can't actual occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t}\n\t\t\t\telseif ($next=='/')\n\t\t\t\t{\n\t\t\t\t\t$close=true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$current_tag.=strtolower($next);\n\t\t\t\t\t$status=CCP_IN_TAG_NAME;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTES:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif (trim($next)!='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_NAME;\n\t\t\t\t\t$current_attribute_name=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_NAME:\n\t\t\t\tif (($mindless_mode) && ($next!='[')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_NO_MANS_LAND;\n\t\t\t\t\t$pos--;\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($current_tag=='title')\n\t\t\t\t\t{\n\t\t\t\t\t\t$just_new_line=false;\n\t\t\t\t\t\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\t\t\t\t\t\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t\t\t\t\t\t$tag_output->attach($close_list);\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif (($attribute_map==array()) && (!$lax))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($attribute_map!=array())\n\t\t\t\t\t{\n\t\t\t\t\t\t$at_map_keys=array_keys($attribute_map);\n\t\t\t\t\t\t$old_attribute_name=$at_map_keys[count($at_map_keys)-1];\n\t\t\t\t\t\t$attribute_map[$old_attribute_name].=' '.$current_attribute_name;\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_push($tag_stack,array($current_tag,$attribute_map,$tag_output,$white_space_area,$in_separate_parse_section,$formatting_allowed,$textual_area,$mindless_mode,$comcode_dangerous,$comcode_dangerous_html));\n\n\t\t\t\t\tlist($tag_output,$comcode_dangerous,$comcode_dangerous_html,$white_space_area,$formatting_allowed,$in_separate_parse_section,$textual_area,$attribute_map,$status,$in_html,$in_semihtml,$pos,$in_code_tag)=_opened_tag($mindless_mode,$as_admin,$source_member,$attribute_map,$current_tag,$pos,$comcode_dangerous,$comcode_dangerous_html,$in_separate_parse_section,$in_html,$in_semihtml,$close,$len,$comcode);\n\t\t\t\t\tif ($in_code_tag) $code_nest_stack=0;\n\n\t\t\t\t\t$tag_output->attach($tag_raw);\n\t\t\t\t}\n\t\t\t\telseif ($next=='=') $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\telseif ($next!=' ') $current_attribute_name.=strtolower($next);\n\t\t\t\telse $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_LEFT;\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_LEFT:\n\t\t\t\tif (($mindless_mode) && ($next!='[') && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='=') $status=CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT;\n\t\t\t\telseif (trim($next)!='')\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_ATTRIBUTE_ERROR',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\n\t\t\t\t\tif ($next=='[')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t}\n\t\t\t\t\telseif ($next==']')\n\t\t\t\t\t{\n\t\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_BETWEEN_ATTRIBUTE_NAME_VALUE_RIGHT:\n\t\t\t\tif (($mindless_mode) && ($next!='[') && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next=='[') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_OPEN_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ($next==']') // Can't actually occur though\n\t\t\t\t{\n\t\t\t\t\tif (!$lax) return comcode_parse_error($preparse_mode,array('CCP_TAG_CLOSE_ANOMALY'),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telseif ((($next=='\"')/* && (!$in_semihtml)*/) || (($in_semihtml) && (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t{\n\t\t\t\t\tif ($next!='\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos+=5;\n\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='quot;';\n\t\t\t\t\t}\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_VALUE;\n\t\t\t\t\t$current_attribute_value='';\n\t\t\t\t}\n\t\t\t\telseif ($next!='')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_ATTRIBUTE_VALUE_NO_QUOTE;\n\t\t\t\t\t$current_attribute_value=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_VALUE_NO_QUOTE:\n\t\t\t\tif (($mindless_mode) && ($next!=']')) $tag_raw.=($next);\n\n\t\t\t\tif ($next==' ')\n\t\t\t\t{\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t}\n\t\t\t\telseif ($next==']')\n\t\t\t\t{\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t\t$pos--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$current_attribute_value.=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CCP_IN_TAG_ATTRIBUTE_VALUE:\n\t\t\t\tif ($mindless_mode) $tag_raw.=($next);\n\n\t\t\t\tif ((($next=='\"')/* && (!$in_semihtml)*/) || (($in_semihtml) && (substr($comcode,$pos-1,6)=='&quot;')))\n\t\t\t\t{\n\t\t\t\t\tif ($next!='\"')\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos+=5;\n\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='quot;';\n\t\t\t\t\t}\n\t\t\t\t\t$status=CCP_IN_TAG_BETWEEN_ATTRIBUTES;\n\t\t\t\t\tif ((isset($attribute_map[$current_attribute_name])) && (!$lax)) return comcode_parse_error($preparse_mode,array('CCP_DUPLICATE_ATTRIBUTES',$current_attribute_name,$current_tag),$pos,$comcode,$check_only);\n\t\t\t\t\t$attribute_map[$current_attribute_name]=$current_attribute_value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($next=='\\\\')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($comcode[$pos]=='\"')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='&quot;';\n\t\t\t\t\t\t\t$current_attribute_value.='\"';\n\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t} elseif (substr($comcode,$pos-1,6)=='&quot;')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='&quot;';\n\t\t\t\t\t\t\t$current_attribute_value.='&quot;';\n\t\t\t\t\t\t\t$pos+=6;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($comcode[$pos]=='\\\\')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($mindless_mode) $tag_raw.='\\\\';\n\t\t\t\t\t\t\t$current_attribute_value.='\\\\';\n\t\t\t\t\t\t\t++$pos;\n\t\t\t\t\t\t} else $current_attribute_value.=$next;\n\t\t\t\t\t} else $current_attribute_value.=$next;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($continuation);\n\t$tag_output->attach($continuation);\n\t$continuation='';\n\n\tlist($close_list,$list_indent)=_close_open_lists($list_indent,$list_type);\n\tif ($GLOBALS['XSS_DETECT']) ocp_mark_as_escaped($close_list);\n\t$tag_output->attach($close_list);\n\n\tif (($status!=CCP_NO_MANS_LAND) || (count($tag_stack)!=0))\n\t{\n\t\tif (!$lax)\n\t\t{\n\t\t\t$stack_top=array_pop($tag_stack);\n\t\t\treturn comcode_parse_error($preparse_mode,array('CCP_BROKEN_END',is_null($stack_top)?$current_tag:$stack_top[0]),$pos,$comcode,$check_only);\n\t\t} else\n\t\t{\n\t\t\twhile (count($tag_stack)>0)\n\t\t\t{\n\t\t\t\t$_last=array_pop($tag_stack);\n\t\t\t\t/*if ($_last[0]=='title') Not sure about this\n\t\t\t\t{\n\t\t\t\t\t$_structure_sweep=false;\n\t\t\t\t\tbreak;\n\t\t\t\t}*/\n\t\t\t\t$embed_output=_do_tags_comcode($_last[0],$_last[1],$tag_output,$comcode_dangerous,$pass_id,$pos,$source_member,$as_admin,$connection,$comcode,$wml,$structure_sweep,$semiparse_mode,NULL,NULL,$in_semihtml,$is_all_semihtml);\n\t\t\t\t$in_code_tag=false;\n\t\t\t\t$white_space_area=$_last[3];\n\t\t\t\t$in_separate_parse_section=$_last[4];\n\t\t\t\t$formatting_allowed=$_last[5];\n\t\t\t\t$textual_area=$_last[6];\n\t\t\t\t$tag_output=$_last[2];\n\t\t\t\t$tag_output->attach($embed_output);\n\t\t\t\t$mindless_mode=$_last[7];\n\t\t\t\t$comcode_dangerous=$_last[8];\n\t\t\t\t$comcode_dangerous_html=$_last[9];\n\t\t\t}\n\t\t}\n\t}\n\n//\t$tag_output->left_attach('<div class=\"xhtml_validator_off\">');\n//\t$tag_output->attach('</div>');\n\n\treturn $tag_output;\n}", "public function encodeOnly($string){\n $final = html_entity_decode($string);\n return $final;\n }", "function escapePhp() {\n\t\t$rv = $this->getContents();\n\t\t$changes = array(\n\t\t\t'<?' => '&lt;?',\n\t\t\t'?>' => '?&gt;',\n\t\t);\n\t\treturn str_replace( array_keys( $changes ), $changes, $rv );\n\t}", "public function remove_utf8_bom($text)\n {\n $bom = pack('H*', 'EFBBBF');\n $text = preg_replace(\"/^$bom/\", '', $text);\n return $text;\n }", "function remove_self_closing_tags( $input ) {\n\treturn str_replace( ' />', '>', $input );\n}", "function utf8ToHtmlEntities($string) { \n\t /* avoid using 0xA0 (\\240) in ereg ranges. RH73 does not like that */ \n\t if (! ereg(\"[\\200-\\237]\", $string) and ! ereg(\"[\\241-\\377]\", $string)) { \n\t return $string; \n\t\t}\n\t // decode three byte unicode characters \n\t $string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\", \n\t \"'&#'.((ord('\\\\1')-224)*4096 + (ord('\\\\2')-128)*64 + (ord('\\\\3')-128)).';'\", \n\t $string); \n\n\t // decode two byte unicode characters \n\t $string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\", \n\t \"'&#'.((ord('\\\\1')-192)*64+(ord('\\\\2')-128)).';'\", \n\t $string); \n\n\t return $string; \n\t}", "function twig_html_to_text(string $string): string\n{\n $string = preg_replace('/<a[^>]*>/', '', $string);\n $string = str_replace('</a>', '', $string);\n $string = str_replace('<b>', '', $string);\n $string = str_replace('</b>', '', $string);\n $string = str_replace('<i>', '', $string);\n $string = str_replace('</i>', '', $string);\n $string = str_replace('<u>', '', $string);\n $string = str_replace('</u>', '', $string);\n $string = str_replace('<li>', '', $string);\n $string = str_replace('</li>', '', $string);\n $string = preg_replace('/<p[^>]*>/', '', $string);\n $string = str_replace('</p>', '', $string);\n $string = preg_replace('/<style>[^<]*<\\/style>/', '', $string);\n\n // additional substitions\n $string = str_replace(\"\\\\\", \"\\\\\\\\\", $string);\n $string = str_replace(\"\\r\", '', $string);\n $string = str_replace(\"\\n\", '', $string);\n $string = str_replace('<br>', \"\\n\", $string);\n $string = str_replace('<br\\>', \"\\n\", $string);\n $string = str_replace('<hr>', \"---\\n\", $string);\n $string = str_replace('&nbsp;', ' ', $string);\n return $string;\n}", "private function cleanStr($data)\n {\n return trim(strip_tags($data));\n }", "function fixEncoding($in_str) \r\n{ \r\n $cur_encoding = mb_detect_encoding($in_str) ; \r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\n return $in_str; \r\n else \r\n return utf8_encode($in_str); \r\n}", "function utf8_clean($str)\n{\n return iconv('UTF-8', 'UTF-8//IGNORE', $str);\n}", "function cleanupContent($content)\n {\n $content=removeInvisibleHtml($content); //remove invisible HTML tags first (strip_tags would only remove tags but leave content between them)\n $content=strip_tags($content); //remove all tags\n $content=preg_replace(\"/[^\\p{L}[:print:]\\s]/u\", \"\", $content); //remove all non-printable characters\n $content=preg_replace(\"/( )+/\", \" \", $content); //replace excess whitespace with single whitespace, preserving new lines\n\n\treturn trim($content); //return clean content\n }", "function removexmlcomments($data)\n{\n $data = preg_replace(\"/<!--(.*?)-->/ms\",\"\",$data);\n $data = preg_replace(\"/<\\\\?(.*?)\\\\?>/\",\"\",$data);\n return $data;\n}", "function init_code(&$code)\n\n{\n\n $code .= \"\\n\";\n\n \n\n // code not allowed to contain our special characters\n\n return ($code = strtr($code, array(\"\\x00\" => '', \"\\x01\" => '')));\n\n}", "private function renderHead() {\n\t\t$head = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . PHP_EOL;\n\t\tif (!empty($this->stylesheets))\n\t\t\t$head .= implode(PHP_EOL, $this->stylesheets);\n\n\t\tif ($this->type == 'RSS2') {\n\t\t\t$head .= $this->openTag('rss', array(\n\t\t\t\t\t\t\"version\" => \"2.0\",\n\t\t\t\t\t\t\"xmlns:content\" => \"http://purl.org/rss/1.0/modules/content/\",\n\t\t\t\t\t\t\"xmlns:atom\" => \"http://www.w3.org/2005/Atom\",\n\t\t\t\t\t\t\"xmlns:wfw\" => \"http://wellformedweb.org/CommentAPI/\")) . PHP_EOL;\n\t\t} elseif ($this->type == 'RSS1') {\n\t\t\t$head .= $this->openTag('rdf:RDF', array(\n\t\t\t\t\t\t\"xmlns:rdf\" => \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n\t\t\t\t\t\t\"xmlns\" => \"http://purl.org/rss/1.0/\",\n\t\t\t\t\t\t\"xmlns:dc\" => \"http://purl.org/dc/elements/1.1/\"\n\t\t\t\t\t)) . PHP_EOL;\n\t\t} else if ($this->type == 'Atom') {\n\t\t\t$head .= $this->openTag('feed', array(\"xmlns\" => \"http://www.w3.org/2005/Atom\")) . PHP_EOL;\n\t\t}\n\t\treturn $head;\n\t}", "function cleantohtml($s){\n\t// Restores the added slashes (ie.: \" I\\'m John \"\n\t// for security in output, and escapes them in htmlentities(ie.: &quot; etc.)\n\t// It preserves any <html> tags in that they are encoded aswell (like &lt;html&gt;)\n\t// As an extra security, if people would try to inject tags that would become tags\n\t// after stripping away bad characters, we do still strip tags but only after htmlentities,\n\t// so any genuine code examples will stay\n\treturn strip_tags(htmlentities(trim(stripslashes($s)), ENT_NOQUOTES, \"UTF-8\"));\n}", "public function doXHTML_cleaning() {}", "public function remove_bad_utf8($str)\n {\n $str = str_replace('“', '&quot;', $str);\n $str = str_replace('”', '&quot;', $str);\n $str = str_replace('‘', '&#39;', $str);\n $str = str_replace('’', '&#39;', $str);\n $str = str_replace('&#8220;', '&quot;', $str);\n $str = str_replace('&#8221;', '&quot;', $str);\n \n /// convertimos a utf8\n ini_set('mbstring.substitute_character', \"none\");\n return mb_convert_encoding($str, 'UTF-8', 'auto');\n }", "function _wp_get_head(){\n $msg=\"<?xml version='1.0' encoding='ISO-8859-2'?>\n\t\t\t\t\t<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'\n\t\t\t\t\t\t\t\t\t xmlns:xsd='http://www.w3.org/2001/XMLSchema'\n\t\t\t\t\t\t\t\t\t xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n\t\t\t\t\t\t\t\t\t xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'\n \t\t\t\t\t\t\t xmlns:ns4='http://codewebservice.namespace'\n\t\t\t\t\t\tSOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>\n\t\t\t\t\t<SOAP-ENV:Body>\n \t\";\n return $msg;\n }", "function NCRx_UTF8($str){\n\t\t$len = strlen($str);\n\t\t$result = '';\n\t\t$ln=0;\n\t\tfor($i=0;$i<$len;$i++){\n\t\t\t$n = '';\n\t\t\tif ($str[$i] == '-'){\n\t\t\t\t$k = $i+1;\n\t\t\t\tif ($k < $len && $str[$k] == '-'){\n\t\t\t\t\t$k++;\n\t\t\t\t\twhile ($k < $len && is_numeric($str[$k]))\n\t\t\t\t\t\t$n .= $str[$k++];\n\t\t\t\t\tif ($k < $len && $str[$k]==';')\n\t\t\t\t\t\t$i = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($n!=''){\n\t\t\t\t$n = intval($n);\n\t\t\t\tif ($n==13 || $n==10){\n\t\t\t\t\t$result .= $ln?'':'<br>';\n\t\t\t\t\t$ln = 1;\n\t\t\t\t}elseif ($n<128){\n\t\t\t\t\t$result .= chr($n);\n\t\t\t\t\t$ln = 0;\n\t\t\t\t}else{\n\t\t\t\t\t$s = '';\n\t\t\t\t\t$first = 0;\n\t\t\t\t\t$mask = 0x80;\n\t\t\t\t\twhile ($n>0){\n\t\t\t\t\t\t$byte = $n & 0x3F; //00111111\n\t\t\t\t\t\t$n = $n >> 6;\n\t\t\t\t\t\tif ($n) $s = chr($byte | 0x80).$s;\n\t\t\t\t\t\t$first = $first | $mask;\n\t\t\t\t\t\t$mask = $mask >> 1;\n\t\t\t\t\t}\n\t\t\t\t\t$s = chr($first | $byte).$s;\n\t\t\t\t\t$result .= $s;\n\t\t\t\t\t$ln = 0;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$result .= $str[$i];\n\t\t\t\t$ln = 0;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function extract_html_tag($line) {\n if (preg_match(self::REGEX_CODE, $line)) {\n return preg_replace(self::REGEX_CODE, '\\1', $line);\n }\n }" ]
[ "0.6023787", "0.59477615", "0.58602923", "0.5858104", "0.5726064", "0.56438816", "0.5616145", "0.5614433", "0.56082714", "0.55887884", "0.55876464", "0.5582783", "0.55038685", "0.54936403", "0.5480618", "0.5478454", "0.5472869", "0.54432523", "0.54317075", "0.5403369", "0.5385149", "0.5381379", "0.5368385", "0.5361064", "0.53588057", "0.5329527", "0.5303062", "0.52987456", "0.52918464", "0.52878153", "0.5273881", "0.5273226", "0.52679545", "0.5258906", "0.52554744", "0.5241997", "0.5240911", "0.5238723", "0.5237497", "0.52262294", "0.5225058", "0.52239627", "0.52135164", "0.52135164", "0.52082676", "0.5203621", "0.5200556", "0.51994586", "0.5199432", "0.5190942", "0.51890415", "0.51691705", "0.51645195", "0.5163877", "0.51620454", "0.51554984", "0.5153742", "0.5141855", "0.5139743", "0.5136409", "0.5135808", "0.5130141", "0.5129549", "0.51280797", "0.51274747", "0.5120435", "0.5118429", "0.51096106", "0.5102119", "0.50956535", "0.50955516", "0.50941277", "0.5092726", "0.5086473", "0.508478", "0.50834435", "0.50828946", "0.50787926", "0.50741005", "0.507191", "0.5070683", "0.50700384", "0.506789", "0.5067844", "0.50672376", "0.50569", "0.5055197", "0.5049748", "0.50491065", "0.50489116", "0.50485224", "0.5045256", "0.5044163", "0.50436306", "0.5042336", "0.50344896", "0.5033167", "0.5032435", "0.5027099", "0.50264245" ]
0.5744224
4
This function fixes some last issues such as image URLs, '' blocks are replaced with '' blocks, etc.
protected static function finalizePart($part) { $part = self::cleanCode($part); $file = new DOMDocument(); libxml_use_internal_errors(true); $file->loadHTML($part); $images = $file->getElementsByTagName('img'); foreach ($images as $image) { $imageStart = self::cleanCode($file->saveHTML($image)); if (strpos($imageStart, 'wizardawn.and-mag.com') === false) { $imageNew = self::cleanCode(preg_replace('/.\/[\s\S]+?\//', 'http://wizardawn.and-mag.com/maps/', $imageStart)); $part = str_replace($imageStart, $imageNew, $part); } } $part = preg_replace("/<font.*?>(.*?)<\/font>/", "<span>$1</span>", $part); return self::cleanCode($part); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _clean_bbcode($str)\n{\n\t$str = preg_replace('/\\[img:[a-z0-9]{10,}\\].*?\\[\\/img:[a-z0-9]{10,}\\]/', ' ', $str);\n\t$str = preg_replace('/\\[\\/?url(=.*?)?\\]/', ' ', $str);\n\t$str = preg_replace('/\\[\\/?[a-z\\*=\\+\\-]+(\\:?[0-9a-z]+)?:[a-z0-9]{10,}(\\:[a-z0-9]+)?=?.*?\\]/', ' ', $str);\n\treturn $str;\n}", "function more_zero_cleanup() {\n function zero_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n }\n\n // This removes inline width/height from images\n function remove_thumbnail_dimensions( $html ) {\n $html = preg_replace( '/(width|height)=\\\"\\d*\\\"\\s/', \"\", $html );\n return $html;\n }\n\n add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 );\n add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 );\n // Removes attached image sizes as well\n add_filter( 'the_content', 'remove_thumbnail_dimensions', 10 );\n\n\n }", "private function remove_self_closing_tags() {\n\t\tadd_filter('get_avatar', [$this, 'remove_self_closing_tag']); // <img]/>\n\t\tadd_filter('comment_id_fields', [$this, 'remove_self_closing_tag']); // <input]/>\n\t\tadd_filter('post_thumbnail_html', [$this, 'remove_self_closing_tag']); // <img]/>\n\t}", "function clean_raw() {\r\n $this->cleaned_image = cloneImg($this->get_image());\r\n foreach ($this->text_blocks as $block) {\r\n $x1=$block->x1;\r\n $y1=$block->y1;\r\n $x2=$block->x2;\r\n $y2=$block->y2;\r\n $x3=$block->x3;\r\n $y3=$block->y3;\r\n $x4=$block->x4;\r\n $y4=$block->y4;\r\n $r=$block->background_color_alt[0];\r\n $g=$block->background_color_alt[1];\r\n $b=$block->background_color_alt[2];\r\n $background = imagecolorallocate($this->cleaned_image, $r, $g, $b);\r\n $polygon=array($x1,$y1,$x2,$y2,$x3,$y3,$x4,$y4);\r\n imagefilledpolygon($this->cleaned_image,$polygon,4,$background);\r\n $this->cleaned_image_path=\"uploads/\".microtime().\".jpg\";\r\n imagewrite($this->cleaned_image,$this->cleaned_image_path,$quality=100);\r\n }\r\n }", "function style_fixing( $match ) {\r\n $match[0] = preg_replace_callback('/url\\s*\\(\\s*[\\'\\\"]?(.*?)\\s*[\\'\\\"]?\\s*\\)/is', \"style_url_replace\", $match[0]);\r\n //echo \"<pre>\".htmlspecialchars($match[0]).\"</pre>\";\r\n return $match[0];\r\n}", "function replaceIMG($html)\r\n\t{\r\n\t\t$iStart = stripos($html,\"<img\");\r\n\t\twhile((string)$iStart != null) //string typecast to handle \"0\" which equates to FALSE in PHP...\r\n\t\t{\r\n\t\t\t//get entire IMG tag\r\n\t\t\t$iEnd = stripos($html,\">\",$iStart)+1;\r\n\t\t\t$imgTag = substr($html,$iStart,($iEnd-$iStart));\r\n\t\t\t\r\n\t\t\t//get src\r\n\t\t\t$iSrcStart = stripos($imgTag,\"src=\");\r\n\t\t\tif(substr($imgTag,($iSrcStart+4),1) == \"'\")\r\n\t\t\t{\r\n\t\t\t\t//single quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,\"'\",$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//double quote\r\n\t\t\t\t$iSrcEnd = stripos($imgTag,'\"',$iSrcStart+5);\r\n\t\t\t}\r\n\t\t\t$imgSrc = substr($imgTag,$iSrcStart+5,($iSrcEnd-($iSrcStart+5)));\r\n\t\t\t\r\n\t\t\t//get alt\r\n\t\t\t$iAltStart = stripos($imgTag,\"alt=\");\r\n\t\t\tif($iAltStart != null)\r\n\t\t\t{\r\n\t\t\t\tif(substr($imgTag,($iAltStart+4),1) == \"'\")\r\n\t\t\t\t{\r\n\t\t\t\t\t//single quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,\"'\",$iAltStart+5);\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//double quote\r\n\t\t\t\t\t$iAltEnd = stripos($imgTag,'\"',$iAltStart+5);\r\n\t\t\t\t}\r\n\t\t\t\t$imgAlt = substr($imgTag,$iAltStart+5,($iAltEnd-($iAltStart+5)));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//replace HTML\r\n\t\t\tif((string)stripos($imgSrc,\"scripts/CLEditor/images/icons/\") == null) //exclude icons from rich text editor\r\n\t\t\t{\r\n\t\t\t\t$replacementHTML = \"<div class='table comicborder popupshadow-margin'><div class='table-row'><div class='table-cell'><a href='\" . $imgSrc . \"'>\" . $imgTag . \"</a></div></div>\";\r\n\t\t\t\tif($iAltStart != null)\r\n\t\t\t\t{\r\n\t\t\t\t\t$replacementHTML = $replacementHTML . \"<div class='table-row'><div class='table-cell comicimagecaption'>\" . $imgAlt . \"</div></div>\";\r\n\t\t\t\t}\r\n\t\t\t\t$replacementHTML = $replacementHTML . \"</div>\";\r\n\t\t\t\t$html = substr_replace($html,$replacementHTML,$iStart,($iEnd-$iStart));\r\n\t\t\t\t\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($replacementHTML)));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//prep next loop\r\n\t\t\t\t$iStart = stripos($html,\"<img\",($iStart+strlen($imgTag)));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $html;\r\n\t}", "function testBug11370()\n {\n $bbc = new HTML_BBCodeParser2(array('filters' => ''));\n $bbc->addFilter('Images');\n\n $this->assertEquals('<img src=\"admin.php?fs=image\" alt=\"\" />',\n $bbc->qparse(\"[img]admin.php?fs=image[/img]\")\n );\n }", "function zero_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n }", "function tags_tinymce_fix( $init )\n{\n // html elements being stripped\n $init['extended_valid_elements'] = 'i[*],span[*]';\n // don't remove line breaks\n $init['remove_linebreaks'] = false;\n // convert newline characters to BR\n $init['convert_newlines_to_brs'] = true;\n // don't remove redundant BR\n $init['remove_redundant_brs'] = false;\n // pass back to wordpress\n return $init;\n}", "function string_strip_bbcode( $p_string, $p_multiline = TRUE ) {\n\t\t\t$t_change_quotes = FALSE;\n\t\t\tif ( ini_get_bool( 'magic_quotes_sybase' ) ) {\n\t\t\t\t$t_change_quotes = TRUE;\n\t\t\t\tini_set( 'magic_quotes_sybase', FALSE );\n\t\t\t}\n\n\t\t\t# restore pre/code tags.\n\t\t\t$p_string = $this->restore_pre_code_tags( $p_string, $p_multiline);\n\t\t\t\n\t\t\t# ensures that the links will be opened in a new window/tab, so as to not lose the currently displayed issue. \n\t\t\t$t_extra_link_tags = 'target=\"_blank\"';\n\t\t\t\n\t\t\t# if there are any expressed links, images convert them to bbcode.\n\t\t\t$p_string = preg_replace( \"/^((http|https|ftp):\\/\\/[a-z0-9;\\/\\?:@=\\&\\$\\-_\\.\\+!*'\\(\\),~%#]+)/i\", \"[url]$1[/url]\", $p_string );\n\t\t\t$p_string = preg_replace( \"/([^='\\\"(\\[url\\]|\\[img\\])])((http|https|ftp):\\/\\/[a-z0-9;\\/\\?:@=\\&\\$\\-_\\.\\+!*'\\(\\),~%#]+)/i\", \"$1[url]$2[/url]\", $p_string );\n\t\t\t\n\t\t\t$t_search[] = \"/\\[img\\]((http|https|ftp):\\/\\/[a-z0-9;\\/\\?:@=\\&\\$\\-_\\.\\+!*'\\(\\),~%# ]+?)\\[\\/img\\]/is\";\n\t\t\t$t_search[] = \"/\\[img\\]([.]*[a-z0-9;\\/\\?:@=\\&\\$\\-_\\.\\+!*'\\(\\),~%# ]+?)\\[\\/img\\]/is\";\n\t\t\t$t_search[] = \"/\\[url\\]((http|https|ftp|mailto):\\/\\/([a-z0-9\\.\\-@:]+)[a-z0-9;\\/\\?:@=\\&\\$\\-_\\.\\+!*'\\(\\),\\#%~ ]*?)\\[\\/url\\]/is\";\n\t\t\t$t_search[] = \"/\\[url=((http|https|ftp|mailto):\\/\\/[^\\]]+?)\\](.+?)\\[\\/url\\]/is\";\n\t\t\t$t_search[] = \"/\\[url=([a-z0-9;\\/\\?:@=\\&\\$\\-_\\.\\+!*'\\(\\),~%# ]+?)\\](.+?)\\[\\/url\\]/is\";\t\t\t\t\n\t\t\t$t_search[] = \"/\\[email\\]([a-z0-9\\-_\\.\\+]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+?)\\[\\/email\\]/is\";\n\t\t\t$t_search[] = \"/\\[email=([a-z0-9\\-_\\.\\+]+@[a-z0-9\\-]+\\.[a-z0-9\\-\\.]+?)\\](.+?)\\[\\/email\\]/is\";\n\t\t\t$t_search[] = \"/\\[color=([\\#a-z0-9]+?)\\](.+?)\\[\\/color\\]/is\";\n\t\t\t$t_search[] = \"/\\[highlight=([\\#a-z0-9]+?)\\](.+?)\\[\\/highlight\\]/is\";\t\t\t\n\t\t\t$t_search[] = \"/\\[size=([+\\-\\da-z]+?)\\](.+?)\\[\\/size\\]/is\";\n\t\t\t$t_search[] = \"/\\[list\\](\\n|\\r\\n|)/is\";\n\t\t\t$t_search[] = \"/\\[list=(.+?)\\](\\n|\\r\\n|)/is\";\n\t\t\t$t_search[] = \"/\\[\\/list\\](\\n|\\r\\n|)/is\";\n\t\t\t$t_search[] = \"/\\[\\*\\]/is\";\n\t\t\t$t_search[] = \"/\\[b\\](.+?)\\[\\/b\\]/is\";\n\t\t\t$t_search[] = \"/\\[u\\](.+?)\\[\\/u\\]/is\";\n\t\t\t$t_search[] = \"/\\[i\\](.+?)\\[\\/i\\]/is\";\n\t\t\t$t_search[] = \"/\\[s\\](.+?)\\[\\/s\\]/is\";\n\t\t\t$t_search[] = \"/\\[left\\](.+?)\\[\\/left\\]/is\";\n\t\t\t$t_search[] = \"/\\[center\\](.+?)\\[\\/center\\]/is\";\n\t\t\t$t_search[] = \"/\\[right\\](.+?)\\[\\/right\\]/is\";\n\t\t\t$t_search[] = \"/\\[justify\\](.+?)\\[\\/justify\\]/is\";\n\t\t\t$t_search[] = \"/\\[hr\\](\\n|\\r\\n|)/is\";\n\t\t\t$t_search[] = \"/\\[sub\\](.+?)\\[\\/sub\\]/is\";\n\t\t\t$t_search[] = \"/\\[sup\\](.+?)\\[\\/sup\\]/is\";\n\t\t\t$t_search[] = \"/\\[table\\](\\n|\\r\\n|)/is\";\n\t\t\t$t_search[] = \"/\\[table=(.+?)\\](\\n|\\r\\n|)/is\";\n\t\t\t$t_search[] = \"/\\[\\/table\\](\\n|\\r\\n|)/is\";\n\t\t\t$t_search[] = \"/\\[tr\\](.+?)\\[\\/tr\\]/is\";\t\t\t\t\t \n\t\t\t$t_search[] = \"/\\[th\\](.+?)\\[\\/th\\]/is\";\n\t\t\t$t_search[] = \"/\\[td\\](.+?)\\[\\/td\\]/is\";\n\t\t\t$t_search[] = '/\\[code\\](.+)\\[\\/code\\]/imsU';\n\t\t\t$t_search[] = '/\\[code start=([0-9]+)\\](.+)\\[\\/code\\]/imsU';\n\n\t\t\t$t_replace[] = \"(Image: $1)\";\n\t\t\t$t_replace[] = \"(Image: $1)\";\n\t\t\t$t_replace[] = \"$1\";\n\t\t\t$t_replace[] = \"$1\";\n\t\t\t$t_replace[] = \"$1\";\n\t\t\t$t_replace[] = \"$1\";\n\t\t\t$t_replace[] = \"$2\";\n\t\t\t$t_replace[] = \"$2\";\n\t\t\t$t_replace[] = \"$2\";\t\t\t\n\t\t\t$t_replace[] = \"$2\";\n\t\t\t$t_replace[] = \"\";\n\t\t\t$t_replace[] = \"\";\n\t\t\t$t_replace[] = \"\";\n\t\t\t$t_replace[] = \"* \";\n\t\t\t$t_replace[] = \"$1\";\n\t\t\t$t_replace[] = \"$1\";\n\t\t\t$t_replace[] = \"$1\";\n\t\t\t$t_replace[] = \"$1\";\n\t\t\t$t_replace[] = \"\\n$1\";\n\t\t\t$t_replace[] = \"\\n$1\";\n\t\t\t$t_replace[] = \"\\n$1\";\n\t\t\t$t_replace[] = \"\\n$1\";\n\t\t\t$t_replace[] = \"--------------------------------\";\n\t\t\t$t_replace[] = \"$1\";\n\t\t\t$t_replace[] = \"$1\"; \n\t\t\t$t_replace[] = \"\";\n\t\t\t$t_replace[] = \"\";\n\t\t\t$t_replace[] = \"\";\n\t\t\t$t_replace[] = \"\\n\";\n\t\t\t$t_replace[] = \" $1 \";\n\t\t\t$t_replace[] = \" $1 \";\n\t\t\t$t_replace[] = \"\\n$1\";\t\t\n\t\t\t$t_replace[] = \"\\n$2\";\n\t\t\t\n\t\t\t# perform the actual replacement.\n\t\t\t$p_string = preg_replace( $t_search, $t_replace, $p_string );\n\t\t\n\t\t\t# code=lang\n\t\t\t$p_string = preg_replace_callback('/\\[code=(\\w+)\\](.+)\\[\\/code\\]/imsU',\n\t\t\tcreate_function('$m', '\n\t\t\t\treturn $m[2];\n\t\t\t')\n\t\t\t, $p_string);\n\t\t\t\n\t\t\t# code=lang start=n\n\t\t\t$p_string = preg_replace_callback('/\\[code=(\\w+)\\ start=([0-9]+)\\](.+)\\[\\/code\\]/imsU',\n\t\t\tcreate_function('$m', '\n\t\t\t\treturn $m[3];\n\t\t\t')\n\t\t\t, $p_string);\n\t\t\t\n\t\t\t# process quotes.\t\n\t\t\t$p_string = $this->string_strip_quote($p_string);\n\t\t\t\n\t\t\tif ( $t_change_quotes )\n\t\t\t\tini_set( 'magic_quotes_sybase', TRUE );\n\n\t\t\treturn $p_string;\n\t\t }", "function filter($content){\n$content=str_replace(\"Try it Yourself\",\"Run\",$content);\n$content=str_replace('Exercise','Lesson',$content);\n$content=str_replace('colormap.gif','/images/colormap.gif',$content);\n$content=str_replace('objectExplained.gif','http://www.w3schools.com/js/objectExplained.gif',$content);\n$content=str_replace('pic_chart.jpg','http://www.w3schools.com/browsers/pic_chart.jpg',$content);\n$content=str_replace('pic_ie.jpg','http://www.w3schools.com/html/pic_ie.jpg',$content);\n$content=str_replace('pic_ie128.jpg','http://www.w3schools.com/browsers/pic_ie128.jpg',$content);\n$content=str_replace('pic_chrome128.gif','http://www.w3schools.com/browsers/pic_chrome128.gif',$content);\n$content=str_replace('pic_firefox128.png','http://www.w3schools.com/browsers/pic_firefox128.png',$content);\n$content=str_replace('pic_safari128.gif','http://www.w3schools.com/browsers/pic_safari128.gif',$content);\n$content=str_replace('pic_opera128.jpg','http://www.w3schools.com/browsers/pic_opera128.jpg',$content);\n$content=str_replace('pic_iphone.jpg','http://www.w3schools.com/browsers/pic_iphone.jpg',$content);\n$content=str_replace('/cert/pic_html_cert_small.gif','/images/avatar-hat-240.png',$content);\n$content=str_replace('mov_bbb.mp4','http://www.w3schools.com/html/mov_bbb.mp4',$content);\n$content=str_replace('mov_bbb.ogg','http://www.w3schools.com/html/mov_bbb.ogg',$content);\n$content=str_replace('pic_video.jpg','http://www.w3schools.com/html/pic_video.jpg',$content);\n$content=str_replace('tryhtml5_canvas_coordinates.htm','http://www.w3schools.com/html/tryhtml5_canvas_coordinates.htm',$content);\n$content=str_replace('pic_mountain.jpg','http://www.w3schools.com/html/pic_mountain.jpg',$content);\n$content=str_replace('pic_graph.png','http://www.w3schools.com/html/pic_graph.png',$content);\n$content=str_replace('pic_notepad.jpg','http://www.w3schools.com/html/pic_notepad.jpg',$content);\n$content=str_replace('iphone5.png','http://www.w3schools.com/jquerymobile/iphone5.png',$content);\n$content=str_replace('icons/','http://www.w3schools.com/jquerymobile/icons/',$content);\n$content=str_replace('tryjqmob_touch.htm','http://www.w3schools.com/jquerymobile/tryjqmob_touch.htm',$content);\n$content=str_replace('tryjqmob_switch.htm','http://www.w3schools.com/jquerymobile/tryjqmob_switch.htm',$content);\n$content=str_replace('tryjqmob_slider.htm','http://www.w3schools.com/jquerymobile/tryjqmob_slider.htm',$content);\n$content=str_replace('selectmenu.jpg','http://www.w3schools.com/jquerymobile/selectmenu.jpg',$content);\n$content=str_replace('tryjqmob_forms.htm','http://www.w3schools.com/jquerymobile/tryjqmob_forms.htm',$content);\n$content=str_replace('tryjqmob_filters_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_filters_app.htm',$content);\n$content=str_replace('tryjqmob_lists.htm','http://www.w3schools.com/jquerymobile/tryjqmob_lists.htm',$content);\n$content=str_replace('tryjqmob_lists_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_lists_app.htm',$content);\n$content=str_replace('tryjqmob_collapsible_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_collapsible_app.htm',$content);\n$content=str_replace('tryjqmob_panels_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_panels_app.htm',$content);\n$content=str_replace('tryjqmob_navbars_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_navbars_app.htm',$content);\n$content=str_replace('tryjqmob_toolbars.htm','http://www.w3schools.com/jquerymobile/tryjqmob_toolbars.htm',$content);\n$content=str_replace('tryjqmob_default.htm','http://www.w3schools.com/jquerymobile/tryjqmob_default.htm',$content);\n$content=str_replace('tryjqmob_popup_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_popup_app.htm',$content);\n$content=str_replace('tryjqmob_icon_app.htm','http://www.w3schools.com/jquerymobile/tryjqmob_icon_app.htm',$content);\n$content=str_replace('tryjqmob_button_app.htm','http://www.w3schools.com/jquerymobile/jqmsupport.jpg',$content);\n$content=str_replace('<img src=\"/images/w3cert.gif\"','<div class=\"bottom-ads\"',$content);\n$content=str_replace('src=\"selector.gif\"','src=\"http://www.w3schools.com/css/selector.gif\"',$content);\n$content=str_replace('href','data-href',$content);\n$content=str_replace('W3Schools','Website myweb.pro.vn',$content);\n$content=str_replace('pic_html5.gif','/images/pic_html5.gif',$content);\n$content=str_replace('bs.png','http://www.w3schools.com/bootstrap/bs.png',$content);\n$content=str_replace('transforms.gif','http://www.w3schools.com/css/transforms.gif',$content);\n$content=str_replace('pic_angular.jpg','http://www.w3schools.com/angular/pic_angular.jpg',$content);\n$content=str_replace('pic_appml.jpg','http://www.w3schools.com/appml/pic_appml.jpg',$content);\n$content=str_replace('nodetree.gif','http://www.w3schools.com/dom/nodetree.gif',$content);\n$content=str_replace('Customers.html','http://www.w3schools.com/website/Customers.html',$content);\n$content=str_replace('pic_browsers_pie.png','http://www.w3schools.com/browsers/pic_browsers_pie.png',$content);\n$content=str_replace('pic_chrome50.gif','http://www.w3schools.com/browsers/pic_chrome50.gif',$content);\n$content=str_replace('pic_firefox50.png','http://www.w3schools.com/browsers/pic_firefox50.png',$content);\n$content=str_replace('pic_ie50.png','http://www.w3schools.com/browsers/pic_ie50.png',$content);\n$content=str_replace('pic_safari50.gif','http://www.w3schools.com/browsers/pic_safari50.gif',$content);\n$content=str_replace('pic_opera50.gif','http://www.w3schools.com/browsers/pic_opera50.gif',$content);\n$content=str_replace('http://www.w3schools.com/html/demo_html.asp','http://myweb.pro.vn/',$content);\n$content=str_replace('http://www.w3schools.com/stdtheme.css','http://myweb.pro.vn/css/font-awesome.css',$content);\n$content=str_replace('http://www.w3schools.com/html/demo_xhtml.asp','http://myweb.pro.vn/toefl/index',$content);\n$content=str_replace('http://www.w3schools.com/dom/note.xml','http://myweb.pro.vn/game/',$content);\nreturn $content;\n}", "function fix_links(&$talk_data) {\n\t# to some URL like http://elearning.physik..../attachment/...whatever.pdf\n\t#\n\t# This works by call-by-reference, that is, $talk_data is changed in-place.\n\t$wikiopen = preg_quote('[['); $wikiclose = preg_quote(']]');\n\t$ticket = $talk_data['ticket_id'];\n\tforeach($talk_data as &$value) {\n\t\t// resolve links to attachments\n\t\t$value = preg_replace(\"/(?:$wikiopen)?(?:raw-)?attachment:(.*?)(?:$wikiclose)?/i\",\n\t\t\t\"https://elearning.physik.uni-frankfurt.de/projekt/raw-attachment/ticket/$ticket/\\\\1\",\n\t\t\t$value);\n\t\t// whaa... remaining brackets\n\t\t$value = str_replace(']]', '', $value);\n\t}\n\tunset($value); // dereference\n}", "protected static function fixBBCodes($text, $uid) {\n\t\t$text = preg_replace('~\\[/list:(u|o)~i', '[/list', $text);\n\t\t// fix closing list element tags\n\t\t$text = preg_replace('~\\[/\\*:m:'.$uid.'\\]~i', '', $text);\n\t\t\n\t\t// remove uid\n\t\t$text = preg_replace('~\\[(/?[^:\\]]+):'.$uid.'~', '[$1', $text);\n\t\t$text = preg_replace('~:'.$uid.'\\]~', ']', $text);\n\t\t\n\t\t// fix size bbcode\n\t\t$text = preg_replace_callback('~(?<=\\[size=)\\d+(?=\\])~', function ($matches) {\n\t\t\t$wbbSize = 24;\n\t\t\tif ($matches[0] <= 50) $wbbSize = 8;\n\t\t\telse if ($matches[0] <= 85) $wbbSize = 10;\n\t\t\telse if ($matches[0] <= 150) $wbbSize = 14;\n\t\t\telse if ($matches[0] <= 200) $wbbSize = 18;\n\t\t\t\n\t\t\treturn $wbbSize;\n\t\t}, $text);\n\t\t\n\t\t// see: https://github.com/phpbb/phpbb3/blob/179f41475b555d0a3314d779d0d7423f66f0fb95/phpBB/includes/functions.php#L3767\n\t\t$text = preg_replace('#<!\\-\\- s(.*?) \\-\\-><img src=\".*? \\/><!\\-\\- s\\1 \\-\\->#', '\\\\1', $text);\n\t\t$text = preg_replace('#<!\\-\\- e \\-\\-><a href=\"mailto:(.*?)\">.*?</a><!\\-\\- e \\-\\->#', '[email]\\\\1[/email]', $text);\n\t\t$text = preg_replace('#<!\\-\\- ([mw]) \\-\\-><a (?:class=\"[\\w-]+\" )?href=\"(.*?)\">.*?</a><!\\-\\- \\1 \\-\\->#', '[url]\\\\2[/url]', $text);\n\t\t$text = preg_replace('#<!\\-\\- l \\-\\-><a (?:class=\"[\\w-]+\" )?href=\"(.*?)(?:(&amp;|\\?)sid=[0-9a-f]{32})?\">.*?</a><!\\-\\- l \\-\\->#', '[url]\\\\1[/url]', $text);\n\t\t\n\t\t// fix code php bbcode...\n\t\t$text = preg_replace_callback('#\\[code(=php)?\\](.*)\\[/code\\]#s', function ($matches) {\n\t\t\t$content = $matches[2];\n\t\t\t$content = str_replace(array(\n\t\t\t\t'<br />',\n\t\t\t\t'&nbsp;&nbsp;&nbsp;&nbsp;'\n\t\t\t), array(\n\t\t\t\t\"\\n\",\n\t\t\t\t\"\\t\"\n\t\t\t), $content);\n\t\t\t$content = preg_replace('#(?:<span class=\"syntax[^\"]*\">|</span>)#', '', $content);\n\t\t\t\n\t\t\treturn '[code'.$matches[1].']'.$content.'[/code]';\n\t\t}, $text);\n\t\t\n\t\t// convert attachments\n\t\t$text = preg_replace('~\\[attachment=(\\d+)\\]<!-- ia\\\\1 -->.*?<!-- ia\\\\1 -->\\[/attachment\\]~', '', $text); // TODO: not supported right now\n\t\t\n\t\t// remove crap\n\t\t$text = MessageUtil::stripCrap($text);\n\t\t\n\t\treturn $text;\n\t}", "function cms_rawurlrecode($url, $force = false, $tolerate_errors = false)\n{\n if ((cms_mb_strlen($url) > 255) || ($force)) {\n require_code('urls_simplifier');\n $url = _cms_rawurlrecode($url, $tolerate_errors);\n }\n\n return $url;\n}", "function _cleanup_image_add_caption($matches)\n {\n }", "function bot_mt_replace_handler(&$matches)\n {\n\n // echo \"DEBUG5:\".$this->_params->get('blog_mode') .\"<br/>\";\n\n //\n // inline parameters processing\n //\n if (strtolower(substr($matches[0], 0, 11)) == '{multithumb') {\n // Just for remding: '|{multithumb([^}]*)}#is';\n $this->inline_parms($matches[3]);\n\n // go to the next match\n return '';\n\n }\n\n // it's a normal image\n return $this->image_replacer($matches);\n }", "function pixtulate_filter ( $content ) {\r\n\t$pixtulate_connector = get_option ( 'pixtulate_connector' );\r\n\t$base_url = get_site_url();\r\n\r\n\t$base_url_arr = parse_url($base_url);\r\n\tif ($base_url_arr[path]) {\r\n\t\t$base_url_mod = $base_url_arr[scheme]. '\\:\\/\\/' .$base_url_arr[host]. '\\\\' .$base_url_arr[path];\r\n\t} else {\r\n\t\t$base_url_mod = $base_url_arr[scheme]. '\\:\\/\\/' .$base_url_arr[host];\r\n\t}\r\n\r\n\tif($pixtulate_connector == $base_url)\r\n\t\treturn preg_replace(\"/(src=\\\")(.*)([^>]*)(\".$base_url_mod.\"\\/)/\", \"data-$1$2$3\", $content);\r\n\telse\r\n\t\treturn preg_replace(\"/(src=\\\")(.*)([^>]*)(uploads\\/)/\", \"data-$1$3\", $content);\r\n}", "function pd_img_unautop($imgWrap)\n{\n $imgWrap = preg_replace('/<p>\\\\s*?(<a .*?><img.*?><\\\\/a>|<img.*?>)?\\\\s*<\\\\/p>/s', '<figure>$1</figure>', $imgWrap);\n return $imgWrap;\n}", "function pixtulate_type_filter ( $content ) {\r\n\t$post_type = get_post_type();\r\n\r\n\tif($post_type == 'page' || $post_type == 'post') {\r\n\t\t$pixtulate_connector = get_option ( 'pixtulate_connector' );\r\n\t\t$base_url = get_site_url();\r\n\r\n\t\t$base_url_arr = parse_url($base_url);\r\n\r\n\t\tif ($base_url_arr[path]) {\r\n\t\t\t$base_url_mod = $base_url_arr[scheme]. '\\:\\/\\/' .$base_url_arr[host]. '\\\\' .$base_url_arr[path];\r\n\t\t} else {\r\n\t\t\t$base_url_mod = $base_url_arr[scheme]. '\\:\\/\\/' .$base_url_arr[host];\r\n\t\t}\r\n\r\n\t\tif($pixtulate_connector == $base_url)\r\n\t\t\treturn preg_replace(\"/(src=\\\")(.*)([^>]*)(\".$base_url_mod.\"\\/)/\", \"data-$1$2$3\", $content);\r\n\t\t\t// return preg_replace(\"/(src=\\\")(.*)([^>]*)/\", \"data-$1$2$3\", $content);\r\n\t\telse\r\n\t\t\treturn preg_replace(\"/(src=\\\")(.*)([^>]*)(uploads\\/)/\", \"data-$1$3\", $content);\r\n\t}\r\n}", "function attachment_image_link_remove_filter($content) {\n $content = preg_replace(array('{<a(.*?)(wp-att|wp-content\\/uploads)[^>]*><img}', '{ wp-image-[0-9]*\" /></a>}'), array('<img', '\" />'), $content);\n return $content;\n}", "protected function updateBrokenLinks() {}", "function parse_bbcode($str = '', $max_images = 500)\n\t{\n\t if($max_images > 0):\n\t\t $str_max = \"style=685fdf61c833dc53d197f0a2d1a04148f90f0d4aquot;max-width:\".$max_images.\"px; width: [removed]this.width > \".$max_images.\" ? \".$max_images.\": true);685fdf61c833dc53d197f0a2d1a04148f90f0d4aquot;\";\n\t endif;\n\n\t $find = array(\n\t\t\"'\\[b\\](.*?)\\[/b\\]'is\",\n\t\t\"'\\[i\\](.*?)\\[/i\\]'is\",\n\t\t\"'\\[u\\](.*?)\\[/u\\]'is\",\n\t\t\"'\\[s\\](.*?)\\[/s\\]'is\",\n\t\t\"'\\[img\\](.*?)\\[/img\\]'i\",\n\t\t\"'\\[url\\](.*?)\\[/url\\]'i\",\n\t\t\"'\\[url=(.*?)\\](.*?)\\[/url\\]'i\",\n\t\t\"'\\[link\\](.*?)\\[/link\\]'i\",\n\t\t\"'\\[link=(.*?)\\](.*?)\\[/link\\]'i\",\n\t );\n\n\t $replace = array(\n\t\t'<strong>\\1</strong>',\n\t\t'<em>\\1</em>',\n\t\t'<u>\\1</u>',\n\t\t'<s>\\1</s>',\n\t\t'<img src=\"\\1\" alt=\"\" />',\n\t\t'<a href=\"\\1\">\\1</a>',\n\t\t'<a href=\"\\1\">\\2</a>',\n\t\t'<a href=\"\\1\">\\1</a>',\n\t\t'<a href=\"\\1\">\\2</a>',\n\t );\n\n\t return str_replace( \"\\r\\n\", \"<br />\", preg_replace($find, $replace, $str) );\n\t}", "function Sanitizer($game){\n $lowerCase = strtolower($game);\n $stringCleaner = str_replace(array(' ', ',', '!',\"'\", '-', '?',), '', $lowerCase);\n $jpgFileName = 'http://cacheimg.casinomidas.com/images/www/games/minipods/'.$stringCleaner.'-minipod.jpg';\n return $jpgFileName;\n}", "function replace_images_with_placeholders( string $content ) : string {\n\tif ( filter_input( INPUT_GET, 'noscript-load-images', FILTER_VALIDATE_BOOLEAN ) ) {\n\t\treturn $content;\n\t}\n\tif ( ! preg_match_all( '/<img [^>]+>/', $content, $images ) ) {\n\t\treturn $content;\n\t}\n\tforeach ( $images[0] as $image ) {\n\t\t$attachment_id = null;\n\t\t$image_attr = preg_match_all( '/\\s([\\w-]+)([=\\s]([\\'\\\"])((?!\\3).+?[^\\\\\\])\\3)?/', $image, $match_attr ) ? array_combine( array_map( 'esc_attr', $match_attr[1] ), array_map( 'esc_attr', $match_attr[4] ) ) : [];\n\t\tif ( ! empty( $image_attr['class'] ) && preg_match( '/wp-image-([0-9]+)/i', $image_attr['class'], $class_id ) ) {\n\t\t\t$attachment_id = absint( $class_id[1] );\n\t\t}\n\t\tif ( ! $attachment_id ) {\n\t\t\t$attachment_id = url_to_attachment_id( $image_attr['src'] );\n\t\t}\n\t\tif ( ! $attachment_id ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$svg_string = get_placeholder_svg( $attachment_id, $image_attr, apply_filters( 'lazy_load_images_svg_placeholder_style', 'color-block-grid', $image, $image_attr, $attachment_id ) );\n\t\tif ( ! $svg_string ) {\n\t\t\tcontinue;\n\t\t}\n\t\twp_enqueue_script( 'lazy-load-images' );\n\t\tif ( isset( $image_attr['src'] ) ) {\n\t\t\t$image_attr['data-src'] = $image_attr['src'];\n\t\t\t$image_attr['src'] = 'data:image/svg+xml;charset=UTF-8,' . rawurlencode( $svg_string );\n\t\t}\n\t\tif ( isset( $image_attr['srcset'] ) ) {\n\t\t\t$image_attr['data-srcset'] = $image_attr['srcset'];\n\t\t\tunset( $image_attr['srcset'] );\n\t\t}\n\t\tif ( isset( $image_attr['sizes'] ) ) {\n\t\t\t$image_attr['data-sizes'] = $image_attr['sizes'];\n\t\t\tunset( $image_attr['sizes'] );\n\t\t}\n\t\t$content = str_replace(\n\t\t\t$image, apply_filters(\n\t\t\t\t'lazy_load_images_placeholder_image', '<img ' . implode(\n\t\t\t\t\t' ', array_map(\n\t\t\t\t\t\tfunction( string $key, string $value ) : string {\n\t\t\t\t\t\t\t\treturn esc_attr( $key ) . '=\"' . esc_attr( $value ) . '\"';\n\t\t\t\t\t\t}, array_keys( $image_attr ), $image_attr\n\t\t\t\t\t)\n\t\t\t\t) . ' /><noscript><form><button name=\"noscript-load-images\" value=\"true\">Load Images</button></form></noscript>', $image, $image_attr, $svg_string\n\t\t\t), $content\n\t\t);\n\t}\n\treturn $content;\n}", "function clean_urls($text) {\r\n\t$text = strip_tags(lowercase($text));\r\n\t$code_entities_match = array(' ?',' ','--','&quot;','!','@','#','$','%',\r\n '^','&','*','(',')','+','{','}','|',':','\"',\r\n '<','>','?','[',']','\\\\',';',\"'\",',','/',\r\n '*','+','~','`','=','.');\r\n\t$code_entities_replace = array('','-','-','','','','','','','','','','','',\r\n '','','','','','','','','','','','','');\r\n\t$text = str_replace($code_entities_match, $code_entities_replace, $text);\r\n\t$text = urlencode($text);\r\n\t$text = str_replace('--','-',$text);\r\n\t$text = rtrim($text, \"-\");\r\n\treturn $text;\r\n}", "function horse_thatbooks_misc_cleanup( $output ) {\n\t// MANGLED LINK SHORTENERS\n\t$botched_url_snippets = array(\n\t\t'/tco/' => '/t.co/'\n\t);\n\n\tforeach( $botched_url_snippets as $bus => $r ) {\n\t\t$output = str_replace( $bus, $r, $output );\n\t}\n\n\t// HTML ENTITIES\n\t$output = htmlspecialchars_decode( $output );\n\n\t// BEGINNINGS OF STRINGS\n\t// The only non-alphanumeric character allowed at the beginning of strings is a dot, when\n\t// followed immediately by an @\n\tpreg_match( '/^[a-zA-Z@0-9]/', $output, $matches );\n\tif ( empty( $matches ) ) {\n\t\tswitch ( substr( trim( $output ), 0, 1 ) ) {\n\t\t\tcase '.' :\n\t\t\t\tif ( '@' == substr( trim( $output ), 1, 1 ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// else fall through\n\n\t\t\tdefault :\n\t\t\t\t$output = trim( substr( trim( $output ), 1 ) );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn $output;\n}", "function cleanLink($input) {\n\t// Prefix URL with http:// if it was missing from the input\n\tif(trim($input[url]) != \"\" && !preg_match(\"#^https?://.*$#\",$input[url])) { $input[url] = \"http://\" . $input[url]; } \t\n\t\t\n\t\t$curly = array(\"{\",\"}\");\n\t\t$curly_replace = array(\"&#123;\",\"&#125;\");\n\t\t\n\t\tforeach($input as $field => $data) {\n\t\t\t$input[$field] = filter_var(trim($data),FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\t$input[$field] = str_replace($curly,$curly_replace,$input[$field]); // Replace curly brackets (needed for placeholders to work)\n\t\t\t\t\n\t\tif($field == \"url\") {\n\t\t\t$input[url] = str_replace(\"&#38;\",\"&\",$input[url]); // Put &s back into URL\n\t\t\n\t\t}\n\t}\t\n\treturn($input);\n}", "function snipVerbottenImagesFromPost($post_id) {\n // make a query to the verbottenimage_posts table\n // question: what are the verbotten_image_id s? remeber there might be multiple\n // now find their positiions iin the post_content, and cycle through them stating with last first ( so as to not upset subsequent positiions)\n global $wpdb;\n $someObj = new stdClass;\n\n\n // The post featured image link stored in the WordPress database is stored in wp_postmeta with a meta_key called _thumbnail_id.\n // in wp_posts_meta, wwhere meta_key = _thumbnail_id and meta_value = the verbotten_image_id and the post_id is the post_id ... then we need to \n // should we delete? or should we instead change the meta key from _thumbnail_id ==> verbottenimage_id and also do a substitution ... add a new record \n // ... mostly identical to the previous one, putting _thumbnail_id --> a known substitute image. Alternatively, we could store all the data pertaining to the deleted verbotten images someplace else. LEt's say, in a different table altogether.\n \n\n // get the data for that post_id\n // verbottenimage_posts\n // check the thumbnail id, if the thumbnail id is one of the verbotten images, then fix it.\n\n \n // do the backup + featured image substitution first.\n\n\n $verbottenimage_post_images_query_result = $wpdb->get_results(\"SELECT * FROM verbottenimage_posts WHERE verbottenimage_posts.post_id = {$post_id}\");\n \n if (count($verbottenimage_post_images_query_result) > 0 ) {\n\n\n\n // change the meta key from _thumbnail_id in wp_post_meta 507117\n\n \n\n $somePostContent = $verbottenimage_post_images_query_result[0]->post_content;\n\n // get the $imgPositions\n preg_match_all('/(<img)/', $somePostContent, $imgPositions, PREG_OFFSET_CAPTURE);\n\n $snips = Array();\n // find the position if the needle in the hayStack\n forEach($verbottenimage_post_images_query_result AS $item) {\n $needle = 'wp-image-' . $item->verbotten_image_id . '\"';\n // strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ) : int\n $needlePos = strpos($somePostContent, $needle);\n if ($needlePos === false) {\n $needle = 'wp-image-' . $item->verbotten_image_id . ' ';\n $needlePos = strpos($somePostContent, $needle);\n }\n // and then reset needle back to original\n $needle = 'wp-image-' . $item->verbotten_image_id;// it is not used, just going pack in the json response\n\n $snipObj = new stdClass;\n $snipObj->id = $item->verbotten_image_id;\n $snipObj->identifier = $needle;\n\n $snipObj->needlePos = $needlePos;\n // $snipObj->imgPositions = $imgPositions;\n \n $possibleSnipStartPositions = Array();\n forEach($imgPositions[0] AS $possibleSnipStartObj) {// for some reason there are two identical arrays in an array?! so we jsut use the first one, which gives us an array of 2-item arrays, the second of which [1], is the positiion\n array_push($possibleSnipStartPositions, $possibleSnipStartObj[1]);\n }\n \n $snipStart = 0;\n forEach($possibleSnipStartPositions AS $pos) {\n if($pos < $needlePos && $pos > $snipStart) {\n $snipStart = $pos;\n }\n }\n \n $snipObj->snipStart = $snipStart;// the the highest in imgPositions that is below $needlePos\n $snipObj->snipEnd = strpos($somePostContent, '>', $needlePos) + 1; // the lowest > character that is above $needlePos. +1 because the '>' is precisely 1 character in length\n array_push($snips, $snipObj);\n\n }\n // remove all the snips where !needlePos\n foreach ($snips as $key => $snipObj) {\n if ($snipObj->needlePos === false) {\n unset($snips[$key]);\n }\n}\n // make sure that the $snips are ordered in order of their needlePos\n usort($snips, \"sortOnReverseNeedlePos\");\n\n // and now we start snipping. We have $somePostContent already to start with.\n\n\n\t\t// this works\n\n $snippedContent = $somePostContent;// start with somePostContent, but allow progressive snips to occur.\n forEach($snips AS $snipObj) {\n // make the html comment that has the edit link in it. And sandwhich iit between the snips\n $editLinkComment = \"<!-- AnImageWasRemoved edit-link: https://www.everythingzoomer.com/wp-admin/upload.php?item={$snipObj->id} -->\";\n $firstHalf = substr($snippedContent, 0, $snipObj->snipStart);\n $secondHalf = substr($snippedContent, $snipObj->snipEnd);\n $snippedContent = $firstHalf . $editLinkComment . $secondHalf;\n }\n // $someObj->snippedContent = $snippedContent;\n // now we are done with all the snipping, and are ready to make the query to update.\n\n // and now make the query \n // $verbottenimage_post_images_query_result = $wpdb->get_results(\"SELECT * FROM verbottenimage_posts WHERE verbottenimage_posts.post_id = {$post_id}\");\n \n // $snipQuery = $wpdb->get_results(\"UPDATE verbottenimage_posts SET fixed_post_content = {$snippedContent} WHERE verbottenimage_posts.post_id = {$post_id}\");// this does them all at once, instead of doing it sequentially. it will do them all, multiple times, but whatever, it will be inefficient, but still work\n $snipQuery = $wpdb->update(\n 'verbottenimage_posts',\n array( \n 'fixed_post_content' => $snippedContent\n ),\n array(\n 'post_id' => $post_id \n )\n );\n\n // now, let's actually snip the post_content from wp_posts\n $replaceActualPostContentQuery = $wpdb->update(\n 'wp_posts',\n array( \n 'post_content' => $snippedContent\n ),\n array(\n 'ID' => $post_id \n )\n );\n\n // and lastly, let's update the removed for each of the verbottenimages .. only after te post has been updated.\n $reeplacedQuery = $wpdb->update(\n 'verbottenimage_posts',\n array( \n 'removed' => 1\n ),\n array(\n 'post_id' => $post_id \n )\n );\n\n\n $someObj->snipQuery = $snipQuery;\n }\n \n // $numberOfImages = substr_count($somePostContent, '<img');\n \n $someObj->snips = $snips;\n return $someObj;\n // return $verbottenimage_post_images_query_result;\n }", "function replacespecialcharsurl($str){\n\t\t$str=trim($str);\n\t\t$str=ereg_replace(\"&#039;\",\"\",$str);\n\t\t$str=ereg_replace(\"\\/\",\"\",$str);\n\t\t$str=ereg_replace(\"-\",\"\",$str);\n\t\t$str=ereg_replace('\"',\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"#\",\"\",$str);\n\t\t$str=ereg_replace(\"\\?\",\"\",$str);\n\t\t$str=ereg_replace(\",\",\"\",$str);\n\t\t$str=ereg_replace(\"'\",\"\",$str);\n\t\t$str=ereg_replace(\"&\",\"\",$str);\n\t\t$str=ereg_replace(\"\\.\",\"\",$str);\n\t\t$str=ereg_replace(\":\",\"\",$str);\n\t\t$str=ereg_replace(\"\\(\",\"\",$str);\n\t\t$str=ereg_replace(\"\\)\",\"\",$str);\n\t\t$str=ereg_replace(\"!\",\"\",$str);\n\t\t$str=ereg_replace(\"\\%\",\"\",$str);\n\t\t$str=ereg_replace(\"\\>\",\"\",$str);\n\t\t$str=ereg_replace(\" \",\" \",$str);\n\t\t$str=ereg_replace(\" \",\"-\",$str);\n\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"�\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=ereg_replace(\"’\",\"\",$str);\n\t\t$str=strtolower($str);\n\t\treturn $str;\n}", "function tidy_theme_img_code($new, $old, $table, $field, $db = null)\n{\n if ($new === $old) {\n return; // Still being used\n }\n\n $path = ($old == '') ? null : find_theme_image($old, true, true);\n if ((is_null($path)) || ($path == '')) {\n return;\n }\n\n if ((strpos($path, '/images_custom/') !== false) && ($GLOBALS['SITE_DB']->query_select_value('theme_images', 'COUNT(DISTINCT id)', array('path' => $path)) == 1)) {\n if (is_null($db)) {\n $db = $GLOBALS['SITE_DB'];\n }\n $count = $db->query_select_value($table, 'COUNT(*)', array($field => $old));\n if ($count == 0) {\n @unlink(get_custom_file_base() . '/' . $path);\n sync_file(get_custom_file_base() . '/' . $path);\n $GLOBALS['SITE_DB']->query_delete('theme_images', array('id' => $old));\n }\n }\n}", "protected function fix_supporting_file_references() {\r\n\t\tpreg_match_all('/<link([^<>]*?) href=\"([^\"]*?)\"([^<>]*?)\\/>/is', $this->code, $link_matches);\r\n\t\t/*$counter = sizeof($link_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t\r\n\t\t\t$counter--;\r\n\t\t}*/\r\n\t\t$array_replaces = array();\r\n\t\tforeach($link_matches[0] as $index => $value) {\r\n\t\t\t$href_content = $link_matches[2][$index];\r\n\t\t\tif($href_content[0] === '/' || strpos($href_content, 'http://') !== false) { // avoid root references and URLs\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$initial_href_content = $href_content;\r\n\t\t\t\t\t// first try looking closer\r\n\t\t\t\t\t$proper_reference = false;\r\n\t\t\t\t\twhile(!$proper_reference && substr($href_content, 0, 3) === '../') {\r\n\t\t\t\t\t\t$href_content = substr($href_content, 3);\r\n\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // try looking farther\r\n\t\t\t\t\t\t$counter = 0;\r\n\t\t\t\t\t\twhile(!$proper_reference && $counter < 10) {\r\n\t\t\t\t\t\t\t$href_content = '../' . $href_content;\r\n\t\t\t\t\t\t\t$relative_path = ReTidy::resolve_relative_path($href_content, $this->file);\r\n\t\t\t\t\t\t\tif(file_exists($relative_path)) {\r\n\t\t\t\t\t\t\t\t$proper_reference = true;\r\n\t\t\t\t\t\t\t\t$array_replaces['href=\"' . $initial_href_content . '\"'] = 'href=\"' . $href_content . '\"';\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$counter++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!$proper_reference) { // give up or finish\r\n\t\t\t\t\t\tvar_dump($this->file, $href_content, $relative_path);exit(0);\r\n\t\t\t\t\t\tprint('<span style=\"color: red;\">Could not fix broken reference in &lt;link&gt;: ' . $value . '</span>');exit(0);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->logMsg('Reference ' . htmlentities($value) . ' was fixed.');\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\tforeach($array_replaces as $index => $value) {\r\n\t\t\t$this->code = str_replace($index, $value, $this->code);\r\n\t\t}\r\n\t}", "function imageProcessor($text)\r\n {\r\n $this->images = array();\r\n // если включена обработка пробелов в путях картинок\r\n if ($this->feed['params']['image_space_on']) {\r\n $text = preg_replace_callback('|<img(.*?)src(.*?)=[\\s\\'\\\"]*(.*?)[\\'\\\"](.*?)>|is', array(&$this, 'imageParser'), $text);\r\n } else {\r\n $text = preg_replace_callback('|<img(.*?)src(.*?)=[\\s\\'\\\"]*(.*?)[\\'\\\"\\s](.*?)>|is', array(&$this, 'imageParser'), $text);\r\n }\r\n return $text;\r\n }", "function tags_tinymce_fix( $init )\n{\n // html elements being stripped\n $init['extended_valid_elements'] = 'div[*],article[*]';\n // don't remove line breaks\n $init['remove_linebreaks'] = false;\n // convert newline characters to BR\n $init['convert_newlines_to_brs'] = true;\n // don't remove redundant BR\n $init['remove_redundant_brs'] = false;\n // pass back to wordpress\n return $init;\n}", "function wpfme_remove_img_ptags($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function wph_remove_p_images($content) {\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "private function fixUri(){\n\t\t$this->uri = rtrim($this->uri,'/');\n\t}", "public function fix() {}", "public function fix() {}", "function __urls_amigables($url) {\n $url = strtolower($url);\n \n //Rememplazamos caracteres especiales latinos\n $find = array('�', '�', '�', '�', '�', '�');\n $repl = array('a', 'e', 'i', 'o', 'u', 'n');\n $url = str_replace ($find, $repl, $url);\n \n // A�aadimos los guiones\n $find = array(' ', '&', '\\r\\n', '\\n', '+');\n $url = str_replace ($find, '-', $url);\n \n // Eliminamos y Reemplazamos dem�s caracteres especiales\n $find = array('/[^a-z0-9\\-<>]/', '/[\\-]+/', '/<[^>]*>/');\n $repl = array('', '-', '');\n $url = preg_replace ($find, $repl, $url);\n return $url;\n }", "function filter_ptags_on_images($content){\n$content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\nreturn preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function unescape_invalid_shortcodes($content)\n {\n }", "function _fix_data() {\n\t\tif (isset($this->url) && $this->url) $this->_parse_url($this->url);\n\n\t\treturn true;\n\t}", "function clean_word() {\r\n\t\tpreg_match_all('/<img[^<>]*? alt=\"Text Box:\\s*([^\"]*?)\"[^<>]*?>/is', $this->code, $text_box_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$counter = sizeof($text_box_matches[0]) - 1;\r\n\t\twhile($counter > -1) {\r\n\t\t\t$offset = $text_box_matches[0][$counter][1];\r\n\t\t\t$text = $text_box_matches[1][$counter][0];\r\n\t\t\t$text = '<p>' . str_replace('&#13;&#10;', '</p>\r\n<p>', $text) . '</p>';\r\n\t\t\t$this->code = substr($this->code, 0, $offset) . $text . substr($this->code, $offset + strlen($text_box_matches[0][$counter][0]));\r\n\t\t\t$counter--;\r\n\t\t}\r\n\t\t\r\n\t\t// although at least firefox seems smart enough to not display them, \r\n\t\t// some versions of word may use soft hyphens for print layout or some such nonsense\r\n\t\t// is this a candidate for general (basic) usage?\r\n\t\t$this->code = str_replace('&shy;', '', $this->code);\r\n\t\t// this needs revision for array(\"­\", \"&#173;\", \"&#xad;\", \"&shy;\"); and the fact that soft hyphens are misused by document authors (specific case: they show in RTF files but not in firefox)\r\n\t\t\r\n\t\tReTidy::decode_for_DOM_all_character_entities(); // since much of the clean_word work is removing styles\r\n\t\t\r\n\t\t// should we simply eliminate all names and ids (since the structure function will generate those which are needed)?\r\n\t\t// seems we should except for footnotes: _ftnref _ftn _ednref _edn\r\n\t\t$this->code = preg_replace('/ id=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"/is', '', $this->code);\r\n\t\t$this->code = preg_replace('/(<a[^<>]*?) name=\"([^_][^\"]*?|_[^fe][^\"]*?|_f[^t][^\"]*?|_e[^d][^\"]*?|_ft[^n][^\"]*?|_ed[^n][^\"]*?)\"([^<>]*?>)/is', '$1$3', $this->code);\r\n\t\t\r\n\t\t\r\n\t\t// often in word documents the lang attributes are wrong... so:\r\n\t\t$this->code = preg_replace('/ lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"EN[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t$this->code = preg_replace('/ xml:lang=\"FR[^\"]*\"/', '', $this->code);\r\n\t\t\r\n\t\t// white background\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)whiteBG([^\"]*)\"/is', ' class=\"$1$2\"', $this->code);\r\n\t\t// parks canada specific:\r\n\t\t$this->code = preg_replace('/ class=\"([^\"]*)backTop([^\"]*)\"/is', ' class=\"$1alignRight$2\"', $this->code);\t\t\r\n\t\t\r\n\t\t// topPage; these should not exist (since documents in their original format shall not have links to the top)\r\n\t\t// but they sometimes come from styles to classes. On tags other than spans they style the alignment.\r\n\t\t$this->code = preg_replace('/<span([^>]*)class=\"([^\"]*)topPage([^\"]*)\"/is', '<span$1class=\"$2$3\"', $this->code);\r\n\t\t\r\n\t\t// word document section <div>s\r\n\t\t//$this->code = preg_replace('/<div style=\"page\\s*:\\s*[^;]+;\">/is', '<div stripme=\"y\">', $this->code);\r\n\t\tReTidy::non_DOM_stripme('<div style=\"page\\s*:\\s*[^;]+;\">');\r\n\t\t\r\n\t\t// remove style information declarations(?) or qualifications(?) like !msnorm and !important? \r\n\t\t// Nah, there is no need until word is seen to use !important (it could also be in government stylesheets so there is the remote chance that we\r\n\t\t// would like to keep it). Definately get rid of !msnorm though.\r\n\t\t$arrayStyleInformationPiecesToDelete = array(\r\n\t\t'!msorm',\r\n\t\t);\r\n\t\tforeach($arrayStyleInformationPiecesToDelete as $styleInformationPieceToDelete) {\r\n\t\t\t$styleInformationPieceToDeleteCount = -1;\r\n\t\t\twhile($styleInformationPieceToDeleteCount != 0) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*?)' . $styleInformationPieceToDelete . '([^\"]*?)\"/is', 'style=\"$1$2\"', $this->code, -1, $styleInformationPieceToDeleteCount);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// blockquote\r\n\t\tpreg_match_all('/<p[^<>]*style=[^<>]*(margin-right\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*(margin-left\\s*:\\s*([^;\\'\"]*)[;\\'\"])[^<>]*>(.*?)<\\/p>/is', $this->code, $p_matches2);\r\n\t\tforeach($p_matches2[0] as $index => $value) {\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[2][$index], $margin_right_matches);\r\n\t\t\tpreg_match('/([0-9\\.]*)in/', $p_matches2[4][$index], $margin_left_matches);\r\n\t\t\tif($margin_right_matches[1] > 0.4 && $margin_left_matches[1] > 0.4) {\r\n\t\t\t\t$original = $new = $p_matches2[0][$index];\r\n\t\t\t\t$new = str_replace($p_matches2[1][$index], '', $new);\r\n\t\t\t\t$new = str_replace($p_matches2[3][$index], '', $new);\r\n\t\t\t\t$new = str_replace('<p', '<div', $new);\r\n\t\t\t\t$new = str_replace('</p>', '</div>', $new);\r\n\t\t\t\t$new = \"<blockquote>\" . $new . \"</blockquote>\";\r\n\t\t\t\t$this->code = str_replace($original, $new, $this->code);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// onmouseover, onmouseout; attributes to delete\r\n\t\t$arrayAttributesToDelete = array(\r\n\t\t'onmouseover',\r\n\t\t'onmouseout',\r\n\t\t);\r\n\t\tforeach($arrayAttributesToDelete as $attributeToDelete) {\r\n\t\t\t$this->code = preg_replace('/' . $attributeToDelete . '=\"([^\"]*)\"/is', '', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// microsoft styles to delete\r\n\t\t$arrayMicrosoftStylesToDelete = array(\r\n\t\t'page-break-before',\r\n\t\t'page-break-after',\r\n\t\t'page-break-inside',\r\n\t\t'text-autospace',\r\n\t\t'text-transform',\t\t\r\n\t\t//'border',\r\n\t\t'border-left', // (2011-11-07)\r\n\t\t'border-right', // (2011-11-07)\r\n\t\t'border-bottom', // (2011-11-07)\r\n\t\t'border-top', // (2011-11-07)\r\n\t\t'border-collapse',\r\n\t\t'margin', //// notice that we may in some cases want to keep margins (as an indication of indentation)\r\n\t\t'margin-left', ////\r\n\t\t'margin-right', ////\r\n\t\t'margin-top', ////\r\n\t\t'margin-bottom', ////\t\t\t\t\t\t\t\r\n\t\t'padding',\r\n\t\t'padding-left',\r\n\t\t'padding-right',\r\n\t\t'padding-top',\r\n\t\t'padding-bottom',\r\n\t\t'font',\r\n\t\t'font-size', //// notice that we may in some cases want to keep font-size\r\n\t\t'font-family',\r\n\t\t//'font-style', // font-style: italic;\r\n\t\t//'text-decoration', // text-decoration: underline;\r\n\t\t'line-height',\r\n\t\t'layout-grid-mode',\r\n\t\t'page',\r\n\t\t'text-indent', //// notice that we may in some cases want to keep text-indent\r\n\t\t'font-variant', //// this may have to be amended in the future (if some document uses small caps without capitalizing those first letters that need to be capitalized)\r\n\t\t'mso-style-name',\r\n\t\t'mso-style-link',\r\n\t\t'z-index',\r\n\t\t'position',\r\n\t\t// we cannot enable the following and keep other style information that these are substrings of\r\n\t\t'top',\r\n\t\t'right',\r\n\t\t'bottom',\r\n\t\t'left',\r\n\t\t'letter-spacing',\r\n\t\t);\r\n\t\t// for this we assume that there are no embedded stylesheets\r\n\t\tforeach($arrayMicrosoftStylesToDelete as $microsoftStyle) {\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($microsoftStyle) . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif($this->config['strict_accessibility_level'] > 0) { // then just make it grey\r\n\t\t\twhile(true) {\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*;\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countA);\r\n\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape('color') . '\\s*:\\s*[^;\"]*\"/is', 'style=\"$1\"', $this->code, -1, $countB);\r\n\t\t\t\tif($countA === 0 && $countB === 0) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesToDelete = array(\r\n\t\t//'color' => array('black', 'windowtext'), // these can sometimes override other colours that we keep so ideally we would like to keep these in but style attributes for colour...\r\n\t\t'text-align' => array('justify'),\r\n\t\t'font-weight' => array('normal', 'normal !msorm', 'normal !msnorm'), \r\n\t\t// we take this out although it can usefully cascade other styles\r\n\t\t// which brings up the point that these all probably can... ;(\r\n\t\t//'font-variant' => array('normal', 'normal!important', 'normal !important', 'small-caps'),\r\n\t\t'background' => array('white', '#FFFFFF'),\r\n\t\t'background-color' => array('white', '#FFFFFF'),\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesToDelete as $style => $value) {\r\n\t\t\tforeach($value as $information) {\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . ';\\s*([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countC);\r\n\t\t\t\t\t$this->code = preg_replace('/style=\"([^\"]*)' . ReTidy::preg_escape($style) . '\\s*:\\s*' . ReTidy::preg_escape($information) . '\"/is', 'style=\"$1\"', $this->code, -1, $countD);\r\n\t\t\t\t\tif($countC === 0 && $countD === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$arrayMicrosoftStylesWithValuesOnTagsToDelete = array(\r\n\t\t'text-align' => array('left' => array('p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'font-weight' => array('bold' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),),\r\n\t\t'vertical-align' => array( \r\n\t\t// we should be careful here not to remove any styles that might be used to identify footnotes; although\r\n\t\t// I do not know of any that are currently (2011-11-28) used\r\n\t\t'baseline' => array('span'),\r\n\t\t'sub' => array('span'),\r\n\t\t'super' => array('span'),\r\n\t\t'top' => array('span'),\r\n\t\t'text-top' => array('span'),\r\n\t\t'middle' => array('span'),\r\n\t\t'bottom' => array('span'),\r\n\t\t'text-bottom' => array('span'),\r\n\t\t'inherit' => array('span'),\r\n\t\t),\r\n\r\n\t\t);\r\n\t\tforeach($arrayMicrosoftStylesWithValuesOnTagsToDelete as $property => $stylings) {\r\n\t\t\tforeach($stylings as $styling => $tags) {\r\n\t\t\t\t$tagsString = implode(\"|\", $tags);\r\n\t\t\t\twhile(true) {\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . ';\\s*([^\"]*)\"/is', '<$1$2 style=\"$3$4\"', $this->code, -1, $countE);\r\n\t\t\t\t\t$this->code = preg_replace('/<(' . $tagsString . ')([^<>]*) style=\"([^\"]*)' . ReTidy::preg_escape($property) . '\\s*:\\s*' . ReTidy::preg_escape($styling) . '\"/is', '<$1$2 style=\"$3\"', $this->code, -1, $countF);\r\n\t\t\t\t\tif($countE === 0 && $countF === 0) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// pseudo-elements\r\n\t\t// <a style=\":visited { color: purple; }\">\r\n\t\t$countE = -1;\r\n\t\twhile($countE !== 0) {\r\n\t\t\t//print(\"doing pseudo-elements<br>\\r\\n\");\r\n\t\t\t$this->code = preg_replace('/style=\"([^\"]{0,}):\\w+\\s*\\{[^\\{\\}]{0,}\\}([^\"]*)\"/is', 'style=\"$1$2\"', $this->code, -1, $countE);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// <hr> with width\r\n\t\t$this->code = preg_replace('/<hr([^<>]*) width=\"[^\"]*\"([^<>]*)\\/>/is', '<hr$1$2/>', $this->code);\r\n\t\t\r\n\t\t// microsoft using operating system independant CSS...\r\n\t\t// I guess for this we assume that we are using windows.\r\n\t\t$this->code = preg_replace('/style=\"([^\"]*)border\\s*:\\s*solid\\s+windowtext\\s+1.0pt\\s*(;?)([^\"]*)\"/is', 'style=\"$1border: 1px solid black$2$3\"', $this->code);\r\n\t\t\r\n\t\t// superscript using CSS\r\n\t\t//$this->code = preg_replace('/(<(\\w*)[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?)([^\"]*\"[^<>]*>.*?<\\/\\2>)/is', '<sup>$1$4</sup>', $this->code, -1, $countC);\r\n\t\t$this->code = preg_replace('/<(\\w+[^<>]* style=\"[^\"]*)vertical-align: super\\s*(;?[^\"]*\"[^<>]*)>/is', '<$1$2 newtag=\"sup\">', $this->code);\r\n\t\t\r\n\t\t// clean up stupidity generated by tidy\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) start=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t$this->code = preg_replace('/<div([^<>]*?) type=\"[^\"]*?\"([^<>]*?)>/is', '<div$1$2>', $this->code);\r\n\t\t\r\n\t\tReTidy::post_dom();\r\n\t\t// remove empty <a> tags; aside from general cleanup, to avoid the regular expression recursion limit of 100 (for the ridiculous\r\n\t\t// case of something like that many anchors at the same spot...\r\n\t\t//$this->code = str_replace('<a></a>', '', $this->code);\r\n\t\t$this->code = preg_replace('/<a>([^<>]*?)<\\/a>/is', '$1', $this->code);\r\n\t//\tReTidy::extra_space();\r\n\t\t\r\n\t\t// lists where each list element has a <ul>\r\n\t\tif(ReTidy::is_XHTML()) {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br /><br /></li>', $this->code);\r\n\t\t} else {\r\n\t\t\t$this->code = preg_replace('/<\\/li>\\s*<\\/ul>\\s*<ul( [^<>]*)?>/is', '<br><br></li>', $this->code);\r\n\t\t}\r\n\t\t\r\n\t\t// empty text blocks; notice that we would not want to do this generally\r\n\t\t$this->code = preg_replace('/<(p|h1|h2|h3|h4|h5|h6|li)( [^<>]*){0,1}>&nbsp;<\\/\\1>/is', '', $this->code);\r\n\t\t// some sort of full-width break from word that we do not want\r\n\t\t$this->code = preg_replace('/<br [^<>]*clear\\s*=\\s*[\"\\']*all[\"\\']*[^<>]*\\/>/is', '', $this->code);\r\n\t\t// force a border onto tables because word html uses border on cells rather than on the table\r\n\t\t$this->code = preg_replace('/<table([^<>]*) border=\"0\"/is', '<table$1 border=\"1\"', $this->code);\r\n\t\t// despan anchors\r\n\t\tpreg_match_all('/(<a ([^<>]*)[^\\/<>]>)(.*?)(<\\/a>)/is', $this->code, $anchor_matches);\r\n\t\tforeach($anchor_matches[0] as $index => $value) {\r\n\t\t\tif(strpos($anchor_matches[2][$index], \"href=\") === false) {\r\n\t\t\t\tif(strpos($anchor_matches[2][$index], \"name=\") !== false || strpos($anchor_matches[2][$index], \"id=\") !== false) {\r\n\t\t\t\t\t$this->code = str_replace($anchor_matches[1][$index] . $anchor_matches[3][$index] . $anchor_matches[4][$index], $anchor_matches[1][$index] . $anchor_matches[4][$index] . $anchor_matches[3][$index], $this->code);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// simplify lists that unnecessarily have a list for each list item\r\n\t\tpreg_match_all('/<ol([^<>]*?)>(.*?)<\\/ol>/is', $this->code, $ol_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$size = sizeof($ol_matches[0]) - 1;\r\n\t\twhile($size > -1) {\r\n\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $start_matches);\r\n\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size][0], $type_matches);\r\n\t\t\t$start = $start_matches[1];\r\n\t\t\t$type = $type_matches[1];\r\n\t\t\t$combine_string = \"\";\r\n\t\t\twhile(true) {\r\n\t\t\t\t$end_of_previous_offset = $ol_matches[0][$size - 1][1] + strlen($ol_matches[0][$size - 1][0]);\r\n\t\t\t\t$end_of_current_offset = $ol_matches[0][$size][1] + strlen($ol_matches[0][$size][0]);\r\n\t\t\t\t$combine_string = substr($this->code, $end_of_previous_offset, $end_of_current_offset - $end_of_previous_offset) . $combine_string;\r\n\t\t\t\tpreg_match('/ type=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $type_matches2);\r\n\t\t\t\t$type2 = $type_matches2[1];\r\n\t\t\t\tif($type !== $type2) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tpreg_match('/ start=\"([^\"]*?)\"/is', $ol_matches[0][$size - 1][0], $start_matches2);\r\n\t\t\t\t$start2 = $start_matches2[1];\r\n\t\t\t\tif(!is_numeric($start2) || $start2 >= $start) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tReTidy::preg_match_last('/<[^<>]+>/is', substr($this->code, 0, $ol_matches[0][$size][1]), $last_tag_piece_matches);\r\n\t\t\t\tif($last_tag_piece_matches[0] !== \"</ol>\") {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t$start = $start2;\r\n\t\t\t\t$size--;\r\n\t\t\t}\r\n\t\t\t$cleaned_combine_string = $combine_string;\r\n\t\t\t$cleaned_combine_string = preg_replace('/<\\/ol>\\s*<ol[^<>]*?>/is', '', $cleaned_combine_string);\r\n\t\t\t$this->code = str_replace($combine_string, $cleaned_combine_string, $this->code);\r\n\t\t\t$size--;\r\n\t\t}\r\n\t\t\r\n\t\tReTidy::clean_redundant_sufficient_inline();\r\n\t\tReTidy::double_breaks_to_paragraphs();\r\n\t\tReTidy::encode_for_DOM_all_character_entities(); // re-encode character entities that were decoded at the start of this function\r\n\t\t//$this->code = preg_replace('/(&nbsp;|&#160;|&#xA0;){3,}/is', '&nbsp;&nbsp;', $this->code); // added 2015-06-04\r\n\t\tReTidy::mitigate_consecutive_non_breaking_spaces(); // plz\r\n\t}", "function fixMarkdownImagePaths($md){\n return preg_replace('/(!\\[[^\\]]+\\]\\()([^()]+)(?=\\))/i', '$1' . LOGMD_POSTS_DIR_PATH . '$2', $md);\n }", "public static function imagesReplaceBase64( $html ){\n\n // $html = preg_replace('/<img%20/' , \"<img \" , $html );\n\n preg_match_all('/<img[^>]+>/i',$html,$out,PREG_PATTERN_ORDER);\n // return $out;\n if(count($out[0]) != 0 ){\n foreach($out[0] as $img){\n $begen = strpos($img, \"http\");\n $rest = substr($img,$begen);\n $LinksOfImages[] = str_replace(strstr($rest, '\"'),\"\",$rest);\n }\n } else {\n return $html ;\n }\n\n foreach($LinksOfImages as $link){\n $LinksOfImagess[$link] = str_replace(\" \",\"%20\",$link);\n }\n //return $LinksOfImagess;\n\n foreach($LinksOfImagess as $org => $link){\n try{\n\n $binary = file_get_contents($link);\n $base = base64_encode($binary);\n $mime = getimagesizefromstring($binary)[\"mime\"];\n $str=\"data:\".$mime.\";base64,\";\n $img = $str.$base;\n $arr[$org] = $img ;\n }catch (Exception $e) {\n $arr[$org] = $link;\n }\n }\n\n //return $arr;\n $htmsl = $html ;\n\n\n foreach($arr as $link => $base){\n $htmsl = str_replace($link,$base,$htmsl);\n }\n return $htmsl;\n }", "function fixDescription($Description) {\n\tif ( is_string($Description) ) {\n\t\t$Description = preg_replace(\"#\\[br\\s*\\]#i\", \"{}\", $Description);\n\t\t$Description = preg_replace(\"#\\[b[\\\\\\]*\\s*\\]#i\", \"||\", $Description);\n\t\t$Description = preg_replace('#\\[([^\\]]*)\\]#', '<$1>', $Description);\n\t\t$Description = preg_replace(\"#<span.*#si\", \"\", $Description);\n\t\t$Description = preg_replace(\"#<[^>]*>#i\", '', $Description);\n\t\t$Description = preg_replace(\"#\".\"{}\".\"#i\", '<br>', $Description);\n\t\t$Description = preg_replace(\"#\".\"\\|\\|\".\"#i\", '<b>', $Description);\n\t\t$Description = str_replace(\"&lt;\",\"<\",$Description);\n\t\t$Description = str_replace(\"&gt;\",\">\",$Description);\n\t\t$Description = strip_tags($Description);\n\t\t$Description = trim($Description);\n\t} else {\n\t\treturn \"\";\n\t}\n\treturn $Description;\n}", "function ciniki_web_processBlockAsideImage(&$ciniki, $settings, $tnid, $block) {\n\n if( !isset($block['image_id']) ) {\n return array('stat'=>'ok', 'content'=>'');\n }\n\n $quality = 60;\n $width = 500;\n\n if( isset($settings['default-image-quality']) && $settings['default-image-quality'] > 0 ) {\n $quality = $settings['default-image-quality'];\n }\n if( isset($block['quality']) && $block['quality'] == 'high' ) {\n $quality = 90;\n $width = 1000;\n }\n if( isset($settings['default-image-width']) && $settings['default-image-width'] > $width ) {\n $width = $settings['default-image-width'];\n }\n\n\n //\n // Generate the image url\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'web', 'private', 'getScaledImageURL');\n $rc = ciniki_web_getScaledImageURL($ciniki, $block['image_id'], 'original', $width, 0, $quality);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $content = \"<aside><div \"\n . (isset($block['cssid']) && $block['cssid'] != '' ? \" id='\" . $block['cssid'] . \"'\" : '')\n . \"class='image-wrap'><div class='image'>\"\n . \"<img title='' alt=\\\"\" . (isset($block['title'])?preg_replace(\"/\\\"/\", \"&quot;\", $block['title']):'') . \"\\\" src='\" . $rc['url'] . \"' />\"\n . \"</div>\";\n if( isset($block['caption']) && $block['caption'] != '' ) {\n $content .= \"<div class='image-caption'>\" . $block['caption'] . \"</div>\";\n }\n $content .= \"</div></aside>\";\n\n //\n // Check if this image should be used as the primary when linked from other sites eg: facebook\n //\n if( isset($block['primary']) && $block['primary'] == 'yes' ) {\n $ciniki['response']['head']['og']['image'] = $rc['domain_url'];\n }\n\n return array('stat'=>'ok', 'content'=>$content);\n}", "function customTagReplace($html)\r\n\t{\r\n\t\t//ensure all tags can be found\r\n\t\t$html = str_replace(\"<IMG\",\"<img\",$html);\r\n\t\t$html = str_replace(\"SRC=\",\"src=\",$html);\r\n\t\t$html = str_replace(\"ALT=\",\"alt=\",$html);\r\n\t\t$html = str_replace(\"<SPAN\",\"<span\",$html);\r\n\r\n\t\t$html = replaceIMG($html); //CSS format img tags\r\n\t\t$html = youtubeEmbed($html); //custom include youtube embeds\r\n\t\t$html = apostrapheFix($html); //apostraphe fix for sql INSERT statements\r\n\t\treturn $html;\r\n\t}", "function cleanup_theme_images($old_url)\n{\n\t$files_referenced=collapse_1d_complexity('path',$GLOBALS['SITE_DB']->query_select('theme_images',array('DISTINCT path')));\n\n\t$themes=find_all_themes();\n\tforeach (array_keys($themes) as $theme)\n\t{\n\t\t$files_existing=get_image_paths(get_custom_base_url().'/themes/'.rawurlencode($theme).'/images_custom/',get_custom_file_base().'/themes/'.$theme.'/images_custom/');\n\n\t\tforeach (array_keys($files_existing) as $path)\n\t\t{\n\t\t\t$path=str_replace(get_custom_file_base().'/','',filter_naughty($path));\n\t\t\t$encoded_path=substr($path,0,strrpos($path,'/')+1).rawurlencode(substr($path,strrpos($path,'/')+1));\n\t\t\tif ((!in_array($path,$files_referenced)) && (!in_array($encoded_path,$files_referenced)) && (($old_url==$path) || ($old_url==$encoded_path)))\n\t\t\t{\n\t\t\t\t@unlink(get_custom_file_base().'/'.$path);\n\t\t\t\tsync_file($path);\n\t\t\t}\n\t\t}\n\t}\n}", "function cardealer_filter_ptags_on_images($content){\r\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function _external_to_internal($content)\n\t{\n\t\t// replace hrefs\n\t\tpreg_match_all(\n\t\t\t\t'/(<[^>]+href=[\"\\']?)([^\"\\' >]+)([^\"\\'>]?[^>]*>)/i', \n\t\t\t\t$content, \n\t\t\t\t$regs, \n\t\t\t\tPREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$orig_href = $regs[2][$i];\n\t\t\t\t$new_href = weSiteImport::_makeInternalLink($orig_href);\n\t\t\t\tif ($new_href != $orig_href) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $new_href . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// replace src (same as href!!)\n\t\tpreg_match_all(\n\t\t\t\t'/(<[^>]+src=[\"\\']?)([^\"\\' >]+)([^\"\\'>]?[^>]*>)/i', \n\t\t\t\t$content, \n\t\t\t\t$regs, \n\t\t\t\tPREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$orig_href = $regs[2][$i];\n\t\t\t\t$new_href = weSiteImport::_makeInternalLink($orig_href);\n\t\t\t\tif ($new_href != $orig_href) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $new_href . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// url() in styles with style=\"\"\n\t\tpreg_match_all('/(<[^>]+style=\")([^\"]+)(\"[^>]*>)/i', $content, $regs, PREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$style = $regs[2][$i];\n\t\t\t\t$newStyle = $style;\n\t\t\t\tpreg_match_all('/(url\\(\\'?)([^\\'\\)]+)(\\'?\\))/i', $style, $regs2, PREG_PATTERN_ORDER);\n\t\t\t\tif ($regs2 != null) {\n\t\t\t\t\tfor ($z = 0; $z < count($regs2[2]); $z++) {\n\t\t\t\t\t\t$orig_url = $regs2[2][$z];\n\t\t\t\t\t\t$new_url = weSiteImport::_makeInternalLink($orig_url);\n\t\t\t\t\t\tif ($orig_url != $new_url) {\n\t\t\t\t\t\t\t$newStyle = str_replace($orig_url, $new_url, $newStyle);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($newStyle != $style) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $newStyle . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// url() in styles with style=''\n\t\tpreg_match_all('/(<[^>]+style=\\')([^\\']+)(\\'[^>]*>)/i', $content, $regs, PREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$style = $regs[2][$i];\n\t\t\t\t$newStyle = $style;\n\t\t\t\tpreg_match_all('/(url\\(\"?)([^\"\\)]+)(\"?\\))/i', $style, $regs2, PREG_PATTERN_ORDER);\n\t\t\t\tif ($regs2 != null) {\n\t\t\t\t\tfor ($z = 0; $z < count($regs2[2]); $z++) {\n\t\t\t\t\t\t$orig_url = $regs2[2][$z];\n\t\t\t\t\t\t$new_url = weSiteImport::_makeInternalLink($orig_url);\n\t\t\t\t\t\tif ($orig_url != $new_url) {\n\t\t\t\t\t\t\t$newStyle = str_replace($orig_url, $new_url, $newStyle);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($newStyle != $style) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $newStyle . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// url() in <style> tags\n\t\tpreg_match_all('/(<style[^>]*>)(.*)(<\\/style>)/isU', $content, $regs, PREG_PATTERN_ORDER);\n\t\tif ($regs != null) {\n\t\t\tfor ($i = 0; $i < count($regs[2]); $i++) {\n\t\t\t\t$style = $regs[2][$i];\n\t\t\t\t$newStyle = $style;\n\t\t\t\t// url() in styles with style=''\n\t\t\t\tpreg_match_all(\n\t\t\t\t\t\t'/(url\\([\\'\"]?)([^\\'\"\\)]+)([\\'\"]?\\))/iU', \n\t\t\t\t\t\t$style, \n\t\t\t\t\t\t$regs2, \n\t\t\t\t\t\tPREG_PATTERN_ORDER);\n\t\t\t\tif ($regs2 != null) {\n\t\t\t\t\tfor ($z = 0; $z < count($regs2[2]); $z++) {\n\t\t\t\t\t\t$orig_url = $regs2[2][$z];\n\t\t\t\t\t\t$new_url = weSiteImport::_makeInternalLink($orig_url);\n\t\t\t\t\t\tif ($orig_url != $new_url) {\n\t\t\t\t\t\t\t$newStyle = str_replace(\n\t\t\t\t\t\t\t\t\t$regs2[0][$z], \n\t\t\t\t\t\t\t\t\t$regs2[1][$z] . $new_url . $regs2[3][$z], \n\t\t\t\t\t\t\t\t\t$newStyle);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($newStyle != $style) {\n\t\t\t\t\t$newTag = $regs[1][$i] . $newStyle . $regs[3][$i];\n\t\t\t\t\t$content = str_replace($regs[0][$i], $newTag, $content);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $content;\n\t}", "function clean_url($text)\n\t\t{\n\t\t\t$text=strtolower($text);\n\t\t\t$code_entities_match = array(' ','--','&quot;','!','@','#','$','%','^','&','*','(',')','_','+','{','}','|',':','\"','<','>','?','[',']','\\\\',';',\"'\",',','.','/','*','+','~','`','=');\n\t\t\t$code_entities_replace = array('-','-','','','','','','','','','','','','','','','','','','','','','','','','');\n\t\t\t$text = str_replace($code_entities_match, $code_entities_replace, $text);\n\t\t\treturn $text;\n\t\t}", "function spartan_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function cleanUrl($text) {\r\n $text = strtolower($text);\r\n $code_entities_match = array('&quot;', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '+', '{', '}', '|', ':', '\"', '<', '>', '?', '[', ']', '', ';', \"'\", ',', '.', '_', '/', '*', '+', '~', '`', '=', ' ', '---', '--', '--', '�');\r\n $code_entities_replace = array('', '-', '-', '', '', '', '-', '-', '', '', '', '', '', '', '', '-', '', '', '', '', '', '', '', '', '', '-', '', '-', '-', '', '', '', '', '', '-', '-', '-', '-');\r\n $text = str_replace($code_entities_match, $code_entities_replace, $text);\r\n return $text;\r\n}", "function theme_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function ReplaceSmilies($txt)\n {\n \n $cDir = '../_images/smilies';\n // map waarin de smilies staan...\n $cCodes = array(':)',':p',':P',';)',':d',':D',':(',':lol:',':no:',':cry:',':wtf:',':confused:',':bow:',':eek:',':evil:','.sleep.',':mad:',':rofl:',':music:',':ironic:',':crazy:',':love:',':cool:',':help:',':unsure:',':thumb:','.party.',':clap:',':tong:','.scream.','.doh.',':s',':S',':oink:',':@',':x',':X');\n // array met de smilie codes.\n $cCodes2 = array(':-)',':-p',':-P',';-)',':-d',':-D',':-(',':lol:',':no:',':cry:',':wtf:',':confused:',':bow:',':eek:',':evil:','.sleep.',':mad:',':rofl:',':music:',':ironic:',':crazy:',':love:',':cool:',':help:',':unsure:',':thumb:','.party.',':clap:',':tong:','.scream.','.doh.',':-s',':-S',':oink:',':-@',':-x',':-X');\n // 2e array met codes, dezelfde, maar in andere vorm.\n $cSmilies = array('smile','tong','tong','wink','biglaugh','biglaugh','frown','lol','nono','cry','wtf','confused','bow','eek','evil','sleep','mad','rofl','music','ironic','crazy','love','cool','help','unsure','thumb','party','clap','eviltongue','scream','doh','damn','damn','oink','shy','shutup','shutup');\n // De bestandsnamen ervan\n \n // let erop dat je evenveel smilies hebt ingevoerd bij de bovenstaande 3 array's!\n // Als dat niet het geval is wordt er nu het een en ander aan geknipt...\n \n if(count($cCodes) != count($cCodes2))\n {\n // De aantal smilies in $cCodes en $cCodes2 zijn niet evenveel.\n if(count($cCodes) > count($cCodes2))\n {\n $cAantal = count($cCodes2);\n }\n else\n {\n $cAantal = count($cCodes);\n }\n }\n else\n {\n $cAantal = count($cCodes);\n }\n \n // nu dan het echte vervangen met een for-loop.\n \n for($i=0;$i<$cAantal;$i++)\n {\n $txt = str_replace($cCodes[$i],'<img src=\"'.$cDir.'/'.$cSmilies[$i].'.gif\" border=\"0\" alt=\"'.$cSmilies[$i].'\">',$txt);\n // vervangen van de smilies uit de 1e array.\n $txt = str_replace($cCodes2[$i],'<img src=\"'.$cDir.'/'.$cSmilies[$i].'.gif\" border=\"0\" alt=\"'.$cSmilies[$i].'\">',$txt);\n // vervangen van de smilies uit de 2e array.\n }\n return $txt;\n}", "function cleanupMediaobjectUsage()\n\t{\n\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\t$completecontent = \"\";\n\t\tforeach ($this->getAllRTEContent() as $content)\n\t\t{\n\t\t\t$completecontent .= $content;\n\t\t}\n\t\tilRTE::_cleanupMediaObjectUsage($completecontent, $this->getType() . \":html\",\n\t\t\t$this->getId());\n\t}", "function wpgrade_filter_ptags_on_images($content){\r\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\r\n}", "function _convert()\n {\r\n \t$badStr = $this->html;\n\t //remove PHP if it exists\r\n\t while( substr_count( $badStr, '<'.'?' ) && substr_count( $badStr, '?'.'>' ) && strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) > strpos( $badStr, '<'.'?' ) ) {\r\n\t $badStr = substr( $badStr, 0, strpos( $badStr, '<'.'?' ) ) . substr( $badStr, strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) + 2 ); }\r\n\t //remove comments\r\n\t while( substr_count( $badStr, '<!--' ) && substr_count( $badStr, '-->' ) && strpos( $badStr, '-->', strpos( $badStr, '<!--' ) ) > strpos( $badStr, '<!--' ) ) {\r\n\t $badStr = substr( $badStr, 0, strpos( $badStr, '<!--' ) ) . substr( $badStr, strpos( $badStr, '-->', strpos( $badStr, '<!--' ) ) + 3 ); }\r\n\t //now make sure all HTML tags are correctly written (> not in between quotes)\r\n\r\n\t \r\n\t //TODO: here is any problem, because in some cases happens loop and mail is never parsed\r\n\t //\t for( $x = 0, $goodStr = '', $is_open_tb = false, $is_open_sq = false, $is_open_dq = false; strlen( $chr = $badStr{$x} ); $x++ ) {\r\n//\t //take each letter in turn and check if that character is permitted there\r\n//\t switch( $chr ) {\r\n//\t case '<':\r\n//\t if( !$is_open_tb && strtolower( substr( $badStr, $x + 1, 5 ) ) == 'style' ) {\r\n//\t $badStr = substr( $badStr, 0, $x ) . substr( $badStr, strpos( strtolower( $badStr ), '</style>', $x ) + 7 ); $chr = '';\r\n//\t } elseif( !$is_open_tb && strtolower( substr( $badStr, $x + 1, 6 ) ) == 'script' ) {\r\n//\t $badStr = substr( $badStr, 0, $x ) . substr( $badStr, strpos( strtolower( $badStr ), '</script>', $x ) + 8 ); $chr = '';\r\n//\t } elseif( !$is_open_tb ) { $is_open_tb = true; } else { $chr = '&lt;'; }\r\n//\t break;\r\n//\t case '>':\r\n//\t if( !$is_open_tb || $is_open_dq || $is_open_sq ) { $chr = '&gt;'; } else { $is_open_tb = false; }\r\n//\t break;\r\n//\t case '\"':\r\n//\t if( $is_open_tb && !$is_open_dq && !$is_open_sq ) { $is_open_dq = true; }\r\n//\t elseif( $is_open_tb && $is_open_dq && !$is_open_sq ) { $is_open_dq = false; }\r\n//\t else { $chr = '&quot;'; }\r\n//\t break;\r\n//\t case \"'\":\r\n//\t if( $is_open_tb && !$is_open_dq && !$is_open_sq ) { $is_open_sq = true; }\r\n//\t elseif( $is_open_tb && !$is_open_dq && $is_open_sq ) { $is_open_sq = false; }\r\n//\t } $goodStr .= $chr;\r\n//\t }\r\n$goodStr = $badStr;\r\n\t \r\n\t //now that the page is valid (I hope) for strip_tags, strip all unwanted tags\r\n\t $goodStr = strip_tags( $goodStr, '<title><hr><h1><h2><h3><h4><h5><h6><div><p><br><pre><sup><ul><ol><dl><dt><table><caption><tr><li><dd><th><td><a><area><img><form><input><textarea><button><select><option>' );\r\n\t //strip extra whitespace except between <pre> and <textarea> tags\r\n\t $badStr = preg_split( \"/<\\/?pre[^>]*>/i\", $goodStr );\r\n\t for( $x = 0; is_string( $badStr[$x] ); $x++ ) {\r\n\t if( $x % 2 ) { $badStr[$x] = '<pre>'.$badStr[$x].'</pre>'; } else {\r\n\t $goodStr = preg_split( \"/<\\/?textarea[^>]*>/i\", $badStr[$x] );\r\n\t for( $z = 0; is_string( $goodStr[$z] ); $z++ ) {\r\n\t if( $z % 2 ) { $goodStr[$z] = '<textarea>'.$goodStr[$z].'</textarea>'; } else {\r\n\t $goodStr[$z] = preg_replace( \"/\\s+/\", ' ', $goodStr[$z] );\r\n\t } }\r\n\t $badStr[$x] = implode('',$goodStr);\r\n\t } }\r\n\t $goodStr = implode('',$badStr);\r\n\r\n\t\t$search = array(\r\n\t\t \"/\\r/\", // Non-legal carriage return\r\n\t\t \"/[\\n\\t]+/\", // Newlines and tabs\r\n\t\t '/<br[^>]*>/i', // <br>\r\n\t\t '/&nbsp;/i',\r\n\t\t '/&quot;/i',\r\n\t\t '/&gt;/i',\r\n\t\t '/&lt;/i',\r\n\t\t '/&amp;/i',\r\n\t\t '/&copy;/i',\r\n\t\t '/&trade;/i',\r\n\t\t '/&#8220;/',\r\n\t\t '/&#8221;/',\r\n\t\t '/&#8211;/',\r\n\t\t '/&#8217;/',\r\n\t\t '/&#38;/',\r\n\t\t '/&#169;/',\r\n\t\t '/&#8482;/',\r\n\t\t '/&#151;/',\r\n\t\t '/&#147;/',\r\n\t\t '/&#148;/',\r\n\t\t '/&#149;/',\r\n\t\t '/&reg;/i',\r\n\t\t '/&bull;/i',\r\n\t\t '/&[&;]+;/i'\r\n\t\t );\r\n\r\n\t\t\t$replace = array(\r\n\t\t '', // Non-legal carriage return\r\n\t\t ' ', // Newlines and tabs\r\n\t\t \"\\n\", // <br>\r\n\t\t ' ',\r\n\t\t '\"',\r\n\t\t '>',\r\n\t\t '<',\r\n\t\t '&',\r\n\t\t '(c)',\r\n\t\t '(tm)',\r\n\t\t '\"',\r\n\t\t '\"',\r\n\t\t '-',\r\n\t\t \"'\",\r\n\t\t '&',\r\n\t\t '(c)',\r\n\t\t '(tm)',\r\n\t\t '--',\r\n\t\t '\"',\r\n\t\t '\"',\r\n\t\t '*',\r\n\t\t '(R)',\r\n\t\t '*',\r\n\t\t ''\r\n\t\t );\r\n\t \r\n\t \r\n\t $goodStr = preg_replace( $search, $replace, $goodStr );\r\n\t \r\n\t //remove all options from select inputs\r\n\t $goodStr = preg_replace( \"/<option[^>]*>[^<]*/i\", '', $goodStr );\r\n\t //replace all tags with their text equivalents\r\n\t $goodStr = preg_replace( \"/<(\\/title|hr)[^>]*>/i\", \"\\n --------------------\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(h|div|p)[^>]*>/i\", \"\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<sup[^>]*>/i\", '^', $goodStr );\r\n\t $goodStr = preg_replace( \"/<(ul|ol|dl|dt|table|caption|\\/textarea|tr[^>]*>\\s*<(td|th))[^>]*>/i\", \"\\n\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<li[^>]*>/i\", \"\\n· \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<dd[^>]*>/i\", \"\\n\\t\", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(th|td)[^>]*>/i\", \"\\t\", $goodStr );\r\n\t $goodStr = preg_replace('/<br[^>]*>/i', \"\\n\", $goodStr);\r\n\t $goodStr = preg_replace( \"/<a[^>]* href=(\\\"((?!\\\"|#|javascript:)[^\\\"#]*)(\\\"|#)|'((?!'|#|javascript:)[^'#]*)('|#)|((?!'|\\\"|>|#|javascript:)[^#\\\"'> ]*))[^>]*>/i\", \"[LINK: $2$4$6] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<img[^>]* alt=(\\\"([^\\\"]+)\\\"|'([^']+)'|([^\\\"'> ]+))[^>]*>/i\", \"[IMAGE: $2$3$4] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<form[^>]* action=(\\\"([^\\\"]+)\\\"|'([^']+)'|([^\\\"'> ]+))[^>]*>/i\", \"\\n[FORM: $2$3$4] \", $goodStr );\r\n\t $goodStr = preg_replace( \"/<(input|textarea|button|select)[^>]*>/i\", \"[INPUT] \", $goodStr );\r\n\t //strip all remaining tags (mostly closing tags)\r\n\t $goodStr = strip_tags( $goodStr );\r\n\t //convert HTML entities\r\n\t $goodStr = strtr( $goodStr, array_flip( get_html_translation_table( HTML_ENTITIES ) ) );\r\n\t preg_replace( \"/&#(\\d+);/me\", \"chr('$1')\", $goodStr );\r\n\t //wordwrap\r\n\t //$goodStr = wordwrap( $goodStr );\r\n\t //make sure there are no more than 3 linebreaks in a row and trim whitespace\r\n\t $this->text = preg_replace( \"/^\\n*|\\n*$/\", '', preg_replace( \"/[ \\t]+(\\n|$)/\", \"$1\", preg_replace( \"/\\n(\\s*\\n){2}/\", \"\\n\\n\\n\", preg_replace( \"/\\r\\n?|\\f/\", \"\\n\", str_replace( chr(160), ' ', $goodStr ) ) ) ) );\r\n }", "function strip_phpbb2_tags( $text )\n{\n // The [html] BBCode tag is not supported by phpbb2 or Quicksilver Forums, so just strip those off and leave the contents.\n $text = preg_replace( '/\\[html\\](.+?)\\[\\/html\\]/si', '\\\\1', $text );\n\n /* Convert email tags.\n * phpBB2 does not have an email tag option in their post menu, but it supports manually entering them.\n */\n $text = preg_replace( '/\\[email\\](.+?)\\[\\/email\\]/si', '[email]\\\\1[/email]', $text );\n $text = preg_replace( '/\\[email=(.+?)\\](.*?)\\[\\/email\\]/si', '[email]\\\\1[/email]', $text );\n\n // Convert URL tags....\n $text = preg_replace( '/\\[url=(.*?)\\](.*?)\\[\\/url\\]/si', '[url]\\\\1[/url]', $text );\n $text = preg_replace( '/\\[url\\](.*?)\\[\\/url\\]/si', '[url]\\\\1[/url]', $text );\n\n /* Convert image tags.\n * We'll even be nice and fix malformed ones in posts.\n */\n $text = preg_replace( '/\\[img=(.*?)\\](.*?)\\[\\/img\\]/si', '[img]\\\\1[/img]', $text );\n $text = preg_replace( '/\\[img(.*?)\\](.*?)\\[\\/img(.*?)\\]/si', '[img]\\\\2[/img]', $text );\n\n // Convert color tags....\n $text = preg_replace( '/\\[color=(.*?):(.*?)\\](.*?)\\[\\/color(.*?)\\]/si', '[color=\\\\1]\\\\3[/color]', $text );\n\n // Font size tags....\n $text = preg_replace( '/\\[size=7:(.*?)\\](.*?)\\[\\/size:(.*?)\\]/si', '[size=1]\\\\2[/size]', $text );\n $text = preg_replace( '/\\[size=9:(.*?)\\](.*?)\\[\\/size:(.*?)\\]/si', '[size=2]\\\\2[/size]', $text );\n $text = preg_replace( '/\\[size=12:(.*?)\\](.*?)\\[\\/size:(.*?)\\]/si', '\\\\2', $text );\n $text = preg_replace( '/\\[size=18:(.*?)\\](.*?)\\[\\/size:(.*?)\\]/si', '[size=5]\\\\2[/size]', $text );\n $text = preg_replace( '/\\[size=24:(.*?)\\](.*?)\\[\\/size:(.*?)\\]/si', '[size=7]\\\\2[/size]', $text );\n\n // Fix the text formatting tags....\n $text = preg_replace( '/\\[s\\](.*?)\\[\\/s\\]/si', '[s]\\\\2[/s]', $text ); // <- Not actually supported\n $text = preg_replace( '/\\[b:(.*?)\\](.*?)\\[\\/b:(.*?)\\]/si', '[b]\\\\2[/b]', $text );\n $text = preg_replace( '/\\[i:(.*?)\\](.*?)\\[\\/i:(.*?)\\]/si', '[i]\\\\2[/i]', $text );\n $text = preg_replace( '/\\[u:(.*?)\\](.*?)\\[\\/u:(.*?)\\]/si', '[u]\\\\2[/u]', $text );\n\n // Reconfigure code tags....\n $text = preg_replace( '/\\[code:(.*?)\\]/si', '[code]', $text );\n $text = preg_replace( '/\\[\\/code:(.*?)\\]/si', '[/code]', $text );\n\n // Reconfigure quote tags....\n $text = preg_replace( '/\\[quote:(.*?)\\]/si', '[quote]', $text );\n $text = preg_replace( '/\\[\\/quote:(.*?)\\]/si', '[/quote]', $text );\n\n // Now fix the generic junk that's left over....\n $text = str_replace( \"'\", \"\\'\", $text );\n $text = str_replace( \"&nbsp;\", \" \", $text );\n $text = str_replace( \"&gt;\", \">\", $text );\n $text = str_replace( \"&lt;\", \"<\", $text );\n $text = str_replace( \"&amp;\", \"&\", $text );\n $text = str_replace( \"&quot;\", \"\\\"\", $text );\n $text = str_replace( \"&#33;\", \"!\", $text );\n $text = str_replace( \"&#033;\", \"!\", $text );\n $text = str_replace( \"&#34;\", \"\\\"\", $text );\n $text = str_replace( \"&#36;\", \"$\", $text );\n $text = str_replace( \"&#036;\", \"$\", $text );\n $text = str_replace( \"&#37;\", \"\\%\", $text );\n $text = str_replace( \"&#39;\", \"\\'\", $text );\n $text = str_replace( \"&#039;\", \"\\'\", $text );\n $text = str_replace( \"&#40;\", \"(\", $text );\n $text = str_replace( \"&#41;\", \")\", $text );\n $text = str_replace( \"&#58;\", \":\", $text );\n $text = str_replace( \"&#59;\", \";\", $text );\n $text = str_replace( \"&#60;\", \"<\", $text );\n $text = str_replace( \"&#62;\", \">\", $text );\n $text = str_replace( \"&#064;\", \"@\", $text );\n $text = str_replace( \"&#64;\", \"@\", $text );\n $text = str_replace( \"&#91;\", \"[\", $text );\n $text = str_replace( \"&#092;\", \"\\\\\", $text );\n $text = str_replace( \"&#92;\", \"\\\\\", $text );\n $text = str_replace( \"&#92\", \"\\\\\", $text );\n $text = str_replace( \"&#93;\", \"]\", $text );\n $text = str_replace( \"&#95;\", \"\\_\", $text );\n $text = str_replace( \"&#124;\", \"|\", $text );\n\n $text = str_replace( \"\\\\n\", \"\\\\\\\\n\", $text );\n $text = str_replace( \"\\\\r\", \"\\\\\\\\r\", $text );\n $text = str_replace( \"\\\\t\", \"\\\\\\\\t\", $text );\n $text = str_replace( \"\\\\e\", \"\\\\\\\\e\", $text );\n $text = str_replace( \"\\\\0\", \"\\\\\\\\0\", $text );\n\n return $text;\n}", "protected function fixEtag()\n {\n if (is_string($this->etag)) {\n $arr = explode('-', $this->etag);\n if (count($arr) === 4) {\n $string = \"Make vimeo/psalm happy\";\n if (! is_null($this->path)) {\n $string = trim(basename($this->path));\n }\n $hash = hash('ripemd160', $string, false);\n $arr[0] = substr($hash, 4, 5);\n $arr[2] = $this->timestamp;\n $this->etag = sprintf(\"%s-%s-%x-%s\", $arr[0], $arr[1], $arr[2], $arr[3]);\n }\n }\n }", "function cdn_html_alter_image_urls(&$html) {\n $url_prefix_regex = _cdn_generate_url_prefix_regex();\n $pattern = \"#((<img\\s+|<img\\s+[^>]*\\s+)src\\s*=\\s*[\\\"|\\'])($url_prefix_regex)([^\\\"|^\\']*)([\\\"|\\'])#i\";\n _cdn_html_alter_file_url($html, $pattern, 0, 4, 5, 1, '');\n}", "private function _replace_inline_css()\n\t{\n\t\t// preg_match_all( '/url\\s*\\(\\s*(?![\"\\']?data:)(?![\\'|\\\"]?[\\#|\\%|])([^)]+)\\s*\\)([^;},\\s]*)/i', $this->content, $matches ) ;\n\n\t\t/**\n\t\t * Excludes `\\` from URL matching\n\t\t * @see #959152 - Wordpress LSCache CDN Mapping causing malformed URLS\n\t\t * @see #685485\n\t\t * @since 3.0\n\t\t */\n\t\tpreg_match_all( '#url\\((?![\\'\"]?data)[\\'\"]?([^\\)\\'\"\\\\\\]+)[\\'\"]?\\)#i', $this->content, $matches ) ;\n\t\tforeach ( $matches[ 1 ] as $k => $url ) {\n\t\t\t$url = str_replace( array( ' ', '\\t', '\\n', '\\r', '\\0', '\\x0B', '\"', \"'\", '&quot;', '&#039;' ), '', $url ) ;\n\n\t\t\tif ( ! $url2 = $this->rewrite( $url, LiteSpeed_Cache_Config::ITEM_CDN_MAPPING_INC_IMG ) ) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\t\t\t$attr = str_replace( $matches[ 1 ][ $k ], $url2, $matches[ 0 ][ $k ] ) ;\n\t\t\t$this->content = str_replace( $matches[ 0 ][ $k ], $attr, $this->content ) ;\n\t\t}\n\t}", "function testBugs() {\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when [a]!=';';block=b]</b>\", array('a'=>';'), \"\", \"test bug #1\");\r\n\t\t// $this->assertEqualMergeFieldStrings(\"<b>[onshow;when [a]=';';block=b]</b>\", array('a'=>';'), \"<b></b>\", \"test bug #2\"); // bug\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a]'!=';';block=b]</b>\", array('a'=>';'), \"\", \"test bug #3\");\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a]'=';';block=b]</b>\", array('a'=>';'), \"<b></b>\", \"test bug #4\");\r\n\t\t\r\n\t\t// vicious: with a simple quote as value\r\n\t\t//$this->assertEqualMergeFieldStrings(\"<b>[onshow;when [a;htmlconv=esc]!='''';block=b]</b>\", array('a'=>'\\''), \"\", \"test bug #5\");\r\n\t\t//$this->assertEqualMergeFieldStrings(\"<b>[onshow;when [a;htmlconv=esc]='''';block=b]</b>\", array('a'=>'\\''), \"<b></b>\", \"test bug #6\");\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a;htmlconv=esc]'!='''';block=b]</b>\", array('a'=>'\\''), \"\", \"test bug #7\");\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a;htmlconv=esc]'='''';block=b]</b>\", array('a'=>'\\''), \"<b></b>\", \"test bug #8\");\r\n\t\t\r\n\t\t// vicious: with an ']' as value\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a]'!=']';block=b]</b>\", array('a'=>']'), \"\", \"test bug #11\");\r\n\t\t$this->assertEqualMergeFieldStrings(\"<b>[onshow;when '[a]'=']';block=b]</b>\", array('a'=>']'), \"<b></b>\", \"test bug #12\");\r\n\t}", "function test_html_fix() {\n $posts = CompliantPost::published();\n $first_post = $posts[0];\n $first_image = $first_post->embedded_images[0];\n\n // Test\n $content_before = $first_post->wp_post->post_content;\n $updated_content = $first_post->update_content_img_alt_attributes();\n\n // Dump output.\n var_dump(array(\n 'before' => $content_before,\n 'after' => $updated_content\n ));\n var_dump($first_post->errors);\n var_dump($first_post->updates_counter);\n }", "function lumen_fix_shortcodes($content){ \n $array = array (\n '<p>[' => '[', \n ']</p>' => ']', \n ']<br />' => ']'\n );\n\n $content = strtr($content, $array);\n return $content;\n}", "function normalize($url) {\n\t\t//$result = preg_replace('%(?<!:/|[^/])/|(?<=&)&|&$|%', '', $url);\n\t\t$result=str_replace(array('://','//',':::'),array(':::','/','://'),$url);\n\t\treturn $result;\n\t}", "public function contentStrReplace() {}", "private function clean_youtube() {\n\n\t\tadd_filter('embed_oembed_html', function($html, $src, $args){\n\n\t\t\tif ( strpos( $src, 'www.youtube.com') != false ) {\n\t\t\t\t$html = preg_replace( '/(src=(\\S+))(?=\")/', '$1&showinfo=0&rel=0', $html);\n\t\t\t}\n\n\t\t\t$html = '<div class=\"embed-responsive embed-responsive-16by9\">' . $html . '</div>';\n\t\t\treturn $html;\n\t\t}, 10, 3);\n\t}", "function wpex_clean_shortcodes($content){ \n$array = array (\n '<p>[' => '[', \n ']</p>' => ']', \n ']<br />' => ']'\n);\n$content = strtr($content, $array);\nreturn $content;\n}", "function prop_clean() {\n\n remove_action('template_redirect', 'rest_output_link_header', 11);\n remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);\n\n add_filter( 'use_default_gallery_style', '__return_false' );\n\n // Emoji related\n remove_action( 'admin_print_styles', 'print_emoji_styles' );\n\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\tremove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );\n\tremove_filter( 'the_content_feed', 'wp_staticize_emoji' );\n remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );\n\n}", "protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }", "private function strip_ikon_tags( $text )\n\t{\n\t\t// The [html] BBCode tag is not supported by Quicksilver Forums, so when the horrid mess is encountered in Ikonboard.......\n\t\t$text = preg_replace( \"#<!--html-->(.*?)<!--html3-->#\", \"HTML BLOCK REMOVED\", $text );\n\n\t\t// Convert emoticons....\n\t\t$text = preg_replace( \"#<!--emo&(.+?)-->.+?<!--endemo-->#\", \"\\\\1\" , $text );\n\n\t\t/* Convert image tags.\n\t\t * We'll even be nice and fix malformed ones in posts.\n\t\t */\n\t\t$text = preg_replace( \"#<img src=[\\\"'](\\S+?)['\\\"].+?\".\">#\", \"[img]\\\\1[/img]\", $text );\n\t\t$text = preg_replace( '/\\[img=(.*?)\\](.*?)\\[\\/img\\]/si', '[img]\\\\1[/img]', $text );\n\n\t\t// Convert email tags....\n\t\t$text = preg_replace( \"#<a href=[\\\"']mailto:(.+?)['\\\"]>(.+?)</a>#\", \"[email=\\\\1]\\\\2[/email]\", $text );\n\n\t\t// Convert URLs....\n\t\t$text = preg_replace( \"#<a href=[\\\"'](.+?)['\\\"] target=[\\\"'](.+?)['\\\"]>(.+?)</a>#\", \"[url=\\\\1]\\\\3[/url]\", $text );\n\n\t\t// Convert color tags....\n\t\t$text = preg_replace( \"#<span style=[\\\"']color:(.+?)[\\\"']>(.+?)</span>#\", \"[color=\\\\1]\\\\2[/color]\", $text );\n\n\t\t// Font tags are not desired, so they will be summarily parsed out....\n\t\t$text = preg_replace( \"#<font(.+?)>#\", \"\", $text );\n\t\t$text = str_replace ( \"</font>\", \"\", $text );\n\n\t\t// Span tags at this point are also not desired.\n\t\t$text = preg_replace( \"#<span(.+?)>#\", \"\", $text );\n\t\t$text = str_replace ( \"</span>\", \"\", $text );\n\n\t\t// Reconfigure code tags.\n\t\t$text = preg_replace( \"#<!--c1-->(.+?)<!--ec1--><br>#\", '[code]', $text );\n\t\t$text = preg_replace( \"#<!--c1-->(.+?)<!--ec1-->#\", '[code]', $text );\n\t\t$text = preg_replace( \"#<!--c2-->(.+?)<!--ec2-->#\", '[/code]', $text );\n\n\t\t// Reconfigure SQL tags\n\t\t$text = preg_replace( \"#<!--sql-->(.+?)<!--sql1-->#\", '[code]', $text );\n\t\t$text = preg_replace( \"#<!--sql2-->(.+?)<!--sql3-->#\", '[/code]', $text );\n\n\t\t// Strip flash movies and let people know about it.\n\t\t$text = preg_replace( \"'<!--Flash[^>]*?>.*?<!--End Flash-->'si\", \"Flash image stripped during conversion.\", $text );\n\n\t\t// Reconfigure quote tags.\n\t\t$text = preg_replace( \"#<!--QuoteBegin-(.+?)<!--QuoteEBegin-->#\", \"[quote]\", $text );\n\t\t$text = preg_replace( \"#<!--QuoteEnd-->(.+?)<!--QuoteEEnd-->#\", \"[/quote]\", $text );\n\n\t\t// At a loss as to what this was for....\n\t\t$text = preg_replace( \"#<!--me(.+?)<!--e-me--><br>#\", \"\", $text );\n\n\t\t// Fix the text formatting tags....\n\t\t$text = preg_replace( \"#<i>(.+?)</i>#is\", \"[i]\\\\1[/i]\", $text );\n\t\t$text = preg_replace( \"#<b>(.+?)</b>#is\", \"[b]\\\\1[/b]\", $text );\n\t\t$text = preg_replace( \"#<s>(.+?)</s>#is\", \"[s]\\\\1[/s]\", $text );\n\t\t$text = preg_replace( \"#<u>(.+?)</u>#is\", \"[u]\\\\1[/u]\", $text );\n\t\t$text = str_replace( \"<br>\", \"\\n\\r\", $text );\n\t\t$text = str_replace( \"<center>\", \"\", $text );\n\t\t$text = str_replace( \"</center>\", \"\", $text );\n\n\t\t// Fix random junk in the post code....\n\t\t$text = str_replace( \"&nbsp;\", \" \", $text );\n\t\t$text = str_replace( \"&gt;\", \">\", $text );\n\t\t$text = str_replace( \"&lt;\", \"<\", $text );\n\t\t$text = str_replace( \"&amp;\", \"&\", $text );\n\t\t$text = str_replace( \"&quot;\", \"\\\"\", $text );\n\t\t$text = str_replace( \"&#33;\", \"!\", $text );\n\t\t$text = str_replace( \"&#033;\", \"!\", $text );\n\t\t$text = str_replace( \"&#34;\", \"\\\"\", $text );\n\t\t$text = str_replace( \"&#36;\", \"$\", $text );\n\t\t$text = str_replace( \"&#036;\", \"$\", $text );\n\t\t$text = str_replace( \"&#37;\", \"\\%\", $text );\n\t\t$text = str_replace( \"&#39;\", \"'\", $text );\n\t\t$text = str_replace( \"&#039;\", \"'\", $text );\n\t\t$text = str_replace( \"&#40;\", \"(\", $text );\n\t\t$text = str_replace( \"&#41;\", \")\", $text );\n\t\t$text = str_replace( \"&#58;\", \":\", $text );\n\t\t$text = str_replace( \"&#59;\", \";\", $text );\n\t\t$text = str_replace( \"&#60;\", \"<\", $text );\n\t\t$text = str_replace( \"&#62;\", \">\", $text );\n\t\t$text = str_replace( \"&#064;\", \"@\", $text );\n\t\t$text = str_replace( \"&#64;\", \"@\", $text );\n\t\t$text = str_replace( \"&#91;\", \"[\", $text );\n\t\t$text = str_replace( \"&#092;\", \"\\\\\", $text );\n\t\t$text = str_replace( \"&#92;\", \"\\\\\", $text );\n\t\t$text = str_replace( \"&#92\", \"\\\\\", $text );\n\t\t$text = str_replace( \"&#93;\", \"]\", $text );\n\t\t$text = str_replace( \"&#95;\", \"\\_\", $text );\n\t\t$text = str_replace( \"&#124;\", \"|\", $text );\n\n\t\treturn $text;\n\t}", "private static function preProcessBBCodeUIDs($string) {\r\n \r\n $format_search\t= array(\r\n '#\\[url=(.*?)\\](.*?)\\[/url\\] by \\[url=(.*?)\\](.*?)\\[/url\\], on Flickr#i',\r\n \"@\\[b:([a-zA-Z0-9]+)]@i\", \r\n \"@\\[quote:([a-zA-Z0-9]+)=@i\", \r\n \"@\\[/quote:([a-zA-Z0-9]+)\\]@i\",\r\n \"@\\[flash=http://www.flickr.com/apps/video/stewart.swf\\?v=([0-9]+)\\]@i\",\r\n \"@\\[/list:u]@i\",\r\n '#\\[url=/(.*?)\\](.*?)\\[/url\\]#i' // Relative links - ones with leading slashes\r\n );\r\n \r\n $format_replace\t= array(\r\n '<a href=\"$1\" class=\"rp-drawflickr\">$1</a>',\r\n \"[b]\",\r\n \"[quote=\", \r\n \"[/quote]\",\r\n \"[flash=\\\"http://www.flickr.com/apps/video/stewart.swf?v=$1\\\"]\",\r\n \"[/list]\",\r\n '<a href=\"/$1\">$2</a>'\r\n );\r\n \r\n $string = preg_replace($format_search, $format_replace, $string);\r\n \r\n $uc_search = array(\r\n \"[URL\",\r\n \"[/URL]\",\r\n \"[IMG\",\r\n \"[/IMG]\"\r\n );\r\n \r\n $uc_replace = array(); \r\n \r\n foreach ($uc_search as $find) {\r\n $uc_replace[] = strtolower($find); \r\n }\r\n \r\n $string = str_replace($uc_search, $uc_replace, $string);\r\n \r\n return $string;\r\n\r\n }", "protected function cleanupImageContent(array $item)\n {\n array_walk_recursive(\n $item,\n function (&$entry, $key) {\n if ('content' === $key) {\n $entry = \"<CUT>\";\n }\n }\n );\n\n return $item;\n }", "private function cleanUp() : void\n {\n\n // For every line.\n foreach ($this->contents as $lineId => $line) {\n\n // Test.\n preg_match('/( +)(\\*)( )(.+)/', $line, $output);\n\n // First option - this is proper comment line.\n // Second option - sth is wrong - ignore this line.\n if (isset($output[4]) === true && empty($output[4]) === false) {\n $this->contents[$lineId] = $output[4];\n } else {\n unset($this->contents[$lineId]);\n }\n }\n }", "function &zariliaCodeDecode( &$text, $allowimage = 2 ) {\n $patterns = array();\n $replacements = array();\n\n\t\t$patterns[] = \"/\\[siteurl=(['\\\"]?)([^\\\"'<>]*)\\\\1](.*)\\[\\/siteurl\\]/sU\";\n $replacements[] = '<a href=\"' . ZAR_URL . '/\\\\2\" target=\"_blank\">\\\\3</a>';\n $patterns[] = \"/\\[url=(['\\\"]?)(http[s]?:\\/\\/[^\\\"'<>]*)\\\\1](.*)\\[\\/url\\]/sU\";\n $replacements[] = '<a href=\"\\\\2\" target=\"_blank\">\\\\3</a>';\n $patterns[] = \"/\\[url=(['\\\"]?)(ftp?:\\/\\/[^\\\"'<>]*)\\\\1](.*)\\[\\/url\\]/sU\";\n $replacements[] = '<a href=\"\\\\2\" target=\"_blank\">\\\\3</a>';\n $patterns[] = \"/\\[url=(['\\\"]?)([^\\\"'<>]*)\\\\1](.*)\\[\\/url\\]/sU\";\n $replacements[] = '<a href=\"http://\\\\2\" target=\"_blank\">\\\\3</a>';\n $patterns[] = \"/\\[color=(['\\\"]?)([a-zA-Z0-9]*)\\\\1](.*)\\[\\/color\\]/sU\";\n $replacements[] = '<span style=\"color: #\\\\2;\">\\\\3</span>';\n $patterns[] = \"/\\[size=(['\\\"]?)([a-z0-9-]*)\\\\1](.*)\\[\\/size\\]/sU\";\n $replacements[] = '<span style=\"font-size: \\\\2;\">\\\\3</span>';\n $patterns[] = \"/\\[font=(['\\\"]?)([^;<>\\*\\(\\)\\\"']*)\\\\1](.*)\\[\\/font\\]/sU\";\n $replacements[] = '<span style=\"font-family: \\\\2;\">\\\\3</span>';\n $patterns[] = \"/\\[email]([^;<>\\*\\(\\)\\\"']*)\\[\\/email\\]/sU\";\n $replacements[] = '<a href=\"mailto:\\\\1\">\\\\1</a>';\n $patterns[] = \"/\\[b](.*)\\[\\/b\\]/sU\";\n $replacements[] = '<b>\\\\1</b>';\n $patterns[] = \"/\\[i](.*)\\[\\/i\\]/sU\";\n $replacements[] = '<i>\\\\1</i>';\n $patterns[] = \"/\\[u](.*)\\[\\/u\\]/sU\";\n $replacements[] = '<u>\\\\1</u>';\n $patterns[] = \"/\\[d](.*)\\[\\/d\\]/sU\";\n $replacements[] = '<del>\\\\1</del>';\n $patterns[] = \"/\\[object](.*)\\[\\/object\\]/s\";\n $replacements[] = '<b>\\\\1</b>';\n $patterns[] = \"/\\[media]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/media\\]/sU\";\n $replacements[] = '<a href=\"\\\\1\" target=\"_blank\">Play Item</a>';\n $patterns[] = \"/\\[img capt=(['\\\"]?)([^~]*)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n switch ( $allowimage ) {\n case 0:\n default:\n $replacements[] = '';\n break;\n case 1:\n $replacements[] = '<table align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></td></tr></table>';\n break;\n case 2:\n $replacements[] = '<table align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></a></td></tr><tr valign=\"top\"><td align=\"center\" valign=\"top\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><span class=\"captText\"><b>\\\\2</b></span></a></td></tr></table>';\n break;\n } // switch\n\n\t\t$patterns[] = \"/\\[imgc capt=(['\\\"]?)([^~]*)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/imgc\\]/sU\";\n switch ( $allowimage ) {\n case 0:\n default:\n $replacements[] = '';\n break;\n case 1:\n\t\t\t\t$replacements[] = '<div align=\"center\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></td></tr></table></div>';\n break;\n case 2:\n $replacements[] = '<div align=\"center\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></a></td></tr><tr valign=\"top\"><td align=\"center\" valign=\"top\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><span class=\"captText\"><b>\\\\2</b></span></a></td></tr></table></div>';\n break;\n } // switch\n /*\n\t\t*\n\t\t*/\n $patterns[] = \"/\\[imgr capt=(['\\\"]?)([^~]*)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/imgr\\]/sU\";\n switch ( $allowimage ) {\n case 0:\n default:\n $replacements[] = '';\n break;\n case 1:\n $replacements[] = '<table align=\"right\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></td></tr></table>';\n break;\n case 2:\n $replacements[] = '<table align=\"right\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" id=\"caption\"><tr><td align=\"center\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><img src=\"\\\\3\" width=\"90\" alt=\"\" class=\"imglrn\" /></a></td></tr><tr valign=\"top\"><td align=\"center\" valign=\"top\"><a href=\"javascript:pictWindow(\\'' . ZAR_URL . '/pict.php?src=\\\\3\\')\"><span class=\"captText\"><b>\\\\2</b></span></a></td></tr></table>';\n break;\n } // switch\n\n\n $patterns[] = \"/\\[img align=(['\\\"]?)(left|center|right)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n $patterns[] = \"/\\[img]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n $patterns[] = \"/\\[img align=(['\\\"]?)(left|center|right)\\\\1 id=(['\\\"]?)([0-9]*)\\\\3]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n $patterns[] = \"/\\[img id=(['\\\"]?)([0-9]*)\\\\1]([^\\\"\\(\\)\\?\\&'<>]*)\\[\\/img\\]/sU\";\n if ( $allowimage != 1 ) {\n $replacements[] = '<a href=\"\\\\3\" target=\"_blank\">\\\\3</a>';\n $replacements[] = '<a href=\"\\\\1\" target=\"_blank\">\\\\1</a>';\n $replacements[] = '<a href=\"' . ZAR_URL . '/image.php?id=\\\\4\" target=\"_blank\">\\\\4</a>';\n $replacements[] = '<a href=\"' . ZAR_URL . '/image.php?id=\\\\2\" target=\"_blank\">\\\\3</a>';\n } else {\n $replacements[] = '<img src=\"\\\\3\" align=\"\\\\2\" alt=\"\" />';\n $replacements[] = '<img src=\"\\\\1\" alt=\"\" />';\n $replacements[] = '<img src=\"' . ZAR_URL . '/image.php?id=\\\\4\" align=\"\\\\2\" alt=\"\\\\4\" />';\n $replacements[] = '<img src=\"' . ZAR_URL . '/image.php?id=\\\\2\" alt=\"\\\\3\" />';\n }\n\n\t\t$patterns[] = \"/\\[quote]/sU\";\n $replacements[] = _QUOTEC . '<div class=\"zariliaQuote\"><blockquote>';\n $patterns[] = \"/\\[\\/quote]/sU\";\n $replacements[] = '</blockquote></div>';\n $patterns[] = \"/javascript:/si\";\n $replacements[] = \"java script:\";\n $patterns[] = \"/about:/si\";\n $replacements[] = \"about :\";\n\n \t$patterns[] = \"/\\[zariliauplurl]/sU\";\n $replacements[] = ZAR_UPLOAD_URL;\n $text = preg_replace( $patterns, $replacements, $text );\n return $text;\n }", "function mdwpfp_init_markup_cleanup() {\n add_action('init', 'mdwpfp_head_cleanup');\n\n // Remove WP version from the RSS feed.\n add_filter('the_generator', 'mdwpfp_rss_version');\n\n // Clean the WP generated code around images.\n add_filter('the_content', 'mdwpfp_filter_ptags_on_images');\n\n // Remove pesky injected css for recent comments widget.\n add_filter('wp_head', 'mdwpfp_remove_wp_widget_recent_comments_style', 1);\n // Clean up injected comment styles in the <head>.\n add_action('wp_head', 'mdwpfp_remove_recent_comments_style', 1);\n\n // Clean the default WP photo gallery output.\n add_filter('gallery_style', 'mdwpfp_gallery_style');\n\n}", "function filter_ptags_on_images($content) {\n $content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n return preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "function filter_ptags_on_images($content) {\n $content = preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n return preg_replace('/<p>\\s*(<iframe .*>*.<\\/iframe>)\\s*<\\/p>/iU', '\\1', $content);\n}", "private function getImageIntoCss(): void\n {\n preg_match_all(self::REGEX_IMAGE_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $sImgPath = PH7_PATH_ROOT . $this->sBaseUrl . $aHit[1][$i] . $aHit[2][$i];\n $sImgUrl = PH7_URL_ROOT . $this->sBaseUrl . $aHit[1][$i] . $aHit[2][$i];\n\n if ($this->isDataUriEligible($sImgPath)) {\n $this->sContents = str_replace(\n $aHit[0][$i],\n 'url(' . Optimization::dataUri($sImgPath, $this->oFile) . ')',\n $this->sContents\n );\n } else {\n $this->sContents = str_replace(\n $aHit[0][$i],\n 'url(' . $sImgUrl . ')',\n $this->sContents\n );\n }\n }\n }", "function baindesign324_filter_ptags_on_images($content){\n\t return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n\t}", "function shariff3uu_catch_image() {\n\t\t$result = preg_match_all( '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', get_post_field( 'post_content', get_the_ID() ), $matches );\n\t\tif ( array_key_exists( 0, $matches[1] ) ) {\n\t\t\treturn $matches[1][0];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function tnsl_fShortenBlockURLs($sBlockfile = '', $sContents = '') {\r\n\tglobal $tnsl_bDebugMode, $tnsl_sGTFileDir, $tnsl_asGTFileExclude, $tnsl_asNoGTFile;\r\n\tif (!in_array($sBlockfile, $tnsl_asGTFileExclude)) {\r\n\t\tif ($tnsl_bDebugMode) {\r\n\t\t\techo '[ShortLinks_Function] = Present In Block<br />';\r\n\t\t}\r\n\t\tif ($sBlockfile != '') {\r\n\t\t\t$sGTBlockPath = $tnsl_sGTFileDir . '/GTB-' . $sBlockfile;\r\n\t\t\tif (@file_exists($sGTBlockPath)) { // Block has been \"Tapped\"\r\n\t\t\t\tif ($tnsl_bDebugMode) {\r\n\t\t\t\t\techo '[ShortLinks_FilePath] = GTB File Exists for :: ' . $sBlockfile . '<br />';\r\n\t\t\t\t}\r\n\t\t\t\ttnsl_fCleanLinks($sContents);\r\n\t\t\t\tunset($urlin, $urlout);\r\n\t\t\t\tinclude_once($sGTBlockPath);\r\n\t\t\t\t$sContents = preg_replace($urlin, $urlout, $sContents);\r\n\t\t\t} else {\r\n\t\t\t\tif ($tnsl_bDebugMode) {\r\n\t\t\t\t\techo '[ShortLinks_FilePath] = GTB File Does NOT Exist for :: ' . $sBlockfile . '<br />';\r\n\t\t\t\t\t$tnsl_asNoGTFile[] = $sGTBlockPath;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif ($tnsl_bDebugMode) {\r\n\t\t\t\techo '[ShortLinks_Function] = In HTML Block<br />';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $sContents;\r\n}", "function custom_filter_ptags_on_images($content){\n\treturn preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function block_core_gallery_data_id_backcompatibility($parsed_block)\n {\n }", "public function sanitizeLocalUrlInvalidDataProvider() {}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}", "function repair_broken_character_encoding() {\r\n\t\t$array_replaces = array(\r\n\t\t// multibyte\r\n\t\t'&acirc;&amp;#x80;&amp;#x99;' => '&rsquo;',\r\n\t\t'&acirc;&amp;#x80;&amp;#x91;' => '-',\r\n\t\t'&acirc;&amp;#x80;&amp;#x93;' => '&ndash;',\r\n\t\t'&Acirc;<q>&laquo;' => '<q>&laquo;',\r\n\t\t'&Acirc;&nbsp;&raquo;</q>' => '&nbsp;&raquo;</q>',\r\n\t\t// single byte\r\n\t\t'&Atilde;&copy;' => 'é',\r\n\t\t'&Atilde;&amp;#x89;' => 'É',\r\n\t\t'&Atilde;&reg;' => 'î',\r\n\t\t'&Atilde;&sect;' => 'ç',\r\n\t\t'&Atilde;&amp;#x98;' => '&bull;',\r\n\t\t'&Atilde;&uml;' => 'è',\r\n\t\t'&Atilde;&acute;' => 'ô',\r\n\t\t'&Atilde;&nbsp;&raquo;' => 'û',\r\n\t\t'&Atilde;&ordf;' => 'ê',\r\n\t\t'&Atilde;&amp;#x87;' => '&Ccedil;',\r\n\t\t'&Atilde;&sup1;' => '&ugrave;',\r\n\t\t'&Atilde;&amp;#x80;' => '&Agrave;',\r\n\t\t'&Atilde;&cent;' => '&acirc;',\r\n\t\t'&Atilde;&amp;#x88;' => '&Egrave;',\r\n\t\t'&Atilde;<q>&laquo;&nbsp;' => 'ë',\r\n\t\t'&Aring;&amp;#x93;' => '&oelig;',\r\n\t\t'&thinsp;&acirc;€&brvbar;' => '&hellip;',\r\n\t\t'.&Acirc; ' => '.&nbsp; ',\r\n\t\t'&amp;#x9C;&acirc;&amp;#x80;&brvbar;' => '&hellip;',\r\n\t\t'&acirc;&amp;#x80;&amp;#x9D;' => '&rdquo;',\r\n\t\t'&acirc;&amp;#x80;' => '&ldquo;',\r\n\t\t'&acirc;€™' => '&rsquo;',\r\n\t\t'&nbsp;? ' => ' à ',\r\n\t\t'&Aring;“' => '&oelig;',\r\n\t\t);\r\n\t\t$total_count = 0;\r\n\t\tforeach($array_replaces as $search => $replace) {\r\n\t\t\t$this->code = str_replace($search, $replace, $this->code, $count);\r\n\t\t\t$total_count += $count;\r\n\t\t}\r\n\t\t$this->code = str_replace('&Atilde;', 'à', $this->code, $count); // have to be careful with this last step since what's being used to identify character encodinbg problems itself has to also be repaired\r\n\t\t$total_count += $count;\r\n\t\tReTidy::warning_if($total_count . ' instances of broken character encoding repaired.', $total_count);\r\n\t\tif(strpos($this->code, '&Atilde;') !== false || strpos($this->code, 'Ã') !== false) {\r\n\t\t\tReTidy::warning('&Atilde; was found so character encoding problems likely remain.');\r\n\t\t}\r\n\t}", "function excerpt_remove_blocks($content)\n {\n }", "function spiplistes_corrige_img_pack ($img) {\n\tif(preg_match(\",^<img src='dist/images,\", $img)) {\n\t\t$img = preg_replace(\",^<img src='dist/images,\", \"<img src='../dist/images\", $img);\n\t}\n\treturn($img);\n}", "private function _replace_file_types()\n\t{\n\t\tpreg_match_all( '#(src|data-src|href)\\s*=\\s*[\\'\"]([^\\'\"\\\\\\]+)[\\'\"]#i', $this->content, $matches ) ;\n\t\tif ( empty( $matches[ 2 ] ) ) {\n\t\t\treturn ;\n\t\t}\n\n\t\t$filetypes = array_keys( $this->_cfg_cdn_mapping ) ;\n\t\tforeach ( $matches[ 2 ] as $k => $url ) {\n\t\t\t$url_parsed = parse_url( $url ) ;\n\t\t\tif ( empty( $url_parsed[ 'path' ] ) ) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\t\t\t$postfix = substr( $url_parsed[ 'path' ], strrpos( $url_parsed[ 'path' ], '.' ) ) ;\n\t\t\tif ( ! in_array( $postfix, $filetypes ) ) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\n\t\t\tLiteSpeed_Cache_Log::debug2( 'CDN matched file_type ' . $postfix . ' : ' . $url ) ;\n\n\t\t\tif( ! $url2 = $this->rewrite( $url, LiteSpeed_Cache_Config::ITEM_CDN_MAPPING_FILETYPE, $postfix ) ) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\n\t\t\t$attr = str_replace( $url, $url2, $matches[ 0 ][ $k ] ) ;\n\t\t\t$this->content = str_replace( $matches[ 0 ][ $k ], $attr, $this->content ) ;\n\t\t}\n\t}", "function cs_safebalises($texte) {\r\n\t$texte = trim($texte);\r\n\t// ouvre/supprime la premiere balise trouvee fermee (attention aux modeles SPIP)\r\n\tif(preg_match(',^(.*)</([a-z]+)>,Ums', $texte, $m) && !preg_match(\",<$m[2][ >],\", $m[1])) \r\n\t\t$texte = strlen($m[1])?\"<$m[2]>$texte\":trim(substr($texte, strlen($m[2])+3));\r\n\t// referme/supprime la derniere balise laissee ouverte (attention aux modeles SPIP)\r\n\tif(preg_match(',^(.*)[ >]([a-z]+)<,Ums', $rev = strrev($texte), $m) && !preg_match(\",>$m[2]/<,\", $m[1])) \r\n\t\t$texte = strrev(strlen($m[1])?\">$m[2]/<$rev\":trim(substr($rev, strlen($m[2])+2)));\r\n\t// balises <p|span|div> a traiter\r\n\tforeach(array('span', 'div', 'p') as $b) {\r\n\t\t// ouvrante manquante\r\n\t\tif(($fin = strpos($texte, \"</$b>\")) !== false)\r\n\t\t\tif(!preg_match(\",<{$b}[ >],\", substr($texte, 0, $fin)))\r\n\t\t\t\t$texte = \"<$b>$texte\";\r\n\t\t// fermante manquante\r\n\t\t$texte = strrev($texte);\r\n\t\tif(preg_match(',[ >]'.strrev(\"<{$b}\").',', $texte, $reg)) {\r\n\t\t\t$fin = strpos(substr($texte, 0, $deb = strpos($texte, $reg[0])), strrev(\"</$b>\"));\r\n\t\t\tif($fin===false || $fin>$deb) $texte = strrev(\"</$b>\").$texte;\r\n\t\t}\r\n\t\t$texte = strrev($texte);\r\n\t}\r\n\treturn $texte;\r\n}", "function mgl_instagram_format_link($str)\n{\n // Remove http:// and https:// from url\n $str = preg_replace('#^https?://#', '', $str);\n return $str;\n}", "function ceto_fix_shortcodes($content){\n $array = array (\n '<p>[' => '[',\n ']</p>' => ']',\n ']<br />' => ']'\n );\n $content = strtr($content, $array);\n return $content;\n}", "function po_filter_ptags_on_images($content){\n return preg_replace('/<p>\\s*(<a .*>)?\\s*(<img .* \\/>)\\s*(<\\/a>)?\\s*<\\/p>/iU', '\\1\\2\\3', $content);\n}" ]
[ "0.6392453", "0.6077643", "0.59694445", "0.596433", "0.5857513", "0.5848073", "0.57800984", "0.5645394", "0.5629749", "0.5612482", "0.56060094", "0.5605865", "0.55846745", "0.55782247", "0.5564736", "0.55591226", "0.55472636", "0.55447125", "0.5544226", "0.5532858", "0.5526865", "0.5522369", "0.55168456", "0.55134547", "0.5512149", "0.55095416", "0.55090183", "0.55034924", "0.54991543", "0.5493349", "0.54913765", "0.5491103", "0.5486436", "0.5468304", "0.54613215", "0.5440281", "0.5436919", "0.5436092", "0.5423452", "0.53886324", "0.53866094", "0.53724897", "0.53696334", "0.5350042", "0.533205", "0.53256637", "0.53152496", "0.53124434", "0.5312363", "0.5310203", "0.5299171", "0.5296258", "0.5292287", "0.52917147", "0.52869415", "0.52824175", "0.52811533", "0.52790344", "0.52751017", "0.5273032", "0.52683586", "0.5264885", "0.52607477", "0.52602744", "0.52556545", "0.5248573", "0.5247187", "0.5244677", "0.52417374", "0.523927", "0.5236737", "0.5236605", "0.5233523", "0.5233514", "0.5214003", "0.5213692", "0.5212429", "0.52111435", "0.5210401", "0.5210401", "0.52073026", "0.5203707", "0.5202418", "0.5201825", "0.519538", "0.5193941", "0.51900077", "0.5189631", "0.5189631", "0.5189631", "0.5189631", "0.5189631", "0.5189631", "0.5186497", "0.5183762", "0.5180805", "0.5179569", "0.5174413", "0.51728857", "0.51633704", "0.5158073" ]
0.0
-1
AUTHORIZATION / /Author: Sivkovych Maksym /Developed: 01.09.2015 /
function gen_rand_id() { return ( time() + rand( rand(10000,50000), rand(50000,99000) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n return true; // I do not know how to create authorisation for the back-end and the time constraints of the project did not allow me to get to this stage either. It is something I would like to learn to do in the future however.\n }", "public function testGetAuthorizationProducts()\n {\n }", "public function testGetAuthorizationDivisions()\n {\n }", "public static function authorizable()\n {\n return true;\n }", "public function testPostAuthorizationDivisions()\n {\n }", "public function testGetAuthorizationPermissions()\n {\n }", "public function authorizable(): bool\n {\n return false;\n }", "public function testGetAuthorizationRole()\n {\n }", "public function testRequireAuthor()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "public function test_authorization_header()\n {\n }", "public function testGetAuthorizationDivision()\n {\n }", "public function testGetAuthorizationDivisionspermittedMe()\n {\n }", "function hal_autoriser() {\n}", "public function getAuthorizations(): array;", "public function securityAction()\n {\n\n }", "public function testAddOrderAudit()\n {\n }", "public function authorize();", "public function authorize();", "public function isAuthorized() {\n\t\t\n\t}", "abstract public function authorize();", "abstract public function authorize();", "function doAuthorizationChecks() \n\t{\n\t\tif (API_Operation::$docs_mode)\n\t\t\treturn API_Operation::$docs_mode->addOperationNote(\"This operation does not require the user to be authenticated.\");\n\t}", "function doAuthorizationChecks() \n\t{\n\t\tif (API_Operation::$docs_mode)\n\t\t\treturn API_Operation::$docs_mode->addOperationNote(\"This operation does not require the user to be authenticated.\");\n\t}", "public function authorize($uriComponents, $requestHeaders, $requestMethod, $requestParams, $requestBody)\n {\n// new QEEE(3,\"quality\",\"a\"),\n// new QEEE(2,\"milk\",\"b\"),\n// new QEEE(2,\"milk\",\"c\"),\n// new QEEE(5,\"pork\",\"c\"));\n// var_dump(ArrayUtils::sort($arr, array(new OrderColumn(\"num\", Comparison::descending))));\n// var_dump($arr);\n\n\n $this->uriComponents = $uriComponents;\n $this->requestHeaders = $requestHeaders;\n $this->requestMethod = $requestMethod;\n $this->requestParams = $requestParams;\n $this->requestBody = $requestBody;\n\n // Get and check the authorization and scope of the client\n // if the header contain authorization code\n // find user id with that code (check if the code is in expired_time) and check scope\n // else redirect to api with that path if api scope is (0,0,0,0)\n\n $this->scopes = \"0,0,0,0\";\n $accessToken = null;\n $this->chanelId = -1;\n foreach ($requestHeaders as $name => $value) {\n if (StringUtils::compareStringIgnoreCase(strtolower($name), strtolower(Constants::ChanelID))) {\n $this->chanelId = $value;\n } else if (StringUtils::compareStringIgnoreCase(strtolower($name), strtolower(Constants::Authorization))) {\n $accessToken = $value;\n }\n }\n\n if ($accessToken != null) {\n try {\n $token = TokenService::getInstance()->findFirstByToken($accessToken);\n if ($token != null) {\n $tokenDate = DateTimeUtils::convertStringToDateTimeDB($token->created_timestamp);\n $currentDate = DateTimeUtils::getCurrentTime();\n if ($tokenDate != false) {\n $interval = $currentDate->getTimestamp() - $tokenDate->getTimestamp();\n $expire = $token->expired_interval;\n if ($expire == null || $expire < 0 || $interval < $expire) {\n $authorization = AuthorizationService::getInstance()->find($token->authorized_id);\n// var_dump($authorization);\n foreach ($authorization as $item) {\n $auth_id = $item->id;\n switch ($this->chanelId) {\n case Configuration::BOARD:\n $boardConfiguration = BoardConfigurationService::getInstance()->findByAuthID($auth_id);\n// var_dump($boardConfiguration);\n if ($boardConfiguration != null) {\n $this->requestHeaders[Constants::BoardID] = $boardConfiguration->id;\n $this->scopes = $boardConfiguration->scopes;\n $this->interceptData = $boardConfiguration;\n $this->token = $token;\n $this->authorization = $item;\n }\n break;\n case Configuration::USER:\n $userConfiguration = UserService::getInstance()->findByAuthID($auth_id);\n if ($userConfiguration != null) {\n $this->requestHeaders[Constants::UserID] = $userConfiguration->id;\n $this->scopes = $userConfiguration->scopes;\n $this->interceptData = $userConfiguration;\n $this->token = $token;\n $this->authorization = $item;\n }\n break;\n case Configuration::USER_DEVICE:\n $userDeviceConfiguration = UserDeviceService::getInstance()->findByAuthID($auth_id);\n if ($userDeviceConfiguration != null) {\n $this->requestHeaders[Constants::UserDeviceID] = $userDeviceConfiguration->id;\n $this->scopes = $userDeviceConfiguration->scopes;\n $this->interceptData = $userDeviceConfiguration;\n $this->token = $token;\n $this->authorization = $item;\n }\n break;\n case Configuration::SERVER:\n $serverConfiguration = ServerConfigurationService::getInstance()->findByAuthID($auth_id);\n if ($serverConfiguration != null) {\n $this->requestHeaders[Constants::ServerID] = $serverConfiguration->id;\n $this->scopes = $serverConfiguration->scopes;\n $this->interceptData = $serverConfiguration;\n $this->token = $token;\n $this->authorization = $item;\n }\n break;\n default:\n echo \"Unknown Error\";\n break;\n }\n }\n }\n }\n }\n } catch (Exception $e) {\n// echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n echo \"Unknown Error\";\n }\n }\n }", "function beManaged()\n {\n }", "function apiVersion() {}", "public function testGetAuthorizationRoles()\n {\n }", "public function testPutAuthorizationDivision()\n {\n }", "public function getAuthorizationString();", "public function testAddVendorComplianceSurveyAudit()\n {\n }", "public function testPostAuthorizationDivisionObject()\n {\n }", "public function testPutAuthorizationRole()\n {\n }", "function authorize($args)\n{\n global $_zp_authority;\n $args = decode64($args);\n //debugLog('after decode: '.var_export($args, true));\n logger('authorize', ($args['loglevel']));\n if (!preg_match('#^1.4#', ($version = getVersion()))) {\n return new ZEN_Error(-2, 'Zenphoto version '.$version.' but v1.4.x required!');\n }\n $_zp_authority = new Zenphoto_Authority();\n $hash = $_zp_authority->passwordHash($args['loginUsername'], $args['loginPassword']);\n debugLog('hashvalue: '.$hash);\n $userobj = getAnAdmin([\n '`user`=' => $args['loginUsername'],\n '`valid`=' => 1,\n ]);\n if ($userobj == '') {\n return new ZEN_Error(-1, 'Incorrect username or password '.$args['loginUsername'].' '.$args['loginPassword']);\n } //$userobj == ''\n else {\n $localhash = $userobj->getPass();\n debugLog('hash = '.$hash.' localhash = '.$localhash);\n if ($hash == $localhash) {\n return true;\n } //$userobj\n else {\n return new ZEN_Error(-1, 'Incorrect username or password '.$args['loginUsername'].' '.$args['loginPassword']);\n }\n }\n}", "public function authorizeShouldCreateMetadata(): void\n {\n $metadata = new Metadata();\n $metadata->setShopType('Shopware');\n $metadata->setShopVersion('5.12');\n $metadata->addMetadata('ModuleType', 'Shopware 5');\n $metadata->addMetadata('ModuleVersion', '18.3.12');\n $this->assertEmpty($metadata->getId());\n\n $paypal = $this->heidelpay->createPaymentType(new Paypal());\n $this->heidelpay->authorize(1.23, 'EUR', $paypal, 'https://heidelpay.com', null, null, $metadata);\n $this->assertNotEmpty($metadata->getId());\n }", "public function authorize()\n { \n\n if($this->path() == 'add_vendor' || $this->path() == 'edit_vendor'){\n return true;\n }else{\n return false;\n }\n \n }", "public function authorizeAction();", "public function testAuthenticationsInweboIdGet()\n {\n }", "public function authorize()\n {\n\t\t\t return true;\n }", "public function testPatchAuthorizationRole()\n {\n }", "public function testAddAuthentication();", "public function testGetAuthorizationSubject()\n {\n }", "public function testAuthenticationServiceAuthenticationInformation()\n {\n }", "public function testGetAuthorizationDivisionsHome()\n {\n }", "public function authority() : string;", "public function authority() : string;", "function cilien_autoriser(){}", "public function authorize()\n {\n return true; // TODO : edit it with roles\n }", "public function testAddPackingPlanAudit()\n {\n }", "public function setAuthorized() {}", "public function testPutAuthorizationRolesDefault()\n {\n }", "public function testPostAuthorizationRole()\n {\n }", "public function testAuthenticationsInweboIdPut()\n {\n }", "protected function __authorization(){\n\t\t $this->cURL->headers['Authorization'] = 'Bearer '.$this->access_token;\n }", "public function authorize (): bool\n {\n return true;\n }", "public function authorize(){\n\t\treturn true;\n\t}", "public function authorize(){\n\t\treturn true;\n\t}", "public function testAddReplenishmentAudit()\n {\n }", "public function provides() {\n return [ 'authorizer' ];\n }", "public function authorize()\t{\n\t\treturn true;\n\t}", "public function authorize()\n {\n // to do update verification and rules on the rights to create a company\n return true;\n }", "public function authorize()\n {\n return true; // All can use SortInput\n }", "public function authorize(): bool\n {\n return true;\n }", "public function isAuthorized() {}", "public function authorize()//AQUI QUE VALIDA USUÀRIO\r\n {\r\n return true;\r\n }", "public function authorize()\n {\n return true ;\n }", "public function authorize()\n {\n return true ;\n }", "public function authorize()\n {\n\t\treturn true;\n }", "public function testAuthenticationServiceAuthenticationUpdate()\n {\n }", "public function relatorio4(){\n $this->isAdmin();\n }", "public function authorize()\n {\n return true; //admin guard\n }", "public function testAuthenticationServiceListAuthentications()\n {\n }", "public function testGetAuthorizationRoleSubjectgrants()\n {\n }", "public function testShowUnauthicatedAccess(): void { }", "function rest_authorization_required_code()\n {\n }", "function cl_autoriser(){}", "public function authorize()\n {\n return true; //tRUE CUALQUIER USUARIO PUEDE CREAR UN PROYECTO\n }", "public function testAuthenticationServiceAuthenticationCreate()\n {\n }", "public function authorize(){\n return true;\n }", "public function authorize(){\n return true;\n }", "public function authorize(){\n return true;\n }", "public function authorize(){\n return true;\n }", "public function authorize(){\n return true;\n }", "public function authorize(): bool\n {\n return TRUE;\n }", "public function authorize()\n {\n return true;\n }", "public function authorize(){\n return true;\n }", "public function authorize()\n {\n return true; //true - todos\n }", "public function authorize()\n {\n // TODO: установка разрешения\n return true;\n }", "function livraison_autoriser() {}", "public function authorize() \n { \n return true; \n }", "public function authorize()\n {\n return true; //[ *1. default=false ]\n }", "public function authorize()\n {\n return True;\n }", "public function authorize()\n {\n return True;\n }", "public function authorize()\n {\n return True;\n }", "public function authorize()\n {\n return True;\n }", "public function authorize()\n {\n return True;\n }", "public function authorize()\n {\n return True;\n }", "public function authorize()\n {\n return True;\n }", "public function testGetAuthorizationDivisionsLimit()\n {\n }", "public function authorize(): bool\r\n {\r\n return true;\r\n }", "private function metodo_privado() {\n }", "public function authorize()\n {\n return true;\n\n }" ]
[ "0.6040563", "0.600226", "0.5906152", "0.59021276", "0.58676934", "0.5798292", "0.5761906", "0.5750662", "0.5739944", "0.5697317", "0.5660763", "0.56556743", "0.5636695", "0.56342965", "0.56159836", "0.5612847", "0.5605602", "0.5605602", "0.5604172", "0.55916196", "0.55916196", "0.55723214", "0.55723214", "0.55683047", "0.5563083", "0.556226", "0.5562215", "0.5561404", "0.5543726", "0.5536062", "0.553165", "0.552206", "0.5497595", "0.5496381", "0.54797673", "0.54621553", "0.54548544", "0.5453079", "0.54522127", "0.5449388", "0.54493237", "0.5434003", "0.5429513", "0.541652", "0.541652", "0.54112214", "0.5406431", "0.5376079", "0.5371566", "0.53707826", "0.5367127", "0.53491235", "0.5348343", "0.5345166", "0.5344486", "0.5344486", "0.5335332", "0.5334569", "0.5327492", "0.5319794", "0.5316604", "0.53085876", "0.52930963", "0.529293", "0.5290873", "0.5290873", "0.52891606", "0.5287428", "0.52809083", "0.5276711", "0.5276069", "0.52730024", "0.5269448", "0.52681214", "0.5267944", "0.5267926", "0.5267527", "0.5262241", "0.5262241", "0.5262241", "0.5262241", "0.5262241", "0.5258419", "0.52575755", "0.5253877", "0.5253028", "0.52509564", "0.52500194", "0.52387375", "0.5220321", "0.5219639", "0.5219639", "0.5219639", "0.5219639", "0.5219639", "0.5219639", "0.5219639", "0.5219258", "0.5219145", "0.5217437", "0.52117324" ]
0.0
-1
das Segment soll nur gezeichnet werden, wenn der Nutzer eingeloggt ist
public static function show($console, $result, $data) { if (!Einstellungen::$accessAllowed) { return; } Installation::log(array('text' => Installation::Get('main', 'functionBegin'))); $text = ''; if (!$console) { $text .= Design::erstelleBeschreibung($console, Installation::Get('database_informations', 'description', self::$langTemplate)); $text .= Design::erstelleZeile($console, Installation::Get('database_informations', 'db_path', self::$langTemplate), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_path'], 'data[DB][db_path]', 'localhost', true), 'v'); $text .= Design::erstelleZeile($console, Installation::Get('database_informations', 'db_name', self::$langTemplate), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_name'], 'data[DB][db_name]', 'uebungsplattform', true), 'v'); echo Design::erstelleBlock($console, Installation::Get('database_informations', 'title', self::$langTemplate), $text); } $text = ''; if (!$console) { $text .= "<tr><td colspan='2'>" . Installation::Get('databaseAdmin', 'description', self::$langTemplate) . "</td></tr>"; $text .= Design::erstelleZeile($console, Installation::Get('databaseAdmin', 'db_user', self::$langTemplate), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_user'], 'data[DB][db_user]', 'root', true), 'v'); $text .= Design::erstelleZeile($console, Installation::Get('databaseAdmin', 'db_passwd', self::$langTemplate), 'e', Design::erstellePasswortzeile($console, $data['DB']['db_passwd'], 'data[DB][db_passwd]', '', true), 'v'); echo Design::erstelleBlock($console, Installation::Get('databaseAdmin', 'title', self::$langTemplate), $text); } $text = ''; if (!$console) { $text .= "<tr><td colspan='2'>" . Installation::Get('databasePlatformUser', 'description', self::$langTemplate) . "</td></tr>"; $text .= Design::erstelleZeile($console, Installation::Get('databasePlatformUser', 'db_user_operator', self::$langTemplate), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_user_operator'], 'data[DB][db_user_operator]', 'DBOperator', true), 'v'); $text .= Design::erstelleZeile($console, Installation::Get('databasePlatformUser', 'db_passwd_operator', self::$langTemplate), 'e', Design::erstellePasswortzeile($console, $data['DB']['db_passwd_operator'], 'data[DB][db_passwd_operator]', '', true), 'v'); echo Design::erstelleBlock($console, Installation::Get('databasePlatformUser', 'title', self::$langTemplate), $text); } Installation::log(array('text' => Installation::Get('main', 'functionEnd'))); return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actividadesPorSegmento()\n {\n //\n }", "static function get_segment($id){\n\t\t$start_marker = \"#zazzle_acc_start \".$id;\n\t\t$end_marker = \"#zazzle_acc_end \".$id.\"\\n\";\n\t\t\n\t\t$start = strpos(self::$FDATA, $start_marker);\n\t\t$end = strpos(self::$FDATA, $end_marker);\n\t\t\n\t\t//echo \"--Start: \".$start.\"<br>\";\n\t\t//echo \"--End: \".$end.\"<br>\";\n\t\t\n\t\tif($start === false){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$segment = substr(self::$FDATA, $start, $end - $start +strlen($end_marker));\n\t\t//echo \"--Segment: \".$segment.\"<br>\";\n\t\treturn $segment;\n\t}", "static function beginSegment($segtag) {\n self::$segbuf = \"\" . $segtag;\n if ($segtag != \"UNH\") {\n self::$segcnt++;\n } else {\n self::$segcnt = 1;\n }\n }", "public function segments() : array;", "public function getSegmentId()\n {\n return $this->segment_id;\n }", "public function getSegment()\n {\n return $this->_segment;\n }", "public function segment($num_segment=NULL){\n\t\t$base_url = $this->site_url();\n\t\t$actual_link = $this->protocol() . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\t$set_parse = str_replace($base_url, $this->protocol() . 'g.g/', $actual_link);\n\t\t$parse_url = parse_url($set_parse, PHP_URL_PATH);\n\t\t$arrPath = explode('/', $parse_url);\n\t\t/*\tmembuat urutan ulang index array. urutan pertama menjadi 1 */\n\n\t\tif($num_segment == NULL){\n\n\t\t\t/* menampilkan semua data array */\n\t\t\treturn $arrPath;\n\t\t} else {\n\n\t\t\t/* chcek jika input data melebihi jumlah array path */\n\t\t\tif(count($arrPath) >= $num_segment){\n\t\t\t\tif(isset($arrPath[$num_segment])){\n\t\t\t\t\treturn $arrPath[$num_segment];\n\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t}", "public function verifyNameSegment()\n {\n if($_REQUEST['txtnombre']){\n if(isset($_REQUEST['old_name'])){\n // Edicion\n if($_REQUEST['txtnombre'] != $_REQUEST['old_name']){\n $input = $_REQUEST['txtnombre'];\n\n if($_REQUEST['target'] == 1)\n $sql = \"SELECT name_segment FROM t_segment WHERE name_segment = '$input'\";\n elseif($_REQUEST['target'] == 2)\n $sql = \"SELECT name_sub_segment FROM t_sub_segment WHERE name_sub_segment = '$input'\";\n elseif($_REQUEST['target'] == 3)\n $sql = \"SELECT name_micro_segment FROM t_micro_segment WHERE name_micro_segment = '$input'\";\n\n //Incluye el modelo que corresponde\n require_once 'models/SegmentsModel.php';\n $model = new SegmentsModel();\n $result = $model->goCustomQuery($sql);\n\n if($result->rowCount() > 0)\n echo \"false\";\n else\n echo \"true\";\n }\n else\n echo \"true\";\n }\n else{\n // Nuevo\n $input = $_REQUEST['txtnombre'];\n\n if($_REQUEST['target'] == 1)\n $sql = \"SELECT name_segment FROM t_segment WHERE name_segment = '$input'\";\n elseif($_REQUEST['target'] == 2)\n $sql = \"SELECT name_sub_segment FROM t_sub_segment WHERE name_sub_segment = '$input'\";\n elseif($_REQUEST['target'] == 3)\n $sql = \"SELECT name_micro_segment FROM t_micro_segment WHERE name_micro_segment = '$input'\";\n\n //Incluye el modelo que corresponde\n require_once 'models/SegmentsModel.php';\n $model = new SegmentsModel();\n $result = $model->goCustomQuery($sql);\n\n if($result->rowCount() > 0)\n echo \"false\";\n else\n echo \"true\";\n }\n }\n else\n echo \"false\";\n }", "function segment($index){\n\t\t\tif(!empty($this->path[$index-1])){\n\t\t\t return $this->path[$index-1];\n\t\t\t}else{ \n\t\t\t return false;\n\t\t\t}\n\t\t}", "function izbaci_internu_komandu($string, $start, $end){\r\n $ini = strpos($string,$start);\r\n if ($ini == 0) return \"\";\r\n $pdeo = substr($string,0,$ini);\r\n $ini += strlen($start); \r\n $len = strpos($string,$end,$ini) - $ini;\r\n $pocddela = strpos($string,$end) + strlen($end);\r\n $duzina = strlen($string);\r\n $duzinaDDela = $duzina - $pocddela;\r\n $drugiDeo = substr($string,$pocddela,$duzinaDDela);\r\n //return substr($string,$ini,$len).\" pos1=\".strpos($string,$start).\" pos2=\".strpos($string,$end,$ini).\" | \".$string . \" prvideo=\".$pdeo . \" drugiDeo=\".$drugiDeo;\r\n return $pdeo . $drugiDeo ;\r\n}", "public function getSegment()\n {\n return $this->Segment;\n }", "function get_segment_name() {\n\tif ( isset( $_SERVER['HTTP_X_WPENGINE_SEGMENT'] ) ) {\n\t\treturn sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_WPENGINE_SEGMENT'] ) );\n\t}\n}", "private function dajImeKontrolera()\n {\n $segmenti = explode('\\\\', get_class($this));\n $kontroler = end($segmenti);\n\n if (substr($kontroler, -9) == 'Kontroler') {\n return substr($kontroler, 0, -9);\n }\n\n return $kontroler;\n }", "public function index()\n {\n\n return \"Segment1: \" . print_r($this->segments[0],true);\n }", "function SegmentAdmin()\n\t{\n\t\t// if we've already worked this out, return it.\n\t\tif (!is_null($this->segmentadmin)) {\n\t\t\treturn $this->segmentadmin;\n\t\t}\n\t\t\n\t\t$admin = false;\n\n\t\tif ($this->isAdmin()) {\n\t\t $admin = true;\n\t\t}\n\t\t\n\t\tif ($this->group->segmentadmin == 1) {\n\t\t $admin = true;\n\t\t}\n\t\t\n\t\t$this->segmentadmin = $admin;\n\t\t\n\t\treturn $this->segmentadmin;\n\t}", "public function isSegmentAdmin()\n\t{\n\t return $this->group->segmentadmin == 1;\n\t}", "abstract protected function determineRootline() ;", "public function getSegCountX2() {}", "function get_segment_id() : string {\n\tif ( defined( 'ALTIS_SEGMENT_ID' ) ) {\n\t\treturn ALTIS_SEGMENT_ID;\n\t}\n\treturn SEGMENT_ID;\n}", "public function getIdSegmentation()\n {\n return $this->id_segmentation;\n }", "static function getSegmentCount() {\n return self::$segcnt;\n }", "public function getSegmentID()\n {\n return isset($this->SegmentID) ? $this->SegmentID : null;\n }", "public function getSegment()\n {\n return isset($this->segment) ? $this->segment : null;\n }", "function secenjeSadrzajPolja($line)\n {\n\n $s=substr($line, strrpos($line, \":\")+1);\n \n return $s;\n }", "function CanCreateSegment()\n\t{\n\t\tif ($this->SegmentAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ($this->HasAccess('Segments', 'Create')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function secenjeVrstaPolja($line)\n{ \n \n \n $tacka=strpos($line, ':');// trazi lokaciju tacke\n \n if($tacka>7){ // ako je tacka na 7 mestu primenjuje secenje do prve ;\n $s=substr($line, 0, strpos($line, ';'));\n }else{ \n $s= substr($line, 0, strpos($line, ':'));\n } \n return $s;\n}", "protected function determineRootline() {}", "protected function determineRootline() {}", "public function show(Segment $segment)\n {\n //\n }", "public function getContentSegments();", "static function segword($str) {\n\t\t$segObj = new Segmentation();\n\t\t$sc = $segObj->_getSegClient();\n $sc->SetLimits(0, 1, 1);\n\t\t$searchRes = $segObj->queryViaValidConnection($str, 'goods_id_dist');\n\t\tif( $searchRes == false ) {\n\t\t\treturn false;\n\t\t}\n\t\t//var_dump($searchRes['words']);\n\t\t//return array_keys( $searchRes['words'] );\n\t\tif (!empty($searchRes['words'])) {\n\t\t\treturn array_keys($searchRes['words']);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t} \n\t}", "public function stampaDipendenti() {\n echo '<p> Nome: ' . $this->nome . '</p>';\n echo '<p> Cognome: ' . $this->cognome . '</p>';\n echo '<p> Software utilizzati: ' . $this->software . '</p>';\n }", "public function segments(){\n return $this->segments;\n }", "public function getSegmentName() : \\string\n {\n return $this->segmentName;\n }", "public function getSegmentNames()\n {\n return $this->segmentNames;\n }", "public function run()\n {\n $segments = [\n [\n 'name' => \"Exatas\"\n ],\n [\n 'name' => \"Humanas\"\n ],\n [\n 'name' => \"Saúde\"\n ],\n [\n 'name' => \"Tecnologia\"\n ],\n ];\n\n Segment::insert($segments);\n }", "function makeSegment($point_1, $point_2)\n{\n return cons($point_1, $point_2);\n}", "public function testGetTextSegment()\n {\n $this->assertEquals($this->alignment->getTextSegmentId(), $this->alignment->getTextSegment()->getId());\n }", "public function getSegmentCount()\n {\n return $this->count(self::SEGMENT);\n }", "public function partidos_cancha()\n\t{\n\t\tif($this->moguardia->isloged(true) and $torneo > 0)\n\t\t{\n\t\t\t$this->load->view('torneos/partidos_cancha');\n\t\t}\n\t}", "protected function getCurrentSegment(string $seg): string\n {\n if ($seg[0] === '{') {\n return str_replace(['}', '{'], '', $seg);\n }\n\n return $seg;\n }", "public function setSegment($value)\n {\n return $this->set('Segment', $value);\n }", "public function testGetTextSegmentId()\n {\n $this->assertEquals(2, $this->alignment->getTextSegmentId());\n }", "private function get_category_breaking_segment($segments)\n {\n\n // var_dump($segments);\n }", "public function suprDiplomePossede()\n {\n //sécurité :\n $action = 'deleteFolderInformation';\n $error = AccessControll::checkRight($action);\n if ( empty($error) ){ //ok\n //on réccupère l'id à supr (clée primaire)\n $id = $this->request->getGetAttribute('id');\n //ajout d'une entrée dans le fichier de log\n $data = DossierManager::getPossedeByClef($id);\n $auth = AuthenticationManager::getInstance();\n $username = $auth->getMatricule();\n $type = 'possedeDiplome';\n self::logDeletedInformation($data, $username, $type);\n //on supprime (retourne le matricule)\n $matricule = DossierManager::suprDiplomePossedeById($id);\n //on réaffiche le dossier actualisé\n $dossier = DossierManager::getOneFromId($matricule);\n $prez = self::afficheDossierComplet($dossier);\n $this->response->setPart('contenu', $prez);\n } else{\n header(\"location: index.php\");\n die($error);\n }\n }", "function check_path_segment(string $path)\n{\n $trailingslashed = trailingslashit($path);\n\n // Don't want a leading slash.\n $frontchecked = ltrim($trailingslashed, '\\\\/');\n return $frontchecked;\n}", "public function getSegment($key);", "public function testSetTextSegmentId()\n {\n $this->alignment->setTextSegmentId(25);\n $this->assertEquals(25, $this->alignment->getTextSegmentId());\n }", "function part2() {\n foreach ($this->areas as $a) {\n extract($a); // creates in scope: $id, $x, $y, $w, $h\n $area = $this->charCounter($id, $this->fabric);\n echo \"$id: $area\\n\";\n if ($area == $w * $h) {\n die(\"$id fills $area cells and is not overlapped.\\n\");\n }\n }\n echo \"No region found.\\n\";\n }", "public function setSegment($segment)\n {\n $this->_is_loaded = false;\n $this->_segment = $segment;\n $this->load();\n }", "function fundMapPar($caminhos){\n\t$k = 1;\n\t$pathAux = '';\n\t$i = count($caminhos)-1;\n\t$pathAux.=$caminhos[$i].'#';\n\t$path[] = $caminhos[$i];\n\t$i--;\n\t$pathAux.=$caminhos[$i].'#';\n\t$path[] = $caminhos[$i];\n\t$i--;\n\twhile ($i >= 0) {\n\n\t\tif (fullUpper($caminhos[$i]) == fullUpper($path[$k])) {\n\t\t\t$pathAux.=$caminhos[$i-1].'#';\n\t\t\t$path[] = $caminhos[$i-1];\n\t\t\t$k++;\n\t\t};\n\t\t$i = $i - 2;\n\t} \n\treturn $pathAux;\n}", "public function hasContentSegment($segment);", "public function getContentSegment($segment = 'content');", "public function get_segments($num = false)\n\t{\n\t\tif($num !== false)\n\t\t{\n\t\t\treturn isset($this->segments[$num]) ? $this->segments[$num] : false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->segments;\n\t\t}\n\t}", "protected function getMappingSegment($className, $segment)\n\t{\n\t\treturn explode('@', $this->mappings[$className])[$segment];\n\t}", "public function getSegments()\n {\n return $this->Segments;\n }", "protected function segment($Tag)\n {\n $this->log(__LINE__, '[parser] segment()', [$Tag]);\n\n // Loop through source code array\n $i = 0;\n foreach($this->SourceCodeArray as $Line)\n {\n // If find tag, break\n if(stripos($Line, $Tag) !== false) { break; }\n $i++;\n }\n\n // Splice array\n array_splice($this->SourceCodeArray, 0, $i);\n }", "public function initializeSlug(){\n if (empty($this->Nom_vis)) {\n \n $slugify = new Slugify();\n $this->Nom_vis = $slugify->Slugify($this->Nom_vis);\n \n }\n }", "function zusatz_zeichnen($ZEbene_Bezeichnung,$Ebeneninhalt,$s,$X_min,$Y_max,$Stroke_width,$Color)\n{\n\treturn $ZE_Ausg = ' <g transform=\"matrix('.$s.' 0 0 '.$s.' '.$X_min.' '.$Y_max.')\" id=\"zusatz_'.$ZEbene_Bezeichnung.'\" fill=\"none\" pointer-events=\"none\" stroke-width=\"'.$Stroke_width.'\" stroke=\"'.$Color.'\">\n\t\t\t<desc>Zusatz-Inhalt '.utf8_encode($ZEbene_Bezeichnung).'</desc>'.\n\t\t\t$Ebeneninhalt\n\t.'</g>';\n}", "public function getSegmentCount() : int\r\n {\r\n $iCount = 0;\r\n if (($aSegments = $this->getSegments()) !== null) {\r\n $iCount = count($aSegments);\r\n }\r\n return $iCount;\r\n }", "function getRouteSegment($number)\n{\n\t// Get the current route as an array\n\t$route = getRouteArray();\n\n\t// If the route segment exists we return the segment if not the if statement\n\t// will be ignored and false will be returned instead.\n\tif (isset($route[$number]))\n\t{\n\t\treturn $route[$number];\n\t}\n\n\treturn false;\n}", "public function testSectorNoEspecificadoSiSeDanInstanciaSinEspecificar(){\n\t\t\t$emp= $this-> crear(\"Antonella\", \"Adriano\", 2, 5000);\n\t\t\t$this->assertEquals(\"No especificado\", $emp->getSector());\n\t\t}", "function noidungtt($sotu,$noidung)\n{\n\n\t$n=explode(\" \",$noidung);\n\t$noidunginra=\" \";\n\tif($sotu<=count($n)){\n for($i=0;$i<$sotu;$i++)\n\t\t $noidunginra = $noidunginra.$n[$i].\" \";\n $noidunginra .=\"...\";\n }\n\telse\n\t\techo \"<h1>cảnh báo : số từ tóm lược nhiều hơn nội dung ban đầu</h1>\"; \n\treturn $noidunginra;\n}", "public function getStemH() {}", "protected function getMapperSegment($command, $segment)\n\t{\n\t\treturn explode('@', call_user_func($this->mapper, $command))[$segment];\n\t}", "public function segment($segment_number, $safe = FALSE) {\n /**\n * get entry url and explode it\n */\n $segments = explode('/', $this->get('url'));\n $count = count($segments);\n /**\n * if any segment not exists return null\n */\n if ($count == 0) {\n return NULL;\n }\n /**\n * ignore all empty value of url\n */\n for ($i = 0; $i < $count; $i++) {\n if ($segments[$i] == '') {\n unset($segments[$i]);\n $count = count($segments);\n }\n }\n /**\n * if all items are correct return invoked value\n */\n if ($segment_number > 0 && is_array($segments) && $segment_number <= $count) {\n $segment = $safe ? strip_tags($segments[$segment_number-1]) : $segments[$segment_number-1];\n return $segment;\n }\n return NULL;\n }", "public function total_segments()\n\t{\n\t\treturn count($this->segments);\n\t}", "public function createSegments() : array\n {\n $cleanPath = $this->name;\n\n if(strpos($cleanPath, \"/\") == 0)\n {\n $cleanPath = substr($cleanPath, 1);\n }\n\n return explode(\"/\", $cleanPath);\n }", "public function testGetSegmentsDefault(): void\n {\n self::assertNull($this->class->getSegments());\n }", "function uriSegment($segment = '')\n {\n $request_uri = trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');\n $explode = explode('/', str_replace('index.php/', '', $request_uri));\n\n if(empty($segment)) return '';\n\n if(!empty($explode[($segment-1)]))\n return $explode[($segment-1)];\n else \n return '';\n }", "public function getSegmentType()\n {\n return (string) $this->json()->segment_type;\n }", "function conversor_segundos($seg_ini) {\n\n\t\t\t$horas = floor($seg_ini/3600);\n\t\t\t$minutos = floor(($seg_ini-($horas*3600))/60);\n\t\t\t\t\t\t\t\n\t\t\treturn $horas.\"h:\".$minutos.\"m\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "static function writeSegment($file) {\n self::$segbuf .= self::SEGMENT_TERMINATOR;\n if (file_put_contents($file, self::$segbuf) === FALSE) {\n $errmsg = \"File $file: Error writing segment \" . self::$segbuf\n . \".\\n\";\n fwrite(STDERR, $errmsg);\n exit(1);\n }\n }", "protected function remove_dot_segments($input)\n {\n }", "protected function remove_dot_segments($input)\n {\n }", "public function setSegmentId($var)\n {\n GPBUtil::checkString($var, True);\n $this->segment_id = $var;\n\n return $this;\n }", "function consolidatePath2($path, $type) {\n $cpath = array();\n /*\n What are the conditions that determine a transfer?\n 1. If the connection type is different (express -> local)\n 2. If the train in the next segment is different and the original one is not available\n 3. if the connection type is transfer\n */\n // debugging\n $debug = true;\n $path_array = $path->path;\n $count = count($path_array);\n // this is a direction path and there is only one or two paths.\n // that means it either goes from loc->station->loc or just loc->loc\n if ($type == \"dir\" && $count <= 2) {\n return \"walk\";\n }\n //set up the first segment\n $segment = $path_array[0];\n if ($type == \"s2s\") {\n $i = 1; \n }\n else {\n $cpath[] = $segment;\n $segment = $path_array[1];\n $i = 2;\n }\n $marker1 = $segment->m1;\n $current_lines = $segment->m1->getOverlapLines($segment->m2);\n $connection = $segment->connection;\n $total_time = $segment->t;\n $segment2 = $path_array[$i+1];\n // loop through the path, starting at the next segment.\n for (; $i < $count; $i++) {\n // grab the segment\n $segment2 = $path_array[$i];\n \n if ($debug) {\n echo \"@\" . $segment2->m1->name . \"<br/>\";\n echo \"lines = \";\n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n \n if ($connection == \"transfer\") {\n // we know this segment is a transfer, so they will have to get off the train\n echo \"transfer<br/>\";\n \n // end the segment\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // add the transfer segment\n // we need to get the transfer lines\n $lines = $segment2->m1->getOverlapLines($segment2->m2);\n $lines = getCorrectLines($lines, $segment2->connection);\n // create new segment\n $new_segment = new Segment($segment2->m1, $segment2->m2, $lines, $segment2->t, $segment2->connection);\n $cpath[] = $new_segment;\n \n // increment if we need to\n if ($i < $count) {\n // increment\n $i++;\n $segment = $path_array[$i];\n $marker1 = $segment->m1;\n $current_lines = $segment->m1->getOverlapLines($segment->m2);\n $connection = $segment->connection;\n $total_time = $segment->t;\n if ($i < $count) {\n // more segments available\n continue;\n }\n // we end here with this segment\n $new_segment = new Segment($segment->m1, $segment->m2, $current_lines, $total_time, $connection);\n $cpath[] = $new_segment;\n return $cpath;\n }\n }\n else if ($connection != $segment2->connection) {\n // the connection types are different, but trains can shift from express to local and vice versa.\n if ($debug) {\n echo \"old conn: \" . $connection . \" | new conn: \" . $segment2->connection . \"<br/>\";\n }\n // do we have the same train available?\n if (sameTrain($current_lines, $segment2)) {\n // it's the same train, so we just update our lines and continue\n $current_lines = updateLines($segment, $current_lines);\n $total_time += $segment2->t;\n $connection = $segment2->connection;\n continue;\n }\n // different trains, so we need to transfer\n \n // end the old segment and add to the path\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"new_segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // reset our variables for the next segment\n $segment = $segment2;\n $marker1 = $segment2->m1;\n $current_lines = $segment2->m1->getOverlapLines($segment2->m2);\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n continue;\n }\n else if (!sameTrain($current_lines, $segment2)) {\n // different trains, so we need to transfer\n if ($debug) {\n echo \"old lines: \";\n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n echo \"new line: \" . $segment2->lines[0]->name . \"<br/>\";\n } \n // end the old segment and add to the path\n $new_segment = new Segment($marker1, $segment2->m1, $current_lines, $total_time, $connection);\n if ($debug) {\n echo \"new_segment = \" . $new_segment->toString() . \"<br/>\";\n }\n $cpath[] = $new_segment;\n \n // reset our variables for the next segment\n $segment = $segment2;\n $marker1 = $segment2->m1;\n $current_lines = $segment2->m1->getOverlapLines($segment2->m2);\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n continue;\n }\n // otherwise, we keep going and merge the segments\n $current_lines = linesIntersect($current_lines, $segment2->m1->getOverlapLines($segment2->m2));\n if ($debug) {\n echo \"# current_lines after intersect: \" . count($current_lines) . \"<br/>\"; \n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n $current_lines = getCorrectLines($current_lines, $connection);\n if ($debug) {\n echo \"# current_lines after correction: \" . count($current_lines) . \"<br/>\"; \n foreach($current_lines as $line) {\n echo $line->name . \" \";\n }\n echo \"<br/>\";\n }\n $connection = $segment2->connection;\n $total_time = $segment2->t;\n } // for\n // add the last segment\n $new_segment = new Segment($marker1, $segment2->m2, $current_lines, $total_time, $connection);\n $cpath[] = $new_segment; \n return $cpath;\n}", "static function trimSeparators($segbuf) {\n $s1 = self::CDE_SEPARATOR . self::SEGMENT_TERMINATOR;\n $s2 = self::DE_SEPARATOR . self::CDE_SEPARATOR;\n \n while (strstr($segbuf, $s1)) {\n $segbuf = str_replace($s1, self::SEGMENT_TERMINATOR, $segbuf);\n }\n \n while (strstr($segbuf, $s2)) {\n $segbuf = str_replace($s2, self::CDE_SEPARATOR, $segbuf);\n } \n }", "static function appendSegment($file) {\n self::$segbuf .= self::SEGMENT_TERMINATOR;\n //self::trimSeparators(self::$segbuf);\n if (file_put_contents($file, self::$segbuf, FILE_APPEND) === FALSE) {\n $errmsg = \"File $file: Error writing segment \" . self::$segbuf\n . \".\\n\";\n fwrite(STDERR, $errmsg);\n exit(1);\n }\n }", "function personnaliser_colonne_extra_fin($flux){\n\tif (defined('_PERSO_COLONNE_EXTRA_FIN')) \n\t\treturn afficher_noisettes(_PERSO_COLONNE_EXTRA_FIN, $flux, true);\n}", "public function IngestSegment($segment,$msg_id,$db_handle)\n {\n $segment_exploded = explode(\"|\",$segment);\n \n $statement = \"INSERT INTO HL7_Segments_Received(HSR_MRId,HSR_SegmentType)\n VALUES (\".$msg_id.\",'\".$segment_exploded[0].\"');\";\n \n if($db_handle->InsertDB($statement) != 1)\n {\n Throw new Exception(\"INSERT ERROR : \".$statement.\" no record inserted\");\n }\n \n \n $segment_id = $db_handle->LastInsertedId();\n \n $this->IngestFields($segment_exploded,$segment_id,$db_handle);\n \n }", "function findNeighbor($Vertex_forWho,$Vertex_finder,$word,$differenceCount){\n\t\t//since some words like car had r as the end but cars had the r and s as end\n\t\t//this function kept breaking, because this was my base case, but to save myself\n\t\t// a headache i split them up into word sized tries\n\n\t\t//if the end of the word is met, then if the difference is only 1 push it back\n\t\t//as an edge to both finder and for who.\n\n\t\tif($Vertexfind->end == true){\n\t\t\tif($differenceCount == 1){\n\t\t\t\t$Vertex_forWho->neighbors[] = $Vertex_finder;\n\t\t\t\t$Vertex_finder->neighbors[] = $Vertex_forWho;\n\t\t\t}\n\t\t}//if the word is still 1 character long, check its edges and find the neighbors for it\n\t\telse if(strlen($word) == 1){\n\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\telse\n\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t}\n\t\t}//for any wordzie bigger than 1, add all the neighbors\n\t\telse if(strlen($word) > 1){\n\t\t\tif($differenceCount > 1)\n\t\t\t\treturn;\n\t\t\telse if($differenceCount == 0){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 0);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)), 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if($differenceCount == 1){\n\t\t\t\tforeach($Vertex_finder->edgeP as $e){\n\t\t\t\t\tif($e->letter == $word[0])\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount);\n\t\t\t\t\telse\n\t\t\t\t\t\tfindNeighbor($Vertex_forWho,$e->child,substr($word,1,strlen($word)),$differenceCount + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function getSegmentNrs(string $segment, $first = false, $createIfNotExist = false)\n {\n $segmentNrs = [];\n foreach ($this->tree as $i => $leave) {\n if (empty($leave)) {\n throw new \\Exception(\"Leave is empty\");\n }\n\n\n if ($leave[0]::name() == $segment) {\n $segmentNrs[] = $i;\n if ($first) {\n return $segmentNrs[0];\n }\n }\n }\n if (is_array($segmentNrs) and count($segmentNrs)) {\n return $segmentNrs;\n } else {\n if ($createIfNotExist) {\n return $this->createSegment($segment);\n } else {\n return false;\n }\n\n }\n }", "public function segment($number, $returnValue = FALSE){\n if(isset($this->segments[$number-1])){\n return $this->segments[$number-1];\n }\n return $returnValue;\n }", "public function testSetSegmentsNull(): void\n {\n $set = $this->class->setSegments(null);\n\n self::assertTrue($set instanceof Command);\n }", "public function cut()\n {\n }", "private function sanitize($segment){\n $chars = $this->config->get('uri_chars');\n $segment = preg_replace(\"/[^\".$chars.\"]/\", \"\", $segment);\n return $segment;\n }", "function getSegment($n)\n{\n foreach (explode(\"/\", preg_replace(\"|/*(.+?)/*$|\", \"\\\\1\", RURL)) as $val) {\n $val = clearSegment($val);\n if ($val != '') {\n $segments[] = $val;\n }\n }\n\n return isset($segments[$n - 1]) ? $segments[$n - 1] : \"\";\n}", "public function listSegmentsJSON()\n {\n //Incluye el modelo que corresponde\n require_once 'models/SegmentsModel.php';\n\n //Creamos una instancia de nuestro \"modelo\"\n $segmentModel = new SegmentsModel();\n\n if(isset($_GET['gbu']))\n $listado = $segmentModel->getAllSegmentsByGbu ($_GET['gbu']);\n else\n $listado = $segmentModel->getAllSegments();\n\n $output = array();\n\n while ($row = $listado->fetch(PDO::FETCH_ASSOC))\n {\n $output[$row['COD_SEGMENT']] = utf8_encode($row['NAME_SEGMENT']);\n }\n\n $output['selected'] = utf8_encode($_GET['current']);\n\n echo json_encode( $output );\n }", "function divertUnsecureLine() \n {\n // Abstract Method\n }", "function graficoPoligno() {\n $maxValue = $this->desenhaBase();\n\n $labelY = $this->margem;\n\n $idx = 0;\n foreach ($this->vetor as $label => $item) {\n $points = array();\n $arPonto = array();\n $arValor = array();\n $idx++;\n\n $color = $this->getColor($idx, 0, 0, 0, 60);\n $x = $this->margem;\n $y = $this->gtamanho + $this->margem;\n\n foreach ($item as $referencia => $value) {\n $val = ($this->gtamanho + ($this->margem * 1)) - (floor((($this->gtamanho) * $value) / $maxValue));\n\n $points[] = $x;\n $points[] = $y;\n $points[] = ($x + $this->columSize);\n $points[] = $val;\n\n $arPonto[] = array(\n 'x' => ($x + $this->columSize),\n 'y' => $val\n );\n\n $arValor[] = array(\n 'x' => ($x + ($this->columSize + $this->margem)),\n 'y' => ($val - 3),\n 'value' => $value\n );\n\n $y = $val;\n $x += $this->columSize;\n }\n\n $points[] = $this->gtamanho + $this->margem;\n $points[] = $this->gtamanho + $this->margem;\n\n imagefilledpolygon($this->image, $points, (count($points) / 2), $color);\n\n if($this->opMostrarPontoValor) {\n foreach ($arPonto as $item) {\n $this->desenhaPonto($item['x'], $item['y'], null);\n }\n\n foreach ($arValor as $item) {\n imagestring($this->image, 2, $item['x'], ($item['y'] - $this->margem), utf8_decode($item['value']), null);\n }\n }\n\n $this->desenhaLabel($label, $color, $labelY);\n $labelY += ($this->margem * 2);\n }\n }", "public static function segmentParserSegmentNotAllowedOnRoot($segment)\n {\n return 'The request URI is not valid, the segment \\'' . $segment . '\\' cannot be applied to the root of the'\n . ' service';\n }", "public function getSegmentValue()\n {\n return $this->segmentValue;\n }", "public function Latir() { //Irá receber da superclasse,apenas alteramos para o que queremos.\n return ' <b>Não conseguio latir!</b>'; // Retorne o latido\n parent::Latir();\n }", "public function getUrlSegment()\n {\n // Create URL segment if we don't have one.\n if(!$this->url_segment){\n $this->url_segment = str_slug($this->getFullName().' '.$this->id);\n $this->save();\n }\n\n return $this->url_segment;\n }", "public function esSubordinado(Usuario $usuario):bool {\n if($this->getJefe()==$usuario)\n return true;\n if(null!=$this->getJefe())\n return $this->getJefe()->esSubordinado($usuario);\n\n return false;\n }", "public function segment($index){\n $index = $index - 1;\n if(isset($this->segments[$index])){\n return $this->segments[$index];\n }\n return false;\n }", "function getPageSegment($separator = null, $offset = 0) {\n $page = $this->getCurrentPage();\n if (!$separator) {\n if (file_exists($this->getPagePath($page))) {\n require_once $this->getPagePath($page);\n }\n return;\n }\n $path = $this->getPagePath($page);\n $string = file_get_contents($path);\n $segments = explode($separator, $string);\n if(array_key_exists($offset, $segments)){\n $segment = $segments[$offset];\n if (substr($segment, 0, 5) !== \"<?php\") {\n $segment = \"?>\" . $segment;\n }\n eval($segment);\n }\n }", "private function prehledNavstev(){\n $this->tpl = \"historie-navstev\";\n \n \t$prehled = new HlavniPrehled($this->db);\n \n $this->render = array(\n\t\t\t'navstevy' => $prehled->vypis(@$_POST), \n\t\t);\t\n }", "public function renderPrivlastnit()\n {\n $spis_id = $this->getParameter('id', null);\n\n $orgjednotka_id = Orgjednotka::dejOrgUzivatele();\n\n $Spis = new Spis;\n $sp = $Spis->getInfo($spis_id);\n if (!empty($sp->orgjednotka_id) || !empty($sp->orgjednotka_id_predano))\n $this->flashMessage('Operace zamítnuta.', 'error');\n else if (!isset($orgjednotka_id))\n $this->flashMessage('Nemůžete převzít spis, protože nejste zařazen do organizační jednotky.',\n 'warning');\n else if ($Spis->zmenitOrg($spis_id, $orgjednotka_id)) {\n $this->flashMessage('Úspěšně jste si převzal tento spis. Pokud spis obsahoval dokumenty, jejich vlastnictví změněno nebylo.');\n } else {\n $this->flashMessage('Převzetí spisu do vlastnictví se nepodařilo. Zkuste to znovu.',\n 'warning');\n }\n\n $this->redirect(':Spisovka:Spisy:detail', array('id' => $spis_id));\n }", "function GrantSegmentAccess($segments)\n\t{\n\t\tif (!is_array($segments)) {\n\t\t\tif (!in_array($lists, $this->access['segments'])) {\n\t\t\t\tarray_push($this->access['segments'], $lists);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tforeach ($segments as $segmentid => $p) {\n\t\t\tif (!in_array($segmentid, $this->access['segments'])) {\n\t\t\t\tarray_push($this->access['segments'], $segmentid);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.5560489", "0.5525527", "0.548117", "0.53180784", "0.5263738", "0.52418303", "0.5204428", "0.52011377", "0.5194929", "0.5153064", "0.5111386", "0.50660557", "0.50550467", "0.50539845", "0.49889225", "0.49888533", "0.4983876", "0.49612054", "0.4885053", "0.48831785", "0.48466703", "0.48372328", "0.4785459", "0.47599456", "0.47577658", "0.47430074", "0.4737589", "0.47362188", "0.47208568", "0.46779045", "0.46773314", "0.467361", "0.46556872", "0.46512", "0.46496218", "0.46329734", "0.4623659", "0.46143273", "0.46123528", "0.4604157", "0.45867583", "0.4580429", "0.45771453", "0.45331037", "0.45238274", "0.45137754", "0.45002297", "0.449745", "0.44873792", "0.44819584", "0.44663265", "0.4451277", "0.44484174", "0.44435224", "0.44423264", "0.44047514", "0.4399376", "0.43978488", "0.4395296", "0.43624395", "0.43611968", "0.43609226", "0.4360164", "0.43580118", "0.43578395", "0.4357492", "0.43450657", "0.43366984", "0.4325491", "0.43215016", "0.43156636", "0.4314703", "0.43059278", "0.43005615", "0.429962", "0.4299266", "0.42991567", "0.42859775", "0.42851046", "0.42838618", "0.4270263", "0.425219", "0.42506403", "0.42429253", "0.42395774", "0.42369905", "0.4235933", "0.42310032", "0.42277446", "0.42227024", "0.42213792", "0.4214917", "0.42137876", "0.4213368", "0.42116028", "0.42109272", "0.42052138", "0.42051232", "0.4203255", "0.41946247", "0.4189818" ]
0.0
-1
Returns an array of all supported encodings
function mb_list_encodings() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getSupportedEncodings()\n {\n return static::$encodings;\n }", "public function getEncodings(): array\n {\n if (null !== $this->encodings) {\n return $this->encodings;\n }\n\n return $this->encodings = array_keys(AcceptHeader::fromString($this->header('accept-encoding'))->all());\n }", "public function getEncodings()\n {\n return $this->_encodings;\n }", "function get_encodings()\r\n {\r\n $rez = array();\r\n $sql = \"SHOW CHARACTER SET\";\r\n $res = @mysql_query($sql);\r\n if(mysql_num_rows($res) > 0)\r\n {\r\n while ($row = mysql_fetch_assoc ($res))\r\n {\r\n $rez[$row[\"Charset\"]] = (\"\" != $row[\"Description\"] ? $row[\"Description\"] : $row[\"Charset\"]); //some MySQL databases return empty Description field\r\n }\r\n }\r\n return $rez;\r\n }", "public function getCharsets(): array\n {\n if (null !== $this->charsets) {\n return $this->charsets;\n }\n\n return $this->charsets = array_keys(AcceptHeader::fromString($this->header('accept-charset'))->all());\n }", "private function getEncodingInfo(): array\n {\n if ($this->encodingInfo !== null) {\n return $this->encodingInfo;\n }\n\n // http://www.w3.org/TR/html5/syntax.html#determining-the-character-encoding\n // http://www.w3.org/TR/html5/document-metadata.html#charset\n\n $this->pushState();\n\n try {\n $this->rewind();\n\n $found = false;\n $pragma = false;\n\n while ($metaTag = $this->find(static::OPENING_TAG, 'meta', 1024)) {\n if (isset($metaTag['attrs']['charset'])) {\n $found = true;\n break;\n } elseif (\n isset($metaTag['attrs']['http-equiv'], $metaTag['attrs']['content'])\n && strcasecmp($metaTag['attrs']['http-equiv'], 'content-type') === 0\n ) {\n $found = true;\n $pragma = true;\n break;\n }\n }\n } finally {\n $this->revertState();\n }\n\n // handle the result\n $encoding = null;\n $isFallback = false;\n\n if ($found) {\n if ($pragma) {\n $encoding = static::parseCharsetFromContentType($metaTag['attrs']['content']);\n } else {\n $encoding = $metaTag['attrs']['charset'];\n }\n }\n\n if ($encoding !== null) {\n $encoding = strtolower($encoding);\n }\n\n if ($encoding === null || !isset(static::SUPPORTED_ENCODING_MAP[$encoding])) {\n // no encoding has been specified or it is not supported\n $encoding = $this->fallbackEncoding;\n $isFallback = true;\n }\n\n return $this->encodingInfo = [\n 'encoding' => $encoding,\n 'tag' => $found ? $metaTag : null,\n 'is_fallback' => $isFallback,\n ];\n }", "private function getSupportedCodecs()\n {\n $venc = shell_exec('ffmpeg -codecs');\n return preg_split(\"#[\\r\\n]+#\", $venc);\n }", "public function getEncoding();", "public function getAcceptEncodes(): array\n {\n $ens = [];\n\n if ($value = $this->getHeaderLine('Accept-Encoding')) {\n if (strpos($value, ';')) {\n [$value,] = explode(';', $value, 2);\n }\n\n $value = str_replace(' ', '', $value);\n $ens = explode(',', $value);\n }\n\n return $ens;\n }", "public function getAvailableAudioCodecs()\n\t{\n\t\treturn array();\n\t}", "public function getAcceptEncoding() {\n if (isset($this->acceptEncoding)) {\n return $this->acceptEncoding;\n }\n\n $header = $this->getHeader(Header::HEADER_ACCEPT_ENCODING);\n if (!$header) {\n return $this->acceptEncoding = array();\n }\n\n return $this->acceptEncoding = Header::parseAccept($header);\n }", "public function getAllEncodingStatus()\n {\n $stream = new StreamStatus();\n $statusALL = array($stream);\n return $statusALL;\n }", "function mb_list_lowerencodings() { $r=mb_list_encodings();\n for ($n=sizeOf($r); $n--; ) { $r[$n]=strtolower($r[$n]); } return $r;\n }", "public function get_encoding()\n {\n }", "public static function getAvailableConverters()\n {\n return [\n 'cwebp', 'vips', 'imagick', 'gmagick', 'imagemagick', 'graphicsmagick', 'wpc', 'ewww', 'gd'\n ];\n }", "abstract protected function _getEncodingTable();", "protected function _getEncodingTable() {}", "protected function _getEncodingTable() {}", "protected function _getEncodingTable() {}", "public function getAcceptCharset() {\n if (isset($this->acceptCharset)) {\n return $this->acceptCharset;\n }\n\n $header = $this->getHeader(Header::HEADER_ACCEPT_CHARSET);\n if (!$header) {\n return $this->acceptCharset = array();\n }\n\n return $this->acceptCharset = Header::parseAccept($header);\n }", "public function getEncoding(): string;", "function convert_data_encodings($known_utf8 = false)\n{\n global $VALID_ENCODING, $CONVERTED_ENCODING;\n $VALID_ENCODING = true;\n\n if ($CONVERTED_ENCODING) {\n return; // Already done it\n }\n\n if (preg_match('#^[\\x00-\\x7F]*$#', serialize($_POST) . serialize($_GET) . serialize($_FILES)) != 0) { // Simple case, all is ASCII\n $CONVERTED_ENCODING = true;\n return;\n }\n\n require_code('character_sets');\n _convert_data_encodings($known_utf8);\n}", "function http_negotiate_charset(array $supported, ?array &$result = null) {}", "public function getCharset();", "public function getCharset();", "protected function getAcceptedExtensions(): array\n {\n return array_keys($this->getConfigResolverAdapters());\n }", "public function getCodec();", "public function getCodec();", "public function getSupportedMimeTypes()\n {\n return array_keys($this->convertersByMimeType);\n }", "public function supportedAlgorithms()\n {\n return array_map(function($value){\n return [$value];\n }, hash_hmac_algos());\n }", "public static function getAllMimeTypes():array;", "public function get_supported_extensions() {\n return array();\n }", "public function getEncoding()\r\n\t{\r\n\t\treturn $this->m_charset;\r\n\t}", "protected static function utf8Encoding($text)\n {\n $encoding = array();\n\n $chars = str_split($text);\n\n $countChars = count($chars);\n\n for ($i = 0; $i < $countChars; ++$i) {\n $temp = $chars[$i];\n\n $ord = ord($chars[$i]);\n\n switch (true) {\n case $ord > 251:\n $temp .= $chars[++$i];\n // no break\n case $ord > 247:\n $temp .= $chars[++$i];\n // no break\n case $ord > 239:\n $temp .= $chars[++$i];\n // no break\n case $ord > 223:\n $temp .= $chars[++$i];\n // no break\n case $ord > 191:\n $temp .= $chars[++$i];\n // no break\n }\n\n $encoding[] = $temp;\n }\n\n return $encoding;\n }", "public function getSupportedExtensions()\n {\n return array_keys($this->convertersByExtension);\n }", "public static function getAllAsArray()\n {\n return [\n self::EN_GB,\n self::DE_DE,\n self::ES_ES,\n self::FR_FR,\n self::IT_IT,\n self::PL_PL,\n self::PT_PT,\n self::RU_RU,\n self::KO_KR,\n self::EN_US,\n self::ZH_TW,\n self::PT_BR,\n self::ES_MX,\n ];\n }", "public function getCharacterEncodingScheme();", "function getEncoding(): string\n {\n return $this->getEncodingInfo()['encoding'];\n }", "public function getContentEncoding();", "public static function getSupportedAlgos(): array\n {\n return password_algos();\n }", "public function admin_get_charsets() {}", "public function admin_get_charsets() {}", "function getSupportedSourceTypes() ;", "public function getEncodingFrom()\n {\n return $this->getInputEncoding();\n }", "public static function getPredefinedEncodingTable($encoding) {}", "public function getAvailableLanguages(): array\n {\n return array_keys($this->settings);\n }", "public function getSupportedLanguageCodes()\n {\n return $this->supported_language_codes;\n }", "public function getSupportedLocales(): array\n {\n return $this->supportedLocales;\n }", "static public function getSupportedPatterns(): array\n {\n return static::$supported_patterns;\n }", "public function getBaseEncodingTable() {}", "public function getBaseEncodingTable() {}", "public function getBaseEncodingTable() {}", "public function getBaseEncodingTable() {}", "public function getBaseEncodingTable() {}", "public function getBaseEncodingTable() {}", "public function getAudioEncoders($default = \"copy\")\n {\n //Function have same code for video, audio and subtitle codecs\n //FFMPeg encoder looks like this:\n //H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_omx h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )\n //We need to extract only name of encoder and their corresponding encoders (sub encoders)\n //set default to copy (no encoding needed)\n $aencArray = array($default => $default);\n $aencArray['copy'] = 'copy';\n $venc = $this->getSupportedCodecs();\n\n foreach ($venc as $line) :\n $line = trim($line);\n //EV stands for Encoding Video. Change EA for Encoding Audio\n if (strpos($line, 'EA')) { //if line have Encoding Audio\n $splitted = explode(\" \", $line); //remove empty space from array\n $i = 0; //$i = index of $splitted line for removing from array $splitted\n foreach ($splitted as $emptyItem) : //array 0=codec params (encoder, decoder..) , 1=name, ... = description and sub-encoders\n if (empty($emptyItem)) {\n unset($splitted[$i]);\n }\n $i++;\n endforeach;\n\n //reindex array\n $splitted_reindexed = array_values($splitted);\n\n //add encoder to aencArray\n $aencArray[$splitted_reindexed[1]] = $splitted_reindexed[1];\n\n //get sub encoders ex: h264 (h264_nvenc, h264_cuvid.. )\n $sr = 0; // index of $splitted_reindexed\n foreach ($splitted_reindexed as $encItem) {\n if ($encItem === \"(encoders:\") {\n //remove unnecessary words from array\n $spliced = array_splice($splitted_reindexed, $sr);\n $i = 1; //$i = index of splitted encoder description. Skip index 0 because it is not encoder name ;\n while ($spliced[$i] != ')') {\n //add to encoder array\n $aencArray[$spliced[$i]] = $spliced[$i];\n $i++;\n }\n }\n $sr++;\n }\n }\n endforeach;\n\n //remove double items and return\n return array_unique($aencArray);\n }", "public function getSupportedBrowserAcceptLanguages()\n {\n return array_intersect_key(\n $this->getBrowserAcceptLanguages(),\n $this->_supportedLanguages\n );\n }", "private function getAvailableFormats()\n {\n return array(\n 'tab',\n 'xml',\n 'json',\n 'perl',\n 'php',\n 'vaml',\n 'html',\n );\n }", "public abstract function getCharset();", "public static function getSupportedEncryptionTypes()\n {\n return array(\n self::ENCRYPT_BLOWFISH_CRYPT,\n self::ENCRYPT_EXT_CRYPT,\n self::ENCRYPT_DES,\n self::ENCRYPT_HASH,\n self::ENCRYPT_MD5,\n self::ENCRYPT_MD5_CRYPT,\n self::ENCRYPT_PLAIN,\n self::ENCRYPT_SHA,\n self::ENCRYPT_SMD5,\n self::ENCRYPT_SSHA,\n self::ENCRYPT_LMPASSWORD,\n self::ENCRYPT_NTPASSWORD,\n self::ENCRYPT_MAIL_UNSUBSCRIBE\n );\n }", "function getEncodingTag(): ?array\n {\n return $this->getEncodingInfo()['tag'];\n }", "public static function supportedFormats()\n {\n return [\n 'avif' => 'image/avif',\n 'gif' => 'image/gif',\n 'jpg' => 'image/jpeg',\n 'pjpg' => 'image/jpeg',\n 'png' => 'image/png',\n 'webp' => 'image/webp',\n 'tiff' => 'image/tiff',\n ];\n }", "public function getSupportedEngines()\n {\n return array_keys($this->engine_supported);\n }", "public function getSupportedSourceTypes() {}", "public function getVideoEncoders($default = \"copy\")\n {\n //Function have same code for video, audio and subtitle codecs\n //FFMPeg encoder looks like this:\n //H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_cuvid ) (encoders: libx264 libx264rgb h264_nvenc h264_omx h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )\n //We need to extract only name of encoder and their corresponding encoders (sub encoders)\n //set default to copy (no encoding needed)\n $vencArray = array($default => $default);\n $vencArray['copy'] = 'copy';\n $venc = $this->getSupportedCodecs();\n\n foreach ($venc as $line) :\n $line = trim($line);\n //EV stands for Encoding Video. Change EA for Encoding Audio\n if (strpos($line, 'EV')) { //if line have Encoding Video\n $splitted = explode(\" \", $line); //remove empty space from array\n $i = 0; //$i = index of $splitted line for removing from array $splitted\n foreach ($splitted as $emptyItem) : //array 0=codec params (encoder, decoder..) , 1=name, ... = description and sub-encoders\n if (empty($emptyItem)) {\n unset($splitted[$i]);\n }\n $i++;\n endforeach;\n\n //reindex array\n $splitted_reindexed = array_values($splitted);\n\n //add encoder to vencArray\n // $apush[$splitted_reindexed[1]] = $splitted_reindexed[1];\n $vencArray[$splitted_reindexed[1]] = $splitted_reindexed[1];\n // array_push($vencArray, $apush);\n\n //get sub encoders ex: h264 (h264_nvenc, h264_cuvid.. )\n $sr = 0; // index of $splitted_reindexed\n foreach ($splitted_reindexed as $encItem) {\n if ($encItem === \"(encoders:\") {\n //remove unnecessary words from array\n $spliced = array_splice($splitted_reindexed, $sr);\n $i = 1; //$i = index of splitted encoder description. Skip index 0 because it is not encoder name ;\n while ($spliced[$i] != ')') {\n //add to encoder array\n $vencArray[$spliced[$i]] = $spliced[$i];\n $i++;\n }\n }\n $sr++;\n }\n }\n endforeach;\n\n //remove double and return\n return array_unique($vencArray);\n }", "private function determine_encoding()\n {\n $gzip = strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false;\n $deflate = strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false;\n\n // Determine used compression method\n $encoding = $gzip ? 'gzip' : ($deflate ? 'deflate' : false);\n\n // Check for buggy versions of Internet Explorer\n if (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') === false &&\n preg_match('/^Mozilla\\/4\\.0 \\(compatible; MSIE ([0-9]\\.[0-9])/i', $_SERVER['HTTP_USER_AGENT'], $matches))\n {\n $version = floatval($matches[1]);\n\n if ($version < 6)\n $encoding = false;\n\n if ($version == 6 && strpos($_SERVER['HTTP_USER_AGENT'], 'EV1') === false)\n $encoding = false;\n }\n return $encoding;\n }", "public function getSupportedMIMETypes(): array\n {\n $mime = null;\n $mimeTypes = [];\n\n $response = preg_split(\"/\\n/\", $this->request('mime-types')) ?: [];\n\n foreach($response as $line)\n {\n if(preg_match('/^\\w+/', $line))\n {\n $mime = trim($line);\n $mimeTypes[$mime] = ['alias' => []];\n }\n else\n {\n [$key, $value] = preg_split('/:\\s+/', trim($line));\n\n if($key == 'alias')\n {\n $mimeTypes[$mime]['alias'][] = $value;\n }\n else\n {\n $mimeTypes[$mime][$key] = $value;\n }\n }\n }\n\n\n return $mimeTypes;\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}", "public function getEncoder();", "public function getEncoder();", "public function getAllowEncoding()\n {\n return $this->allowEncoding;\n }", "public function getSupportedFormat()\n {\n return array(\n 'm4v',\n 'ogv',\n 'flv',\n );\n }", "public static function getCodeTypes() {\n return array('B', 'P', 'PU', 'PR', 'CS', 'SA', 'SR', 'PG');\n }", "protected function getSupportedLocales()\n {\n $locales = app('localize-route')->getConfig('locale_keys') ?? [];\n\n return $locales;\n }", "private static function get_supported_locales() {\r\n\t\tif (self::is_version_1_8_or_higher()) {\r\n\t\t\treturn array(\r\n\t\t\t\tself::WIDGET_DATEPICKER => array(\r\n\t\t\t\t\t'af', 'ar', 'az',\r\n\t\t\t\t\t'bg', 'bs',\r\n\t\t\t\t\t'ca', 'cs',\r\n\t\t\t\t\t'da', 'de', \r\n\t\t\t\t\t'el', 'en-GB', 'eo', 'es', 'et', 'eu', \r\n\t\t\t\t\t'fa', 'fi', 'fo', 'fr-CH', 'fr',\r\n\t\t\t\t\t'he', 'hr', 'hu', 'hy',\r\n\t\t\t\t\t'id', 'is', 'it', \r\n\t\t\t\t\t'ja', \r\n\t\t\t\t\t'ko', \r\n\t\t\t\t\t'lt', 'lv',\r\n\t\t\t\t\t'ms',\r\n\t\t\t\t\t'nl', 'no', \r\n\t\t\t\t\t'pl', 'pt-BR',\r\n\t\t\t\t\t'ro', 'ru',\r\n\t\t\t\t\t'sk', 'sl', 'sq', 'sr', 'sr-SR', 'sv',\r\n\t\t\t\t\t'ta', 'th', 'tr', \r\n\t\t\t\t\t'uk', \r\n\t\t\t\t\t'vi',\r\n\t\t\t\t\t'zh-CN', 'zh-HK', 'zh-TW',\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t);\r\n\t\t}\t\r\n\t\telse {\r\n\t\t\t// Version 1.7\r\n\t\t\treturn array(\r\n\t\t\t\tself::WIDGET_DATEPICKER => array(\r\n\t\t\t\t\t'ar',\r\n\t\t\t\t\t'bg',\r\n\t\t\t\t\t'ca', 'cs',\r\n\t\t\t\t\t'da', 'de', \r\n\t\t\t\t\t'el', 'eo', 'es', \r\n\t\t\t\t\t'fa', 'fi', 'fr',\r\n\t\t\t\t\t'he', 'hr', 'hu', 'hy',\r\n\t\t\t\t\t'id', 'is', 'it', \r\n\t\t\t\t\t'ja', \r\n\t\t\t\t\t'ko', \r\n\t\t\t\t\t'lt', 'lv',\r\n\t\t\t\t\t'ms',\r\n\t\t\t\t\t'nl', 'no', \r\n\t\t\t\t\t'pl', 'pt-BR',\r\n\t\t\t\t\t'ro', 'ru',\r\n\t\t\t\t\t'sk', 'sl', 'sq', 'sr', 'sr-SR', 'sv',\r\n\t\t\t\t\t'th', 'tr', \r\n\t\t\t\t\t'uk', \r\n\t\t\t\t\t'vi',\r\n\t\t\t\t\t'zh-CN', 'zh-TW',\r\n\t\t\t\t),\t\r\n\t\t\t);\r\n\t\t}\t\t\r\n\t}", "private function getVersionChoices(): array\n {\n $versions = [];\n foreach (Php::getSupportedVersions() as $version) {\n $versions[$version] = $version;\n }\n\n return $versions;\n }", "public static function getDefaultEncodingFilter()\n {\n return Form::$defaultEncodingFilter;\n }", "public function encoding()\n {\n return $this->getEncoding();\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public static function getCurrentCharset() {}", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getEncoding()\n {\n return $this->encoding;\n }", "public function getContentEncoding()\n {\n }", "function getDatabaseEncoding() {\n\t\t$sql = \"SELECT getdatabaseencoding() AS encoding\";\n\n\t\treturn $this->selectField($sql, 'encoding');\n\t}", "function getSupportedLocalesNative()\n{\n $arr = [];\n foreach(LaravelLocalization::getSupportedLocales() as $localeCode => $properties)\n {\n $arr_list = [LaravelLocalization::getLocalizedURL($localeCode, null, [], true)=>$properties['native']];\n $arr= array_merge((array)$arr,(array)$arr_list);\n }\n return $arr;\n}", "public function getSupportedLocalesKeys();", "function getEncodingIndex($encoding = 'auto'){\n static $marks = array('-', '_', '.', ':');\n $result = -1;\n if (is_string($encoding)) {\n foreach ($marks as $mark) {\n if (strpos($encoding, $mark) !== false) {\n $split = explode($mark, $encoding);\n $encoding = implode('', $split);\n }\n }\n switch (strtoupper(trim($encoding))) {\n case 'ANSIX341968':\n case 'ANSIX341986':\n case 'ASCII':\n case 'CP367':\n case 'CSASCII':\n case 'IBM367':\n case 'ISO646IRV1991':\n case 'ISOIR6':\n case 'ISO646':\n case 'ISO646US':\n case 'US':\n case 'USASCII':\n $result = 0;\n break;\n case 'EUC':\n case 'EUCJP':\n case 'EUCJPWIN':\n case 'EUCJPMS':\n case 'EUCJPOPEN':\n case 'XEUCJP':\n $result = 1;\n break;\n case 'CP932':\n case 'MSKANJI':\n case 'SJIS':\n case 'SJISWIN':\n case 'SJISOPEN':\n case 'SHIFTJIS':\n case 'WINDOWS31J':\n case 'XSJIS':\n $result = 2;\n break;\n case 'ISO2022JP':\n case 'ISO2022JPMS':\n case 'JIS':\n $result = 3;\n break;\n case 'CP819':\n case 'CSISOLATIN1':\n case 'IBM819':\n case 'ISO885911987':\n case 'ISO88591':\n case 'ISOIR100':\n case 'L1':\n case 'LATIN1':\n $result = 4;\n break;\n case 'UTF8':\n $result = 5;\n break;\n case 'UTF16':\n $result = 6;\n break;\n case 'UTF16BE':\n $result = 7;\n break;\n case 'UTF16LE':\n $result = 8;\n break;\n case 'UTF32':\n $result = 9;\n break;\n case 'CNBIG5':\n case 'CP950':\n case 'BIG5':\n case 'BIGFIVE':\n $result = 10;\n break;\n case 'CNGB':\n case 'EUCCN':\n case 'GB':\n case 'GB2312':\n case 'XEUCCN':\n $result = 11;\n break;\n case 'EUCKR':\n case 'KSX1001':\n case 'KSC5601':\n case 'XEUCKR':\n $result = 12;\n break;\n case 'BIN':\n case 'BINARY':\n $result = 13;\n break;\n case 'AUTO':\n default:\n $result = -1;\n break;\n }\n }\n return $result;\n }", "public function getAcceptableContentTypes(): array\n {\n if (null !== $this->acceptableContentTypes) {\n return $this->acceptableContentTypes;\n }\n\n return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->header('accept'))->all());\n }", "public function getAll($encoding = 'UTF-8') {}", "public function compatibility() : array\n {\n return DataType::all();\n }", "public function getEncoding() {\n\t\treturn $this->encoding;\n\t}", "public static function getCiphers()\n {\n return [\n 'ECDHE-RSA-AES128-GCM-SHA256',\n 'ECDHE-ECDSA-AES128-GCM-SHA256',\n 'ECDHE-RSA-AES256-GCM-SHA384',\n 'ECDHE-ECDSA-AES256-GCM-SHA384',\n 'DHE-RSA-AES128-GCM-SHA256',\n 'DHE-DSS-AES128-GCM-SHA256',\n 'kEDH+AESGCM',\n 'ECDHE-RSA-AES128-SHA256',\n 'ECDHE-ECDSA-AES128-SHA256',\n 'ECDHE-RSA-AES128-SHA',\n 'ECDHE-ECDSA-AES128-SHA',\n 'ECDHE-RSA-AES256-SHA384',\n 'ECDHE-ECDSA-AES256-SHA384',\n 'ECDHE-RSA-AES256-SHA',\n 'ECDHE-ECDSA-AES256-SHA',\n 'DHE-RSA-AES128-SHA256',\n 'DHE-RSA-AES128-SHA',\n 'DHE-DSS-AES128-SHA256',\n 'DHE-RSA-AES256-SHA256',\n 'DHE-DSS-AES256-SHA',\n 'DHE-RSA-AES256-SHA',\n '!aNULL',\n '!eNULL',\n '!EXPORT',\n '!DES',\n '!3DES',\n '!MD5',\n '!RC4',\n '!PSK',\n '!SSLv2',\n '!SSLv3'\n ];\n }", "public function acceptsEncoding($encoding = null) {\n if (!isset($encoding))\n return $this->encodings;\n return in_array($encoding, $this->encodings);\n }", "public function getEncoding(): string\n {\n return $this->encoding;\n }", "public function getEncoding(): string\n {\n return $this->encoding;\n }", "public function toArray()\n {\n $choose = array(\n 'Open Sans' => 'Open Sans',\n 'Arial' => 'Arial',\n 'Helvetica' => 'Helvetica',\n 'Comic Sans MS' => 'Comic Sans MS',\n 'Calibri' => 'Calibri',\n 'Roboto' => 'Roboto',\n 'Courier' => 'Courier',\n 'Symbola' => 'Symbola',\n 'Times New Roman' => 'Times New Roman',\n );\n return $choose;\n }", "public function getEncoding()\n {\n return $this->_encoding;\n }", "public function getEncoding()\n {\n return $this->_encoding;\n }" ]
[ "0.8505918", "0.79961467", "0.78899133", "0.72097003", "0.6886738", "0.681051", "0.6729014", "0.6624039", "0.660498", "0.6536415", "0.6493128", "0.63531595", "0.6351361", "0.61397177", "0.6139451", "0.61228967", "0.60637647", "0.60637647", "0.6062227", "0.6058838", "0.6045615", "0.60006654", "0.5949188", "0.5910732", "0.5910732", "0.58955854", "0.58798194", "0.58798194", "0.5867953", "0.58470815", "0.58222", "0.58176434", "0.57790196", "0.57760453", "0.57745445", "0.5757619", "0.573739", "0.5732652", "0.5686268", "0.56801593", "0.56793284", "0.56790435", "0.56514287", "0.5645725", "0.5638867", "0.56361413", "0.5626227", "0.56227446", "0.56138515", "0.5606867", "0.5606867", "0.5606269", "0.5606269", "0.5606269", "0.5606269", "0.560321", "0.5593636", "0.55864173", "0.5585107", "0.5582376", "0.55819535", "0.5575735", "0.55675286", "0.55631334", "0.55556196", "0.5536819", "0.55359983", "0.5521649", "0.5516131", "0.5516131", "0.5512986", "0.5509384", "0.5486798", "0.54841125", "0.5475837", "0.54744786", "0.5470096", "0.5456065", "0.545315", "0.5449694", "0.5445913", "0.5445913", "0.5445913", "0.5445913", "0.54396445", "0.543149", "0.5413113", "0.5400203", "0.5394795", "0.53917116", "0.53727424", "0.5372686", "0.53717786", "0.536987", "0.53669536", "0.5366916", "0.5366916", "0.5365126", "0.5360239", "0.5360239" ]
0.708968
4
Display a listing of the resource.
public function index() { if (Session::has('unit_user_id')) { $perspectives = Perspective::all(); $id = Session::get('unit_user_id', 'default'); $user = UserUnit::where('UserUnitID', $id) ->first(); $unit_objectives = UnitObjective::where('UserUnitID', '=', $user->UnitID)->get(); return view('unit-ui.unit-scorecard') ->with('user', $user) ->with('unit_objectives', $unit_objectives) ->with('perspectives', $perspectives); } else { Session::flash('message', 'Please login first!'); return Redirect::to('/'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.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() { // }
{ "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}" ]
[ "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.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }" ]
[ "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.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "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(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $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 editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7855196", "0.76957726", "0.7273917", "0.7241426", "0.71717227", "0.7064183", "0.70528984", "0.69836885", "0.694763", "0.69469565", "0.6941572", "0.69301945", "0.6903868", "0.68989486", "0.68989486", "0.68787694", "0.68641657", "0.6860115", "0.6857286", "0.68464494", "0.6834566", "0.68116575", "0.68075293", "0.6805924", "0.6801357", "0.6796291", "0.67915684", "0.67915684", "0.67874014", "0.678544", "0.67787844", "0.6777662", "0.67675763", "0.676299", "0.6746726", "0.6745706", "0.67450166", "0.67450166", "0.6739429", "0.6734577", "0.6725992", "0.67127997", "0.6694406", "0.6692487", "0.6689421", "0.66884303", "0.6687299", "0.6685663", "0.6682167", "0.66701853", "0.66697115", "0.6666091", "0.6666091", "0.66627705", "0.6661716", "0.6661522", "0.6657919", "0.6656454", "0.6653187", "0.6642113", "0.66332614", "0.66324973", "0.66275465", "0.66275465", "0.6619777", "0.6619387", "0.6617973", "0.66154003", "0.66110945", "0.6607966", "0.66065043", "0.6596376", "0.65953517", "0.65941286", "0.6591486", "0.6590759", "0.6588404", "0.658161", "0.6580548", "0.6579757", "0.6577171", "0.65761065", "0.657386", "0.65686774", "0.6567784", "0.65672046", "0.6566417", "0.65615803", "0.65615714", "0.65615714", "0.65592474", "0.65586483", "0.65568006", "0.6556628", "0.65564895", "0.6555322", "0.65551996", "0.6555016", "0.654888", "0.65477645", "0.65451735" ]
0.0
-1
Update the specified resource in storage.
public function update($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($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
Create a new policy instance.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createPolicy() {\n\t\tthrow new CmisNotImplementedException(\"createPolicy\");\n\t}", "public function testPolicyCanBeCreated()\n {\n $policy = factory(App\\Models\\Policy::class)->create([\n 'title' => 'Administrator',\n ]);\n\n $this->assertEquals($policy->title, 'Administrator');\n\n $this->seeInDatabase('policies', ['id' => '1', 'title' => 'Administrator']);\n }", "public function toPolicy()\n {\n return new Policy($this->calls);\n }", "public function addPolicy(Policy $policy)\n {\n $this->policies[] = $policy;\n return $this;\n }", "public function policy(Policy $policy = null)\n {\n if(null === $policy)\n {\n return $this->child('policy');\n }\n return $this->child('policy', $policy);\n }", "public function __construct($childPolicy) { }", "public function getPolicy()\n {\n return Controllers\\PolicyController::getInstance();\n }", "public function create()\n {\n return view('policy.create');\n }", "public function create()\n {\n return view('admin.policy.create');\n }", "public function create(Request $request)\n {\n $policy = new Policy();\n\n $now = Carbon::now();\n $next_year = Carbon::now()->addYear()->subDay();\n\n $policy->date_from = $now->format('d.m.Y');\n $policy->time_from = $now->addHour()->format('H').':00';\n $policy->date_to = $next_year->format('d.m.Y');\n $policy->time_to = '24:00';\n $policy->sign_date = $now->format('d.m.Y');\n $policy->same_client_owner = true;\n $policy->p_base = 4118;\n $policy->p_k1 = 1.8;\n $policy->p_k2 = 1.0;\n $policy->p_k3 = 1.0;\n $policy->p_k4 = 1.0;\n $policy->p_k5 = 1.0;\n $policy->p_k6 = 1.0;\n $policy->p_k7 = 1.0;\n $policy->p_k8 = 1.0;\n $policy->policy_serial = 'EEE';\n $policy->dk_date = $next_year->format('d.m.Y');\n $policy->t_amount = 500.0;\n $policy->f_amount = 2000.0;\n\n $max_policy_number = Policy::all()->max('policy_number');\n if(!$max_policy_number){\n $max_policy_number = '0724573036';\n }\n $max_receipt_number = Policy::all()->max('receipt_number');\n if(!$max_receipt_number){\n $max_receipt_number = '1711116';\n }\n $policy->policy_number = str_pad((int)$max_policy_number + 1, 10, '0', STR_PAD_LEFT);\n $policy->receipt_number = (int)$max_receipt_number + 1;\n\n $vehicles = [];\n $client = Client::find($request->get('client_id'));\n if($client){\n $policy->client = $client;\n $policy->drivers = $client->drivers;\n $vehicles = $client->vehicles;\n //if(!empty($vehicles)){\n // $policy->vehicle = $client->vehicles()->first();\n //}\n }\n $policy->company_name = trans('policy.Company Megaruss');\n $policy->owner_company = false;\n\n session()->put('url.intended', URL::previous());\n\n $companies = Policy::getCompanyOptionsForSelect();\n $makers = Vehicle::getMakeOptionsForSelect();\n\n return view('policies.create', compact('policy','vehicles','companies','makers'));\n }", "public function policy($force_new = false)\n\t{\n\t\tif ((! $force_new) && (! is_null($this->policy))) {\n\t\t\treturn $this->policy;\n\t\t}\n\n\t\treturn $this->policy = policy($this->policy_class);\n\t}", "public function create(PolicyCreateResponseModel $responseModel): ViewModel;", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.stsPolicy');\n }", "protected function getCreateNewObjectPolicy() {\n return PhabricatorPolicies::POLICY_NOONE;\n }", "public function run()\n\t{\n\t\t/** Access policy for admin\n\t\t */\n\t\tApp\\Model\\Base\\Policy::create([\n\t\t\t'name' => 'Admin',\n\t\t\t'description' => 'Access policy for admin',\n\t\t]);\n\n\t\t/** Access policy for manager\n\t\t */\n\t\tApp\\Model\\Base\\Policy::create([\n\t\t\t'name' => 'Manager',\n\t\t\t'description' => 'Access policy for manager',\n\t\t]);\n\n\t\t/** Access policy for simple member\n\t\t */\n\t\tApp\\Model\\Base\\Policy::create([\n\t\t\t'name' => 'Member',\n\t\t\t'description' => 'Access policy for simple member',\n\t\t]);\n\t}", "public function store(Request $request)\n {\n\n $rules = [\n 'sub_broker_name',\n 'policy_holder_name',\n 'category',\n 'product_name',\n 'policy_amount',\n 'issuing_status',\n ];\n\n $this->validate($request, $rules);\n\n $policy = new Policy;\n\n $policy->sub_broker_id = $request->sub_broker_name;\n $policy->policy_holder_name = $request->policy_holder_name;\n $policy->category = $request->category;\n $policy->product_name = $request->product_name;\n $policy->policy_amount = $request->policy_amount;\n $policy->issuing_status = $request->issuing_status;\n\n $policy->save();\n\n// $data = $request->all();\n// $subbroker = Policy::create($data);\n\n return redirect()->route('policy.index');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function createPolicy(\n $repositoryId,\n PropertiesInterface $properties,\n $folderId = null,\n array $policies = [],\n AclInterface $addAces = null,\n AclInterface $removeAces = null,\n ExtensionDataInterface $extension = null\n ) {\n // TODO: Implement createPolicy() method.\n }", "public function create() {}", "public function newInstance();", "public function newInstance();", "public function store(Request $request, PrivacyPolicy $PrivacyPolicy)\n {\n //dd(10);\n $inputArr['title'] = $request->get('title');\n $inputArr['description'] = $request->get('description');\n $PrivacyPolicy = $PrivacyPolicy->saveNewPolicy($inputArr);\n if(!$PrivacyPolicy){\n return redirect()->back()->with('error', 'Unable to add questionnaire. Please try again later.');\n }\n\n return redirect()->route('admin.privacypolicy.index')->with('success_message', 'New Privacy & Policy created successfully.');\n }", "public function createPolicy(User $user)\n {\n return $user->may(static::PERMISSION_CREATE);\n }", "public function createPolicy(User $user)\n {\n return $user->may(static::PERMISSION_CREATE);\n }", "public function Create()\n\t{\n\t\treturn new self;\n\t}", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n\t{\n\t\treturn new self;\n\t}", "public function store(Request $request)\n {\n $this->validate($request, $this->rules);\n $mytime = Carbon\\Carbon::now();\n $policy = PrivacyPolicy::create($request->all() + [\n 'created_by' => Auth::user()->id,\n 'created_at' => $mytime->toDateTimeString()\n ]);\n \\Session::flash('flash_message','You have just created new Privacy Policy.');\n return redirect()->route('privacyPolicy.index');\n }", "public static function create() {\n return new self();\n }", "public static function create() {\n\t\treturn new self();\n\t}", "public function create()\n {\n $id = DB::table('policies')->max('id');\n\n $id += 1;\n\n return view('admin.policies.create', compact('id'));\n }", "public function create()\n {\n return new $this->class;\n }", "public static function create()\n\t\t{\n\t\t\treturn new self();\n\t\t}", "private function createCollectionPolicy() {\n module_load_include('inc', 'fedora_repository', 'api/fedora_item');\n $fedora_item = new fedora_item($this->contentModelPid);\n $datastreams = $fedora_item->get_datastreams_list_as_array();\n if (isset($datastreams['COLLECTION_POLICY_TMPL'])) {\n $collection_policy_template = $fedora_item->get_datastream_dissemination('COLLECTION_POLICY_TMPL');\n $collection_policy_template_dom = DOMDocument::loadXML($collection_policy_template);\n $collection_policy_template_root = $collection_policy_template_dom->getElementsByTagName('collection_policy');\n if ($collection_policy_template_root->length > 0) {\n $collection_policy_template_root = $collection_policy_template_root->item(0);\n $node = $this->importNode($collection_policy_template_root, TRUE);\n $datastream = $this->createDatastreamElement('COLLECTION_POLICY', 'A', 'X');\n $version = $this->createDatastreamVersionElement('COLLECTION_POLICY.0', 'Collection Policy', 'text/xml');\n $content = $this->createDatastreamContentElement();\n $this->root->appendChild($datastream)->appendChild($version)->appendChild($content)->appendChild($node);\n }\n }\n }", "public function create()\n\t{\n\t\t//Permissions are created via code\n\t}", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public static function create(): self\n {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public function create(){}", "public function addToPolicyID($policyID)\n {\n $this->policyID[] = $policyID;\n return $this;\n }", "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public function store(StorePolicyRequest $request)\n {\n\n $client = Client::find($request->input('client.id'));\n\n if(!$client){\n $client = new Client();\n }\n $client->fill($request->input('client'));\n $client->save();\n\n if($request->has('vehicle.id')){\n $vehicle = Vehicle::find($request->input('vehicle.id'));\n }else{\n $vehicle = new Vehicle();\n }\n $vehicle->fill($request->input('vehicle'));\n $vehicle->client()->associate($client);\n $vehicle->save();\n\n $policy = new Policy($request->all());\n $policy->client()->associate($client);\n if($request->input('same_client_owner')){\n $policy->setOwnerData($client);\n }\n $policy->vehicle()->associate($vehicle);\n $policy->save();\n\n $drivers_sync = [];\n foreach($request->input('drivers') as $key => $driver){\n if(!empty($driver['name'])){\n $d = Driver::find($driver['id']);\n if(!$d){\n $d = new Driver();\n }\n $d->fill($driver);\n $d->client()->associate($client);\n $d->save();\n array_push($drivers_sync, $d->id);\n }\n }\n $policy->drivers()->sync($drivers_sync);\n\n flash()->success('Policy has been created successfully.');\n return Redirect::intended('/');\n }", "protected function policy()\n {\n return $this->gate()->getPolicyFor($this);\n }", "public function run()\n {\n PrivacyPolicy::create([\n\n 'main_text'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_one'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_two'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_three'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_four'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_five'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_six'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_seven'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n 'text_eight'=>[\n 'ar'=>'نص رئيسي',\n 'en'=>'main',\n ],\n ]);\n }", "public function create()\n {}", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(ReturnPolicyRequest $Model): SetReturnPolicyResponse\n {\n return $this->client->request('createReturnPolicy', 'POST', 'return_policy',\n [\n 'json' => $Model->getArrayCopy(),\n ]\n );\n }", "public function create() {\n\t\t\t//\n\t\t}", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public function create()\n {\n $this->cpAuthorize();\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }" ]
[ "0.69238234", "0.63803977", "0.63180053", "0.6157489", "0.59963197", "0.5828844", "0.5753017", "0.5750766", "0.57240343", "0.5712267", "0.57120466", "0.5633073", "0.5629794", "0.5476492", "0.5414451", "0.536653", "0.5354097", "0.5354097", "0.5354097", "0.53313726", "0.5293763", "0.5292304", "0.5292304", "0.52784693", "0.52376395", "0.52376395", "0.52274543", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.5222868", "0.52038455", "0.5195074", "0.5190787", "0.5188793", "0.51716197", "0.5159273", "0.5158003", "0.51553255", "0.5153394", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51464254", "0.51383084", "0.51383084", "0.51305", "0.5099971", "0.5092445", "0.5087874", "0.50853986", "0.5082831", "0.5065765", "0.50374144", "0.503741", "0.50371057", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50312907", "0.50251085", "0.5007391", "0.5007391", "0.5007391", "0.5007391" ]
0.0
-1
Get the segment ID for tracking.
function get_segment_id() : string { if ( defined( 'ALTIS_SEGMENT_ID' ) ) { return ALTIS_SEGMENT_ID; } return SEGMENT_ID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSegmentID()\n {\n return isset($this->SegmentID) ? $this->SegmentID : null;\n }", "public function getSegmentId()\n {\n return $this->segment_id;\n }", "protected function getTrackedClientId() {\n /*if (isset($_COOKIE['_ga'])) {\n list($version,$domainDepth, $cid1, $cid2) = preg_split('[\\.]', $_COOKIE[\"_ga\"],4);\n $contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1.'.'.$cid2);\n $cid = $contents['cid'];\n }\n else {*/\n $cid = $this->client->serial;\n //}\n return $cid;\n }", "public function getSegment()\n {\n return isset($this->segment) ? $this->segment : null;\n }", "public function getUrlSegment()\n {\n // Create URL segment if we don't have one.\n if(!$this->url_segment){\n $this->url_segment = str_slug($this->getFullName().' '.$this->id);\n $this->save();\n }\n\n return $this->url_segment;\n }", "public function getTrackingId()\n {\n return $this->trackingId;\n }", "public function getTrackingID()\n {\n return $this->trackingID;\n }", "public function getSegment()\n {\n return $this->_segment;\n }", "function get_segment_name() {\n\tif ( isset( $_SERVER['HTTP_X_WPENGINE_SEGMENT'] ) ) {\n\t\treturn sanitize_text_field( wp_unslash( $_SERVER['HTTP_X_WPENGINE_SEGMENT'] ) );\n\t}\n}", "public function getSegment()\n {\n return $this->Segment;\n }", "public function getIdSegmentation()\n {\n return $this->id_segmentation;\n }", "public static function trackId(): string\n {\n return 'tid';\n }", "public function getClubstaticId($segment, $query)\n\t{\n\t\tif ($this->noIDs)\n\t\t{\n\t\t\treturn (int) array_search($segment, $this->clubs);\n\t\t}\n\t\t\n\t\treturn (int) $segment;\n\t}", "public function getActivityId();", "public function getSegmentName() : \\string\n {\n return $this->segmentName;\n }", "public function getTrackingId()\n {\n if (isset($this->data['TrackingId'])) {\n return $this->data['TrackingId'];\n } else {\n return false;\n }\n }", "function getTrackID() {\n\t\treturn $this->_TrackID;\n\t}", "public function getRegisterId()\n {\n return (isset($this->segments()[3]) ? $this->segments()[3] : null);\n }", "public function getDetectionId()\n {\n return $this->detection_id;\n }", "static function get_segment($id){\n\t\t$start_marker = \"#zazzle_acc_start \".$id;\n\t\t$end_marker = \"#zazzle_acc_end \".$id.\"\\n\";\n\t\t\n\t\t$start = strpos(self::$FDATA, $start_marker);\n\t\t$end = strpos(self::$FDATA, $end_marker);\n\t\t\n\t\t//echo \"--Start: \".$start.\"<br>\";\n\t\t//echo \"--End: \".$end.\"<br>\";\n\t\t\n\t\tif($start === false){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$segment = substr(self::$FDATA, $start, $end - $start +strlen($end_marker));\n\t\t//echo \"--Segment: \".$segment.\"<br>\";\n\t\treturn $segment;\n\t}", "public function getSegmentType()\n {\n return (string) $this->json()->segment_type;\n }", "public function getTrackKey()\n\t{\n\t\treturn $this->statpro->getTrackKey();\n\t}", "public function getIdentifier()\n {\n $configID = $this->get_config() ? $this->get_config()->ID : 1;\n return ucfirst($this->get_mode()) . \"Site\" . $configID;\n }", "public function getSvrId()\n {\n return $this->get(self::_SVR_ID);\n }", "public function getStorageId()\n {\n return $this->_getField(self::$STORAGE_ID);\n }", "public function getSegmentValue()\n {\n return $this->segmentValue;\n }", "public function getIdentifier()\n {\n return $this->getParam('flowIdentifier');\n }", "public function getId(): int\n {\n return (int)substr($this->token, 0, strpos($this->token, ':'));\n }", "public static function getTraceId()\n {\n static::checkInit();\n return static::$traceId;\n }", "public static function getTraceSpanId()\n {\n static::checkInit();\n return static::$traceSpanId;\n }", "public function getId()\n\t{\n\t\t$videoId\t= '';\n\n\t\tpreg_match('/videos\\/(.*)/', $this->url , $matches);\n\t \tif (!empty($matches[1])){\n\t\t\t$videoId\t= $matches[1];\n\t\t}\n\n\t\treturn $videoId;\n\t}", "public function getTrackingNumber() : string\n\t{\n\t\treturn $this->trackingNumber;\n\t}", "protected function GetId() {\n\n $Id= $this->GetOption('Id');\n if (!$Id) {\n $Id= $this->GetName(); // let id be same as name\n $Id= str_replace(array('[',']'),'_', $Id); // id cannot contain '[' and ']'\n $Id= trim($Id, '_'); // id cannot start with '_'\n }\n return $Id;\n }", "public function getStudentId() {\n\t\tpreg_match ( '/\\d{9}/', $this->transcript, $ID ); // this will get the SID of the student\n\n\t\tif (count ( $ID ) > 0) {\n\t\t\t\t\n\t\t\t// $key= mt_rand ( MIN_KEY, MAX_KEY ); // will append a random key to the SI\n\t\t\treturn $ID [0]; // . strval($key);\n\t\t} else\n\t\t\treturn null;\n\t}", "public function getTeamId($segment, $query)\n\t{\n\t\tif ($this->noIDs)\n\t\t{\n\t\t\treturn (int) array_search($segment, $this->teams);\n\t\t}\n\n\t\treturn (int) $segment;\n\t}", "static function getSegmentCount() {\n return self::$segcnt;\n }", "function getId() {\n\t\treturn $this->getData('studyId');\n\t}", "function event_id() \n {\n $list = explode( ':', $this->rule->rule_key);\n if ( count( $list) == 4 && $list[2] == 'event') return $list[3];\n return NULL;\n }", "protected function getCurrentId()\n {\n return (array_key_exists($this->idfieldName(), $this->data)) ? $this->data[$this->idfieldName()] : NULL;\n }", "public static function getLogid(): string\n {\n $contextData = self::getCoroutineContext(self::DATA_KEY);\n $logid = $contextData['logid'] ?? '';\n return $logid;\n }", "public function getId(){\n if(!$this->id){\n return $this->getShippingOptionId().'_'.md5($this->getShippingServiceName());\n }\n return $this->id;\n }", "public static function getSpanid(): int\n {\n $contextData = self::getCoroutineContext(self::DATA_KEY);\n\n return (int)($contextData['spanid'] ?? 0);\n }", "public function getId(): int\n {\n $idSplit = explode('.', $this->data['externalidField']);\n return $idSplit[1] ?? $this->data['externalidField'];\n }", "public function getActivityLogId()\n {\n return $this->activityLogId;\n }", "public function getEventID() {\n return \"dataevent-\".$this->getID();\n }", "public static function getId(){\n\t\t\n\t\t$serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : \"unknown\";\n\t\t\n\t\t//added MD5 because IE doesn't like dots I suspect\n\t\treturn md5(\\GO::config()->id.'AT'.$serverName);\n\t}", "public function getId()\n {\n $tmp = (array) $this->getHeaderFieldModel($this->getIdField());\n\n return $this->headers->has($this->getIdField()) ? current($tmp) : $this->id;\n }", "public function id(): string\n {\n return $this->model->getRouteKey();\n }", "public function getSourcedId()\n {\n return isset($context['sourcedId']) ? $context['sourcedId'] : null;\n }", "public function getSearchLogId()\n\t{\n\t\tif ($this->request AND $this->session AND $this->session->has('last_searchlog_id')) {\n\t\t\t$ref = $this->request->server->get('HTTP_REFERER');\n\t\t\t$search_url = App::getRouter()->generate('user', array(), true) . 'search';\n\t\t\t$search_url = preg_replace('#^https?://#', '', $search_url);\n\n\t\t\tif ($ref && preg_match('#' . preg_quote($search_url, '#') . '(\\?.*?)?$#', $ref)) {\n\t\t\t\t$searchlog = App::findEntity('DeskPRO:SearchLog', $this->session->has('last_searchlog_id'));\n\t\t\t\tif ($searchlog->visitor && $this->visitor && $searchlog->visitor == $this->visitor) {\n\t\t\t\t\treturn $searchlog['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "public function getPathId()\n {\n return $this->pathId;\n }", "public function getActivityIdentifier()\n {\n if (array_key_exists(\"activityIdentifier\", $this->_propDict)) {\n return $this->_propDict[\"activityIdentifier\"];\n } else {\n return null;\n }\n }", "private function retrieveSharedCatalogStoreId()\n {\n $sharedCatalogStoreId = $this->getSharedCatalog()->getStoreId();\n if (!isset($sharedCatalogStoreId)) {\n $sharedCatalogStoreId = $this->request->getParam('store_id');\n }\n\n return (int)$sharedCatalogStoreId;\n }", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function getSegmentStatus()\n {\n return isset($this->SegmentStatus) ? $this->SegmentStatus : null;\n }", "public function getTrackNumber() {}", "public function getId()\n {\n return substr($this->_id, 0, 12);\n }", "protected function getSessionId()\n {\n $id = $this->di->session->get('requestRecorderId');\n\n if ($id == null) {\n $id = time();\n $this->di->session->set('requestRecorderId', $id); // Figure out something better than time()\n }\n\n return $id;\n }", "public function getServerId()\n {\n return $this->get(self::_SERVER_ID);\n }", "public function getRecordId()\n {\n return isset($this->fields['id']) ?\n $this->fields['id'] : '';\n }", "public function getSystemLogID() {\n\t\treturn $this->id;\n\t}", "public function getTrackingNumber()\n {\n return $this->trackingNumber;\n }", "static function get_url_segment() {\r\n\t\tself::$url_path;\r\n\t}", "public function getIdentifier()\n {\n return $this->getUri()->toString();\n }", "public function getTrackingNumber()\n {\n return $this->tracking_number;\n }", "public function getId()\n {\n return (substr($this->_id, 0, 12));\n }", "public function getSpecimenId()\n {\n \t#$testCategoryName = $this->testType->testCategory->name;\n \t#return substr($testCategoryName, 0 , 3).'-'.$this->specimen->id;\n\t\treturn $this->specimen->accession_number;\n }", "public static function id(){\n return self::info('id');\n }", "public function getID()\n {\n return $this->banner_campaign_id;\n }", "public function getId()\n {\n return $this->currentId;\n }", "public function getIdentifier()\n {\n return $this->id;\n }", "protected function getCurrentSegment(string $seg): string\n {\n if ($seg[0] === '{') {\n return str_replace(['}', '{'], '', $seg);\n }\n\n return $seg;\n }", "public function getId()\n {\n return $this->identifier;\n }", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public static function getID()\n {\n return self::getInstance()->_getID();\n }", "public function getTrackingKey()\n {\n if (!is_null($this->_messageTrackKey))\n return $this->_messageTrackKey;\n else\n return null;\n }", "public function getSpanId()\n {\n return $this->span_id;\n }", "public function getID()\n {\n return $this->formattedData['id'];\n }", "public function setSegmentId($var)\n {\n GPBUtil::checkString($var, True);\n $this->segment_id = $var;\n\n return $this;\n }", "public function getSiteId();", "public function getRequestId()\n {\n return isset ($this->headers ['x-log-requestid']) ? $this->headers ['x-log-requestid'] : '';\n }", "function getSId() {\n return $this->sId;\n }", "public function getActivityId(): ?string;", "public function getRecordId()\n {\n return $this->get(self::_RECORD_ID);\n }", "public function identifier()\n {\n return $this->id;\n }", "public function getDisplaySvrId()\n {\n return $this->get(self::_DISPLAY_SVR_ID);\n }", "public function getId()\n\t{\n\t\treturn $this->googleDriveFile->getId();\n\t}", "public function getStorageId(): string\n {\n return sprintf('$%s', $this->getData());\n }", "public static function getId() {\n return isset(self::$id)\n ? self::$id\n : (self::$id = base_convert(crc32(self::getBaseDir()),16,32));\n\t}", "public function get_identifier() {\n return $this->identifier;\n }", "private function getEntityId()\n\t{\n\t\t$id = $this->GetDocumentId();\n\t\t$pairs = explode('_', $id[2]);\n\n\t\treturn count($pairs) > 1 ? $pairs[1] : $pairs[0];\n\t}", "function getSiteId() {\n\t\treturn $this->getData('siteId');\n\t}", "public function getId() \r\n\t{\r\n\t\treturn $this->sId;\r\n\t}", "public function getIdentifier()\n {\n return $this->slug ?: $this->id;\n }", "function getId() {\n\t\treturn $this->getData('sectionDecisionId');\r\n\t}", "public function getSid(){\n return $this->sid;\n }", "public function getTrackKey()\n\t{\n\t\treturn $this->track_key;\n\t}", "private function getCurrentID() {\n if ($this->sessionid > 0) {\n\t\t\treturn $this->sessionid;\n\t\t}\n $cookie_id = 0;\n\t\tif (isset($GLOBALS[\"_COOKIE\"][\"sessionid\"])) {\n\t\t\t$cookie_array = explode('|', $GLOBALS[\"_COOKIE\"][\"sessionid\"]);\n\t\t\tif ($cookie_array[0]) {\n\t\t\t\t$cookie_id = $cookie_array[0];\n\t\t\t}\n\t\t}\n\t\treturn $cookie_id;\n }", "function getEventID() \n {\n return $this->getValueByFieldName('event_id');\n }" ]
[ "0.8050756", "0.80341816", "0.66298974", "0.6371639", "0.6354863", "0.6314366", "0.6285118", "0.62657547", "0.62021095", "0.6185875", "0.61442864", "0.61403924", "0.61395913", "0.60435605", "0.6026777", "0.59958154", "0.5961211", "0.59377456", "0.58873844", "0.5853302", "0.58412254", "0.58251524", "0.58136046", "0.58089083", "0.5781357", "0.5776245", "0.5746057", "0.5709491", "0.5707211", "0.56987613", "0.5647646", "0.56375325", "0.56354713", "0.56342417", "0.56276524", "0.5620983", "0.5617721", "0.5610291", "0.56032616", "0.560143", "0.5587975", "0.5587172", "0.5581996", "0.55715513", "0.5567842", "0.5562266", "0.55601364", "0.5555905", "0.55530405", "0.55237603", "0.5517249", "0.55155337", "0.55141705", "0.55140233", "0.550176", "0.5500161", "0.54927486", "0.5490148", "0.5488264", "0.54855937", "0.54845166", "0.5483639", "0.54835707", "0.54827327", "0.5474614", "0.54701155", "0.546536", "0.5459712", "0.54561263", "0.54544294", "0.5445945", "0.54458606", "0.54433763", "0.54428405", "0.54428405", "0.5439461", "0.5439257", "0.54288924", "0.54282707", "0.54270554", "0.54260784", "0.54218495", "0.5420237", "0.54181886", "0.54159826", "0.5413696", "0.5413392", "0.54085994", "0.5398777", "0.5397835", "0.5389613", "0.5388843", "0.53866905", "0.53818226", "0.5378242", "0.5377299", "0.5373942", "0.53733546", "0.5369185", "0.53676355" ]
0.7577411
2
Track an event in Segment.io.
function track( array $message ) { if ( ! initialize() ) { return; } // Add user ID if missing. if ( ! isset( $message['userId'] ) ) { $user = get_segmentio_user_details(); $message['userId'] = $user['id']; } Segment::track( $message ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function track($event, $properties=array()) {\n $params = array(\n 'event' => $event,\n 'properties' => $properties\n );\n\t\t//Check if token is passed in properties array\n if (!isset($params['properties']['token'])){\n $params['properties']['token'] = $this->token;\n }\n //create url to send an HTTP POST Request\n $url = $this->host . 'track/?data=' . base64_encode(json_encode($params));\n //Execute HTTP POST in the background\n exec(\"curl '\" . $url . \"' >/dev/null 2>&1 &\"); \n }", "public function trackEvent($event) {\n\t\t\n\t\t// do not track anything if user is in overlay mode\n\t\tif (owa_coreAPI::getStateParam('overlay')) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$this->setGlobalEventProperty( 'HTTP_REFERER', owa_coreAPI::getServerParam('HTTP_REFERER') );\n\t\t\n\t\t// needed by helper page tags function so it can append to first hit tag url\t\n\t\tif (!$this->getSiteId()) {\n\t\t\t$this->setSiteId($event->get('site_id'));\n\t\t}\n\t\t\n\t\tif (!$this->getSiteId()) {\n\t\t\t$this->setSiteId(owa_coreAPI::getRequestParam('site_id'));\n\t\t}\n\t\t\n\t\t// set various state properties.\n\t\t$this->manageState( $event );\n\t\t\n\t\t$event = $this->setAllGlobalEventProperties( $event );\n\t\t\n\t\t// send event to log API for processing.\n\t\treturn owa_coreAPI::logEvent($event->getEventType(), $event);\n\t}", "public function track_event(string $event_type, $extra_info = [])\n {\n }", "public function onEvent();", "public function track($event, $properties = array()) {\n $this->_events->track($event, $properties);\n }", "function event()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('event', $data)\n );\n $this->output($ret);\n }", "public function track($trackingNumber);", "public function trackCommand(ConsoleCommandEvent $event)\n {\n if (!$this->consent) {\n return;\n }\n $command = $event->getCommand();\n $input = $event->getInput();\n\n $args = $input->getArguments();\n if ($input->hasOption('uri')) {\n $args['uri'] = $input->getOption('uri');\n }\n\n $this->telemetry\n ->queueEvent('console.command', $args)\n ->setDeviceId(OsInfo::uuid())->logQueuedEvents();\n }", "public function handleEvent(PhutilEvent $event) {\n // occurs, this method will be invoked. You should respond to the event.\n\n // In this case, we just echo a message out so the event test script will\n // do something visible.\n\n $console = PhutilConsole::getConsole();\n $console->writeOut(\n \"%s\\n\",\n pht(\n '%s got test event at %d',\n __CLASS__,\n $event->getValue('time')));\n }", "public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }", "public function broadcastEvent(\\Montage\\Event\\Event $event);", "public function send_events()\n {\n }", "public function handle(Event $event): void\n {\n $this->redis->publish('events', json_encode($event, JSON_THROW_ON_ERROR));\n }", "public function handle($event)\n {\n \n }", "public function handleSendEvent(object $message): void;", "public function handle(Event $event): void;", "public function handle(\\Inhere\\Event\\EventInterface $event)\n {\n }", "public function run($event) {\n }", "public function run($event) {\n }", "function Piwik_PostEvent( $eventName, &$object = null, $info = array() )\n{\n\tPiwik_PluginsManager::getInstance()->dispatcher->post( $object, $eventName, $info, true, false );\n}", "public function handle($event)\n {\n $this->handledEvents[] = $event;\n }", "protected function event($event)\n {\n if(isset($this->events)) {\n $this->events->dispatch($event);\n }\n }", "public function track(string $userId, string $event, array $properties = [])\n {\n $this->storage->storeTrack($userId, $event, $properties, $this->context->get());\n }", "protected function recordActivity($event)\n {\n $this->activity()->create([\n 'user_id' => auth()->id(),\n 'type' => $this->getActivityType($event),\n ]);\n }", "public function queueEvent($eventId);", "protected function recordActivity($event)\n {\n $this->activity()->create([\n //type => created_thread\n 'type' => $event . '_' . strtolower(class_basename($this)),\n 'user_id' => auth()->id()\n ]);\n }", "function OnTrack($track)\n\t{\n\t\t\n\t\techo \"\\nEvento onTrack lanzado!!! track:\".$track;\n\t\t\n\t\t$this->informaClientesResultadoLecturaTarjeta($track);\n\t\t\n\n\t\t//###Primero controlamos si el nodo tiene asociada una taquilla en la bd y guardo su id\n\t\t$result = $this->conexionDB->query(\"SELECT id_taquillas \n\t\t\t\t\t\t\t\t\t\t\tfrom taquillas \n\t\t\t\t\t\t\t\t\t\t\twhere ip_nodo = '\".$this->ipLocal.\"'\");\n\t\t\n\t\tif ($result->num_rows == 0)\n\t\t{\n\t\t\techo \"\\nLa dirección de este nodo no controla ninguna taquilla en la Base de Datos: \".$this->ipLocal.\"\\n\\n\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//buscamos en primer row,ya que taquillas tiene ip_nodo UNIQUE\n\t\t$row = $result->fetch_assoc();\n\t\t$id_taqui = $row['id_taquillas'];\n\t\t\n\t\t//----------\n\t\t\n\t\t\n\t\t//###Segundo controlamos, mirando el numero de tarjeta, cual es el empleado que la posee\n\t\t$result = $this->conexionDB->query(\"SELECT id_empleados \n\t\t\t\t\t\t\t\t\t\t\tfrom empleados \n\t\t\t\t\t\t\t\t\t\t\twhere num_tarjeta = '\".$track.\"'\");\n\t\t\n\t\tif ($result->num_rows == 0)\n\t\t{\n\t\t\techo \"\\nNo existe empleado con numero de tarjeta equivalente a track: \".$track.\"\\n\\n\";\n\t\t\t\n\t\t\t//MODO SUPER restrictivo, una tarjeta errónea hace saltar la alarma del relé num 2 (indice 1)\n\t\t\t//comentar siguientes dos lineas para evitarlo\n\t\t\t//$this->ActivateRelay(1, 0xA);\n\t\t\t//echo \"\\nModo restrictivo, tarjeta no autorizada, dispara Alarma\\n\";\n\t\t\t\n\t\t\treturn;\n\t\t}\t\n\t\t\n\t\t//buscamos en primer row,ya que empleados tiene num_tarjeta UNIQUE\n\t\t$row = $result->fetch_assoc();\n\t\t$id_emp = $row['id_empleados'];\n\t\t\n\t\t//----------\n\t\t\n\t\t\n\t\t\n\t\t//###Tercero, controlamos, mirando el id de empleado y el id de taquilla, si el empleado es POSEEDOR de esa taquilla\n\t\t//segun la logica de la base de datos\n\t\t$result = $this->conexionDB->query(\"SELECT id_empleados \n\t\t\t\t\t\t\t\t\t\t\tfrom empleados \n\t\t\t\t\t\t\t\t\t\t\twhere num_tarjeta = '\".$track.\"' and id_empleados = (select id_empleados from taquillas where id_taquillas=\".$id_taqui.\")\");\n\t\t\n\t\tif ($result->num_rows == 0)\n\t\t{\n\t\t\techo \"\\nEl empleado con id \".$id_emp.\" y num_tarjeta \".$track.\" NO es poseedor de la taquilla que controla este Nodo\\n nodo con IP: \".$this->ipLocal.\", controla taquilla con id:\".$id_taqui.\"\\n\\n\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//###Cuarto, por fin!!! producimos apertura de taquilla, relé 0, 5 decimas de segundo (son numeros hexa)\n\t\techo \"\\nEmpleado y Tarjeta autenticados para la taquilla de este nodo, se procede a la apertura de puerta\\n\\n\";\n\t\t$resultadoActivateRelay = $this->ActivateRelay(0, 5);\n\t\t\n\t\t//que codigo responde ActivateRelay??, ha de ser == 0\n\t\tif($resultadoActivateRelay > 0)\n\t\t{\n\t\t\techo \"\\nErr. Se intento abrir puerta pero ActivateRelay() no tuvo exito\\n\\n\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\techo \"\\nACCESO PERMITIDO!!!\\n\\n\";\n\t\t\n\t\t$query = \"insert into accesos (id_taquillas, id_empleados, fecha_hora, num_tarjeta)\n\t\t\t\t values(\".$id_taqui.\",\".$id_emp.\",'\".date(\"Y-m-d H:i:s\").\"','\".$track.\"')\";\n\t\t\t\t\n\t\t\t\t\n\t if ( $this->conexionDB->query($query) ) \n\t {\n\t\t echo \"\\nOntrack produjo registro de acceso en Base de Datos\\n\\n\";\n\t\t} \n\t\telse \n\t\t{\n\t\t echo \"\\nProblema de insercion de registro acceso en Base de Datos\\n\\n\";\n\t\t return;\n\t\t}\n\t\t \n\t\t\n\t\t\n\t}", "abstract protected function handle($event);", "protected function send_request(array $event_info)\n {\n }", "public function trackTransaction() {\n\t\t\n\t\tif ( ! empty( $this->commerce_event ) ) {\n\t\t\t$this->trackEvent( $this->commerce_event );\n\t\t\t$this->commerce_event = '';\n\t\t}\n\t}", "public function on($event, $callback){ }", "public function index()\n {\n //\n /*$song = Song::findOrFail(2508);\n $file_name = \"/var/www/html/osca/storage/app/public/songs/2508.mp3\";\n event(new SongUploaded($song, storage_path(\"app/public/songs/{$file_name}\")));\n return \"request sent\";*/\n }", "public function setupEventTracking($event, $inputParams)\n {\n /* @var $scicAdapter FACTFinder_Default_ScicAdapter */\n if (Mage::helper('factfinder')->useLegacyTracking()) {\n $scicAdapter = $this->_getFacade()->getLegacyTrackingAdapter();\n } else {\n $scicAdapter = $this->_getFacade()->getScicAdapter();\n }\n\n switch ($event) {\n case FACTFinder_Default_TrackingAdapter::EVENT_INSPECT:\n $searchHelper = $searchHelper = Mage::helper('factfinder/search');\n $scicAdapter->setupClickTracking(\n $inputParams['id'],\n $inputParams['sid'],\n $searchHelper->getQuery()->getQueryText(),\n 1, //pos\n 1, //origPos\n 1, //page\n $inputParams['product']->getSimilarity(),\n $inputParams['product']->getName(),\n $searchHelper->getPageLimit(),\n $searchHelper->getDefaultPerPageValue());\n break;\n case FACTFinder_Default_TrackingAdapter::EVENT_CART:\n $scicAdapter->setupCartTracking(\n $inputParams['id'],\n $inputParams['sid'],\n $inputParams['amount'],\n $inputParams['price'],\n $inputParams['uid']\n );\n break;\n case FACTFinder_Default_TrackingAdapter::EVENT_BUY:\n $scicAdapter->setupCheckoutTracking(\n $inputParams['id'],\n $inputParams['sid'],\n $inputParams['amount'],\n $inputParams['price'],\n $inputParams['uid']\n );\n break;\n case FACTFinder_Default_TrackingAdapter::EVENT_DISPLAY:\n case FACTFinder_Default_TrackingAdapter::EVENT_FEEDBACK:\n case FACTFinder_Default_TrackingAdapter::EVENT_AVAILABILITY_CHECK:\n case FACTFinder_Default_TrackingAdapter::EVENT_CACHE_HIT:\n case FACTFinder_Default_TrackingAdapter::EVENT_SESSION_START:\n // Not implemented yet\n break;\n }\n\n return $scicAdapter;\n }", "public function triggerEvent($eventId);", "private function sendEvent(string $event, array $data): void\n {\n echo \"event: {$event}\\n\";\n echo 'data: ' . json_encode($data) . \"\\n\\n\";\n\n ob_flush();\n flush();\n }", "protected function recordActivity($event)\n {\n Activity::create([\n 'user_id' => auth()->id(),\n 'type' => $this->getType($event),\n 'date' => Carbon::now(),\n ]);\n }", "public function tracker($event)\n {\n if ($this->mode > 0) {\n $time = array_sum(explode(\" \", microtime()));\n\n // Prepare for Memory, just if functions avail\n if (function_exists('memory_get_usage')) {\n $mem = sprintf(\"MemAct: %05d KB &nbsp;&nbsp;\", memory_get_usage() / 1024);\n } else {\n $mem = \"\";\n }\n if (function_exists('memory_get_peak_usage')) {\n $memmax = sprintf(\"MemPeak: %05d KB &nbsp;&nbsp;\", memory_get_peak_usage() / 1024);\n } else {\n $memmax = \"\";\n }\n\n if (!$this->timer_first or !$event) {\n $this->timer_first = $time;\n }\n if (!$this->timer_last or !$event) {\n $this->timer_last = $time;\n }\n\n $tmp_out = sprintf(\n \"Step: %07.1f ms &nbsp; Total: %07.1f ms &nbsp;&nbsp;\".$mem.$memmax.\" => [%s]<br />\\n\",\n ($time - $this->timer_last) * 1000,\n ($time - $this->timer_first)*1000,\n $event\n );\n\n $this->timer_out .= $tmp_out;\n $this->timer_all = $time - $this->timer_first;\n $this->timer_last = $time;\n }\n }", "public function dispatchEvent($event);", "public function pushEvent($name)\n {\n $this->data['event'] = $name;\n }", "public function eventcallback(){\n\n $data = self::validate_request($_POST['signed_request']);\n\n // CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(); data after json_decode:' . print_r($data, true));\n /** example\n [issued_at] => 1442959000\n [user_id] => 10015\n [event] => logout\n [algorithm] => HMAC-SHA256\n */\n\n CakeLog::write(LOG_DEBUG, \"Received event from TrueNTH portal: ${data['event']}\");\n\n if ($data['event'] == 'logout'){\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(); data[event] == \"logout\"');\n $sessionObj = new DatabaseSessionPlusUserId();\n $deleteResult = $sessionObj->deleteByUserId($data['user_id']);\n CakeLog::write(LOG_DEBUG, \"Event-triggered logout complete\");\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . \"(); just did logout, heres deleteResult: $deleteResult\");\n }\n //else CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(); data[event] != \"logout\"');\n\n //CakeLog::write(LOG_DEBUG, __CLASS__ . '.' . __FUNCTION__ . '(); done.');\n }", "public function handle(EventInterface $event): void;", "public function sendEvent($context) {\n\t\t\n\t\t\t//Store some information on the Symphony Entry.\n\t\t\t$entry = $context['entry'];\n\t\t\t\n\t\t\t$entry_settings = $entry->get();\n\t\t\t$entry_id = $entry_settings['id'];\t\n\t\n\t\t\t$e_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'e-')) {\n\t\t\t\t\t$e_data[str_replace('e-', 'e_', $key)] = $value;\n\t\t\t\t} else if ($this->string_begins_with($key, 'g-')) {\n\t\t\t\t\t$e_data[str_replace('g-', 'g_', $key)] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Change the e_status property to a value the API understands\n\t\t\tif($e_data['e_status'] == 'yes') {\n\t\t\t\t$e_data['e_status'] = 'active';\n\t\t\t} else {\n\t\t\t\t$e_data['e_status'] = 'pending';\n\t\t\t}\t\n\t\t\t//Set the format of the Date/Times\n\t\t\t$e_data['e_start'] = date('Y-m-d G:i:s', strtotime($e_data['e_start']));\n\t\t\t$e_data['e_stop'] = date('Y-m-d G:i:s', strtotime($e_data['e_stop']));\n\t\t\t$e_data['e_deadline'] = date('Y-m-d G:i:s', strtotime($e_data['e_deadline']));\n\n\t\t\t//Another Required field is the User ID\n\t\t\t$e_data['u_id'] = $this->u_id;\n\t\t\t\n\t\t\t//Create a unique Push URL (e_pushurl) from the entry ID.\n\t\t\t$e_data['e_pushurl'] = URL .'/eventarc-updater/?hash='.sha1($entry_id).'&id='.$entry_id;\n\t\t\n\t\t\t//Address Data\n\t\t\t$a_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'a-')) {\n\t\t\t\t\t$a_data[str_replace('a-', 'a_', $key)] = $value;\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t\t//If the ID & URL are not set - Create a new event.\n\t\t\tif($e_data['e_id'] == '' && $e_data['e_url'] == '') {\n\t\t\t\n\t\t\t\tunset($e_data['e_id']);\n\t\t\t\tunset($e_data['e_url']);\t\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->event_create();\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_create();\n\t\t\t\t}\n\n\t\t\t\t if($result) {\n\t\n\t\t\t\t \tif(!isset(self::$fieldManager)) {\n\t\t\t\t \t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t \t}\n\t\t\t\t \t\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['e_id'],\n\t\t\t\t \t\t'value' => $result['e_id'],\n\t\t\t\t \t\t'value_formatted' => $result['e_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc URL (e_url).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['url'],\n\t\t\t\t \t\t'value' => $result['url'],\n\t\t\t\t \t\t'value_formatted' => $result['url'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['a_id'],\n\t\t\t\t \t\t'value' => $result['a_id'],\n\t\t\t\t \t\t'value_formatted' => $result['a_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t$entry->commit();\n\t\t\t \n\t\t\t\t }\n\t\t\t\t \n\t\t\t} \n\t\t\t//Event already exists - update the event. \n\t\t\telse {\n\t\t\t\t\n\t\t\t\t//Check that the URL is not empty.\t\n\t\t\t\tif($e_data['e_url'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc URL (e_url).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['url'],\n\t\t\t\t\t\t'value' => $result['url'],\n\t\t\t\t\t\t'value_formatted' => $result['url'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Check that the Address ID is not empty.\t\n\t\t\t\tif($a_data['a_id'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get_address($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['a_id'],\n\t\t\t\t\t\t'value' => $result['a_id'],\n\t\t\t\t\t\t'value_formatted' => $result['a_id'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t//Store the retrieved address ID.\n\t\t\t\t\t$a_data['a_id'] = $result['a_id'];\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Don't want to manually change the URL generated by Eventarc.\n\t\t\t\tunset($e_data['e_url']);\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Edit the Event.\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\t\n\t\t\t\t\t ->event_update();\n\t\t\t\t\t $result = $this->eventarc\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->address_update();\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_update();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "static function event($unique_user_id, $title, $params = array())\n {\n\n if (!$params || !is_array($params)) {\n $params = array();\n }\n\n $params['title'] = $title;\n \n $message = array(\n 'unique_id' => $unique_user_id,\n 'event' => 'custom',\n 'created_at' => self::get_time(),\n 'params' => $params,\n );\n\n self::store_or_send('event', 'POST', $message);\n }", "public function addEvent($event){\n $this->events[]=$event;\n }", "public function track($params) {\n if (ENVIRONMENT !== 'development') {\n return $this->mp->track($params['message'], array(\"label\" => $params['action'], \"ip\" => $this->CI->input->ip_address()));\n }\n }", "public function recordThat(DomainEvent $event);", "function notify($event)\n {\n if(SWConfig::read_values('statuswolf.debug'))\n {\n $this->loggy = new KLogger(ROOT . 'app/log/', KLogger::DEBUG);\n }\n else\n {\n $this->loggy = new KLogger(ROOT . 'app/log/', KLogger::INFO);\n }\n\n $this->auth_log_messages[] = $event;\n\n $this->loggy->logDebug(json_encode($this->auth_log_messages));\n }", "public function processAction()\n {\n $env = $this->getEnvironment();\n $this->setProcessTitle('IcingaDB Event Stream: ' . $env->get('name'));\n $handler = new IcingaEventHandler($env);\n $handler->processEvents();\n }", "function ga_send_event($category=null, $action=null, $label=null) {\n\tif ( $GLOBALS['ga_v'] === null ) {\n\t\t$GLOBALS['ga_v'] = 1;\n\t}\n\n\tif ( $GLOBALS['ga_cid'] === null ) {\n\t\t$GLOBALS['ga_cid'] = gaParseCookie();\n\t}\n\n\t$data = array(\n\t\t'v' => $GLOBALS['ga_v'],\n\t\t'tid' => $GLOBALS['ga'],\n\t\t'cid' => $GLOBALS['ga_cid'],\n\t\t't' => 'event',\n\t\t'ec' => $category, //Category (Required)\n\t\t'ea' => $action, //Action (Required)\n\t\t'el' => $label //Label\n\t);\n\tgaSendData($data);\n}", "public static function queue($event)\n {\n }", "public function storeEvent($event)\n {\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n }", "public function publish($event, $typeHint = null);", "public function onTrackPlayed(){\n $this->request->validate([\n 'type' => 'string|in:song,episode',\n ]);\n\n if($this->request->input('type') == 'song') {\n $song = Song::findOrFail($this->request->input('id'));\n $song->increment('plays');\n if(isset($song->artists[0])) {\n $artist_id = $song->artists[0]->id;\n //Insert song statistic\n DB::statement(\"INSERT INTO \" . DB::getTablePrefix() . \"popular (`song_id`, `artist_id`, `plays`, `created_at`) VALUES (\" . intval($song->id). \", '\" . $artist_id . \"', '1', '\" . Carbon::now() . \"') ON DUPLICATE KEY UPDATE plays=plays+1\");\n }\n\n if ($song->user_id && config('settings.monetization') && Role::getUserValue('monetization_streaming', $song->user_id)) {\n\n if ($song->user_id && config('settings.monetization') && Role::getUserValue('monetization_streaming', $song->user_id)) {\n if(request()->ip()) {\n if(! Stream::where('streamable_id', $song->id)->where('streamable_type', (new Song)->getMorphClass())->where('ip', request()->ip())->exists()) {\n $revenue = Role::getUserValue('monetization_streaming_rate', $song->user_id);\n $steam = new Stream();\n $steam->user_id = $song->user_id;\n $steam->streamable_id = $song->id;\n $steam->streamable_type = (new Song)->getMorphClass();\n $steam->revenue = $revenue;\n $steam->ip = request()->ip();\n $steam->save();\n $song->user()->increment('balance', $revenue);\n }\n }\n }\n\n }\n\n if(auth()->check())\n {\n if($song->user_id) {\n $song->user()->increment('balance', Role::getUserValue('monetization_streaming_rate', $song->user_id));\n }\n makeActivity(auth()->user()->id, $song->id, (new Song)->getMorphClass(), 'playSong', $song->id);\n History::updateOrCreate(\n [\n 'user_id' => auth()->user()->id,\n 'historyable_id' => $song->id,\n 'historyable_type' => (new Song)->getMorphClass(),\n ],\n [\n 'created_at' => Carbon::now(),\n 'ownerable_type' => (new Artist)->getMorphClass(),\n 'ownerable_id' => isset($song->artists[0]) ? $song->artists[0]->id : null,\n 'interaction_count' => DB::raw('interaction_count + 1')\n ]\n );\n }\n\n return response()->json(array('success' => true));\n\n } else {\n $episode = Episode::findOrFail($this->request->input('id'));\n $episode->increment('plays');\n\n if ($episode->user_id && config('settings.monetization') && Role::getUserValue('monetization_streaming', $episode->user_id)) {\n if(request()->ip()) {\n if(! Stream::where('streamable_id', $episode->id)->where('streamable_type', (new Episode)->getMorphClass())->where('ip', request()->ip())->exists()) {\n $revenue = Role::getUserValue('monetization_streaming_rate', $episode->user_id);\n $steam = new Stream();\n $steam->user_id = $episode->user_id;\n $steam->streamable_id = $episode->id;\n $steam->streamable_type = (new Episode)->getMorphClass();\n $steam->revenue = $revenue;\n $steam->ip = request()->ip();\n $steam->save();\n $episode->user()->increment('balance', $revenue);\n }\n }\n }\n\n return response()->json(array('success' => true));\n }\n }", "public function onEvent($event)\n\t{\n\t\tif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_BEFORE_INSERT)\n\t\t{\n\t\t\t/**\n\t\t\t * If document_id is set in the model the service will first try to pull \n\t\t\t * the document to update it. If it is unable to get the record \n\t\t\t * (it will be since this is an insert) it will do nothing and \n\t\t\t * the document will not be inserted.\n\t\t\t */\n\t\t\t$event->model->document_id = NULL;\n\t\t\t$result = $this->saveDocument($event->model);\n\t\t\t$event->model->document_id = $result->item->document_id;\n\t\t}\n\t\telseif ($event->type == DB_Models_ObservableWritableModel_1::EVENT_UPDATE)\n\t\t{\n\t\t\t$this->saveDocument($event->model);\n\t\t}\n\t}", "public static function onUpdateEvent($param)\n {\n try\n {\n if (isset($param['id']))\n {\n // get the parameter $key\n $key=$param['id'];\n \n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // instantiates object CalendarEvent\n $object = new CalendarEvent($key);\n $object->start_time = str_replace('T', ' ', $param['start_time']);\n $object->end_time = str_replace('T', ' ', $param['end_time']);\n $object->store();\n \n // close the transaction\n TTransaction::close();\n }\n }\n catch (Exception $e) // in case of exception\n {\n new TMessage('error', $e->getMessage());\n TTransaction::rollback();\n }\n }", "public function getRecordingStartedEvent();", "public function record(EventData $eventData)\n {\n $this->insertUpdateLiveEvent($eventData);\n $this->insertSocialType($eventData);\n $this->insertSocialAccount($eventData);\n $this->createAccountAndLiveEventRelation($eventData);\n $this->em->clear();\n }", "public function getEventName() : String;", "public function getEventSubscriber();", "function sendEvent( $event )\n {\n Event_Manager::notify( $event );\n }", "public static function event($event = null)\n {\n }", "public function store(EventRequest $request) {\n if (Auth::user()->profile != 'admin') {\n abort(403);\n } else {\n \\App\\Event::create([\n 'name' => $request->name,\n 'event' => $request->event,\n 'point' => $request->point,\n 'start' => $request->start,\n 'end' => $request->end,\n ]);\n $request->session()->flash('alert', 'success');\n $request->session()->flash('status', 'เพิ่มข้อมูลกิจกรรมเรียบร้อยแล้ว');\n return redirect()->back();\n }\n }", "function helloGCS(CloudEventInterface $cloudevent)\n{\n $log = fopen(getenv('LOGGER_OUTPUT') ?: 'php://stderr', 'wb');\n $data = $cloudevent->getData();\n fwrite($log, 'Event: ' . $cloudevent->getId() . PHP_EOL);\n fwrite($log, 'Event Type: ' . $cloudevent->getType() . PHP_EOL);\n fwrite($log, 'Bucket: ' . $data['bucket'] . PHP_EOL);\n fwrite($log, 'File: ' . $data['name'] . PHP_EOL);\n fwrite($log, 'Metageneration: ' . $data['metageneration'] . PHP_EOL);\n fwrite($log, 'Created: ' . $data['timeCreated'] . PHP_EOL);\n fwrite($log, 'Updated: ' . $data['updated'] . PHP_EOL);\n}", "public function on()\n {\n echo 'The tv is on now.' . PHP_EOL;\n }", "public function process(object $event) {\r\n\r\n }", "public function liveUpdate($collection_id, $document_id)\n {\n //set_time_limit(0);\n\n //$response = new Symfony\\Component\\HttpFoundation\\StreamedResponse();\n //$response->headers->set('Cache-Control', 'no-cache');\n //$response->headers->set('Content-Type', 'text/event-stream');\n\n //$response->setCallback(\n\n\n // Example from https://pineco.de/simple-event-streaming-in-laravel/\n return response()->stream(\n function () use ($collection_id, $document_id) {\n $owner = Sentinel::getUser();\n $elapsed_time = 0;\n $started_time = new DateTime();\n $started_time = $started_time->sub(new DateInterval('PT7S')); //look for annotations performed 7 seconds ago from now\n\n\n $count = 0;\n while (true) {\n if (connection_aborted()) {\n break;\n }\n if ($elapsed_time > 100) // Cap connections at 100 sec. The browser will reopen the connection on close\n die();\n\n echo (\"event: message\\n\");\n flush();\n $is_shared = 0;\n $is_owner = DB::table('collections')\n ->where('id', (int) $collection_id)\n ->where('owner_id', $owner['id'])\n ->count();\n if ($is_owner == 0) {\n $is_shared = DB::table('shared_collections')\n ->where('collection_id', (int) $collection_id)\n ->where('to', $owner['email'])\n ->count();\n if ($is_shared == 0) {\n echo ('data: ' . json_encode('You do not have access to this document. Please select another document.') . \"\\n\\n\"); //send data to client\n flush();\n }\n }\n // The collection is owned/shared.\n $started_time_new = new DateTime();\n if ($is_owner == 1 or $is_shared == 1) {\n $new_annotations = TempAnnotation::withTrashed()\n ->where('collection_id', (int) $collection_id)\n ->where('document_id', (int) $document_id)\n ->where('updated_at', '>=', $started_time)\n ->get($this->returnProperties);\n } else {\n $new_annotations = [];\n }\n\n // echo(\"data: [{\\\"email\\\": \".json_encode($owner['email']).\", \\\"is_owner\\\": $is_owner, \\\"is_shared\\\": $is_shared, \\\"len\\\": \".sizeof($new_annotations).\", \\\"count\\\": $count}]\\n\\n\");\n //flush();\n if (sizeof($new_annotations) > 0) {\n $started_time = $started_time_new;\n $elapsed_time = 0;\n echo ('data: ' . json_encode($new_annotations) . \"\\n\"); //send data to client\n flush();\n } else {\n $elapsed_time += 4;\n echo ('data: ' . json_encode($new_annotations) . \"\\n\"); //send data to client\n flush();\n sleep(3);\n }\n\n $count += 1;\n echo (\"id: \" . uniqid() . \"\\n\\n\");\n flush();\n sleep(1);\n }\n\n // try {\n // $elapsed_time = 0;\n // $started_time = new DateTime();\n // $started_time = $started_time->sub(new DateInterval('PT7S')); //look for annotations performed 7 seconds ago from now\n //\n // while (true) {\n // echo \"event: message\\n\";\n // if (connection_aborted()) {\n // break;\n // }\n // if ($elapsed_time>100) // Cap connections at 100 sec. The browser will reopen the connection on close\n // die();\n //\n // $is_owner = DB::table('collections')\n // ->where('id', (int) $collection_id) \n // ->where('owner_id', $owner['id'])\n // ->count();\n //\n // if ($is_owner == 0) {\n // $is_shared = DB::table('shared_collections')\n // ->where('collection_id', (int) $collection_id) \n // ->where('to', $owner['email'])\n // ->count();\n //\n // if($is_shared == 0) {\n // echo('data: ' . json_encode('You do not have access to this document. Please select another document.') . \"\\n\\n\"); //send data to client\n // //ob_flush();\n // flush();\n //\n // }\n // }\n //\n // $started_time_new = new DateTime();\n // $new_annotations = TempAnnotation::withTrashed() \n // ->where('collection_id', (int) $collection_id)\n // ->where('document_id', (int) $document_id)\n // ->where('updated_at', '>=', $started_time)\n // ->get(array('_id', 'collection_id', 'document_id', 'type', 'spans', 'attributes', /*'updated_at', 'updated_by',*/'deleted_at'));\n //\n // if (sizeof($new_annotations)>0) {\n // $started_time = $started_time_new;\n // $elapsed_time = 0;\n //\n // echo 'data: ' . json_encode($new_annotations) . \"\\n\\n\"; //send data to client\n // //ob_flush();\n // flush();\n // } else\n // $elapsed_time += 4;\n // sleep(3);\n // }\n // }\n // catch (Exception $e) {\n // //display custom message\n // echo \"data: {\\\"msg\\\": \\\"\". json_encode($e->errorMessage()).\"\\\"}\\n\\n\";\n // flush();\n // }\n // flush();\n // sleep(1);\n },\n 200,\n [\n 'Cache-Control' => 'no-cache',\n 'Content-Type' => 'text/event-stream',\n ]\n );\n // );\n\n // return $response;\n }", "public function recordHit()\n {\n global $configArray;\n\n if ($configArray['Statistics']['enabled']) {\n // Setup Statistics Index Connection\n $solrStats = ConnectionManager::connectToIndex('SolrStats');\n\n // Save Record View\n $solrStats->saveRecordView($this->recordDriver->getUniqueID());\n unset($solrStats);\n }\n }", "function track(){\n\n\t\tif($params = $this->getURLParams()) {\n\n\t\t\t//different link versions, for maintaining backwards compatability\n\t\t\tif(isset($params['Version']) && $params['Version'] == \"v2\"){\n\n\t\t\t\tif($decrypted = $this->decryptHash()){\n\n\t\t\t\t\tif($recipient = DataObject::get_one(\"Newsletter_SentRecipient\",\"\\\"Email\\\" = '\".$decrypted['e'].\"' AND \\\"ParentID\\\" = \".$decrypted['nl'])){\n\t\t\t\t\t\t$recipient->recordClick();\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($decrypted['l']) && is_numeric($decrypted['l']) && $link = DataObject::get_by_id('Newsletter_TrackedLink', (int)$decrypted['l'])){\n\t\t\t\t\t\t$link->recordClick();\n\t\t\t\t\t\treturn $this->redirect($link->Original, 301);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}elseif(isset($params['Hash']) && ($hash = Convert::raw2sql($params['Hash']))) {\n\t\t\t\t$link = DataObject::get_one('Newsletter_TrackedLink', \"\\\"Hash\\\" = '$hash'\");\n\t\t\t\tif($link) {\n\t\t\t\t\t// check for them visiting this link before\n\t\t\t\t\t$link->recordClick();\n\t\t\t\t\treturn $this->redirect($link->Original, 301);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn $this->httpError(404);\n\t}", "public function notify($eventName, $client, $eventData)\n {\n // todo 1 Frank Make basic tracer plugin\n echo 'tracing event (' . $this->priority . '):', $eventName, PHP_EOL;\n }", "public function trackEvent($id, $eventName, $additionalParams = [], $isSystem = true)\n {\n if ($this->isEmptyString($id)) {\n throw new InvalidArgumentException;\n }\n\n if (!$eventName) {\n throw new InvalidArgumentException;\n }\n\n $params = [\n 'event' => $eventName,\n 'params' => json_encode($additionalParams)\n ];\n if (!$isSystem) {\n $params['by_user_id'] = 'true';\n }\n\n $res = $this->call('users/' . $id . '/events', $params, 'post');\n\n if ($res && isset($res['id'])) {\n return true;\n }\n\n return false;\n }", "public function onOmnipayRequestBeforeSend(Event $event)\n {\n $this->logger->info($this->gateway_name, $event->toArray());\n }", "public static function saved($event) {\n\n\t\t$account = $event->getSubject();\n\t\t$new = $event['new'];\n\n\t}", "public function handleEvent($eventName, array $params);", "public function DoEvent($nEvent) {}", "public function save()\n {\n $data = [\n 'eventKey' => $this->eventKey,\n 'eventType' => $this->getEventType(),\n 'eventAction' => $this->getEventAction(),\n 'eventSubjectID' => $this->getSubjectID(),\n 'eventSubjectData' => trim($this->getSubjectData()),\n 'eventUserID' => ($this->user) ? $this->user->id() : 0,\n 'eventTriggered' => date('Y-m-d H:i:s')\n ];\n\n $PerchAPI = new PerchAPI(1.0, 'redfinch_logger');\n $Events = new RedFinchLogger_Events($PerchAPI);\n\n return $Events->create($data);\n }", "public function __construct($event)\n {\n $this->event = $event;\n }", "public function __construct($event)\n {\n $this->event = $event;\n }", "function collectAction( KalturaStatsEvent $event )\r\n\t{\r\n\t\t$evenLogFullPath = kConf::get ( \"event_log_file_path\" );\r\n\t\t\r\n\t\t// if no file path - do nothing\r\n\t\tif ( ! $evenLogFullPath ) return;\r\n\t\t\r\n\t\t$http_referrer = isset ( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : \"\";\r\n\t\t\r\n\t\t$users_timestamp = $event->eventTimestamp;\r\n\t\t\r\n\t\t$eventLine = \r\n\t\t\t$event->clientVer . self::SEPARATOR \r\n\t\t\t. $event->eventType . self::SEPARATOR\r\n\t\t\t. date ( \"Y-m-d H:i:s\" , time() ) . self::SEPARATOR // use server time\r\n\t\t\t. $event->sessionId . self::SEPARATOR\r\n\t\t\t. $event->partnerId . self::SEPARATOR\r\n\t\t\t. $event->entryId . self::SEPARATOR\r\n\t\t\t. $event->uniqueViewer . self::SEPARATOR\r\n\t\t\t. $event->widgetId . self::SEPARATOR\r\n\t\t\t. $event->uiconfId . self::SEPARATOR\r\n\t\t\t. $event->userId . self::SEPARATOR\r\n\t\t\t. $event->currentPoint . self::SEPARATOR\r\n\t\t\t. $event->duration . self::SEPARATOR\r\n\t\t\t. requestUtils::getRemoteAddress() . self::SEPARATOR\r\n\t\t\t. $event->processDuration . self::SEPARATOR\r\n\t\t\t. $event->controlId . self::SEPARATOR\r\n\t\t\t. $event->seek . self::SEPARATOR\r\n\t\t\t. $event->newPoint . self::SEPARATOR\r\n\t\t\t. ( $event->referrer ? $event->referrer : \"\" )\t. self::SEPARATOR\t// duw to the way flash sends the referrer - allow it to override\r\n\t\t\t. $users_timestamp . self::SEPARATOR\r\n\t\t\t. PHP_EOL \r\n\t\t;\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$res = $this->writeToFile ( $evenLogFullPath , $eventLine);\r\n\t\t\tif ( ! $res )\r\n\t\t\t\tKalturaLog::err( \"Error while trying to write event to log. Event:\\n\". $eventLine );\r\n }\r\n catch ( Exception $ex )\r\n {\r\n \tKalturaLog::err( \"Error while trying to write event to log. Event:\\n\". $eventLine );\t\r\n }\r\n\t\treturn true;\r\n\t}", "public abstract function emitEvent(EventDescriptor $descriptor);", "abstract public function getEventName();", "public function it_stores_events_raised_by_our_jas_app() : void\n {\n $id = '8741e80e-153f-4254-b13e-21ac8ac34948';\n $this->json('POST', '/store-jas-events', [\n 'id' => $id,\n 'name' => 'GameStarted',\n 'date' => 1_503_301_742_819,\n 'payload' => [\n 'game_id' => 'hoi'\n ]\n ])->seeJson([\n 'created' => true\n ]);\n\n $this->seeInDatabase('jas_events', [\n 'uuid' => $id,\n 'name' => 'GameStarted',\n 'date' => 1_503_301_742_819,\n ]);\n }", "public function handle()\n {\n\n $eventIdAsk = $this->option('event_id') ?? $this->ask(\"Enter Event ID?\");\n $event = new ShovelEvent($eventIdAsk);\n $httpResponse = $event->getHttpResponse();\n\n if ($httpResponse !== 200) {\n $this->error(\"HTTP Response: {$httpResponse}.\");\n $this->error(\"URL: {$event->url()}.\");\n $this->error(\"Event ID: {$eventIdAsk} may not exists. Needs manual inspection.\");\n return;\n }\n\n $title = $event->title();\n\n $this->info(\"HTTP Response: {$httpResponse}.\");\n $this->info(\"URL: {$event->url()}.\");\n $this->info(\"Retrieved detail for: {$title}.\");\n\n $result = [\n 'title' => $title,\n 'usabmx_id' => $event->idFromShareLinks(),\n 'usabmx_venue_id' => $event->venueId(),\n 'fee' => $event->fee(),\n 'type' => $event->getTypeFromTitle(),\n 'registration_start_time' => $event->registrationStartTime(),\n 'registration_end_time' => $event->registrationEndTime(),\n\n // National\n 'start_date' => $event->startDate(),\n 'end_date' => $event->endDate(),\n 'flyer_uri' => $event->flyerUri(),\n 'event_schedule_uri' => $event->eventScheduleUri(),\n 'hotel_uri' => $event->hotelUri(),\n ];\n\n $this->info(\"\\nDetail:\");\n foreach ($result as $k => $v) {\n $this->comment(\"{$k}: {$v}\");\n }\n\n $save = $this->option('save') ?: $this->choice(\"Save to disk?\", ['Y','N'], 1);\n\n if ($save === \"N\") {\n $this->info(\"Done.\");\n return;\n }\n\n $filename = str_slug(\"{$eventIdAsk} {$title}\");\n $filepath = \"public/events/detail/{$filename}.json\";\n $saved = Storage::disk('local')->put($filepath, json_encode($result));\n\n if ($saved === false) {\n $this->error(\"Failed to save: {$filepath}.\");\n return false;\n }\n\n $this->info(\"Saved: {$filepath}.\");\n return true;\n }", "public function send()\n {\n // Stream post the data\n $this->evaluateResponse($this->httpPost($this->str_endpoint . '/event', $this->compile()));\n }", "public function emit($event, $parameters);", "public function hitStat($event_type_key, $date_occurred = NULL, $event_amount = NULL, $track_key = NULL, $space_key = NULL)\n\t{\n\t\tif (!$track_key) $track_key = $this->track_key;\n\t\tif (!$space_key) $space_key = $this->space_key;\n\t\t\n\t\t$this->statpro->recordEvent($track_key, $space_key, $event_type_key, $date_occurred, $event_amount);\n\t}", "public function getEventType(): string;", "public function sendFacebookAppEvent()\n {\n $this->initializeFacebookEvent();\n $eventFields = array(\n 'event' => urlencode('CUSTOM_APP_EVENTS'),\n 'access_token' => urlencode($this->fbAccessToken),\n 'application_tracking_enabled' => 1,\n 'advertiser_tracking_enabled' => 1,\n //\"advertiser_id=1383-6676-5853-8751\", \n 'custom_events' => '['.json_encode($this->customEventsFields).']'\n );\n $this->attemptToSendFacebookAppEvent($eventFields);\n }", "public function track($id) {\n $data = array(\n \"status\" => \"tracked\"\n );\n $this->db->where(\"id\", $id);\n $this->db->update(\"violations\", $data);\n }", "public function publish($event, $bus);", "private function api_record_event( $event_name, $properties = array(), $identity = null ) {\n\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// identify user first\n\t\t$this->set_named_identity( $identity );\n\n\t\t// remove blank properties\n\t\tif( isset( $properties[''] ) ) {\n\t\t\tunset( $properties[''] );\n\t\t}\n\n\t\t// record the event\n\t\t$this->get_api()->record( $event_name, $properties );\n\t}", "public function event(DomainEvent $event);", "function record_incident($tag,$email,$message){\n $query = \"INSERT INTO HISTORY (TIME,TAG,EMAIL,MESSAGE) VALUES (\" . time() . \",'\" . $tag . \"','\" . $email . \"','\" . $message . \"')\" ; \n if(!$this->query($query)) return false;\n return true;\t \n }", "protected function _write($event)\n {\n $this->logs[] = $event;\n }", "public function getEvent();", "public function construct(CakeEvent $event) {\n\t\t$this->__startTime = time();\n\t}", "private function tweet($event) {\n\n $city = City::where('id','=',$event->city_id)->first();\n $title = $event->title;\n $date = date('d/m/y', strtotime($event->time_start));\n $time = date('g.ia', strtotime($event->time_start));\n $venue = explode(\",\", $event->venue)[0];\n $link = route('{city}.events.show', ['city' => $city->iata, 'slug' => $event->slug]);\n $status = $title . ' - ' . $date . ' - '. $time .' at '. $venue . '. ' . $link;\n\n Twitter::reconfig([\n 'consumer_key' => $city->twitter_consumer_key,\n 'consumer_secret' => $city->twitter_consumer_secret,\n 'token' => $city->twitter_access_token,\n 'secret' => $city->twitter_access_token_secret\n ]);\n\n Twitter::postTweet(array('status' => $status, 'format' => 'json'));\n Log::info($status);\n }", "function logEvent($message)\n\t{\n\t\tdate_default_timezone_set ( \"America/Chicago\" );\n\t\t$time = date( \"Y-m-d H:i:s\");\n\t\t$fp = fopen('files/log.txt', 'a');\n\t\tfwrite($fp, $time.\"-- \");\n\t\tfwrite($fp, $message);\n\t\tfwrite($fp, \"\\n\");\n\t\tfclose($fp);\n\t}", "public function track($loginUserId, $eventKey, $properties)\n {\n $event = new CustomEvent();\n $event->eventTime($this->currentMillisecond());\n $event->eventKey($eventKey);\n $event->loginUserId($loginUserId);\n $event->eventProperties($properties);\n $this->_consumer->consume($event);\n }", "function Core_PostEvent( $eventName, &$object = null, $info = array() )\n{\n\t$notification = new Event_Notification($object, $eventName, $info);\n\tCore_ModuleManager::getInstance()->dispatcher->postNotification( $notification, true, false );\n}", "function on_start(){\n //$userID = $u->getUserID();\n \n //print \"runnin\";\n //$cartEventClassName = 'ScottcAffiliateRelation';\n //$cartEventClassPath = 'packages/scottc_affiliates/libraries/affiliate_relation.php';\n $eventClassName = 'AffiliateGateway';\n $eventClassPath = 'packages/affiliate_gateway/libraries/affiliate_gateway.php';\n \n define(\"ENABLE_APPLICATION_EVENTS\", true);\n \n Events::extend('on_start', $eventClassName, 'eventOnStart', $eventClassPath, $_GET);\n //Events::extend('on_page_view', 'AffiliateGateway', 'eventOnStart', 'packages/affiliate_gateway/libraries/affiliate_gateway.php');\n \n // if($_GET){\n // Loader::library('affiliate_relation',SCOTTECOMAFFILATESPACKAGEHANDLE);\n // $har = new ScottcAffiliateRelation($_GET);\n // }\n }" ]
[ "0.63427", "0.6148601", "0.5968593", "0.5944442", "0.5856823", "0.5728856", "0.5685747", "0.5578267", "0.55767316", "0.5522375", "0.55001205", "0.54672366", "0.5443277", "0.54281765", "0.54256284", "0.5420515", "0.53927517", "0.53385603", "0.53385603", "0.5315379", "0.5307801", "0.5298457", "0.52909356", "0.52853936", "0.5277199", "0.52767956", "0.52583927", "0.52525455", "0.52343535", "0.5228823", "0.5208631", "0.5206704", "0.5205372", "0.5179033", "0.5172268", "0.51710904", "0.51687366", "0.5166208", "0.51495034", "0.51490164", "0.51465905", "0.5118676", "0.51161605", "0.50976133", "0.50856215", "0.5084247", "0.5078245", "0.5076943", "0.50744003", "0.50736105", "0.5070358", "0.50669473", "0.5058155", "0.50560975", "0.5047811", "0.50475776", "0.5043599", "0.50420743", "0.5037193", "0.50170517", "0.50029373", "0.49943027", "0.49770606", "0.4970143", "0.49667826", "0.4964358", "0.49638975", "0.49624655", "0.4960056", "0.49575207", "0.49508253", "0.4950513", "0.49464944", "0.4941171", "0.49348548", "0.49346796", "0.49346796", "0.49252564", "0.49220258", "0.492028", "0.4917535", "0.4897605", "0.48952955", "0.48934227", "0.489312", "0.48919716", "0.4886621", "0.48838493", "0.48816326", "0.48766857", "0.4871804", "0.4871067", "0.48685998", "0.48685458", "0.48642856", "0.48534632", "0.4848469", "0.4847841", "0.48470333", "0.48440188" ]
0.682682
0
Check user has opted in to tracking.
function is_user_opted_in( ?WP_User $user = null ) : ?bool { if ( ! $user ) { $user = wp_get_current_user(); } if ( ! $user->exists() ) { return null; } $did_opt_in = get_user_meta( $user->ID, META_OPT_IN, true ); if ( $did_opt_in === '' ) { return null; } return intval( $did_opt_in ) === 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function track_clicks_allowed_by_user(){\n if (!$this->get_config('track_visits_of_loggedin_users',true) && serendipity_userLoggedIn()){\n return false;\n }\n return true;\n }", "public function canManageTracking();", "public function isTrackingAllowed() {\n\t $data = Mage::getStoreConfig('rublon_allow_tracking');\n\t \t\t\n\t return !empty($data)?true:false;\n\t}", "public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "public static function maybe_track_usage() {\n\n\t\t/** checking optin state */\n\t\tif ( 'yes' == self::get_optIn_state() ) {\n\t\t\t$data = self::collect_data();\n\n\t\t\t//posting data to api\n\t\t\tXL_API::post_tracking_data( $data );\n\t\t}\n\t}", "static function isTrackable()\n {\n if(!Auth::check())\n return true;\n $user = Auth::User();\n if(stristr($user->type, 'Employee') || stristr($user->type, 'Demo'))\n return false;\n return true;\n }", "public function is_tracking_enabled()\n {\n }", "static function allowShowingProfile($agentoptin)\n\t{\n global $configClass;\n if($configClass['show_agent_details'] == 1)\n\t\t{\n if($configClass['use_privacy_policy'] == 1) \n\t\t\t{\n if ($configClass['allow_user_profile_optin'] && $agentoptin == 0) \n\t\t\t\t{\n return true;\n }\n\t\t\t\telse\n\t\t\t\t{\n return false;\n }\n }\n\t\t\telse\n\t\t\t{\n return true;\n }\n }\n return false;\n }", "function IsGoogleAnalytics() {\n\t\t// SiteConfig::current_site_config()->googleAnalytics;\n\t\treturn Member::currentUserID() ? 0 : 1;\n\t}", "public function isTrackingAvailable()\n {\n return true;\n }", "public function isTrackingAvailable()\n {\n return false;\n }", "function handle_opt_in_form() {\n\tif ( isset( $_POST['altis_telemetry_opt_in'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( true );\n\t}\n\tif ( isset( $_POST['altis_telemetry_opt_out'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( false );\n\t}\n}", "public function is_google_user_logged_in(){\n\t\treturn $this->session->userdata('current_google_user_id') != FALSE;\n\t}", "static function allowShowingProfileInListing($agentoptin){\n global $configClass;\n if($configClass['listing_show_agent'] == 1){\n if($configClass['use_privacy_policy']) {\n if ($configClass['allow_user_profile_optin'] && $agentoptin == 0) {\n return true;\n }else{\n return false;\n }\n }else{\n return true;\n }\n }\n return false;\n }", "public static function maybe_push_optin_notice() {\n\t\tif ( self::get_optIn_state() == false && apply_filters( 'xl_optin_notif_show', self::$should_show_optin ) ) {\n\t\t\tdo_action( 'maybe_push_optin_notice_state_action' );\n\t\t}\n\t}", "function opt_in( bool $did_opt_in, ?WP_User $user = null ) {\n\t$user = $user ?? wp_get_current_user();\n\tupdate_user_meta( $user->ID, META_OPT_IN, $did_opt_in ? 1 : 0 );\n\n\t// Alias previously unknown user if they opted in.\n\tif ( $did_opt_in ) {\n\t\tif ( ! initialize() ) {\n\t\t\treturn;\n\t\t}\n\t\tSegment::alias( [\n\t\t\t'userId' => get_id(),\n\t\t\t'previousId' => get_anonymous_id(),\n\t\t] );\n\t}\n}", "public function isActive() \n {\t\n \t// if PIWIK tracking is activated return TRUE\n \tif (Mage::getStoreConfig('piwik/piwik/active')) {\n \t\treturn true;\n \t}\n \t// return FALSE otherwise\n \treturn false;\n }", "public static function optin_track_usage() {\n\n\t\t/** update week day for tracking */\n\t\t$track_week_day = date( 'w' );\n\t\tupdate_option( 'xl_track_day', $track_week_day, false );\n\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "public static function isGgoogleAnalyticConfigured()\n {\n return (bool) config('analytics.view_id');\n }", "private function disable_tracking() {\n\n\t\t// don't disable tracking on AJAX requests\n\t\tif ( is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// disable tracking if admin, shop manager, or API key is blank\n\t\tif ( is_admin() || current_user_can( 'manage_options' ) || ( ! $this->api_key ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkOptIn(Checkout $event)\n {\n // Ignore steps that are not cart, address or payment.\n switch ($event->getStepKey()) {\n case 'cart':\n case 'address':\n case 'payment':\n $data = $event->getDataKey('mailchimp_opt_in');\n if ($data === 'on') {\n $order = $event->getOrder();\n $order->setProperty('mailchimp_opt_in', true);\n $order->save();\n }\n }\n }", "public function has_tracking() {\n\t\t\treturn $this->hastracking == 'Y' ? true : false;\n\t\t}", "public function isAuthorize(){\n $userPlan = $this->request->session()->get('userPlan');\n return ($userPlan >= 1)? true : abort(404) ;\n }", "public function autoTrack() {\n\t\tif (\n\t\t\tin_array( 'googleAnalytics', aioseo()->internalOptions->internal->deprecatedOptions, true ) &&\n\t\t\t! aioseo()->options->deprecated->webmasterTools->googleAnalytics->id\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! aioseo()->options->deprecated->webmasterTools->googleAnalytics->advanced ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\taioseo()->options->deprecated->webmasterTools->googleAnalytics->trackOutboundLinks\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function is_surveillant() {\n return $this->session->get(\"niveau_acces\") >= 1;\n }", "public function optIn() {\n return !empty($this->args['send_optin']);\n }", "public function isLoged()\n\t{\t\n\t\treturn $this->session->userdata('assistant_id');\n\t}", "public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function ingelogd() {\n\t\t\treturn $this->bLoggedIn;\n\t\t}", "public static function checkVisitor() {\n $request = app('request');\n $showMessage = TRUE;\n if (isset($_COOKIE['alchemy_visited']) && $_COOKIE['alchemy_visited'] != null)\n {\n $showMessage = FALSE;\n } else {\n self::updateVisitorCookie();\n }\n return $showMessage;\n \n }", "public function getAdTrackingEnabled();", "public function UserIsSignedInOrRecirectToSignIn() {\n\t\t\n\t\tif(!isset($_SESSION['accountUser'])) { \n\t\t\trequire(TP_PAGESPATH . '/pages_login/PLogin.php');\n\t\t}\n\t}", "public function isLogined()\n {\n return isset($_SESSION['userLogin']);\n }", "function is_user_option_local($key, $user_id = 0, $blog_id = 0)\n {\n }", "function customerIsLogedIn() {\n\t\treturn isset($_SESSION) && isset($_SESSION[\"webuser\"]) && isset($_SESSION[\"webuser\"][\"ID\"]);\n\t}", "private function isOnboardedWithAccountAndGoogle()\n {\n if (false === (new PsAccountsService())->getShopUuidV4() &&\n false === $this->configurationRepository->getGoogleLinkedValue()\n ) {\n return false;\n }\n\n return true;\n }", "public function checkOnAccess() : bool\r\n {\r\n if (empty($this->gates)){\r\n return true;\r\n }\r\n\r\n foreach ($this->gates as $gate) {\r\n\r\n if(Gate::allows($gate)){\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function vote_active() { \n\n\t\t/* Going to do a little more here later */\n\t\tif ($this->type == 'vote') { return true; } \n\n\t\treturn false;\n\n\t}", "public function isSignupChecked()\n {\n $v = Mage::helper('budgetmailer/config')->getAdvancedCreateAccount();\n \n return \n Professio_BudgetMailer_Model_Config_Source_Account::HIDDENCHECKED\n == $v\n || Professio_BudgetMailer_Model_Config_Source_Account::CHECKED\n == $v;\n }", "private function isSingIn()\n\t{\n\t\tif ($this->session->isLoggon && $this->session->isAdmin) {\n\t\t\treturn true;\n\t\t}\n\t\tredirect('service/sign-out', 'refresh');\n\t}", "public function checkSignedIn() {\n\t if (!empty($this->user) && $this->user !== 'anon.') {\n\t $this->addAlias($this->getIdentifier(), $this->user);\n\t }\n\t}", "public function userActive(){\n\t\treturn (isset($this->session) && $this->session != null && isset($this->session['id']) && $this->session['id'] > 0) ? true : false;\n\t}", "function google_login_allow_sign_on_with_google()\n{\n\n \n\treturn elgg_get_plugin_setting('sign_on', 'google_login') == 'yes';\n}", "public function isSelected()\n {\n /* @var $session Dhl_Intraship_Model_Session */\n $session = Mage::getSingleton('intraship/session');\n return (\n true === $session->hasData('is_gogreen') &&\n 1 === (int) $session->getData('is_gogreen')\n );\n }", "public function isAuth() {\n $connector = Mage::getSingleton('vidtest/connector')->getApiModel($this->getApiModelCode());\n return $connector->isLoggedIn();\n }", "public function is_active( $curr ){\n\t\t$bypass_list = self::get_option( 'bypass_list', array() );\n\t\treturn ! in_array( $curr, $bypass_list );\n\t}", "public static function isActivated ()\r\n {\r\n return Session::exists('acl');\r\n }", "public function hasIsCheckIn(){\n return $this->_has(3);\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 hasUserConnected() {\n $accessToken = get_option(self::ACCESS_TOKEN_OPTION_NAME);\n\n return !empty($accessToken);\n }", "public function userIsExcluded() {\n\t\t// Check whether we should exclude tracking for specific user roles.\n\t\t$excludeUsers = aioseo()->options->deprecated->webmasterTools->googleAnalytics->excludeUsers;\n\t\tif (\n\t\t\taioseo()->options->deprecated->webmasterTools->googleAnalytics->advanced &&\n\t\t\t! empty( $excludeUsers ) &&\n\t\t\tis_user_logged_in()\n\t\t) {\n\t\t\t$currentUser = wp_get_current_user();\n\t\t\tif ( ! empty( $currentUser ) ) {\n\t\t\t\t$intersect = array_intersect( $excludeUsers, $currentUser->roles );\n\t\t\t\tif ( ! empty( $intersect ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasUserConnected() {\n $accessTokenIG = get_option( self::INSTAGRAM_TOKEN_LONG_LIVED_TIME );\n $accessTokenFB = get_option( self::FACEBOOK_TOKEN );\n\n return ! empty( $accessTokenIG ) || ! empty( $accessTokenFB );\n }", "public function tracking() {\n\n\t\t// Return if user is logged in\n\t\tif ( is_user_logged_in() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Display tracking code\n\t\tif ( $tracking = get_theme_mod( 'tracking' ) ) {\n\t\t\techo $tracking;\n\t\t}\n\n\t}", "public function isTrackingNotification()\n {\n return (1 == $this->getConfig('notification/tracking_notification'));\n }", "static function filter_has_tracker_id()\n\t{\n\n\t\tif ( ! jumplead_is_tracker_id_valid() ) {\n\t\t\twp_redirect( admin_url( 'admin.php?page=jumplead_settings' ) );\n\t\t\texit;\n\t\t}\n\t}", "function handle_profile_form( int $user_id ) {\n\tif ( ! check_admin_referer( 'update-user_' . $user_id ) ) {\n\t\treturn;\n\t}\n\n\tif ( isset( $_POST['altis_telemetry_opt_in_toggle'] ) ) {\n\t\topt_in( true );\n\t} else {\n\t\topt_in( false );\n\t}\n}", "private function isSingIn()\n {\n if ($this->session->isLoggon && $this->session->isAdmin) {\n return true;\n }\n redirect('logout', 'refresh');\n }", "public function authorize()\n {\n $user = Auth::user();\n $vendor = $user->vendor->first();\n $isOwner = AvailableFacility::where(array(\n 'id' => $this->id,\n 'vendor_id' => $vendor->id\n ))->count();\n if ($isOwner) {\n return true;\n } else {\n return false;\n }\n }", "public function isReported()\n\t{\n\t\tif ($this->get('state') == self::APP_STATE_FLAGGED)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function can_activate(): bool;", "private function isViewed() {\n $viewKey = $this->getViewKey();\n\n if ( Auth::check() ) {\n $viewed = Cache::get($viewKey.':user:'.Auth::user()->id);\n return !empty($viewed);\n } else {\n $time = session($viewKey);\n if ( !empty($time) ) {\n $viewed = (time() - $time) < config('counter.viewCountDuration') * 60;\n } else {\n $viewed = false;\n }\n return $viewed;\n }\n }", "function is_current_parcours_completed($id_user , $id_episode , $id_parcours) {\n\n\t$completed = false;\n\n\tglobal $wpdb;\n\n\t$episodes = get_field('episodes' , $id_parcours); \n\t$episodes_number = count($episodes); \n\n\t$rowcount = $wpdb->get_var(\"SELECT COUNT(*) FROM tracking WHERE id_user = $id_user AND id_parcours = $id_parcours\");\n\n\tif($rowcount == $episodes_number) $completed = true;\n\n\treturn $completed;\n\n}", "public static function isEnabled()\n {\n $app_model = new waAppSettingsModel();\n $is_enabled = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID . '-profile');\n $profile_cookie = $app_model->get(array('shop', self::PLUGIN_ID), self::PLUGIN_ID_SHORT . '-profile-cookie');\n $cookie_enabled = $profile_cookie && waRequest::cookie($profile_cookie, '');\n return $is_enabled && $cookie_enabled;\n }", "function dialogue_can_track_dialogue($user = false) {\n global $USER, $CFG;\n\n // return unless enabled at site level\n if (empty($CFG->dialogue_trackreadentries)) {\n return false;\n }\n\n // default to logged if no user passed as param\n if ($user === false) {\n $user = $USER;\n }\n\n // dont allow guests to track\n if (isguestuser($user) or empty($user->id)) {\n return false;\n }\n\n // finally if user has trackForums set then allow tracking\n return true && ! empty($user->trackforums);\n}", "function user_verify(){\n \n $verify = false;\n \n if( isset($_SESSION['user_id']) ){\n \n if( isset($_SESSION['user_ip']) && $_SERVER['REMOTE_ADDR'] == $_SESSION['user_ip'] ){\n \n if( isset($_SESSION['user_agent']) && $_SERVER['HTTP_USER_AGENT'] == $_SESSION['user_agent'] ){\n \n $verify = true;\n\n }\n \n }\n \n }\n \n return $verify;\n \n }", "private function runTracking()\n {\n //Ignore if no request, import fixtures.\n if (!$this->request) {\n return false;\n }\n\n // Check if enable\n if (!$this->getConfigValue('log_enabled', 'bool')) {\n return false;\n }\n\n // We never log tracking service calls\n $excludeUrls = $this->getConfigValue('exclude_urls', 'array');\n if ($excludeUrls) {\n $currentUrl = $this->request->getRequestUri();\n foreach ($excludeUrls as $url) {\n if (substr($currentUrl, 0, strlen($url)) == $url) {\n return false;\n }\n }\n }\n\n return true;\n }", "function check_user_has_data_access($survey_id,$user_id)\n\t{\n\t\t$requests=$this->get_user_study_n_collection_requests($survey_id,$user_id);\n\t\t\t\n\t\t\tforeach($requests as $request)\n\t\t\t{\n\t\t\t\tif ($request['status']=='APPROVED')\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\treturn FALSE;\n\t}", "public function authorize()\n {\n return (Auth::user()->type === User::VENDEDOR);\n }", "function have_profile(){\n\treturn ( get_profile('enabled') === true && get_profile() !== -1 );\n}", "function acquiropay_gateway_check_enabled( $gateways ) {\n\n\t\t$this->log( 'Check payment option' );\n\n\t\t// Check if current user have debugging cookie\n\t\t$hiding_cookie_value = \"\";\n\t\tif( strlen( $this->hiding_cookie_rule ) ) {\n\t\t\t$hiding_cookie_value = isset( $_COOKIE[$this->hiding_cookie_rule] ) ? \n\t\t\t\t$_COOKIE[$this->hiding_cookie_rule] : \"\";\n\t\t}\n\n\t\t// Hide payment option for all users without debugging cookie\n\t\tif( $this->hiding_by_cookie_enabled == 'yes' ) {\n\t\t\tif( strlen( $hiding_cookie_value ) ) {\n\t\t\t}\n\t\t\telse {\t\t\t\t\t\n\t\t\t\t$this->log( 'Payment option HIDDEN' );\n\t\t\t\tunset( $gateways[$this->id] );\n\t\t\t}\n\t\t}\n\n\t\treturn $gateways;\n\t}", "public function logged_in()\n\t{\n\t\treturn $this->_me != NULL;\n\t}", "public function hasPostAuthentication()\n {\n return isset($this->sessionStorage->user['twofactor_activated']) && $this->sessionStorage->user['twofactor_activated'] === true;\n }", "public function authorize()\n {\n $status = request()->post('status');\n if (!empty($status) && !in_array($status, [\n LoanApplicationService::PENDING_STATUS, LoanApplicationService::APPOVED_STATUS, LoanApplicationService::REJECTED_STATUS])) {\n return false;\n }\n return true;\n }", "function isAuthed ()\r\n\t{\r\n\t\tif ((strlen($this->acUserAuth) > 0 ? $this->acUserAuth : 0) >= $this->acPageAuth)\r\n\t\t{\r\n\t\t\t$status = true;\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$status = false;\r\n\t\t}\r\n\t\treturn $status;\r\n\t}", "function last_visited_enabled() {\n\treturn !( OFF == config_get( 'recently_visited' ) || current_user_is_anonymous() );\n}", "public function is_current_requested() {\n\t\treturn $this->is_interstitial_requested( $this->get_current_interstitial() );\n\t}", "public function getGoogleAnalyticsEnabled()\n\t{\n\t\treturn $this->google_analytics_enabled;\n\t}", "protected function should_send_tracking( $current_time ) {\n\t\t$last_time = get_option( $this->option_name );\n\n\t\t// When there is no data being set.\n\t\tif ( ! $last_time ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $this->exceeds_treshhold( $current_time - $last_time );\n\t}", "public function is_inspector()\n {\n $session = $this->session->userdata('user');\n if($session)\n {\n if($session['role'] == 'INSPECTOR')\n {\n if(date('H') > 7 AND date('H') < 14)\n {\n $access = FALSE;\n }\n else\n {\n $access = TRUE;\n }\n\n $session['timeAccess'] = $access;\n $this->session->set_userdata($session);\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n return FALSE;\n $this->log_out();\n }\n }", "public function onTrial() : bool\n {\n return (bool) $this->is_freetrial;\n }", "function it_exchange_abandoned_carts_is_active_shopper() {\n\t// We do not start tracking until they log in\n\tif ( ! it_exchange_get_current_customer() )\n\t\treturn false;\n\n\t// We do not start tracking until they have an item in their cart\n\t$cart_products = it_exchange_get_cart_products();\n\tif ( count( $cart_products ) < 1 )\n\t\treturn false;\n\n\t// If user is logged in and has an item in their cart, this is an active shopper\n\treturn true;\n}", "function check_user_analytics_exist( $post ) {\n\n $form_id = get_post_meta( $post->ID, '_wpuf_form_id', true );\n $user_analytics_info = get_post_meta( $post->ID, 'user_analytics_info', true );\n\n if ( empty( $form_id ) && empty( $user_analytics_info ) ) {\n return false;\n }\n\n return true;\n }", "public function checkAuth()\n {\n return $this->api->check('GP', session('nxs_gp.username'));\n }", "public function authorize()\n {\n // todo: dominion selected, selected dominion in active round?\n return Auth::check();\n }", "public function authorize()\n {\n $id = $this->route('auction_house');\n $user = \\Auth::user();\n $auctionHouse = \\App\\AuctionHouse::findOrFail($id);\n\n return $user\n && $auctionHouse->user_id !== $user->id;\n }", "public function authorize()\n\t{\n\t\t$expenses = $this->input('expense_ids');\n\t\tif($expenses != null && count($expenses) > 0) {\n\t\t\t$reportId = Expense::find($expenses[0])->report_id;\n\t\t\t$report = ExpenseReport::find($reportId);\n\t\t\tif($report->status) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static function should_show_profiler() {\n\t\t/* phpcs:disable WordPress.Security.NonceVerification */\n\t\t$is_current_page = isset( $_GET['page'] ) &&\n\t\t\t'wc-admin' === $_GET['page'] &&\n\t\t\tisset( $_GET['path'] ) &&\n\t\t\t'/setup-wizard' === $_GET['path'];\n\t\t/* phpcs: enable */\n\n\t\tif ( $is_current_page ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$onboarding_data = get_option( self::PROFILE_DATA_OPTION, array() );\n\n\t\t$is_completed = isset( $onboarding_data['completed'] ) && true === $onboarding_data['completed'];\n\t\t$is_skipped = isset( $onboarding_data['skipped'] ) && true === $onboarding_data['skipped'];\n\n\t\t// @todo When merging to WooCommerce Core, we should set the `completed` flag to true during the upgrade progress.\n\t\t// https://github.com/woocommerce/woocommerce-admin/pull/2300#discussion_r287237498.\n\t\treturn ! $is_completed && ! $is_skipped;\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 }", "private function checkAuth()\n {\n $this->isAuthenticated = false;\n $isLoggedIn = is_user_logged_in();\n\n if ($isLoggedIn) {\n $this->username = wp_get_current_user()->user_login;\n $id = wp_get_current_user()->ID;\n $meta = get_user_meta($id, 'wp_capabilities', false);\n foreach ($meta[0] as $key => $value) {\n $k = strtoupper($key);\n if (($k == $this->PluginRole) or\n ($k == $this->AdminRole)) {\n $this->isAuthenticated = true;\n }\n }\n }\n }", "public function is_double_optin()\n {\n $optin_campaign_id = absint($this->extras['optin_campaign_id']);\n\n $setting = $this->get_integration_data('SendinblueConnect_enable_double_optin');\n\n return apply_filters('mo_connections_sendinblue_is_double_optin', $setting === true, $optin_campaign_id);\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 authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "private function setViewed(){\n if ( !$this->isViewed() ){\n $viewKey = $this->getViewKey();\n\n if ( Auth::check() ){ //user had login, record user action\n Cache::put($viewKey.':user:'.Auth::user()->id, time(), Config::get('counter.viewCountDuration'));\n $this->recordUser('view');\n } else { //guest. use session\n session([$viewKey=>time()]);\n }\n\n return true;\n }\n\n return false;\n }", "public function is_signed_in(){\n \n return $this->signed_in; \n }", "public function is_enabled_global() {\n\t\t$enabled = get_option( 'rg_gforms_enable_akismet' );\n\n\t\treturn $enabled === false ? true : $enabled === '1';\n\t}", "public function is_logged_in()\n {\n return isset($this->user);\n }", "public function isInvoiced() {\n\t\treturn true;\n\t}", "public function isShowActivator() {\n\t\t$cache = WP_Helper::getCache();\n\t\tif ( $cache->get( 'wdf_isActivated', false ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\tif ( get_site_transient( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif ( get_site_option( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$keys = [\n\t\t\t'wp_defender',\n\t\t\t'wd_scan_settings',\n\t\t\t'wd_hardener_settings',\n\t\t\t'wd_audit_settings',\n\t\t\t'wd_2auth_settings',\n\t\t\t'wd_masking_login_settings'\n\t\t];\n\t\tforeach ( $keys as $key ) {\n\t\t\t$option = get_site_option( $key );\n\t\t\tif ( is_array( $option ) ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}", "function is_active()\n {\n return $this->userData[$this->user_active];\n }" ]
[ "0.682192", "0.6804307", "0.6787952", "0.66602725", "0.6555752", "0.6413919", "0.6180687", "0.6172894", "0.6157108", "0.6113443", "0.60877657", "0.6081415", "0.5957942", "0.59385", "0.5897497", "0.5891258", "0.58445394", "0.5812008", "0.57971454", "0.5794397", "0.5784385", "0.5783022", "0.5756669", "0.5747429", "0.5717288", "0.5694779", "0.5667324", "0.56435555", "0.56389546", "0.56291157", "0.5622825", "0.5602231", "0.5589025", "0.5582294", "0.55790347", "0.55769235", "0.55709016", "0.55534804", "0.554794", "0.55453426", "0.5523799", "0.5523161", "0.55223376", "0.5518649", "0.54918474", "0.5472136", "0.5462676", "0.5458942", "0.5458647", "0.5443962", "0.5443696", "0.54319793", "0.54311025", "0.54290736", "0.54106206", "0.5407625", "0.5407022", "0.54005194", "0.5392557", "0.53836006", "0.5372728", "0.5368905", "0.536486", "0.53639835", "0.5355858", "0.53553516", "0.5354734", "0.53497815", "0.5342893", "0.53391075", "0.5337195", "0.53338003", "0.53290176", "0.5324895", "0.53216", "0.5317504", "0.53145933", "0.53071994", "0.52962077", "0.5290549", "0.5289641", "0.52887595", "0.52789235", "0.5277775", "0.52749705", "0.5272875", "0.5271162", "0.52682424", "0.52682424", "0.52614635", "0.5258063", "0.52442145", "0.52437645", "0.5238358", "0.523747", "0.5236327", "0.5236212", "0.52359146", "0.5235852", "0.5233957" ]
0.5652171
27
Return an automatic, pseudoanonymous ID for the current user.
function get_anonymous_id() : string { $current_user = wp_get_current_user(); return substr( sha1( $current_user->ID . $current_user->user_registered ), 0, 8 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAnonymousId();", "public function getAnonymousUserId()\n {\n return $this->auser_id;\n }", "public function getAnonymousId()\n {\n return $this->anonymousId;\n }", "public function getAnonymousId()\n {\n if (is_null($this->anonymousId)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_ANONYMOUS_ID);\n if (is_null($data)) {\n return null;\n }\n $this->anonymousId = (string) $data;\n }\n\n return $this->anonymousId;\n }", "public static function UserID()\n\t\t{\n\t\treturn sprintf\n\t\t\t(\n\t\t\t'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff)\n\t\t\t);\n\t\t}", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "public function uniqueId(): string\n {\n return strval($this->user->id);\n }", "function get_id() : string {\n\t$current_user = wp_get_current_user();\n\treturn sha1( $current_user->user_email );\n}", "public function get_user_id();", "function get_current_user_id()\n {\n }", "protected function getSimulatingUserId()\n {\n return session(static::SIMULATING_USER_PROFILE_ID);\n }", "public function getCurrentUserId();", "private function getuserid() {\n\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n }\n return $user_id;\n }", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "Public Function UserId() {\n\t\treturn $this->userId;\n\t\n\t}", "protected static function getCurrentUserId()\n {\n return null;\n }", "public function id() {\n return isset($this->_adaptee->user_info['user_id']) ? $this->_adaptee->user_info['user_id'] : null;\n }", "protected function getCurrentUserId()\n\t{\n\t\treturn get_current_user_id();\n\t}", "protected function get_user_id() {\n session_start();\n \n return session_id();\n }", "private static function getIdNewbieUser() {\n $result = mysqli_query(Connection::getConnection(), \"Select auto_increment from \n information_schema.tables where table_name = 'users' and table_schema = 'backend'\");\n return (int) mysqli_fetch_assoc($result)[\"auto_increment\"];\n }", "function identifier()\n\t{\n\t\t$identifier = $this->CI->session->userdata(AUTH_USER_IDENTIFIER);\n\t\tif ($identifier)\n\t\t{\n\t\t\treturn $identifier;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception (\"User identifier referenced, but not initialised. Perhaps the user is not logged in?\");\n\t\t}\n\t}", "function get_user_id(){\n\t\t// get the current user details\n\t\t$cookie_id = $this->decrypt($_COOKIE['CakeCookie']['PDCAUSER']);\t\t\n\t\treturn $cookie_id;\n\t}", "public function getUserID() {\n\t\tif (is_numeric($this->user_id)) {\n\t\t\treturn $this->user_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public static function GetCurrentUserId() {\n try {\n $token = Helper::GetCookies('token');\n $now = new \\DateTime(date('Y-m-d H:i:s'));\n if(!isset($token) || $token == '' || $token == null) {\n return 0;\n }\n else {\n $userDB = DB::table('users')\n ->where('token', $token)\n ->where('timeout', '>=', $now)\n ->where('deleted_at', null)\n ->select('id')\n ->get()->toArray();\n if (isset($userDB) && !empty($userDB)) {\n return $userDB[0]->id;\n }\n }\n return 0;\n }\n catch(Exception $e) {\n throw $e;\n }\n }", "function getUserId(){\n\t//replace with actual\n\treturn '123';\n}", "function labdevs_get_user_current_id()\n{\n global $current_user;\n get_currentuserinfo();\n return $current_user->ID;\n}", "function current_user_id()\n{\n $user = \\Yii::$app->user;\n $user_id = $user->getId();\n return is_numeric($user_id) ? $user_id : 0;\n}", "public function get_user_id()\n\t{\n\t\treturn false;\n\t}", "public function getAuthIdentifier()\n {\n return (string) $this->user['id'];\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserIdentifier(): string\n {\n return ($this->token ?? ($this->appkey ?? ''));\n }", "function anon_nick() {\n isset($this->_anon_nick) || $this->_load_from_session();\n return $this->_anon_nick;\n }", "public static function getCurrentUserId()\n {\n $profile = self::getProfile();\n\n return $profile ? $profile->getProfileId() : 0;\n }", "public function id()\n {\n if ($this->user()) {\n return $this->user()->getAuthIdentifier();\n }\n return null;\n }", "public static function resolveId()\n {\n return Auth::check() ? Auth::user()->getAuthIdentifier() : null;\n }", "public function getUserId()\n {\n \treturn $this->getCurrentUserid();\n }", "public function user_id()\n {\n if($this->logged_in())\n {\n $this->uid = $this->fb->getUser();\n\n return $this->uid;\n } \n else \n {\n return FALSE;\n }\n }", "public function getAuthIdentifier() {\n return $this->id_user;\n }", "function user_id() {\n isset($this->_user_id) || $this->_load_from_session();\n return $this->_user_id;\n }", "public function get_id_user()\n {\n return (isset($this->_id_user)) ? $this->_id_user : null;\n }", "static public function get_user_id()\n\t{\n\t\tif (isset($_SESSION[self::$cookie_name_prefix .self::USER_ID]))\n\t\t\treturn $_SESSION[self::$cookie_name_prefix .self::USER_ID];\n\t\telse\n\t\t\treturn null;\n\t}", "public function getID() {\n return $this->user_id;\n }", "function getUserID(){\n\n\tif( isset($_SESSION['uid'])){\t\n\t\t$id = $_SESSION['uid'];\n\t}else{\n\t\t$id = \"Unregistered\";\n\t}\n\n\treturn $id;\n}", "public function getUserID () {\n return $this->id;\n }", "public function get_user_id()\n {\n return self::getUser();\n }", "public static function generate_guest_id() {\n\t\t$id = self::get_guest_id();\n\t\tif ( ! $id ) {\n\t\t\t$id = time();\n\t\t\tif ( ! is_user_logged_in() ) {\n\t\t\t\tlearn_press_setcookie( 'learn_press_user_guest_id', $id, time() + self::$_guest_transient );\n\t\t\t\tset_transient( 'learn_press_user_guest_' . $id, $id, self::$_guest_transient );\n\t\t\t}\n\t\t}\n\n\t\treturn $id;\n\t}", "public function getLoggedInUserGuid() {\n\t\t$user = $this->getLoggedInUser();\n\t\treturn $user ? $user->guid : 0;\n\t}", "public function getUserIdentifier(): string\n {\n return (string) $this->login;\n }", "public function getUserId() \n {\n if (!$this->hasUserId()) \n {\n $this->userId = 0;\n }\n\n return $this->userId;\n }", "public function _getID()\n {\n $this->selftest();\n return $this->objectUser->ID;\n }", "public static function id ()\n {\n return self::user()->getId();\n }", "public function getUserIdentifier(): string\n {\n return (string) $this->username;\n }", "public function generateId(){\n\n global $verificationId,$id;\n $verificationId = true;\n $id = 0;\n while($verificationId == true){\n $id=$this->idgenerate();\n if(is_null(User::find($id))) {\n $verificationId = false;\n }\n }\n return $id;\n\n }", "function get_user_id()\r\n {\r\n return $this->user->get_id();\r\n }", "public function getUser_ident()\n {\n return $this->user_ident;\n }", "private static function getAuthTokenUserId() {\n global $_iform_warehouse_override;\n if ($_iform_warehouse_override || !function_exists('hostsite_get_user_field')) {\n // If linking to a different warehouse, don't do user authentication as\n // it causes an infinite loop.\n return '';\n }\n else {\n $indiciaUserId = hostsite_get_user_field('indicia_user_id');\n // Include user ID if logged in.\n return $indiciaUserId ? \":$indiciaUserId\" : '';\n }\n }", "public function getUserId()\n {\n return UsniAdaptor::app()->user->getId();\n }", "public function loggedInUserId()\n\t{\n\t\treturn auth()->id();\n\t}", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "public static function resolveId()\n {\n return auth()->check() ? auth()->user()->getAuthIdentifier() : null;\n }", "public function get_id_user()\n\t{\n\t\treturn $this->id_user;\n\t}", "public function getUserID(){\n return($this->userID);\n }", "public function getUser_id()\n {\n return isset($this->user_id) ? $this->user_id : null;\n }", "public function getCustomUserId();", "public function identityId()\n {\n if ($this->identity_id != null) {\n return $this->identity_id;\n } else {\n return false;\n }\n }", "function getMyID()\n{\n $ci =& get_instance();\n $user = $ci->ion_auth->user()->row();\n if(isset($user->id)) {\n return $user->id;\n }else{\n \treturn null;\n }\n}", "public function getIdentifier()\n {\n return $this->user->email;\n }", "public function identity()\r\n {\r\n\t\t$storage = $this->get_storage();\r\n\r\n if ($storage->is_empty()) {\r\n return null;\r\n }\r\n if( is_null(self::$login_user) ){\r\n $u = $storage->read();\r\n\t\t\tself::$login_user = Model_User::instance()->user($u['uid']);\r\n \r\n global $VIEW_AUTH_USERID;\r\n $VIEW_AUTH_USERID = idtourl(self::$login_user['uid']);\r\n }\r\n return self::$login_user; \r\n }", "public function uniqueId(): string\n {\n return $this->person->id;\n }", "public static function GetUserID()\n\t{\n\t\treturn self::GetFB()->getUser();\n\t}", "public function getUserid()\n {\n if ($this->_userid === false) {\n $this->_userid = Userlogin::find()->where(['id' => Yii::$app->user->identity->id])->one();\n }\n return $this->_userid;\n }", "public static function getCurrentID() {\n return Session::get(Privilege::SESSION_NAME_ID);\n }", "function wpcustom_get_current_user_id(){\n\tglobal $current_user;\n\tget_currentuserinfo();\n\treturn $current_user->ID;\n}", "public static function getActiveTimeregistrationUserId() {\n\n\t\tif (GO::user()->getModulePermissionLevel('timeregistration2') == \\GO\\Base\\Model\\Acl::MANAGE_PERMISSION && !empty(GO::session()->values['tr_active_user']))\n\t\t\treturn GO::session()->values['tr_active_user'];\n\t\telse\n\t\t\treturn GO::user()->id;\n\t}", "public function getUserID() {\n if($this->oa_user_id)\n return $this->oa_user_id;\n\n $response = $this->_connectAndGrabUserData();\n\n if($response) {\n $this->oa_user_id = $response['id'];\n\n return $this->oa_user_id;\n }\n\n return false;\n }", "public function getIdentity();", "public function getIdentity()\n {\n if (!isset($this->apiuid)) {\n throw new UnidentifiedUserException(\"Must call identify() before performing any user-related commands.\");\n }\n\n return $this->apiuid;\n }", "function _createId( )\n\t{\n\t\t$agent = $_SERVER['HTTP_USER_AGENT'];\n\t\t$id = md5( $agent . uniqid(dechex(rand())) . $_SERVER['REMOTE_ADDR'] );\n\t\treturn $id;\n\t}", "public function user_id()\n\t{\n\t\tif ($this->logged_in())\n\t\t{\n\t\t\treturn $this->_facebook->getUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->login_url();\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getIduser()\n {\n return $this->iduser;\n }", "public function id()\n\t{\n\t\t// If the driver is an instance of the Cookie driver, we are able to\n\t\t// just return any string since the Cookie driver has no real idea\n\t\t// of a server side persisted session with an ID.\n\t\treturn \\Core\\Str::random('alnum', 40);\n\t}", "public function getCurrentUserId()\n\t{\n\t\treturn array_key_exists('user_id', $this->session->data) ? $this->session->data['user_id'] : 0;\n\t}", "public function getUserLoginId()\n {\n if ($this->_hasVar('user_login_id')) {\n return $this->_getVar('user_login_id');\n }\n return 0;\n }", "private static function get_current_user_id() {\r\n\t\t//print_r($_SESSION);\r\n\t\t$mysqli = Database::connection();\r\n\t\tif (!isset($_SESSION['user_id']) || !is_numeric($_SESSION['user_id'])) {\r\n\t\t\t//Check for a cookie\r\n\t\t\tif (!empty($_COOKIE['token']) && is_numeric($_COOKIE['user_id'])) {\r\n\t\t\t\t$token = $_COOKIE['token'];\r\n\t\t\t\t$user_id = $_COOKIE['user_id'];\r\n\t\t\t\t$sql = \"SELECT token FROM users WHERE user_id = '$user_id'\";\r\n\t\t\t\t$result = $mysqli->query($sql)\r\n\t\t\t\tor die($mysqli->error);\r\n\t\t\t\tif ($result->num_rows == 1) {\r\n\t\t\t\t\t//Attempt to verify the token\r\n\t\t\t\t\t$token_hashed = mysqli_fetch_row($result)[0];\r\n\t\t\t\t\t$verify = password_verify($token, $token_hashed);\r\n\t\t\t\t\tif ($verify) {\r\n\t\t\t\t\t\t//Create the session again\r\n\t\t\t\t\t\t$_SESSION['user_id'] = $user_id;\r\n\t\t\t\t\t\treturn $user_id;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\treturn 'None';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn 'None';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn 'None';\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn $_SESSION['user_id'];\r\n\t\t}\r\n\t}", "public function diviroids_user_id($atts)\n {\n return DiviRoids_Security::get_current_user('ID');\n }", "public function getUserId() {\n\t\t$currentUser = $this->getLoggedUser();\n\t\tif ($currentUser) {\n\t\t\treturn $currentUser->getId();\n\t\t}\n\t}", "public function get_id()\n {\n\n $user_type = $this->isStaff ? \"staff\" : \"user\";\n\n return $this->database->get($user_type,'id',['user_url' => $this->username]);\n\n }", "public function GetId() {\n\t\t\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['id'];\n\t}", "protected function determine_user_id() {\n\t\t$user_id = $this->context->site_user_id;\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.\n\t\t *\n\t\t * @api int|bool $user_id The user ID currently determined.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_person_user_id', $user_id );\n\t}", "public function getUserid()\n {\n return $this->userid;\n }", "public function getUserID() {\n\t\treturn $this->_user_id;\n\t}", "function pms_get_current_user_id() {\r\n if( isset( $_GET['edit_user'] ) && !empty( $_GET['edit_user'] ) && current_user_can('edit_users') )\r\n return (int)$_GET['edit_user'];\r\n else\r\n return get_current_user_id();\r\n }", "public function id()\n {\n return $this->user->id;\n }", "public function getId()\n {\n return $this->app['security']->getToken()->getUser()->getId();\n }", "public static function getCurrentUserId(){\n $user_data = parent::getSession('curent_user');\n $_get_id_user = isset($_GET['id_user']) ? $_GET['id_user'] : null;\n $_post_id_user = isset($_POST['id_user']) ? $_POST['id_user'] : null;\n return\n self::is_SuperUserSession()\n ? ($_post_id_user ? $_post_id_user : ( $_get_id_user ? $_get_id_user : $user_data['id_user'] ))\n : parent::getSession('id_user');\n }", "final protected function userId()\n {\n return $this->container->make(LashyGuard::class)->id();\n }", "public function getuserId() : Uuid {\n\t\treturn($this->userId);\n\t}", "public static function generateUniqueId()\n {\n $request = Request::createFromGlobals();\n $leftHandString = time(). '-';\n $rightHandString = '@' . $request->server->get('SERVER_NAME');\n $fillValue = bin2hex(get_current_user()) . '-' . mt_rand(1000000,9999999);\n\n $fillLength = self::MAX_LENGTH_PER_LINE - strlen($leftHandString) - strlen($rightHandString);\n if (strlen($fillValue) > $fillLength){\n $fillValue = substr($fillValue, 0, $fillLength);\n }\n\n $uniqueIdCandidate = $leftHandString . $fillValue . $rightHandString;\n $uniqueId = substr($leftHandString . $fillValue . $rightHandString, (strlen($uniqueIdCandidate) > self::MAX_LENGTH_PER_LINE) ? strlen($uniqueIdCandidate)-self::MAX_LENGTH_PER_LINE : 0);\n\n return $uniqueId;\n }" ]
[ "0.7870917", "0.77441645", "0.7702843", "0.7604044", "0.73181295", "0.7121897", "0.7109679", "0.7007477", "0.6987701", "0.6909104", "0.686712", "0.68649423", "0.68448615", "0.6820117", "0.67553055", "0.67315423", "0.67232025", "0.66960144", "0.6695697", "0.6677776", "0.66634005", "0.6650975", "0.6640548", "0.6636705", "0.6623695", "0.66096485", "0.6606967", "0.6606247", "0.6597467", "0.6595049", "0.6595049", "0.6595049", "0.6590497", "0.6577904", "0.6567348", "0.6549131", "0.6549068", "0.6548512", "0.65467715", "0.65354574", "0.6531041", "0.6523169", "0.65201336", "0.6508934", "0.65059847", "0.65011024", "0.6490079", "0.6471216", "0.6460816", "0.64557356", "0.64509356", "0.6450543", "0.64498585", "0.64481", "0.64469624", "0.64361435", "0.6434552", "0.64332074", "0.6431458", "0.64276457", "0.64226764", "0.6417279", "0.6414139", "0.6412084", "0.64053214", "0.6397852", "0.6395197", "0.6383286", "0.63744", "0.63548744", "0.63531107", "0.6339583", "0.6328349", "0.63238657", "0.63199794", "0.63192785", "0.6317181", "0.6312542", "0.63044107", "0.6302334", "0.6298777", "0.62958294", "0.629251", "0.62872493", "0.62779415", "0.6267212", "0.6264625", "0.62643087", "0.62632287", "0.62622094", "0.62615424", "0.6260717", "0.62599915", "0.62590504", "0.62587893", "0.62520695", "0.6249129", "0.6246268", "0.62440425", "0.62414336" ]
0.8327695
0
Return a known ID for the current user.
function get_id() : string { $current_user = wp_get_current_user(); return sha1( $current_user->user_email ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_user_id();", "private function getuserid() {\n\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n }\n return $user_id;\n }", "function get_current_user_id()\n {\n }", "public function getCurrentUserId();", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "public function _getID()\n {\n $this->selftest();\n return $this->objectUser->ID;\n }", "public static function resolveId()\n {\n return Auth::check() ? Auth::user()->getAuthIdentifier() : null;\n }", "public static function id ()\n {\n return self::user()->getId();\n }", "function getMyID()\n{\n $ci =& get_instance();\n $user = $ci->ion_auth->user()->row();\n if(isset($user->id)) {\n return $user->id;\n }else{\n \treturn null;\n }\n}", "public function id() {\n return isset($this->_adaptee->user_info['user_id']) ? $this->_adaptee->user_info['user_id'] : null;\n }", "public static function resolveId()\n {\n return auth()->check() ? auth()->user()->getAuthIdentifier() : null;\n }", "public function getUserID () {\n return $this->id;\n }", "public static function resolveId()\n\t{\n\t\treturn auth()->guard('api')->check() ? auth()->guard('api')->user()->getAuthIdentifier() : null;\n\t}", "function labdevs_get_user_current_id()\n{\n global $current_user;\n get_currentuserinfo();\n return $current_user->ID;\n}", "protected function getCurrentUserId()\n\t{\n\t\treturn get_current_user_id();\n\t}", "public function getUserID() {\n\t\tif (is_numeric($this->user_id)) {\n\t\t\treturn $this->user_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "function get_user_id()\r\n {\r\n return $this->user->get_id();\r\n }", "Public Function UserId() {\n\t\treturn $this->userId;\n\t\n\t}", "public function getUserId() {\n\t\t$currentUser = $this->getLoggedUser();\n\t\tif ($currentUser) {\n\t\t\treturn $currentUser->getId();\n\t\t}\n\t}", "public function getUserId()\n {\n \treturn $this->getCurrentUserid();\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getUserid()\n {\n return $this->get(self::_USERID);\n }", "public function getID() {\n return $this->user_id;\n }", "public function getId()\n {\n return $this->app['security']->getToken()->getUser()->getId();\n }", "protected function determine_user_id() {\n\t\t$user_id = $this->context->site_user_id;\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.\n\t\t *\n\t\t * @api int|bool $user_id The user ID currently determined.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_person_user_id', $user_id );\n\t}", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function get_user_id()\n {\n return self::getUser();\n }", "public function id()\n {\n if ($this->user()) {\n return $this->user()->getAuthIdentifier();\n }\n return null;\n }", "public function id()\n {\n return $this->user->id;\n }", "public function getUser_id()\n {\n return isset($this->user_id) ? $this->user_id : null;\n }", "public function get_id()\n {\n\n $user_type = $this->isStaff ? \"staff\" : \"user\";\n\n return $this->database->get($user_type,'id',['user_url' => $this->username]);\n\n }", "function current_user_id()\n{\n $user = \\Yii::$app->user;\n $user_id = $user->getId();\n return is_numeric($user_id) ? $user_id : 0;\n}", "public static function GetCurrentUserId() {\n try {\n $token = Helper::GetCookies('token');\n $now = new \\DateTime(date('Y-m-d H:i:s'));\n if(!isset($token) || $token == '' || $token == null) {\n return 0;\n }\n else {\n $userDB = DB::table('users')\n ->where('token', $token)\n ->where('timeout', '>=', $now)\n ->where('deleted_at', null)\n ->select('id')\n ->get()->toArray();\n if (isset($userDB) && !empty($userDB)) {\n return $userDB[0]->id;\n }\n }\n return 0;\n }\n catch(Exception $e) {\n throw $e;\n }\n }", "public function GetId() {\n\t\t\n\t\t$user = self::GetUserProfile();\n\t\treturn $user['id'];\n\t}", "public function getUserID(){\n return($this->userID);\n }", "function user_id() {\n isset($this->_user_id) || $this->_load_from_session();\n return $this->_user_id;\n }", "public function get_id_user()\n {\n return (isset($this->_id_user)) ? $this->_id_user : null;\n }", "public function getId()\n {\n return $this->userId;\n }", "final protected function userId()\n {\n return $this->container->make(LashyGuard::class)->id();\n }", "public function getId()\n {\n return $this->ID_user;\n }", "public function getUserId() {\n\t\treturn $this->Session->read('UserAuth.User.id');\n\t}", "public function getUserId()\r\n\t{\r\n\t\t$user = parent::getUser();\r\n\t\tif(!($user instanceof User))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn $user->getId();\r\n\t}", "public function getId()\n {\n return $this->user->id;\n }", "protected static function getUserID()\r\n {\r\n $userID = \\CAT\\Helper\\Validate::sanitizePost('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = \\CAT\\Helper\\Validate::sanitizeGet('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = self::router()->getParam(-1);\r\n\r\n if(!$userID || !is_numeric($userID) || !\\CAT\\Helper\\Users::exists($userID))\r\n Base::printFatalError('Invalid data')\r\n . (self::$debug ? '(\\CAT\\Backend\\Users::getUserID())' : '');;\r\n\r\n return $userID;\r\n }", "public function get_id_user()\n\t{\n\t\treturn $this->id_user;\n\t}", "protected function getUserId() {}", "protected function getUserId() {}", "public function getUserID() {\n\t\treturn $this->_user_id;\n\t}", "public function getUserId()\n {\n $value = $this->get(self::user_id);\n return $value === null ? (integer)$value : $value;\n }", "public function getAuthIdentifier()\n {\n return (string) $this->user['id'];\n }", "public function getCustomUserId();", "public function getUserId()\n {\n return (int) $this->_getVar('user_id');\n }", "public function getCurrentUserId()\n\t{\n\t\treturn array_key_exists('user_id', $this->session->data) ? $this->session->data['user_id'] : 0;\n\t}", "public function getUserId ()\n {\n return $this->storage->get(self::$prefix . 'userId');\n }", "function getUserId(){\n\t//replace with actual\n\treturn '123';\n}", "public static function getCurrentUserId(){\n $user_data = parent::getSession('curent_user');\n $_get_id_user = isset($_GET['id_user']) ? $_GET['id_user'] : null;\n $_post_id_user = isset($_POST['id_user']) ? $_POST['id_user'] : null;\n return\n self::is_SuperUserSession()\n ? ($_post_id_user ? $_post_id_user : ( $_get_id_user ? $_get_id_user : $user_data['id_user'] ))\n : parent::getSession('id_user');\n }", "protected static function getCurrentUserId()\n {\n return null;\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }", "public function getId()\n {\n return $this->user['id'];\n }", "public function getUserID()\n {\n return $this->userID;\n }", "public function getUserID()\n {\n return $this->userID;\n }", "public function getId() {\n return $this->get('id', 'user');\n }", "public function getId()\n {\n return isset($this->sessionStorage->user['id']) ? (int) $this->sessionStorage->user['id'] : 0;\n }", "public function getAuthIdentifier() {\n return $this->id_user;\n }", "public function getUserId()\n {\n return UsniAdaptor::app()->user->getId();\n }", "function getUserID(){\n\n\tif( isset($_SESSION['uid'])){\t\n\t\t$id = $_SESSION['uid'];\n\t}else{\n\t\t$id = \"Unregistered\";\n\t}\n\n\treturn $id;\n}", "public function getId()\n {\n return $this->response['user_id'];\n }", "public function getUserID() {\n\t\t\treturn $this->iUser; \t\n\t\t}", "public function getIduser()\n {\n return $this->iduser;\n }", "public function getUserId()\n {\n if (sfContext::hasInstance())\n {\n if ($userId = sfContext::getInstance()->getUser()->getAttribute('user_id'))\n {\n return $userId;\n }\n }\n return 1;\n }", "function pms_get_current_user_id() {\r\n if( isset( $_GET['edit_user'] ) && !empty( $_GET['edit_user'] ) && current_user_can('edit_users') )\r\n return (int)$_GET['edit_user'];\r\n else\r\n return get_current_user_id();\r\n }", "function get_user_id(){\n\t\t// get the current user details\n\t\t$cookie_id = $this->decrypt($_COOKIE['CakeCookie']['PDCAUSER']);\t\t\n\t\treturn $cookie_id;\n\t}", "function identifier()\n\t{\n\t\t$identifier = $this->CI->session->userdata(AUTH_USER_IDENTIFIER);\n\t\tif ($identifier)\n\t\t{\n\t\t\treturn $identifier;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception (\"User identifier referenced, but not initialised. Perhaps the user is not logged in?\");\n\t\t}\n\t}", "private function getUserId()\n {\n $company = $this->getCompany();\n\n if (!isset($company['user']['id'])) {\n throw new BiglionException('User \"id\" not defined', 1);\n }\n\n return $company['user']['id'];\n }", "public function getId()\n\t{\n\t\treturn $this->m_oUser->UserID;\n\t}", "public function getUserId() {\n\t\tif ($this->logged()) {\n\t\t\treturn $_SESSION['auth']['id'];\n\t\t}\n\t\treturn false;\n\t}", "public function getUserId()\n {\n $this->checkIfKeyExistsAndIsInteger('user_id');\n\n return $this->data['user_id'];\n }", "public function getUserId()\n {\n if ($this->validateUser()) {\n return $this->user->getId();\n }\n\n return false;\n }", "public function getUserId()\n {\n return parent::getValue('user_id');\n }", "public function getIdUser() \n\t{\n\t\treturn $this->idUser;\n\t}", "function wpcustom_get_current_user_id(){\n\tglobal $current_user;\n\tget_currentuserinfo();\n\treturn $current_user->ID;\n}", "public static function getCurrentUserId()\n {\n $profile = self::getProfile();\n\n return $profile ? $profile->getProfileId() : 0;\n }", "public function getIdUser()\n {\n return $this->idUser;\n }", "public function getIdUser()\n {\n return $this->idUser;\n }", "public static function getId() {\n return (int)$_SESSION['user']['id'];\n }", "public function getUser_id()\n {\n return $this->user_id;\n }", "public function getUser_id()\n {\n return $this->user_id;\n }" ]
[ "0.81837624", "0.7959843", "0.7947306", "0.79226106", "0.79176784", "0.7912601", "0.77929664", "0.7789738", "0.7788548", "0.77667975", "0.77540994", "0.7739611", "0.77378976", "0.77150416", "0.7706728", "0.76758677", "0.7648391", "0.76423866", "0.7637146", "0.7634667", "0.7624348", "0.76192784", "0.76192784", "0.76192784", "0.7618461", "0.75866014", "0.7575862", "0.7572924", "0.7572924", "0.7572924", "0.7572924", "0.7572924", "0.7572924", "0.7572924", "0.7572924", "0.7572924", "0.7559342", "0.75438774", "0.7541353", "0.75372297", "0.75278735", "0.75244397", "0.751982", "0.7513061", "0.7493981", "0.74906063", "0.7475041", "0.7464702", "0.7464523", "0.7463563", "0.74580294", "0.74510944", "0.7445574", "0.74446034", "0.7442901", "0.74387205", "0.74387205", "0.7434963", "0.7434264", "0.743337", "0.74168485", "0.74162525", "0.7411165", "0.7407463", "0.7407152", "0.73938525", "0.73937076", "0.7378673", "0.7378673", "0.7378673", "0.73776096", "0.73717076", "0.7368765", "0.7368765", "0.73671466", "0.73536", "0.73485714", "0.73266244", "0.73241353", "0.7322522", "0.7321491", "0.73214483", "0.7319532", "0.7313094", "0.7302682", "0.7302352", "0.7296617", "0.72921485", "0.7275064", "0.7271718", "0.7269001", "0.7268462", "0.72676045", "0.7259654", "0.72581583", "0.72563356", "0.72563356", "0.725403", "0.7253184", "0.7253184" ]
0.78142565
6
Get details for the current user.
function get_segmentio_user_details() : array { $current_user = wp_get_current_user(); $auto_id = get_anonymous_id(); $did_opt_in = is_user_opted_in( $current_user ); if ( ! $did_opt_in ) { return [ 'id' => $auto_id, 'opt_in' => false, ]; } $email = $current_user->user_email; $id = get_id(); if ( Altis\get_environment_type() === 'local' ) { // Create distinct_id (important for Mixpanel). $id = $auto_id; $email = 'no-reply+' . $auto_id . '@altis.dev'; } $traits = [ 'first_name' => $current_user->first_name, 'last_name' => $current_user->last_name, 'email' => $email, 'username' => $current_user->user_login, 'created' => $current_user->user_registered, 'avatar' => get_avatar_url( $current_user->ID ), 'roles' => (array) $current_user->roles, ]; /** * Filter user traits delivered to segment.io. * * @param array $traits User traits to send to Segment.io. */ $traits = (array) apply_filters( 'altis.telemetry.user_traits', $traits ); return [ 'id' => $id, 'opt_in' => true, 'traits' => $traits, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }", "public function getAuthUserDetail()\n {\n return $this->user;\n }", "public function getUserDetails()\n {\n try\n {\n $user = \\App\\User::find(getLoggedInUser('id'));\n\n return createResponse(200, \"User Details.\", ['user' => $user]);\n\n }catch(\\Exception $e)\n {\n \\Log::error(\"Get user details API failed: \".$e->getMessage());\n return createResponse(config('httpResponse.SERVER_ERROR'),\n \"Cound not fetch detail!\",\n ['error' => 'Cound not fetch detail!']);\n }\n }", "public function getUserInfo()\n {\n return $this->_process('user/info')->user;\n }", "public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }", "public function profile(){\n // using the auth() helper we are returning the authenticated user info\n return auth('api')->user();\n }", "public function UserDetails()\n {\n if (!Auth::user()) {\n return response()->json(\"Not Authenticated\");\n } else {\n $user = Auth::user();\n return response()->json([$user], 200);\n }\n }", "public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }", "public function userDetails(){\n\t\t\techo $this->name .\"<br>\";\n\t\t\techo $this->age .\"<br>\";\n\t\t\techo $this->dept .\"<br>\";\n\t\t}", "public function getUser()\n {\n $this->getParam('user');\n }", "public function getInfo()\n {\n $user = User::with(['optician'])->find(auth()->id());\n\n return api_resource('mobile\\User')->make($user);\n }", "public function getLoggedInUserDetails()\n {\n try\n {\n return $user = $this->jwtToken()->payload('context');\n\n }catch(\\Exception $e)\n {\n \\Log::error(\"Get user details API failed: \".$e->getMessage());\n return createResponse(config('httpResponse.SERVER_ERROR'),\n \"Cound not fetch detail!\",\n ['error' => 'Cound not fetch detail!']);\n }\n }", "public function userDetails()\n {\n $user = Auth::user();\n return response()->json(['success' => $user]);\n }", "private function getUserInfo()\n {\n // TODO This could be cached\n return $this->userInfoApi->getUserInfo();\n }", "public function getUserInformation()\n {\n return $this->userInformation;\n }", "private function getUser()\n {\n return $this->user->getUser();\n }", "public function getUserInfo() {}", "public function user()\n\t{\n\n\t\t$user = $this->current_user ? $this->current_user : $this->ion_auth->get_user();\n\n\t\techo json_encode($user);die;\n\t}", "public function getUserProfileDetails()\n {\n // Obtain the authenticated user's id.\n $id = Auth::id();\n\n // Query to obtain the user's profile details.\n $userDetails = User::select('first_name', 'last_name', 'email', 'max_fuel_limit', 'max_distance_limit')->where('user_id', $id)->first();\n\n // Return the selected details.\n return $userDetails;\n }", "function getUserInfo()\n {\n return $this->userinfo;\n }", "public function user()\n {\n return $this->context-> getUser();\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "public function getUserInfo()\n {\n return $this->userInfo;\n }", "function getUserInfo(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$user = $this->askFlickr('people.getinfo','user_id='.$this->user);\n\n\t\t/* Return User info */\n\t\treturn $user;\n\t}", "public function getCurrentUserProfileInfo()\n {\n $user = Auth::user();\n $userDetails = DB::table('userProfileData')->where('user_id', $user->id)->first();\n return response()->json(['currentUserDetails' => $userDetails], $this-> successStatus);\n }", "public function getUser(){\n\t\treturn $this->user;\n\t}", "public function getUser() {\r\n return $this->user;\r\n }", "public function profile()\n {\n try {\n $user = auth('api')->user();\n return $this->sendResponse($user, trans('actions.get.success'));\n } catch (Exception $ex) {\n return $this->sendError([], trans('actions.get.failed'));\n }\n }", "public function getUserInfo()\n {\n }", "public function getUser(): string {\n return $this->context->user;\n }", "public function getUser()\r\n {\r\n return $this->user;\r\n }", "public function fetchUser() {\n return $this->QueryAPI(\"current_user\");\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getMe()\n {\n return $this->_execute('/user/', self::METHOD_GET);\n }", "function getUser() \n {\n\t\t\treturn $this->user;\n\t\t}", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "function LoggedIn() {\n\t\treturn $this->Get('UserDetails');\n\t}", "public function get_userInfo()\n {\n return $this->call_method(\"get/userInfo\",\n array()\n );\n }", "function getUserDetails(){\n if(empty($this->userid)){\n return null;\n } \n $userDetailsQuery = \"SELECT * FROM da_userMaster WHERE da_userMaster.username = '$this->userid'\"; \n $dbqry = new dbquery($userDetailsQuery, $this->connid);\n $user = $dbqry->getrowassocarray();\n return $user;\n }", "public function getUser() {\n return $this->user;\n }", "public function getUser() {\n return $this->user;\n }", "public function getUser() {\n return $this->user;\n }", "public function getUser() {\n return $this->user;\n }", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser ()\r\n\t{\r\n\t\treturn $this->user;\r\n\t}", "protected function getUser()\n {\n return $this->user;\n }", "public function getUserInfo()\r\n {\r\n return self::makeCall('getUserInfo', array(), null, false, $this->sessionID);\r\n }", "public function getUser() {\n\t\treturn $this->user;\n\t}", "public function getUser() {\n\t\treturn $this->user;\n\t}", "function getUser() {\n return user_load($this->uid);\n }", "public function getUser() {\n\t\treturn $this->api->getUserById($this->getUserId());\n\t}", "public function get_user_details() {\n $user_id = intval($this->input->post('user_id'));\n if (!$user_id) {\n return $this->send_error('INVALID_INPUT');\n }\n $fields = array(\n 'id',\n 'first_name',\n 'prefix',\n 'last_name',\n 'image',\n 'cover_image',\n 'ranking'\n );\n if ($details = $this->users_model->fields($fields)->get($user_id)) {\n $this->load->model('blog_posts_model');\n $details['blog_posts'] = $this->blog_posts_model->order_by('created_at', 'desc')->get_all(array('user_id' => $user_id));\n $details['ranking'] = unserialize($details['ranking']);\n $this->event_log();\n $this->send_response($details);\n } else {\n return $this->send_error('ERROR');\n }\n }", "public function getUserInformation() {\n /** @var User $user */\n $user = auth()->user() ;\n\n return $user->toArray() ;\n }", "protected function _user() {\n return $this->_adapter_user->user();\n }", "public function show()\n {\n return auth('api')->user();\n }", "public final function getUser()\n {\n return $this->user;\n }", "public function user() { return $this->user; }", "public function show()\n\t{\n\t\ttry {\n\t\t\t$user = Auth::user();\n\t\t\treturn response()->json($user, 200);\n\t\t} catch (\\Exception $e) {\n\t\t\treturn response()->json($e, 400);\n\t\t}\n\t}", "public function show()\n {\n return UserTransformer::resource(Auth::user());\n }", "public function getUser()\n {\n return $this->_user;\n }", "public function user_info() {\n if ($this->rails_cookie_value() == NULL) {\n return null;\n }\n if (!self::$user_info && !self::$user_info_called) {\n $json_data = $this->api_request(\"user/\" . $this->rails_cookie_value());\n self::$user_info = $json_data->{'user'};\n self::$user_info_called = true;\n }\n return self::$user_info;\n }", "public function getUserDetails() {\n\t\tif (defined(\"MO_USER_NAMESPACE\")) {\n\t\t\treturn $this->getContext()->getUser()->getAttribute(MO_USER_NAMESPACE);\n\t\t} else {\n\t\t\treturn $this->getContext()->getUser()->getAttribute(\"userForm\");\n\t\t}\n\t}", "public function getUser( ) {\n\t\treturn $this->user;\n\t}", "public function getUser( ) {\n\t\treturn $this->user;\n\t}", "abstract public function getUserInfo();" ]
[ "0.8352392", "0.7788373", "0.7716951", "0.75918716", "0.75756943", "0.7545161", "0.752918", "0.7451287", "0.7428635", "0.74225134", "0.74141705", "0.7406303", "0.740065", "0.73693043", "0.73686904", "0.73157644", "0.73024726", "0.7301523", "0.7286151", "0.72806305", "0.725474", "0.72422636", "0.72422636", "0.72422636", "0.72129005", "0.7183525", "0.71655434", "0.7156545", "0.7148978", "0.7141154", "0.7135208", "0.7121518", "0.7119666", "0.71115744", "0.7109797", "0.71054834", "0.7104428", "0.7104428", "0.7104428", "0.7102242", "0.71009266", "0.7095434", "0.70905995", "0.70905995", "0.70905995", "0.70905995", "0.70759165", "0.70759165", "0.70759165", "0.70759165", "0.70759165", "0.70759165", "0.70759165", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.707409", "0.7069104", "0.70490444", "0.7034995", "0.70201087", "0.70201087", "0.70147043", "0.6992248", "0.69911486", "0.69842476", "0.69838595", "0.6976309", "0.6974792", "0.6968494", "0.6967336", "0.6963461", "0.69581336", "0.69546765", "0.69545066", "0.69528586", "0.69528586", "0.6952396" ]
0.0
-1
Get a unique ID for the current (local) environment. Generates a persistent, unique ID for the current local environment.
function get_local_install_id() : ?string { if ( Altis\get_environment_type() !== 'local' ) { return null; } $id = get_network_option( null, 'altis_tracking_id', null ); if ( ! empty( $id ) ) { return $id; } if ( is_multisite() ) { // Hash the registration date of the first site to get a unique ID. $site = get_blog_details( get_main_site_id(), false ); $generated = 'local-' . substr( hash( 'sha1', $site->registered ), 0, 6 ); } else { // Get the oldest piece of content. global $wpdb; $first = $wpdb->get_col( "SELECT post_date FROM $wpdb->posts ORDER BY post_date ASC LIMIT 1" ); $generated = 'local-' . substr( hash( 'sha1', $first[0] ), 0, 6 ); } update_network_option( null, 'altis_tracking_id', $generated ); return $generated; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getCurrentID() {\n return Session::get(Privilege::SESSION_NAME_ID);\n }", "protected function _createUniqueId()\n {\n $id = '';\n $id .= function_exists('microtime') ? microtime(true) : (time() . ' ' . rand(0, 100000));\n $id .= '.' . (function_exists('posix_getpid') ? posix_getpid() : rand(50, 65535));\n $id .= '.' . php_uname('n');\n\n return $id;\n }", "public static function getId(){\n\t\t\n\t\t$serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : \"unknown\";\n\t\t\n\t\t//added MD5 because IE doesn't like dots I suspect\n\t\treturn md5(\\GO::config()->id.'AT'.$serverName);\n\t}", "static function makeID() {\n return uniqid();\n }", "public function getID(): string {\n\t\treturn $this->appName;\n\t}", "public function getId(): string\n {\n return session_id();\n }", "public function id()\n\t{\n\t\t// If the driver is an instance of the Cookie driver, we are able to\n\t\t// just return any string since the Cookie driver has no real idea\n\t\t// of a server side persisted session with an ID.\n\t\treturn \\Core\\Str::random('alnum', 40);\n\t}", "protected function _getId ()\n {\n return session_id();\n }", "public static function getId(){\n\t\treturn session_id();\n\t}", "public function getId()\n {\n if (!$this->id) {\n $this->id = md5(uniqid(rand(), true));\n }\n return $this->id;\n }", "public function getId()\n {\n $this->checkIfStarted();\n\n return session_id();\n }", "public function id() {\n\t\tif ( null === $this->_id ) {\n\t\t\t$this->_id = sha1( mt_rand() . microtime( true ) . mt_rand() );\n\t\t}\n\n\t\treturn $this->_id;\n\t}", "protected static function persistentPrefix() {\n if (empty(static::$randomPrefix)) {\n static::$randomPrefix = getmypid() . md5(microtime());\n }\n return static::$randomPrefix;\n }", "protected function generateId() {\n return $this->id = md5(uniqid());\n }", "function _createId( )\n\t{\n\t\t$agent = $_SERVER['HTTP_USER_AGENT'];\n\t\t$id = md5( $agent . uniqid(dechex(rand())) . $_SERVER['REMOTE_ADDR'] );\n\t\treturn $id;\n\t}", "public static function generateUniqueId()\n {\n $request = Request::createFromGlobals();\n $leftHandString = time(). '-';\n $rightHandString = '@' . $request->server->get('SERVER_NAME');\n $fillValue = bin2hex(get_current_user()) . '-' . mt_rand(1000000,9999999);\n\n $fillLength = self::MAX_LENGTH_PER_LINE - strlen($leftHandString) - strlen($rightHandString);\n if (strlen($fillValue) > $fillLength){\n $fillValue = substr($fillValue, 0, $fillLength);\n }\n\n $uniqueIdCandidate = $leftHandString . $fillValue . $rightHandString;\n $uniqueId = substr($leftHandString . $fillValue . $rightHandString, (strlen($uniqueIdCandidate) > self::MAX_LENGTH_PER_LINE) ? strlen($uniqueIdCandidate)-self::MAX_LENGTH_PER_LINE : 0);\n\n return $uniqueId;\n }", "public function newId()\n {\n return md5(microtime());\n }", "public function getId()\n {\n $this->checkIfStarted();\n\n return $this->sessionId;\n }", "public function getId(): string\n {\n return session()->getId();\n }", "public static function getId() {\n return isset(self::$id)\n ? self::$id\n : (self::$id = base_convert(crc32(self::getBaseDir()),16,32));\n\t}", "public function getLocalId()\n {\n if (!$this->psAccountsService) {\n return false;\n }\n\n return $this->psAccountsService->getUserUuidV4();\n }", "private function getCurrentID() {\n if ($this->sessionid > 0) {\n\t\t\treturn $this->sessionid;\n\t\t}\n $cookie_id = 0;\n\t\tif (isset($GLOBALS[\"_COOKIE\"][\"sessionid\"])) {\n\t\t\t$cookie_array = explode('|', $GLOBALS[\"_COOKIE\"][\"sessionid\"]);\n\t\t\tif ($cookie_array[0]) {\n\t\t\t\t$cookie_id = $cookie_array[0];\n\t\t\t}\n\t\t}\n\t\treturn $cookie_id;\n }", "private function session_id()\r\n {\r\n return md5(__FILE__ . \"_\" . $_SERVER[\"HTTP_HOST\"]);\r\n }", "public function getId() {\n\t\treturn session_id();\n\t}", "public static function id()\n {\n if (!ServerHelper::coroutineIsEnabled()) {\n return 0;\n }\n\n return SwCoroutine::getuid();\n }", "protected function generateSessionId()\n\t{\n\t\t//\\Log::info('custom session id created');\n\t\t//return sha1(uniqid('', true).Str::random(25).microtime(true));\n\n\n\t\t// use our own ID generation mechanism\n\t\t$id_hash = str_random(64);\n\n\t\treturn $id_hash;\n\n\t}", "function GET_APP_ID(){\n return \"7d0df388-f064-48eb-9092-27fbbf0a438e\";\n}", "private function get_current_id() {\n\n\t\tstatic $id = null;\n\n\t\treturn $id ?: $id = \\get_queried_object_id();\n\t}", "function ts_get_current_id()\r\n{\r\n\treturn CURRENT_ID;\r\n}", "private function getId(): int|string\n {\n return '/'.($_SESSION['rfe']['lastUsedItemId']++);\n }", "protected static function getExtLocalconfCacheIdentifier() {}", "public function generateNewId()\n {\n return Uuid::uuid4();\n }", "public function generateId()\n {\n $session_id = $this->request->param($this->sid_key, '');\n $_session_id = explode('-',$session_id ? xn_decrypt($session_id):'');\n $this->ip = isset($this->request->server['REMOTE_ADDR'])?$this->request->server['REMOTE_ADDR']:'127.0.0.1';\n $this->useragent = isset($this->request->server['USER-AGENT'])? md5($this->request->server['USER-AGENT']):'';\n $this->sid = ($_session_id[2]&&$this->useragent==$_session_id[1]) ? $_session_id[2] : get_uniqid(32);\n $this->sess_key = $_session_id[2]==$this->sid ? $session_id : xn_encrypt(getut().'-'.$this->useragent.'-'.$this->sid.'-'.$this->ip);\n }", "private function generateId()\n {\n $startHex = dechex((int)$this->startTime);\n $uuid = bin2hex(random_bytes(12));\n\n return \"1-{$startHex}-{$uuid}\";\n }", "public function uniqueId(): string\n {\n return $this->person->id;\n }", "public function id(): string\n {\n if ($this->id) {\n return $this->id;\n }\n\n if ($this->name) {\n return $this->id = $this->generateIdByName();\n }\n\n return $this->id = Str::random(4);\n }", "function generateNewId(){\n\t\t$id = null;\n\t\t//while ( $this->getSessionData($id) !== null ){\n\t\t\t$id = rand(0,100000);\n\t\t//}\n\t\treturn $id;\n\t}", "static public function generateSID() {\n\t\treturn md5( $_SERVER['HTTP_USER_AGENT'] + $_SERVER['REMOTE_ADDR'] + time() + rand() );\n\t}", "public function getId()\n {\n return $this->sys->getId();\n }", "final function getSession_id() {\n\t\treturn $this->getSessionId();\n\t}", "public static function genNewUniqueId() {\n\t\treturn uniqid(mt_rand(), true);\n\t}", "public static function get_id() {\n self::$_id = $_SESSION['id'];\n return self::$_id;\n }", "private static function get_unique_id(){\n\t\tself::$u_id+=1;\n\t\treturn (string) self::$u_id;\n\t}", "public function getPersistentId()\n {\n return $this->getResourceManager()->getPersistentId($this->getResourceId());\n }", "function db_pwassist_create_id()\n{\n\t// Implementation note: we use the PHP Session id\n\t// generation mechanism to create the session id.\n\t$old_session_id = session_id();\n\tsession_regenerate_id();\n\t$pwassist_id = session_id();\n\tsession_id($old_session_id);\n\n\treturn $pwassist_id;\n}", "public function getIdentifier()\n {\n $configID = $this->get_config() ? $this->get_config()->ID : 1;\n return ucfirst($this->get_mode()) . \"Site\" . $configID;\n }", "public function getLocalKey(): string\n {\n return $this->localKey;\n }", "public function createID()\n {\n $myID = new \\MongoID();\n\n return (string) $myID;\n }", "public static function generateID()\n {\n return mt_rand();\n }", "protected function generateIdByName(): string\n {\n return \"auto_id_\" . $this->name;\n }", "public function getId(): ?string\n {\n return $this->isStarted() ? session_id() : null;\n }", "public static function getID()\n {\n return self::getInstance()->_getID();\n }", "public function getUniquekeyid()\n {\n return $this->uniquekeyid;\n }", "public function getUniqueId()\n {\n return '';\n }", "static function uniqueID()\n {\n return substr(str_pad(str_replace('.', '', microtime(true)), 12, 0), 0, 12);\n }", "protected function getId() {\n // Since initializePurgersService() autogenerates the IDs, ours is known.\n return 'id0';\n }", "public function getTempStoreId() {\n $id = [$this->id()];\n foreach ($this->getContexts() as $context) {\n if ($context instanceof AutomaticContext && $context->isAutomatic()) {\n $id = array_merge($id, $context->getCacheTags());\n }\n }\n return implode(':', $id);\n }", "private function generateSessionID() {\n $sid = \"\";\n do $sid = bin2hex(openssl_random_pseudo_bytes(SESSION_ID_SIZE));\n while ($this->memcache->get(PREFIX_SESSION.$this->sessionID) !== false);\n return $sid;\n }", "public static function getLogid(): string\n {\n $contextData = self::getCoroutineContext(self::DATA_KEY);\n $logid = $contextData['logid'] ?? '';\n return $logid;\n }", "function getUniqueID(){\n\treturn md5(uniqid(rand(), true));\n}", "public function getSelfId(): string\n {\n $result = $this->sendGetRequest($this->getRequestUrl('selfId'));\n\n return isset($result->id) ? $result->id : $result;\n }", "protected function _makeId()\n\t{\n\t\treturn JCache::makeId();\n\t}", "function localIdentifier()\n\t{\n\t\t$id = $this->identifier();\n\t\treturn substr($id,0, strpos($id, '::'));\n\t}", "protected function generateId() : string\n {\n return '';\n\n }", "public function getId()\n {\n return $this->systemProperties->getId();\n }", "public static function generateUniqueIdForCart() {\n return uniqid(\"Cart-\", true);\n }", "public function getServerId()\n {\n return $this->get(self::_SERVER_ID);\n }", "public static function id()\n {\n return 1;\n }", "private function getToken()\n {\n return uniqid();\n }", "public function getSystemUid()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->getInfo()->uid;\n }", "protected function _uniqueId()\n {\n $t = explode(\" \", microtime());\n\n return sprintf(\n '%08s-%08s-%04s-%04x%04x',\n $this->_ipToHex(),\n substr(\"00000000\" . dechex($t[1]), -8),\n substr(\"0000\" . dechex(round($t[0] * 65536)), -4),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff)\n );\n }", "protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->module() . '_' . $this->unique() );\n\t}", "public function getUuid()\n {\n if ($this->_uuid !== null) {\n return $this->_uuid;\n }\n\n if ($uuid = Yii::$app->request->cookies->getValue($this->cookieName)) {\n $this->_uuid = (string) $uuid;\n return $this->_uuid;\n }\n\n $uuid = NumberHelper::getGuid();\n $this->setUuid($uuid);\n return $this->_uuid;\n }", "public static function id()\n {\n return self::$id;\n }", "function sess_id()\n {\n return session_id();\n }", "public function genid()\n {\n $date = new DateTime();\n $date->setTimestamp(now());\n $time_based_name = $date->format('YmdHis');\n return $time_based_name . rand(1, 9);\n }", "public function getIdKey()\n {\n\n if (is_null($this->idKey))\n $this->idKey = BuizCore::uniqKey();\n\n return $this->idKey;\n\n }", "public function get_context_id()\n {\n return $this->get_default_property(self::PROPERTY_CONTEXT_ID);\n }", "private function getCurrentWebsiteId()\n {\n return $this->storeManager->getWebsite()->getId();\n }", "public static function getID() {\r\n return 1;\r\n }", "public function getUniqueId()\n {\n return $this->uniqueId;\n }", "function UniqueID(){\n\t\treturn uniqid ('Depari', true);\n\t}", "public function getUniqueId();", "public function getUniqueId();", "public function getUniqueId();", "public function uniqueId(): string\n {\n return strval($this->user->id);\n }", "public function getId() {\n return $this->sessionId;\n }", "public function getLiveId() {}", "public function getID()\n {\n // this only works for web users!\n return $this->session->userdata('ID');\n }", "public function key() : string\n {\n return 'local';\n }", "function getUniqueID(){\n\t\treturn $this->module.'_'.$this->ID;\n\t}", "function generate_external_id($length = 64) {\n\t $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t $charactersLength = strlen($characters);\n\t $randomString = '';\n\t for ($i = 0; $i < $length; $i++) {\n\t $randomString .= $characters[rand(0, $charactersLength - 1)];\n\t }\n\t return $randomString;\n\t}", "function getNewId();", "function Uuid()\n {\n $unid = uniqid() . str_replace('-', '', Guid());\n $uuid = substr($unid, 0, 8) . '-' . substr($unid, 8, 4) . '-' . substr($unid, 12, 4) . '-' . substr($unid, 16, 4) . '-' . substr($unid, 20, 12);\n return $uuid;\n }", "function getDatabaseId();", "function createSurferID() {\n srand((double)microtime() * 10000000);\n // Paranoia mode: Repeat until an unused id is found\n // (which a correct implementation of uniq!!id() should\n // grant anyway ...)\n do {\n $id = (string)md5(uniqid(rand()));\n } while ($this->existID($id, TRUE));\n return $id;\n }", "public function getUniqueId()\n {\n return $this->unique_id;\n }", "public function getUniqueID()\n {\n return $this->uniqueID;\n }", "public function getUniqueID()\n {\n return $this->uniqueID;\n }", "function gen_id() {\n\t\t$this->id = get_uid();\n\t\t$this->mk_paths($this->id);\n\t}" ]
[ "0.69771034", "0.6934184", "0.68988323", "0.68279135", "0.68034136", "0.6796245", "0.6605553", "0.6585326", "0.6580314", "0.657788", "0.65646917", "0.6418477", "0.6407989", "0.64027995", "0.6381688", "0.63759744", "0.63708293", "0.6362983", "0.6362551", "0.63514555", "0.6344313", "0.634176", "0.6335425", "0.6311739", "0.6305627", "0.6231067", "0.62144005", "0.6204202", "0.62030566", "0.61854386", "0.6178937", "0.61762065", "0.61518323", "0.6142347", "0.61357224", "0.61203736", "0.61136127", "0.6106614", "0.60972965", "0.60949814", "0.6090784", "0.6086137", "0.60615176", "0.6054769", "0.6048018", "0.6043783", "0.604284", "0.60405564", "0.60365057", "0.60225195", "0.6017038", "0.60069054", "0.60022265", "0.5996794", "0.5992815", "0.5980626", "0.5978115", "0.59710395", "0.59680456", "0.5966954", "0.5961885", "0.5957937", "0.59530824", "0.59170496", "0.591318", "0.5911521", "0.59083545", "0.5904144", "0.5900452", "0.5900067", "0.5897348", "0.589133", "0.5891185", "0.5887724", "0.58834386", "0.58831084", "0.5859637", "0.5858625", "0.5855053", "0.5854629", "0.58420837", "0.583697", "0.5834793", "0.5834793", "0.5834793", "0.5832739", "0.5823353", "0.582214", "0.5821171", "0.58208776", "0.5820652", "0.58185863", "0.58095753", "0.58073694", "0.58056444", "0.57999605", "0.5796271", "0.5793721", "0.5793721", "0.5782715" ]
0.7294877
0
Get current Altis environment details.
function get_environment_details() : array { $id = Altis\get_environment_name(); $type = Altis\get_environment_type(); if ( $type === 'local' ) { // Create distinct_id (important for Mixpanel). $id = get_local_install_id(); } $traits = [ 'site_name' => get_site_option( 'site_name', get_option( 'blogname', '' ) ), 'environment' => $type, 'domain' => get_site_url(), 'multisite' => is_multisite(), 'feature_tier' => Altis\get_feature_tier(), 'environment_tier' => Altis\get_environment_tier(), 'support_tier' => Altis\get_support_tier(), 'version' => Altis\get_version(), ]; /** * Filter environment traits delivered to segment.io. * * @param array $traits Environment traits to send to Segment.io. */ $traits = (array) apply_filters( 'altis.telemetry.env_traits', $traits ); return [ 'id' => $id, 'traits' => $traits, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public static function environment() {\n return self::$environment;\n }", "public function getEnvironment()\n {\n return $this->getConfigData('environment');\n }", "function getEnvironment(){ return $_ENV['CURRENT_ENVIRONMENT']; }", "function getEnvironment() {\n return Environment::env();\n}", "public function environment()\n {\n return \\Config::get('app')['env'];\n }", "public function getEnv()\n {\n return self::$environment;\n }", "public function environment()\n {\n return $this->env;\n }", "public function getEnvironment()\n {\n return $this->getConfig('environment');\n }", "public function getEnvironment()\n {\n return self::$_environment;\n }", "public function environment() : string\n {\n return $this->environment;\n }", "public function getEnvironment() {\n\t\treturn $this->getKernel()->getEnvironment();\n\t}", "public static function getEnvironment() {\n return self::whichEnv();\n }", "public static function env()\n {\n return self::context()->env();\n }", "public function getEnvironment()\n {\n return $this->config['environment'];\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->_environment;\n }", "public function getEnvironment() {\n return $this->environment; \n }", "public function get_env()\n {\n return $this->env;\n }", "public function getEnvironment() { return $this->environment; }", "public function getEnvironment()\n\t{\n\t\treturn $this->_environment;\n\t}", "public function getEnvironment(): Environment;", "public function getEnv()\n {\n return $this->env;\n }", "public function getEnv()\n {\n return $this->env;\n }", "public function getEnvironments();", "public static function getEnvironment() : array\n {\n return self::$env;\n }", "public function getEnvironment() {\n\n return trim($this->environment);\n }", "public function getAppEnvironment()\n {\n return $this->appEnvironment;\n }", "public function getEnv():string\n {\n return $this->env;\n }", "public function getEnv() {\n\t\treturn APPLICATION_ENV;\n\t}", "public function getEnvironmentVariables()\n {\n return $this->environment_variables;\n }", "protected function get_environment()\n\t{\n\t\treturn $this->environment ?: PHPBB_ENVIRONMENT;\n\t}", "public static function environment(){\n return \\Illuminate\\Foundation\\Application::environment();\n }", "protected function getCurrentEnv() {\n if (empty($this->env)) {\n $this->env = shell_exec('echo -n $'.self::ENV_VARIABLE_NAME);\n }\n return $this->env;\n }", "public function getEnvs();", "protected function getEnvironmentMode() {}", "public static function environment() {\n\t\tif (!isset(self::$_environment)) {\n\t\t\tself::$_environment=new \\GO\\Base\\Environment();\n\t\t}\n\t\treturn self::$_environment;\n\t}", "public function getEnv(): array\n {\n return $this->env;\n }", "public function getEnvironmentVariables()\n {\n return $this->environmentVariables;\n }", "public function getEnvironmentVariables()\n {\n return $this->_environmentVariables;\n }", "public function getEnvironmentVariables()\n {\n return $this->_envVars;\n }", "function get_environment(): string {\n return getenv('APP_ENV') ?\n getenv('APP_ENV') : 'default';\n}", "public static function get()\n\t{\n\t\t// then return content of APPLICATION_ENV\n\t\t// else return \"development\"\n\t\treturn (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : \"development\");\n\t}", "public function env()\n {\n // TODO: Implement env() method.\n }", "public function getEnvironment()\n {\n return $this->environmentNode;\n }", "public static function environment() {\n\t\treturn env('HORIZON_MODE');\n\t}", "public function getEnvironment($name);", "public function environment()\n {\n return 'local';\n }", "public static function getEnv()\n {\n //($s = yaml_parse_file(\"/var/www/app.env\")) || die(\"YAML file not found\");\n //var_dump($s);\n //$thing = file_get_contents(\"/var/www/app.env\");\n //$data = Spyc::YAMLLoad('../spyc-0.6.1/spyc.yaml');\n return yaml_parse_file(\"/var/www/app.env\");\n }", "public function getEnvironments(): array\n {\n return $this->environments;\n }", "public static function environmentFile(){\n return \\Illuminate\\Foundation\\Application::environmentFile();\n }", "private function getEnvironmentInfos()\n\t{\n\t\t// Get a instance of Joomla\\CMS\\Environment\\Browser\n\t\t$browser = JBrowser::getInstance();\n\n\t\t// Get the values form the useragent string\n\t\t$detectedPlatform = $browser->getPlatform();\n\t\t$detectedBrowser = $browser->getBrowser();\n\n\t\t// Prepare the return values\n\t\t$environmentInfos = array(\n\t\t\t'platform' => 'unknown',\n\t\t\t'browser' => 'unknown',\n\t\t);\n\n\t\t// Set the platform value when we support it.\n\t\tif (array_key_exists($detectedPlatform, $this->supportedPlatforms))\n\t\t{\n\t\t\t$environmentInfos['platform'] = $detectedPlatform;\n\t\t}\n\n\t\t// Set the browser value when we support it.\n\t\tif (array_key_exists($detectedBrowser, $this->supportedBrowsers))\n\t\t{\n\t\t\t$environmentInfos['browser'] = $detectedBrowser;\n\t\t}\n\n\t\t// Return the results\n\t\treturn $environmentInfos;\n\t}", "public function environment() {\n $this->envPath = base_path('.env');\n $this->envExamplePath = base_path('.env.example');\n \n $envConfig = $this->getEnvContent();\n \n return view('installer::environment', compact('envConfig'));\n }", "public function getTabletEnvironment()\n {\n return $this->_aTabletEnvironment;\n }", "public function getEngine()\n {\n return $this->environment;\n }", "private function getEnvironmentMode() {\n return $this->config->get('api.mode') === 'live' ? 'prod' : 'dev';\n }", "public function getDesktopEnvironment()\n {\n return $this->_aDesktopEnvironment;\n }", "public function getDefaultEnvironment();", "protected function deriveEnvironment()\n {\n $confDir = $this->getAppConfigDir();\n\n if (file_exists($confDir . 'development.php')) {\n return 'development';\n } elseif (file_exists($confDir . 'testing.php')) {\n return 'testing';\n } elseif (file_exists($confDir . 'production.php')) {\n return 'production';\n } else {\n throw new \\RuntimeException(\n 'Environment Not Specified And Unable To Derive',\n 500\n );\n }\n }", "public function getPhoneEnvironment()\n {\n return $this->_aPhoneEnvironment;\n }", "protected function getEnvironments()\n {\n return array('dev', 'test', 'preprod');\n }", "public function getEnvironmentFile(): string;", "public function getEnvironmentName()\n {\n if ($this->environmentName) {\n return ucfirst($this->environmentName) . ' ' . __(\"Environment\");\n }\n }", "public function getAllEnvironmentVariables()\n {\n return include $_SERVER['DOCUMENT_ROOT'] . '/env.php';\n }", "public function return_oCRNRSTN_ENV(){\n\n return self::$oCRNRSTN_ENV;\n\n }", "function env();", "private function getEnvironmentVariables()\n {\n return array(\n 'GIT_TERMINAL_PROMPT' => '0',\n 'GIT_ASKPASS' => 'echo',\n );\n }", "public static function getEnvironments()\n {\n $instanceSpecificKeys = [\n 'app_frontend_url',\n 'app_backend_url'\n ];\n\n $globalKeys = [\n 'app_config_path',\n 'server_config_path',\n 'isolation_config_path',\n 'handlers_config_path',\n 'configuration:Magento/Mtf/TestSuite/MtfTests',\n 'app_instances',\n 'events_preset',\n 'log_directory'\n ];\n\n $globalEnvironmentVariables = [];\n foreach ($globalKeys as $key) {\n if (isset($_ENV[$key])) {\n $globalEnvironmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $environments = [];\n if (isset($_ENV['app_instances'])) {\n $instancesCount = $_ENV['app_instances'];\n\n for ($x = 0; $x < $instancesCount; $x++) {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n $instanceKey = $key . \"_\" . $x;\n if (isset($_ENV[$instanceKey])) {\n $environmentVariables[$key] = $_ENV[$instanceKey];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n } else {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n if (isset($_ENV[$key])) {\n $environmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n\n return $environments;\n }", "public static function environment()\n {\n $clientId = \"AeJcD0QwLDMAQZH5HHNDfJBKvIxDMd0SWKca3rrX3IdhK62xLu0EInhkOScSskKtxVhNBjroPkIX0Oeu\"; //live;\n// $clientSecret = \"EJs4udErZIsmm1rxvSR_6JIVqojRadq_oDkLLN1nQuqkaq5k8fSKX6CZQvUQzf3dLGdJthYh6xNLgHd3\"; //sandbox;\n $clientSecret = \"EEKCrsLBLWIVx4MTf8Qi1t2uTVNymwpUCxCnhsoZuAFpHPzpqBVliAiIBeSyHoEpeQya8TJdkgrDvXDM\"; //live;\n return new ProductionEnvironment($clientId, $clientSecret);\n }", "public static function environmentPath(){\n return \\Illuminate\\Foundation\\Application::environmentPath();\n }", "public function getEnvironmentTags() {\n\t\treturn array_merge($this->environments[0]);\n\t}", "protected function getEnvironmentVariablesThatICareAbout()\n {\n return array(\n 'shell',\n 'tmpdir',\n 'user',\n 'pwd',\n 'lang',\n 'editor',\n 'home',\n );\n }", "private function getEnvironment(): Environment\n {\n if ($this->environment === null) {\n $this->environment = new Environment();\n }\n\n return $this->environment;\n }", "public static function environment()\n {\n $clientId = getenv(\"CLIENT_ID\") ?: warehouse::get_paypal_client_id();\n $clientSecret = getenv(\"CLIENT_SECRET\") ?: warehouse::get_paypal_secret();\n\n if (rex_config::get('warehouse', 'sandboxmode')) {\n return new SandboxEnvironment($clientId, $clientSecret);\n } else {\n return new ProductionEnvironment($clientId, $clientSecret);\n }\n }", "public function getEnvExamplePath()\n {\n return $this->envExamplePath;\n }", "public function displayEnvironmentDetails(array $vars);", "public function listEnvironments()\n {\n\t\t$data = $this->call(array(), \"GET\", \"environments.json\");\n\t\treturn $data;\n\t\t\n\t\t$data = $this->call(array(), \"GET\", \"environments.json\");\n\t\t$data = $data->{'environments'};\n\t\t$environmentArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$environmentArray->append(new Environment($data[$i], $this));\n\t\t}\n\t\treturn $environmentArray;\n }", "public static function getEnvMode()\n {\n return (Configuration::get('PAYLINE_LIVE_MODE') == '1' ? PaylineSDK::ENV_PROD : PaylineSDK::ENV_HOMO);\n }", "private function getParentEnvironment() {\n\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\treturn getenv();\n\t\t} elseif ( isset( $_ENV['PATH'] ) ) {\n\t\t\treturn [ 'PATH' => $_ENV['PATH'] ];\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}", "public function getEnvironmentPath(): string;", "public function getEnvPath()\n {\n return $this->envPath;\n }", "function derive_environment()\n{\n $envname = 'crm'; // Assume prod environment for now.\n $env_shortname = strrchr(BASE_DIR, '_');\n if ($env_shortname !== false) {\n $env_shortname = substr($env_shortname, 1);\n if ($env_shortname != 'prod') {\n $envname = \"crm$env_shortname\";\n }\n }\n return $envname;\n}", "function env($name)\n{\n return Env::get($name);\n}", "public function caching_environment()\n {\n $info = array();\n $info['cache_on'] = '(count($_POST)!=0 || get_param_integer(\\'keep_non_rated\\',0)==1)?null:array(array_key_exists(\\'guid\\',$map)?$map[\\'guid\\']:\\'\\',(array_key_exists(\\'give_context\\',$map)?$map[\\'give_context\\']:\\'0\\')==\\'1\\',(array_key_exists(\\'include_breadcrumbs\\',$map)?$map[\\'include_breadcrumbs\\']:\\'0\\')==\\'1\\',array_key_exists(\\'param\\',$map)?$map[\\'param\\']:strval(db_get_first_id()),array_key_exists(\\'zone\\',$map)?$map[\\'zone\\']:\\'_SEARCH\\')';\n $info['special_cache_flags'] = CACHE_AGAINST_DEFAULT | CACHE_AGAINST_PERMISSIVE_GROUPS;\n $info['ttl'] = (get_value('no_block_timeout') === '1') ? 60 * 60 * 24 * 365 * 5/*5 year timeout*/ : 60 * 24; // Intentionally, do randomisation acts as 'of the day'\n return $info;\n }", "protected static function getEnvironmentType()\n {\n if ($file = self::getEnvironmentFile()) {\n include_once $file;\n\n if (defined('SS_ENVIRONMENT_TYPE')) {\n return SS_ENVIRONMENT_TYPE;\n }\n }\n\n return 'live';\n }", "public function caching_environment()\n {\n $info = array();\n $info['cache_on'] = 'array(array_key_exists(\\'username\\',$map)?$map[\\'username\\']:\\'\\', array_key_exists(\\'display\\',$map)?$map[\\'display\\']:\\'\\', array_key_exists(\\'period\\',$map)?$map[\\'period\\']:\\'\\', array_key_exists(\\'title\\',$map)?$map[\\'title\\']:\\'\\', array_key_exists(\\'width\\',$map)?$map[\\'width\\']:\\'100%\\', array_key_exists(\\'height\\',$map)?$map[\\'height\\']:\\'100%\\')';\n $info['ttl'] = 15;\n return $info;\n }", "public function needsEnvironment()\n {\n return $this->options['needs_environment'];\n }", "public function getEnv($name);", "private static function loadEnvSettings()\n {\n require_once self::$envPath;\n return $env;\n }", "public function caching_environment()\n {\n $info = array();\n $info['cache_on'] = 'array(array_key_exists(\\'check\\',$map)?$map[\\'check\\']:\\'0\\',array_key_exists(\\'title\\',$map)?$map[\\'title\\']:\\'\\',array_key_exists(\\'hot\\',$map)?$map[\\'hot\\']:\\'0\\',array_key_exists(\\'param\\',$map)?$map[\\'param\\']:do_lang(\\'DEFAULT_FORUM_TITLE\\'),array_key_exists(\\'limit\\',$map)?$map[\\'limit\\']:6,array_key_exists(\\'date_key\\',$map)?$map[\\'date_key\\']:\\'lasttime\\',array_key_exists(\\'username_key\\',$map)?$map[\\'username_key\\']:\\'firstusername\\')';\n $info['ttl'] = (get_value('no_block_timeout') === '1') ? 60 * 60 * 24 * 365 * 5/*5 year timeout*/ : 10;\n return $info;\n }" ]
[ "0.774839", "0.774839", "0.774839", "0.774839", "0.774839", "0.774839", "0.75275433", "0.7482912", "0.74800575", "0.74585325", "0.7410558", "0.7407789", "0.7353706", "0.7314868", "0.7263809", "0.7260313", "0.7259166", "0.7250086", "0.72379804", "0.71902704", "0.71727043", "0.71661055", "0.71661055", "0.71661055", "0.71661055", "0.71661055", "0.71654886", "0.7149911", "0.7141792", "0.7075942", "0.70720106", "0.7038774", "0.69497746", "0.69497746", "0.69090635", "0.6855987", "0.6830634", "0.6808243", "0.6806782", "0.678594", "0.6760432", "0.6759646", "0.6757938", "0.6717287", "0.6665506", "0.661441", "0.6600141", "0.6588662", "0.6583732", "0.65815854", "0.6557906", "0.6549413", "0.65382254", "0.6527521", "0.65144473", "0.65121156", "0.64308196", "0.64261574", "0.6419162", "0.63310635", "0.6292803", "0.6276448", "0.6261812", "0.6254305", "0.6227057", "0.6211261", "0.61977476", "0.6185584", "0.61620444", "0.61593443", "0.6136075", "0.60635215", "0.6048772", "0.60377705", "0.6034918", "0.6025932", "0.60085994", "0.6005731", "0.6004502", "0.5997075", "0.59789515", "0.5976349", "0.59705985", "0.5959077", "0.5952451", "0.59458506", "0.5919918", "0.59189653", "0.589159", "0.58762455", "0.58673203", "0.5866186", "0.5847834", "0.584377", "0.583314", "0.58229357", "0.5822726", "0.5802157", "0.58012486", "0.5794764" ]
0.6941423
34
Identify user to segment.io.
function render_identity_tag() { $user = get_segmentio_user_details(); ?> <script> (function () { var segment_user = <?php echo wp_json_encode( $user ) ?>; if ( ! segment_user.opt_in ) { analytics.setAnonymousId( segment_user.id ); } else { analytics.identify( segment_user.id, segment_user.traits ); } })(); </script> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function identifyUser() {\n}", "function get_segmentio_user_details() : array {\n\t$current_user = wp_get_current_user();\n\t$auto_id = get_anonymous_id();\n\t$did_opt_in = is_user_opted_in( $current_user );\n\n\tif ( ! $did_opt_in ) {\n\t\treturn [\n\t\t\t'id' => $auto_id,\n\t\t\t'opt_in' => false,\n\t\t];\n\t}\n\n\t$email = $current_user->user_email;\n\t$id = get_id();\n\tif ( Altis\\get_environment_type() === 'local' ) {\n\t\t// Create distinct_id (important for Mixpanel).\n\t\t$id = $auto_id;\n\t\t$email = 'no-reply+' . $auto_id . '@altis.dev';\n\t}\n\n\t$traits = [\n\t\t'first_name' => $current_user->first_name,\n\t\t'last_name' => $current_user->last_name,\n\t\t'email' => $email,\n\t\t'username' => $current_user->user_login,\n\t\t'created' => $current_user->user_registered,\n\t\t'avatar' => get_avatar_url( $current_user->ID ),\n\t\t'roles' => (array) $current_user->roles,\n\t];\n\n\t/**\n\t * Filter user traits delivered to segment.io.\n\t *\n\t * @param array $traits User traits to send to Segment.io.\n\t */\n\t$traits = (array) apply_filters( 'altis.telemetry.user_traits', $traits );\n\n\treturn [\n\t\t'id' => $id,\n\t\t'opt_in' => true,\n\t\t'traits' => $traits,\n\t];\n}", "public function get_user_id();", "abstract protected function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "public function getUser();", "protected function determine_user_id() {\n\t\t$user_id = $this->context->site_user_id;\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.\n\t\t *\n\t\t * @api int|bool $user_id The user ID currently determined.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_person_user_id', $user_id );\n\t}", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "abstract public function user();", "public function getUserIdentifier(): string\n\t{\n\t\treturn (string)$this->siret;\n\t}", "public function getUser(ServerRequest $request);", "protected function getUserId() {}", "protected function getUserId() {}", "public function diviroids_user_id($atts)\n {\n return DiviRoids_Security::get_current_user('ID');\n }", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public function getUserIdentifier(): string\n {\n return (string) $this->username;\n }", "public function userId($user);", "public function userByToken();", "public function user($user);", "public static function getUser();", "function user_id () {\r\n\t$info = user_info();\r\n\treturn (isset($info[0]) ? $info[0] : 0);\r\n}", "abstract protected function getUserId() ;", "public function getUser() {}", "public function getUser_ident()\n {\n return $this->user_ident;\n }", "public static function for_user($userid) {}", "abstract public function getUserInfo();", "public function forUser($user);", "public function getUserId(ServerRequestInterface $request): string;", "public function getUser()\n {\n $this->getParam('user');\n }", "public static function get_user_id(){\n return isset(\\Yii::$app->user->id)?\\Yii::$app->user->id:'';\n }", "public function getUserId(): string;", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "private static function getAuthTokenUserId() {\n global $_iform_warehouse_override;\n if ($_iform_warehouse_override || !function_exists('hostsite_get_user_field')) {\n // If linking to a different warehouse, don't do user authentication as\n // it causes an infinite loop.\n return '';\n }\n else {\n $indiciaUserId = hostsite_get_user_field('indicia_user_id');\n // Include user ID if logged in.\n return $indiciaUserId ? \":$indiciaUserId\" : '';\n }\n }", "public function getUserID () {\n return $this->id;\n }", "public function id() {\n return isset($this->_adaptee->user_info['user_id']) ? $this->_adaptee->user_info['user_id'] : null;\n }", "function get_current_user_id()\n {\n }", "public function getUserId()\n {\n return UsniAdaptor::app()->user->getId();\n }", "public function auth_user()\n {\n //echo $this->id;\n //echo $this->username. ' is authenticated';\n }", "public function getUserId()\r\n \t{\r\n \treturn $this->_client->getUser();\r\n \t}", "public function getUserIdentifier(): string\n {\n return (string) $this->login;\n }", "protected function getUserByContext() {}", "private function usr(){\r\n\r\n if(defined(\"USER_ID\")){ return true;}else{return false;}\r\n\r\n }", "function user_logged_in($user_id) {\n \n }", "function get_page_owner($segments = array()) {\n\n\t$owner = elgg_get_logged_in_user_entity();\n\n\tif (is_array($segments)) {\n\t\tforeach ($segments as $segment) {\n\t\t\t$user = get_user_by_username($segment);\n\t\t\tif (elgg_instanceof($user)) {\n\t\t\t\t$owner = $user;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $owner;\n}", "public function identify($user_id, $anon_id = null) {\n $this->_events->identify($user_id, $anon_id);\n }", "public function getUser(): string {\n return $this->context->user;\n }", "public function getIduser()\n {\n return $this->iduser;\n }", "public function get_user_id()\n {\n return self::getUser();\n }", "public function getUserid()\n {\n return $this->userid;\n }", "public function getAuthIdentifier() {\n return $this->id_user;\n }", "function get_user_id()\r\n {\r\n return $this->user->get_id();\r\n }", "public function getCurrentUser()\n {\n $userId = Security::getUserId();\n if (!empty($userId)) {\n $this->uid = $userId;\n }\n }", "public function getIdentifier()\n {\n return $this->user->email;\n }", "public function setUserId()\n {\n if(isset($_GET['userId']))\n {\n echo 'const userId = '.$_GET['userId'].';';\n }\n else\n {\n $config = new Config;\n echo 'const userId = '.$config->defaultUser.';';\n }\n }", "final protected function userId()\n {\n return $this->container->make(LashyGuard::class)->id();\n }", "public function getUserById(UserInput $userInput) {\n\n }", "protected function getFrontendBackendUser() {}", "public function get_switched_user_id()\n {\n }", "public function getUserID(){\n return($this->userID);\n }", "public function getUser()\n {\n }", "private function logInVOUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(44);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }", "public function invoiceuser()\n {\n return $this->bean->info()->user()->name();\n }", "function activateUser($userId);", "private function userDisplay() {\n $showHandle = $this->get('username');\n if (isset($showHandle)) {\n echo '<li class=\"user-handle\">'.$showHandle.'</li>';\n }\n }", "public function getCurrentUserId();", "function get_user_id(){\n\t\t// get the current user details\n\t\t$cookie_id = $this->decrypt($_COOKIE['CakeCookie']['PDCAUSER']);\t\t\n\t\treturn $cookie_id;\n\t}", "public function getUserIdentifier(): string\n {\n return (string) $this->getEmail();\n }", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "public function getUserInfo()\n {\n }", "public function setIduser($value)\n {\n $this->iduser = $value;\n }", "public function whoAmI()\n {\n return $this->username;\n }", "private function _identifyYourself()\n {\n // If there is a nickserv password and it's us joining\n if ($this->_identifyPassword AND ($this->_data->nick == $this->_irc->_nick))\n {\n $this->_privMessage('identify '. $this->_identifyPassword, 'NickServ');\n }\n }", "function handleSSOLogin()\n {\n\t\tif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])){\n \t\t\t$ipAddress = $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t}else{\n \t\t\t$ipAddress = $_SERVER['REMOTE_ADDR'];\n\t\t}\n\t\t$pos = strripos( $ipAddress, ',');\n\t\tif ($pos === false) {\n \t\t\t//nothing to do\t\n\t\t}else{\n\t\t\t$ipAddress=trim(str_replace(\",\",\"\",strrchr($ipAddress,\",\")));\n\t\t}\n\t\t$id = self::isUserIPInList($ipAddress);\n\t\t\n\t\t$ini = eZINI::instance('ssoip.ini');\n \t$debug = $ini->variable('AuthSettings', 'Debug');\n\t\tif ($debug == 'enabled'){\n\t\t\teZLog::write(\"$ipAddress -----> id= $id\",'sso.log');\n\t\t}\n\t\tif ( $id !== false ){\n\t\t\t$user = eZUser::fetch( $id );\n\t\t\tif ( is_object( $user ) ){\n\t\t\t\treturn $user;\n\t\t }\n\t\t}\n return false;\n }", "private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1646);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $this->user->setOpRoles('cclavoisier01.in2p3.fr');\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }", "public function getUserId()\n {\n }", "public function hasUser();", "private function logInSUUser()\n {\n $this->user= self::$kernel->getContainer()->get('doctrine')->getRepository('AppBundle:User')->findOneById(1258);\n\n $session = $this->client->getContainer()->get('session');\n\n $firewall = 'secured_area';\n $attributes = [];\n\n $token = new SamlSpToken(array('ROLE_USER'),$firewall, $attributes, $this->user);\n\n\n $session->set('_security_'.$firewall, serialize($token));\n $this->client->getContainer()->get('security.token_storage')->setToken($token);\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $this->client->getCookieJar()->set($cookie);\n }", "public function documentcheck() {\n $user = User::load(\\Drupal::currentUser()->id());\n bhge_user_registration_user_login($user);\n }", "public function getCurrentUser();" ]
[ "0.76261485", "0.6365902", "0.6063815", "0.60418403", "0.6039321", "0.6039321", "0.6039321", "0.6039321", "0.6039321", "0.6039321", "0.6039321", "0.600522", "0.59909755", "0.5906257", "0.5874889", "0.5864831", "0.5862975", "0.5855472", "0.5855472", "0.5831679", "0.58117414", "0.58117414", "0.58117414", "0.58117414", "0.58117414", "0.58117414", "0.58117414", "0.58117414", "0.5810533", "0.58068615", "0.5801852", "0.57942516", "0.57858443", "0.57422274", "0.5737327", "0.57313937", "0.5721506", "0.5720834", "0.5709648", "0.5706946", "0.56904197", "0.56796247", "0.5676966", "0.5636712", "0.5627602", "0.5627602", "0.5627602", "0.5627602", "0.5627602", "0.5627602", "0.5627602", "0.5627602", "0.5627602", "0.5621594", "0.56179905", "0.56117123", "0.5598352", "0.55980057", "0.5586704", "0.5581882", "0.5564625", "0.55634564", "0.5557742", "0.5550734", "0.55498433", "0.5544959", "0.5542435", "0.5528236", "0.55243075", "0.5521274", "0.5508138", "0.54833984", "0.5482157", "0.54802763", "0.5469768", "0.5467293", "0.5443045", "0.5439689", "0.5436828", "0.5430195", "0.54244846", "0.54235554", "0.54227823", "0.5422328", "0.5419319", "0.54141724", "0.54013723", "0.5400285", "0.53896433", "0.5385746", "0.5385479", "0.53848594", "0.53789955", "0.5375027", "0.53697467", "0.53674734", "0.5364552", "0.5352732", "0.53511846", "0.5349628" ]
0.61779064
2
Opt in or out of tracking.
function opt_in( bool $did_opt_in, ?WP_User $user = null ) { $user = $user ?? wp_get_current_user(); update_user_meta( $user->ID, META_OPT_IN, $did_opt_in ? 1 : 0 ); // Alias previously unknown user if they opted in. if ( $did_opt_in ) { if ( ! initialize() ) { return; } Segment::alias( [ 'userId' => get_id(), 'previousId' => get_anonymous_id(), ] ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function maybe_track_usage() {\n\n\t\t/** checking optin state */\n\t\tif ( 'yes' == self::get_optIn_state() ) {\n\t\t\t$data = self::collect_data();\n\n\t\t\t//posting data to api\n\t\t\tXL_API::post_tracking_data( $data );\n\t\t}\n\t}", "public function do_not_track()\n\t{\n\t\tstatic $shifted;\n\t\tif ($shifted !== TRUE)\n\t\t{\n\t\t\tarray_shift($this->tracker);\n\t\t\t$shifted = TRUE;\n\t\t}\n\t\t$this->set_tracker_cookie();\n\t}", "public static function optin_track_usage() {\n\n\t\t/** update week day for tracking */\n\t\t$track_week_day = date( 'w' );\n\t\tupdate_option( 'xl_track_day', $track_week_day, false );\n\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "public function canManageTracking();", "public function tracker_abort(){\n\t\t$this->env_set('tracker:event', false);\n\t\t}", "public function disableTracking()\n {\n $this->disableTracking = true;\n }", "public function isTrackingAvailable()\n {\n return false;\n }", "private function disable_tracking() {\n\n\t\t// don't disable tracking on AJAX requests\n\t\tif ( is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// disable tracking if admin, shop manager, or API key is blank\n\t\tif ( is_admin() || current_user_can( 'manage_options' ) || ( ! $this->api_key ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function is_tracking_enabled()\n {\n }", "public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "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 }", "function disable_tracking()\n\t{\n\t\t$this->config['enable_online_user_tracking'] = 'n';\n\t\t$this->config['enable_hit_tracking'] = 'n';\n\t\t$this->config['enable_entry_view_tracking'] = 'n';\n\t}", "public function isTrackingAllowed() {\n\t $data = Mage::getStoreConfig('rublon_allow_tracking');\n\t \t\t\n\t return !empty($data)?true:false;\n\t}", "public function testDestiny2SetQuestTrackedState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function isTrackingAvailable()\n {\n return true;\n }", "public function is_trackback()\n {\n }", "public function send() {\n\n\t\t$current_time = time();\n\t\tif ( ! $this->should_send_tracking( $current_time ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$collector = $this->get_collector();\n\n\t\t$request = new WPSEO_Remote_Request( $this->endpoint );\n\t\t$request->set_body( $collector->get_as_json() );\n\t\t$request->send();\n\n\t\tupdate_option( $this->option_name, $current_time, 'yes' );\n\t}", "public function isIgnoreObserver(){\n\t\t$ignore = true;\n\t\t$data = Mage::app()->getRequest()->getParams();\n\t\tif (isset($data['echeck_dropship']) && $data['echeck_dropship'] == 1)$ignore = false;\n\t\treturn $ignore;\n\t}", "function wp_ajax_pmproex_track() \r\n{\t\r\n\tif(!empty($_REQUEST['experiment']))\r\n\t{\r\n\t\tif($_REQUEST['goal'] === 'false')\r\n\t\t\t$_REQUEST['goal'] = false;\r\n\t\tpmproex_track($_REQUEST['experiment'], $_REQUEST['url'], $_REQUEST['goal']);\r\n\t}\r\n\r\n\texit;\r\n}", "public function autoTrack() {\n\t\tif (\n\t\t\tin_array( 'googleAnalytics', aioseo()->internalOptions->internal->deprecatedOptions, true ) &&\n\t\t\t! aioseo()->options->deprecated->webmasterTools->googleAnalytics->id\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! aioseo()->options->deprecated->webmasterTools->googleAnalytics->advanced ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (\n\t\t\taioseo()->options->deprecated->webmasterTools->googleAnalytics->trackOutboundLinks\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function quiet()\n {\n $this->activated = false;\n }", "function handle_opt_in_form() {\n\tif ( isset( $_POST['altis_telemetry_opt_in'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( true );\n\t}\n\tif ( isset( $_POST['altis_telemetry_opt_out'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( false );\n\t}\n}", "public static function maybe_push_optin_notice() {\n\t\tif ( self::get_optIn_state() == false && apply_filters( 'xl_optin_notif_show', self::$should_show_optin ) ) {\n\t\t\tdo_action( 'maybe_push_optin_notice_state_action' );\n\t\t}\n\t}", "public function has_tracking() {\n\t\t\treturn $this->hastracking == 'Y' ? true : false;\n\t\t}", "private static function _skip_tracking() {\n\n\t\tif ( function_exists( 'apply_filters_deprecated' ) ) {\n\t\t\tapply_filters_deprecated( 'statify_skip_tracking', array( '' ), '1.5.0', 'statify__skip_tracking' );\n\t\t}\n\t\t// Skip tracking via Hook.\n\t\t$skip_hook = apply_filters( 'statify__skip_tracking', null );\n\t\tif ( null !== $skip_hook ) {\n\t\t\treturn $skip_hook;\n\t\t}\n\n\t\t// Skip tracking via User Agent.\n\t\t$user_agent = filter_var(\n\t\t\t( isset( $_SERVER['HTTP_USER_AGENT'] ) ? wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) : '' ),\n\t\t\tFILTER_SANITIZE_STRING\n\t\t);\n\t\tif ( is_null( $user_agent )\n\t\t\t|| false === $user_agent\n\t\t\t|| self::is_bot( $user_agent ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Skip tracking via Referrer check.\n\t\tif ( self::check_referrer() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Skip for trackbacks and robots.\n\t\tif ( is_trackback() || is_robots() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Skip logged in users, if enabled.\n\t\tif ( self::$_options['skip']['logged_in'] && is_user_logged_in() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Skip for \"internal\" requests.\n\t\treturn self::_is_internal();\n\t}", "public function unknown() {\n\t\t$this->location = -1;\n\t\t$this->beer = -1;\n\t\t$this->status = -1;\n\t\t$this->update();\n\t}", "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 static function block_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'no', false );\n\t}", "public function videoconferenciaNoInterrumpirOFF( ) {\n $this->setNoInterrumpir(\"ON\");\n// $this->setNoInterrumpir(\"AUTOANSWER\");\n }", "public function track_outgoing() {\n\t\tif ( 'true' == $this->_get_options( 'log_outgoing' ) && (!defined('XMLRPC_REQUEST') || !XMLRPC_REQUEST) && ( ! is_admin() || 'false' == $this->_get_options( 'ignore_admin_area' ) ) )\n\t\t\twp_enqueue_script( 'wp-google-analytics', plugin_dir_url( __FILE__ ) . 'wp-google-analytics.js', array( 'jquery' ), '0.0.3' );\n\t}", "public function tracking()\n {\n if (Request::has('h')) {\n $track = Tracking::getByHash(Request::input('h'));\n if ($track->isActive()) {\n $data = [\n 'tracking_id' => $track->tracking_id,\n 'data' => json_encode(Request::except('h'))\n ];\n Tracking::log($data);\n }\n }\n\n // if we have a mail_id, we update the mail status and the date where it is opened\n if (Request::has(Tracking::MAIL_ID)) {\n if (Mail::exists(uuid('bytes', Request::input(Tracking::MAIL_ID)))) {\n $mail = Mail::getById(uuid('bytes', Request::input(Tracking::MAIL_ID)));\n\n if ($mail->mail_status_id != Mail::STATUS_OPENED) {\n $mail->mail_status_id = Mail::STATUS_OPENED;\n $mail->opened_at = Carbon::now();\n $mail->save();\n }\n }\n }\n\n header('Content-type:image/jpg');\n header(\"Pragma: no-cache\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0, public\");\n header(\"Expires: 0\");\n exit;\n }", "public function post_off(){\n\n\t\tSettings::where_in('type', 'indira')->and_where('param', '=', 'under_development')->update(array('value' => 'false'));\n\n\t\t$data = array();\n\t\t$data[\"on\"] = null;\n\t\t$data[\"off\"] = 'active';\n\n\t\tIndira::set('indira.under_development');\n\n\t\treturn View::make('admin.development.thumbler', $data);\n\t}", "protected function doActionSendTracking()\n {\n \\XLite\\Core\\Mailer::sendOrderTrackingInformationCustomer($this->getOrder());\n\n \\XLite\\Core\\TopMessage::addInfo('Tracking information has been sent');\n }", "public function onAssetsInitialized()\n {\n // Don't proceed if we are in the admin plugin\n if ($this->isAdmin()) {\n $this->documentBlockingReason('admin plugin active');\n return;\n }\n\n // Don't proceed if there is no GA Tracking ID\n $trackingId = trim($this->config->get('plugins.ganalytics.trackingId', ''));\n\n // Add support for environment variables:\n if (preg_match('/env:(.*)/', $trackingId, $match)) {\n $trackingId = getenv($match[1]);\n }\n\n if (empty($trackingId)) {\n $this->documentBlockingReason('trackingId not configured');\n return;\n }\n\n $dntRespected = $this->config->get('plugins.ganalytics.dnt', true);\n if ($dntRespected && !empty($_SERVER['HTTP_DNT'])) {\n $this->documentBlockingReason(\"Do Not Track header sent by the client\");\n return;\n }\n\n // Don't proceed if a blocking cookie is set\n $blockingCookieName = $this->config->get('plugins.ganalytics.blockingCookie', '');\n if (!empty($blockingCookieName) && !empty($_COOKIE[$blockingCookieName])) {\n $this->documentBlockingReason(\"blocking cookie \\\"$blockingCookieName\\\" is set\");\n return;\n }\n\n // Don't proceed if the IP address is blocked\n $blockedIps = $this->config->get('plugins.ganalytics.blockedIps', []);\n if (in_array($_SERVER['REMOTE_ADDR'], $blockedIps)) {\n $this->documentBlockingReason(\"client ip \" . $_SERVER['REMOTE_ADDR'] . \" is in blockedIps\");\n return;\n }\n\n // Don't proceed if the IP address is within a blocked range\n $packedClientIpAddress = $this->packedIPAddress($_SERVER['REMOTE_ADDR']);\n $blockedIpRanges = $this->config->get('plugins.ganalytics.blockedIpRanges', []);\n foreach ($blockedIpRanges as $blockedIpRange) {\n if ($this->inIPAdressRange($packedClientIpAddress, $blockedIpRange)) {\n $this->documentBlockingReason(\"client ip \" . $_SERVER['REMOTE_ADDR'] . \" is in range \\\"\" . $blockedIpRange . \"\\\"\");\n return;\n }\n }\n\n // Parameters\n $objectName = trim($this->config->get('plugins.ganalytics.objectName', 'gtag'));\n $position = trim($this->config->get('plugins.ganalytics.position', 'head'));\n\n // Opt Out and Tracking Code and settings\n $code = ''; // init\n $optout_config = $this->getOptOutConfiguration();\n if (!empty($optout_config)) {\n $code .= $this->getOptOutCode($trackingId, $optout_config);\n }\n $settings = $this->getTrackingSettings($trackingId, $objectName);\n $code .= $this->getTrackingCode($objectName);\n $code .= $settings;\n\n // Embed Google Analytics script\n $group = ($position == 'body') ? 'bottom' : null;\n\n $this->grav['assets']->addJs(\"https://www.googletagmanager.com/gtag/js?id={$trackingId}\", 9, true, 'async', $group);\n $this->grav['assets']->addInlineJs($code, null, $group);\n }", "private function runTracking()\n {\n //Ignore if no request, import fixtures.\n if (!$this->request) {\n return false;\n }\n\n // Check if enable\n if (!$this->getConfigValue('log_enabled', 'bool')) {\n return false;\n }\n\n // We never log tracking service calls\n $excludeUrls = $this->getConfigValue('exclude_urls', 'array');\n if ($excludeUrls) {\n $currentUrl = $this->request->getRequestUri();\n foreach ($excludeUrls as $url) {\n if (substr($currentUrl, 0, strlen($url)) == $url) {\n return false;\n }\n }\n }\n\n return true;\n }", "public function track($trackingNumber);", "function doStopTourAction() {\n//\t\t$request = DevblocksPlatform::getHttpRequest();\n\n\t\t$worker = CerberusApplication::getActiveWorker();\n\t\tDAO_WorkerPref::set($worker->id, 'assist_mode', 0);\n\t\t\n//\t\tDevblocksPlatform::redirect(new DevblocksHttpResponse($request->path, $request->query));\n\t}", "public function markAsTemporaryOffline() {}", "public function videoconferenciaNoInterrumpir( ) {\n $this->setNoInterrumpir(\"OFF\");\n //$this->setNoInterrumpir(\"ALLOCATED\");\n }", "public function tracking() {\n\n\t\t// Return if user is logged in\n\t\tif ( is_user_logged_in() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Display tracking code\n\t\tif ( $tracking = get_theme_mod( 'tracking' ) ) {\n\t\t\techo $tracking;\n\t\t}\n\n\t}", "public function availableCheckout()\n {\n //and disables method if it is not\n\n $country = $this->_website->getConfig('payment/mercadopago/country');\n\n if (!in_array($country, $this->available_transparent_credit_cart)) {\n Mage::getConfig()->saveConfig('payment/mercadopago_custom/active', 0, 'websites', $this->_website->getId());\n }\n\n if (!in_array($country, $this->available_transparent_ticket)) {\n Mage::getConfig()->saveConfig('payment/mercadopago_customticket/active', 0, 'websites', $this->_website->getId());\n }\n }", "public function obligePauseWhenNotCurrent()\n {\n $last_entry = $this->getLastEntry();\n\n //process only when the task is not current\n if (!$this->is_current()) {\n \n if (!in_array($last_entry->entry_type,['pause','end'])) {\n $this->build_error('Please the last entry type of this task must be: pause or end');\n }\n }\n }", "public function saveTrackingPayOut($request_id)\n {\n \n }", "function enableHitsOnly(){\n\t\t$this->hitsonly = true;\n\t}", "public function off()\n {\n echo 'The tv is off now.' . PHP_EOL;\n }", "public function switchOn();", "public function accept(){\r\n\t\tif($this->valid == true) return;\r\n\r\n\t\t$this->valid = true;\r\n\r\n\t\t$mysqli = \\Database::Instance()->get();\r\n\t\t$stmt = $mysqli->prepare(\"UPDATE `hotspots` SET `valid` = 1 WHERE `id` = ?\");\r\n\t\t$stmt->bind_param(\"i\",$this->id);\r\n\t\t$stmt->execute();\r\n\t\t$stmt->close();\r\n\r\n\t\t$this->saveToCache();\r\n\t}", "public function isIntegranteInactivo(){ return false; }", "public function trackOrder($trackingNo);", "public function processChangeOptinVal()\n {\n }", "private function maybe_ping_ud() {\n\n /**\n * May be dismiss notice from UD server\n */\n if( !empty( $_REQUEST[ 'dismiss_ud_notice' ] ) ) {\n $notices = get_option( 'dismissed_ud_notices' );\n if( !is_array( $notices ) ) {\n $notices = array();\n }\n array_push( $notices, $_REQUEST[ 'dismiss_ud_notice' ] );\n $notices = array_unique( $notices );\n update_option( 'dismissed_ud_notices', $notices );\n if( !empty( $_SERVER[ 'HTTP_REFERER' ] ) ) {\n wp_redirect( $_SERVER[ 'HTTP_REFERER' ] );\n } else {\n wp_redirect( admin_url( 'index.php' ) );\n }\n exit;\n }\n\n $cache = true;\n\n $option = sanitize_key( 'ud_ping_' . sanitize_key( $this->slug ) );\n $response = get_option( $option );\n\n if (\n false === $response ||\n empty( $response ) ||\n empty( $response[ 'time' ] ) ||\n ( time() - $response[ 'time' ] ) >= DAY_IN_SECONDS\n ) {\n\n $cache = false;\n\n $detected_products = array();\n\n foreach( $this->get_detected_plugins() as $product ) {\n $detected_products[ $product[ 'product_id' ] ] = array(\n 'version' => $product[ 'product_version' ],\n 'status' => $product[ 'product_status' ],\n 'product_id' => $product[ 'product_id' ],\n );\n }\n\n $response = $this->api->ping( array(\n 'product_id' => $this->slug,\n 'version' => $this->args[ 'version' ],\n 'detected_products' => base64_encode( json_encode( $detected_products ) ),\n ) );\n\n if ( false !== $response && empty( $response[ 'error' ] ) ) {\n update_option( 'ud_ping_' . sanitize_key( $this->slug ), array(\n 'time' => time(),\n 'data' => $response\n ) );\n }\n\n } else {\n if( empty( $response[ 'data' ] ) ) {\n return;\n }\n $response = $response[ 'data' ];\n }\n\n if ( false !== $response && empty( $response[ 'error' ] ) ) {\n\n /**\n * Here we can take care about response.\n *\n * @param string $this->slug ( product_id )\n * @param array $response\n * @param bool $cache got from cache or not\n */\n $this->ping_response = apply_filters( 'ud::ping::response', $response, $this->slug, $cache );\n\n /**\n * Render Admin Notice from UD server.\n */\n if( !empty( $this->ping_response[ 'message' ] ) ) {\n global $_ud_ping_notices;\n\n if( !isset( $_ud_ping_notices ) || !is_array( $_ud_ping_notices ) ) {\n $_ud_ping_notices = array();\n }\n\n $notice = $this->ping_response[ 'message' ];\n\n /** Determine if user has permissions to see plugin notices */\n if ( ! function_exists( 'wp_get_current_user' ) ) {\n require_once( ABSPATH . 'wp-includes/pluggable.php' );\n }\n if( !current_user_can( 'activate_plugins' ) ) {\n return;\n }\n\n /** Determine if notice dismissed */\n $dismissed = get_option( 'dismissed_ud_notices' );\n $dismissed = is_array( $dismissed ) ? $dismissed : array();\n if( in_array( md5( $notice ), $dismissed ) ) {\n return;\n }\n\n if( in_array( $notice, $_ud_ping_notices ) ) {\n return;\n }\n\n array_push( $_ud_ping_notices, $this->ping_response[ 'message' ] );\n\n if( !has_action( 'admin_notices', array( __CLASS__, 'ping_admin_notices' ) ) ) {\n add_action( 'admin_notices', array( __CLASS__, 'ping_admin_notices' ) );\n add_filter( 'ud::ping::response::admin_notice::icon', array( $this, 'get_admin_notice_icon' ) );\n }\n\n }\n\n }\n\n }", "function track_clicks_allowed_by_user(){\n if (!$this->get_config('track_visits_of_loggedin_users',true) && serendipity_userLoggedIn()){\n return false;\n }\n return true;\n }", "private function handleStop(): void\n {\n for ($i = 0; $i < count($this->drivers); $i++) {\n for ($j = $i + 1; $j < count($this->drivers); $j++) {\n if ($this->drivers[$i]->getCurrentStop() === $this->drivers[$j]->getCurrentStop()) {\n $this->exchangeGossips($this->drivers[$i], $this->drivers[$j]);\n }\n }\n }\n }", "function method_optout($request)\n{\n $log = Loggermanager::getLogger('swim.optout');\n \n checkSecurity($request, false, true);\n \n RequestCache::setNoCache();\n \n if (!$request->hasQueryVar('section'))\n {\n $log->warn('No section specified.');\n displayNotFound($request);\n return;\n }\n \n $section = FieldSetManager::getSection($request->getQueryVar('section'));\n if (($section === null) || ($section->getType() !== 'mailing'))\n {\n $log->warn('No valid section specified.');\n displayNotFound($request);\n return;\n }\n \n if (!$request->hasQueryVar('email'))\n {\n $log->warn('No email specified.');\n displayNotFound($request);\n return;\n }\n \n $email = $request->getQueryVar('email');\n $items = Item::findItems($section, null, null, 'emailaddress', $email);\n if (count($items) == 0)\n {\n $log->warn('Email '.$email.' not found.');\n displayNotFound($request);\n return;\n }\n \n if (count($items) > 1)\n $log->warn('More than one contact with the same email address.');\n \n foreach ($items as $itemversion)\n {\n $newversion = $itemversion->getVariant()->createNewVersion($itemversion);\n $newversion->setFieldValue('optedin', false);\n $newversion->setComplete(true);\n $newversion->setCurrent(true);\n }\n\n if ($request->hasQueryVar('redirect'))\n redirect($request->getQueryVar('redirect'));\n else\n redirect($request->getNested());\n}", "public function isDoNotTrack(): bool\n {\n return $this->headers->get('DNT', '0') == '1';\n }", "public function set_a_gate($set=null) {\r\n\tif ($this->gatepost == -$this->status) { //doing the goback - as set by goback_to()\r\n\t\t$this->gatepost = $this->status;\r\n\t\treturn true;\r\n\t} else {\r\n\t\tif (!is_null($set)) {\r\n\t\t\t$this->status = $set;\r\n\t\t}\r\n\t\t$this->replace(); //now the goback can find it\r\n\t\treturn false;\r\n\t}\r\n}", "public function onOutOfBand (): void;", "public function isInvoiced() {\n\t\treturn true;\n\t}", "public function setInactive()\r\n {\r\n $this->active = false;\r\n }", "public function turn_on()\n {\n $this->testing = TRUE;\n }", "static function filter_has_tracker_id()\n\t{\n\n\t\tif ( ! jumplead_is_tracker_id_valid() ) {\n\t\t\twp_redirect( admin_url( 'admin.php?page=jumplead_settings' ) );\n\t\t\texit;\n\t\t}\n\t}", "public function toggle_activeness( $curr ) { // param type: int\n\t\t$bypass_list = self::get_option( 'bypass_list' , array() );\n\t\tif ( in_array( $curr, $bypass_list ) ) { // when the ith opt was off / in the bypassed list, turn it on / remove it from the list\n\t\t unset( $bypass_list[ array_search( $curr, $bypass_list ) ] );\n\t\t\t$bypass_list = array_values( $bypass_list );\n\t\t\tself::update_option( 'bypass_list', $bypass_list );\n\t\t\treturn true;\n\t\t} else { \t// when the ith opt was on / not in the bypassed list, turn it off / add it to the list\n\t\t\t$bypass_list[] = ( int ) $curr;\n\t\t\tself::update_option( 'bypass_list', $bypass_list );\n\t\t\treturn false;\n\t\t}\n\t}", "protected function _checkStatus() {\n if ($this->analyticsEnabled === null) {\n $this->analyticsEnabled = Zend_Registry::get('config')->analytics->enabled; \n } \n if ($this->analyticsEnabled != 1) { \n throw new Exception(\"We're sorry, Analytics is disabled at the moment\");\n }\n }", "public function isTrackingNotification()\n {\n return (1 == $this->getConfig('notification/tracking_notification'));\n }", "public function trackEvent($event) {\n\t\t\n\t\t// do not track anything if user is in overlay mode\n\t\tif (owa_coreAPI::getStateParam('overlay')) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$this->setGlobalEventProperty( 'HTTP_REFERER', owa_coreAPI::getServerParam('HTTP_REFERER') );\n\t\t\n\t\t// needed by helper page tags function so it can append to first hit tag url\t\n\t\tif (!$this->getSiteId()) {\n\t\t\t$this->setSiteId($event->get('site_id'));\n\t\t}\n\t\t\n\t\tif (!$this->getSiteId()) {\n\t\t\t$this->setSiteId(owa_coreAPI::getRequestParam('site_id'));\n\t\t}\n\t\t\n\t\t// set various state properties.\n\t\t$this->manageState( $event );\n\t\t\n\t\t$event = $this->setAllGlobalEventProperties( $event );\n\t\t\n\t\t// send event to log API for processing.\n\t\treturn owa_coreAPI::logEvent($event->getEventType(), $event);\n\t}", "public function applyTracking()\n {\n $this->log->debug(\"Tracking not available before FF 6.0!\");\n return false;\n }", "protected static function set_status()\n {\n }", "public static function is_in_use()\n {\n }", "function OnTrack($track)\n\t{\n\t\t\n\t\techo \"\\nEvento onTrack lanzado!!! track:\".$track;\n\t\t\n\t\t$this->informaClientesResultadoLecturaTarjeta($track);\n\t\t\n\n\t\t//###Primero controlamos si el nodo tiene asociada una taquilla en la bd y guardo su id\n\t\t$result = $this->conexionDB->query(\"SELECT id_taquillas \n\t\t\t\t\t\t\t\t\t\t\tfrom taquillas \n\t\t\t\t\t\t\t\t\t\t\twhere ip_nodo = '\".$this->ipLocal.\"'\");\n\t\t\n\t\tif ($result->num_rows == 0)\n\t\t{\n\t\t\techo \"\\nLa dirección de este nodo no controla ninguna taquilla en la Base de Datos: \".$this->ipLocal.\"\\n\\n\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//buscamos en primer row,ya que taquillas tiene ip_nodo UNIQUE\n\t\t$row = $result->fetch_assoc();\n\t\t$id_taqui = $row['id_taquillas'];\n\t\t\n\t\t//----------\n\t\t\n\t\t\n\t\t//###Segundo controlamos, mirando el numero de tarjeta, cual es el empleado que la posee\n\t\t$result = $this->conexionDB->query(\"SELECT id_empleados \n\t\t\t\t\t\t\t\t\t\t\tfrom empleados \n\t\t\t\t\t\t\t\t\t\t\twhere num_tarjeta = '\".$track.\"'\");\n\t\t\n\t\tif ($result->num_rows == 0)\n\t\t{\n\t\t\techo \"\\nNo existe empleado con numero de tarjeta equivalente a track: \".$track.\"\\n\\n\";\n\t\t\t\n\t\t\t//MODO SUPER restrictivo, una tarjeta errónea hace saltar la alarma del relé num 2 (indice 1)\n\t\t\t//comentar siguientes dos lineas para evitarlo\n\t\t\t//$this->ActivateRelay(1, 0xA);\n\t\t\t//echo \"\\nModo restrictivo, tarjeta no autorizada, dispara Alarma\\n\";\n\t\t\t\n\t\t\treturn;\n\t\t}\t\n\t\t\n\t\t//buscamos en primer row,ya que empleados tiene num_tarjeta UNIQUE\n\t\t$row = $result->fetch_assoc();\n\t\t$id_emp = $row['id_empleados'];\n\t\t\n\t\t//----------\n\t\t\n\t\t\n\t\t\n\t\t//###Tercero, controlamos, mirando el id de empleado y el id de taquilla, si el empleado es POSEEDOR de esa taquilla\n\t\t//segun la logica de la base de datos\n\t\t$result = $this->conexionDB->query(\"SELECT id_empleados \n\t\t\t\t\t\t\t\t\t\t\tfrom empleados \n\t\t\t\t\t\t\t\t\t\t\twhere num_tarjeta = '\".$track.\"' and id_empleados = (select id_empleados from taquillas where id_taquillas=\".$id_taqui.\")\");\n\t\t\n\t\tif ($result->num_rows == 0)\n\t\t{\n\t\t\techo \"\\nEl empleado con id \".$id_emp.\" y num_tarjeta \".$track.\" NO es poseedor de la taquilla que controla este Nodo\\n nodo con IP: \".$this->ipLocal.\", controla taquilla con id:\".$id_taqui.\"\\n\\n\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//###Cuarto, por fin!!! producimos apertura de taquilla, relé 0, 5 decimas de segundo (son numeros hexa)\n\t\techo \"\\nEmpleado y Tarjeta autenticados para la taquilla de este nodo, se procede a la apertura de puerta\\n\\n\";\n\t\t$resultadoActivateRelay = $this->ActivateRelay(0, 5);\n\t\t\n\t\t//que codigo responde ActivateRelay??, ha de ser == 0\n\t\tif($resultadoActivateRelay > 0)\n\t\t{\n\t\t\techo \"\\nErr. Se intento abrir puerta pero ActivateRelay() no tuvo exito\\n\\n\";\n\t\t\treturn;\n\t\t}\n\t\t\n\t\techo \"\\nACCESO PERMITIDO!!!\\n\\n\";\n\t\t\n\t\t$query = \"insert into accesos (id_taquillas, id_empleados, fecha_hora, num_tarjeta)\n\t\t\t\t values(\".$id_taqui.\",\".$id_emp.\",'\".date(\"Y-m-d H:i:s\").\"','\".$track.\"')\";\n\t\t\t\t\n\t\t\t\t\n\t if ( $this->conexionDB->query($query) ) \n\t {\n\t\t echo \"\\nOntrack produjo registro de acceso en Base de Datos\\n\\n\";\n\t\t} \n\t\telse \n\t\t{\n\t\t echo \"\\nProblema de insercion de registro acceso en Base de Datos\\n\\n\";\n\t\t return;\n\t\t}\n\t\t \n\t\t\n\t\t\n\t}", "protected function track(Request $request, Classified $deal)\n {\n // Get tracker\n $tracker = new Tracker;\n\n // Get user ip\n $ip = ip();\n \n // Check if tracking succeed\n if (!$tracker->isSucceed) {\n return;\n }\n \n // New stats query\n $tracking = new ClassifiedStatistics;\n \n // Check if already visited\n $visit = $tracking->whereDealId($deal->id)->whereIp($ip)->first();\n\n // Already visited? update last visit\n if ($visit) {\n\n $visit->last_visit = now();\n $visit->save();\n\n // Success\n return;\n }\n\n // New visit\n $tracking->create([\n 'deal_id' => $deal->id,\n 'ip' => $ip,\n 'provider' => $tracker->provider,\n 'countryCode' => $tracker->countryCode,\n 'countryName' => $tracker->countryName,\n 'state' => $tracker->state,\n 'city' => $tracker->city,\n 'continent' => $tracker->continent,\n 'longitutde' => $tracker->longitutde,\n 'latitude' => $tracker->latitude,\n 'browserName' => $tracker->browserName,\n 'browserVersion' => str_replace('_', '.', $tracker->browserVersion),\n 'browserLanguage' => $request->language,\n 'platformName' => $tracker->platformName,\n 'platformVersion' => str_replace('_', '.', $tracker->platformVersion),\n 'isPhone' => $tracker->isPhone,\n 'isTablet' => $tracker->isTablet,\n 'isDesktop' => $tracker->isDesktop,\n 'isRobot' => $tracker->isRobot,\n 'robotName' => $tracker->robotName,\n 'deviceName' => $tracker->deviceName,\n 'screenWidth' => $request->width,\n 'screenHeight' => $request->height,\n 'referrer' => $tracker->referrer,\n 'referrerDomain' => $tracker->referrerDomain,\n 'searchEngineKeyword' => $tracker->searchEngineKeyword,\n 'first_visit' => $tracker->first_visit,\n 'last_visit' => $tracker->last_visit\n ]);\n\n // Success\n return;\n\n }", "public function should_track_identity()\n {\n }", "public function testOff()\n\t{\n\t\tCatapult\\Log::on(FALSE);\n\t\t$this->assertTrue(!Catapult\\Log::isOn());\n\t}", "function run_leaving_activity_pre()\n\t\t{\n\t\t\t//actually we never send emails when cancelling\n\t\t\treturn true;\n\t\t}", "function stopCountingAdded()\n {\n\t$this->stopCountingAddedLevels();\n\t$this->stopCountingAddedVehicles();\n\t$this->doStopCountingAdded();\n }", "public function beforeSave() {\n if ($this->trackingKey === null) {\n $this->trackingKey = self::getNewTrackingKey();\n }\n\n return parent::beforeSave();\n }", "public function isIntegranteActivo(){ return false; }", "public function setGoal()\n {\n }", "public function propegate() : void\n {\n $this->event->sender->enabledForSite = in_array(\n $this->event->sender->siteId,\n $this->event->sender->getFieldValue('sites')\n );\n }", "function update_status() {\r\n global $order, $db;\r\n\r\n if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_NOCHEX_ZONE > 0) ) {\r\n $check_flag = false;\r\n $check_query = $db->Execute(\"select zone_id from \" . TABLE_ZONES_TO_GEO_ZONES . \" where geo_zone_id = '\" . MODULE_PAYMENT_NOCHEX_ZONE . \"' and zone_country_id = '\" . $order->billing['country']['id'] . \"' order by zone_id\");\r\n while (!$check_query->EOF) {\r\n if ($check_query->fields['zone_id'] < 1) {\r\n $check_flag = true;\r\n break;\r\n } elseif ($check_query->fields['zone_id'] == $order->billing['zone_id']) {\r\n $check_flag = true;\r\n break;\r\n }\r\n $check_query->MoveNext();\r\n }\r\n\r\n if ($check_flag == false) {\r\n $this->enabled = false;\r\n }\r\n }\r\n }", "public function afterFind()\n\t{\n\t\t$session = new CHttpSession;\n\t\t// this is the hack to prevent from stopping/breaking the script\n\t\tif(isset($session[\"timezone\"]) && !empty($session[\"timezone\"])){\n\t\t\t$timezone = $session[\"timezone\"];\n\t\t}else{\n\t\t\t$timezone = 'Australia/Perth';\n\t\t}\n\t\t// Set closed visit if time-checkout reached current time.\n\t\t$dateIn = new DateTime($this->date_check_in);\n\t\t$dateOut = new DateTime($this->date_check_out);\n\t\t$dateNow = new DateTime(\"NOW\" , new DateTimeZone($timezone));\n\n\t\t$isExpired = $dateOut->diff($dateNow)->format(\"%r%a\");\n\n\t\tif( $isExpired > 0 && $this->visit_status == VisitStatus::ACTIVE ) {\n\n\t\t\t$status = \"\";\n\n\t\t\t// * VIC 24Hours visit will be Closed and Manual visit will be Closed manaually, Other visits will be Expired.\n\t\t\t// * Also instead of 'Expired' will have 'Closed' status for Auto Closed EVIC & 24 hour when the check out date exceeds current date. *\n\n\t\t\tif( ($this->card_type == CardType::VIC_CARD_24HOURS || $this->card_type == CardType::VIC_CARD_EXTENDED) &&\n\t\t\t\t$this->visit_status == VisitStatus::AUTOCLOSED ) {\n\t\t\t\t$status = VisitStatus::CLOSED;\n\t\t\t} else if( $this->card_type != CardType::VIC_CARD_24HOURS ) {\n\t\t\t\t$status = VisitStatus::EXPIRED;\n\t\t\t}\n\t\t\t//Get current time to compare with current visit time\n\t\t\t$current = new DateTime('NOW', new DateTimeZone($timezone));\n\t\t\t$current_hour = $current->format(\"H\");\n\t\t\t$current_minutes = $current->format(\"i\");\n\n\t\t\t// Visit Time\n\t\t\t$time_checkout = $this->time_check_out != \"00:00:00\"? $this->time_check_out: $this->finish_time;\n\t\t\t$checkoutdatetime = $this->date_check_out.\" \".$time_checkout;\n\t\t\t$checkout = new DateTime($checkoutdatetime); // checkout is Already in users timezone\n\t\t\t//compare Time hours and minutes\n\t\t\tif( ( $isExpired > 0 ) || ( $isExpired == 0 && $current_hour > $checkout->format(\"H\") )\n\t\t\t\t|| ( $isExpired == 0 && $current_hour == $checkout->format(\"H\") && $current_minutes >= $checkout->format(\"i\")) ) {\n\t\t\t\t//Update\n\t\t\t\tif( !empty($status) ) {\n\t\t\t\t\t$insertArr = array();\n\t\t\t\t\t$insertArr[\"visit_status\"] = $status;\n\n\t\t\t\t\t$this->updateByPk( $this->id, $insertArr );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn parent::afterFind();\n\t}", "public function isVisitante(){ return false; }", "public function headlights_off() {\r\n echo PHP_EOL;\r\n $this->action(\"turning headlights off\");\r\n $this->lights_on = FALSE;\r\n $this->action(\"headlights are off\");\r\n\r\n }", "public function isActivated() {}", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "public function checkIfCurrent() {\n if (isset($_GET['_category']) && $_GET['_category'] == $this->id) {\n $this->activate = true;\n } else {\n $this->activate = false;\n }\n }", "public function isHit()\n {\n return false;\n }", "public function checkOptIn(Checkout $event)\n {\n // Ignore steps that are not cart, address or payment.\n switch ($event->getStepKey()) {\n case 'cart':\n case 'address':\n case 'payment':\n $data = $event->getDataKey('mailchimp_opt_in');\n if ($data === 'on') {\n $order = $event->getOrder();\n $order->setProperty('mailchimp_opt_in', true);\n $order->save();\n }\n }\n }", "function switchPromote()\n\t{\n\t\t$this->doPromote = true;\n\t}", "function update_status() {\n global $order;\n if ($this->enabled && ((int) constant(\"MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_ZONE\") > 0)) {\n $check_flag = false;\n $check_query = tep_db_query(\"select zone_id from \" . TABLE_ZONES_TO_GEO_ZONES . \" where geo_zone_id = '\" . constant(\"MODULE_PAYMENT_CGP_\" . $this->module_cgp_text . \"_ZONE\") . \"' and zone_country_id = '\" . $order->delivery['country']['id'] . \"' order by zone_id\");\n while ($check = tep_db_fetch_array($check_query)) {\n if ($check['zone_id'] < 1) {\n $check_flag = true;\n break;\n } else if ($check['zone_id'] == $order->delivery['zone_id']) {\n $check_flag = true;\n break;\n }\n }\n \n if (! $check_flag) {\n $this->enabled = false;\n }\n }\n }", "final public function onOutOfBand (): void {\n // do nothing\n }", "function action_track() {\n if(model_user::userLoggedIn()) {\n // Include view for this page.\n @include_once APP_PATH . 'view/track_page.tpl.php';\n } else {\n header('Location: /home/login');\n }\n }", "public function turnOff(){\n\t\treturn \"Turn Off executed\";\n\t}", "public function track_status_view() {\n\t\tif ( isset( $_GET['page'] ) && 'wc-status' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) {\n\n\t\t\t$tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : 'status';\n\n\t\t\tWC_Tracks::record_event(\n\t\t\t\t'status_view',\n\t\t\t\tarray(\n\t\t\t\t\t'tab' => $tab,\n\t\t\t\t\t'tool_used' => isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : null,\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif ( 'status' === $tab ) {\n\t\t\t\twc_enqueue_js(\n\t\t\t\t\t\"\n\t\t\t\t\t$( 'a.debug-report' ).click( function() {\n\t\t\t\t\t\twindow.wcTracks.recordEvent( 'status_view_reports' );\n\t\t\t\t\t} );\n\t\t\t\t\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function trackTransaction() {\n\t\t\n\t\tif ( ! empty( $this->commerce_event ) ) {\n\t\t\t$this->trackEvent( $this->commerce_event );\n\t\t\t$this->commerce_event = '';\n\t\t}\n\t}", "function abort() {\n $this->aborted = TRUE;\n }", "function trackPageView() {\n $timeStamp = time();\n $domainName = $_SERVER[\"SERVER_NAME\"];\n if (empty($domainName)) {\n $domainName = \"\";\n }\n\n // Get the referrer from the utmr parameter, this is the referrer to the\n // page that contains the tracking pixel, not the referrer for tracking\n // pixel.\n $documentReferer = $_GET[\"utmr\"];\n if (empty($documentReferer) && $documentReferer !== \"0\") {\n $documentReferer = \"-\";\n } else {\n $documentReferer = urldecode($documentReferer);\n }\n $documentPath = $_GET[\"utmp\"];\n if (empty($documentPath)) {\n $documentPath = \"\";\n } else {\n $documentPath = urldecode($documentPath);\n }\n\n $account = $_GET[\"utmac\"];\n $userAgent = $_SERVER[\"HTTP_USER_AGENT\"];\n if (empty($userAgent)) {\n $userAgent = \"\";\n }\n\n // Try and get visitor cookie from the request.\n $cookie = isset($_COOKIE[COOKIE_NAME]) ? $_COOKIE[COOKIE_NAME] : '';\n\n $dcmguid = isset($_SERVER[\"HTTP_X_DCMGUID\"]) ? $_SERVER[\"HTTP_X_DCMGUID\"] : '';\n $visitorId = getVisitorId(\n $dcmguid, $account, $userAgent, $cookie);\n\n // Always try and add the cookie to the response.\n setrawcookie(\n COOKIE_NAME,\n $visitorId,\n $timeStamp + COOKIE_USER_PERSISTENCE,\n COOKIE_PATH);\n\n $utmGifLocation = \"http://www.google-analytics.com/__utm.gif\";\n\n // Construct the gif hit url.\n $utmUrl = $utmGifLocation . \"?\" .\n \"utmwv=\" . VERSION .\n \"&utmn=\" . getRandomNumber() .\n \"&utmhn=\" . urlencode($domainName) .\n \"&utmr=\" . urlencode($documentReferer) .\n \"&utmp=\" . urlencode($documentPath) .\n \"&utmac=\" . $account .\n \"&utmcc=__utma%3D999.999.999.999.999.1%3B\" .\n \"&utmvid=\" . $visitorId .\n \"&utmip=\" . getIP($_SERVER[\"REMOTE_ADDR\"]);\n\n sendRequestToGoogleAnalytics($utmUrl);\n\n // If the debug parameter is on, add a header to the response that contains\n // the url that was used to contact Google Analytics.\n if (!empty($_GET[\"utmdebug\"])) {\n header(\"X-GA-MOBILE-URL:\" . $utmUrl);\n }\n // Finally write the gif data to the response.\n writeGifData();\n }", "public function post_on(){\n\n\t\tSettings::where_in('type', 'indira')->and_where('param', '=', 'under_development')->update(array('value' => 'true'));\n\n\t\t$data = array();\n\t\t$data[\"on\"] = 'active';\n\t\t$data[\"off\"] = null;\n\n\t\tIndira::set('indira.under_development');\n\n\t\treturn View::make('admin.development.thumbler', $data);\n\t}", "function set_stopout_share_flag($acc_number)\n\t{\n\t $data['stopout_flag'] = 1;\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 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}" ]
[ "0.7023692", "0.6745536", "0.6483121", "0.6312687", "0.6303043", "0.6269456", "0.6262989", "0.60165125", "0.5997165", "0.59912074", "0.588335", "0.57987016", "0.577245", "0.56777954", "0.5634966", "0.5484578", "0.54803425", "0.5477424", "0.54265904", "0.53685606", "0.53452456", "0.531867", "0.5287319", "0.5262479", "0.5193733", "0.51812524", "0.51673317", "0.5153364", "0.51491493", "0.50887275", "0.50758326", "0.50267696", "0.5012197", "0.49555883", "0.49485737", "0.49473172", "0.4933948", "0.49169862", "0.48746452", "0.4871501", "0.48655447", "0.4857355", "0.48499522", "0.4849513", "0.48451594", "0.48353204", "0.48308676", "0.48287293", "0.4821685", "0.4816912", "0.48033398", "0.4798923", "0.47929886", "0.4791602", "0.47816822", "0.47735623", "0.47711822", "0.4758529", "0.4755343", "0.47411382", "0.47371587", "0.47369972", "0.47365254", "0.47347274", "0.47213814", "0.47209865", "0.47207758", "0.47189343", "0.47136524", "0.470149", "0.46979854", "0.46884736", "0.46811548", "0.4677185", "0.46687475", "0.4668481", "0.46680897", "0.4666871", "0.4665608", "0.4652837", "0.4651647", "0.46495932", "0.4645182", "0.46451008", "0.46451008", "0.46358252", "0.46320245", "0.46311945", "0.46303314", "0.46300566", "0.4627727", "0.4626147", "0.4622573", "0.4621133", "0.4619626", "0.46194196", "0.461606", "0.46106768", "0.4607266", "0.46072087" ]
0.4661481
79
Enqueue CSS for opt in UI.
function enqueue_scripts() { if ( ! is_null( is_user_opted_in() ) ) { return; } wp_enqueue_style( 'altis-telemetry', plugins_url( 'assets/opt-in.css', dirname( __FILE__, 2 ) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_css() \n {\n if( $this->options['use-css-file'] ) {\n wp_register_style( 'bbquotations-style' , $this->plugin_url . 'bbquotations-style.css');\n wp_enqueue_style( 'bbquotations-style' );\n } \n }", "public function styles() {\n\t\t\n\t\twp_register_style( 'tinymassmailer-admin', _tinymassmailer_PATH . '/css/page-options.css' );\n\t\twp_enqueue_style( 'tinymassmailer-admin' );\n\t\t\n\t}", "public function enqueue() {\n\t\t\twp_enqueue_style( 'mtm-custom-controls-css', $this->get_mtm_resource_url() . 'css/customizer.css', array(), '1.0', 'all' );\n\t\t}", "public function enqueue() {\n\t\t\twp_enqueue_style( 'mtm-custom-controls-css', $this->get_mtm_resource_url() . 'css/customizer.css', array(), '1.0', 'all' );\n\t\t}", "public function enqueue() {\n\t\t\twp_enqueue_style( 'mtm-custom-controls-css', $this->get_mtm_resource_url() . 'css/customizer.css', array(), '1.0', 'all' );\n\t\t}", "public function enqueue() {\n\t\t\twp_enqueue_style( 'mtm-custom-controls-css', $this->get_mtm_resource_url() . 'css/customizer.css', array(), '1.0', 'all' );\n\t\t}", "public function addStyling()\n {\n \\wp_enqueue_style(self::REACT_WP_THEME, \\get_template_directory_uri() . '/frontend/dist/style.css', [], '0.1');\n }", "function plugin_admin_styles() {\r\n\t\t\t// used by media upload\r\n\t\t\twp_enqueue_style('thickbox');\r\n\t\t\t// Register & enqueue our admin.css file \r\n\t\t\twp_register_style('framework', $this->framework_url .'framework.css');\r\n\t\t\twp_enqueue_style('framework');\r\n\t\t\t// color picker\r\n\t\t\twp_enqueue_style( 'farbtastic' );\r\n\t\t\r\n\t\t}", "function mokore_admin_enqueue_style(){\n\t\twp_register_style('mokore_admin_css', get_template_directory_uri() . '/inc/css/admin.css', false);\n\t\twp_enqueue_style('mokore_admin_css');\n\t}", "public function enqueues()\n {\n\n // CSS\n wp_enqueue_style(\n 'wpforms-builder-settings',\n WPFORMS_PLUGIN_URL . 'assets/css/admin-builder-settings.css',\n null,\n WPFORMS_VERSION\n );\n }", "public function acfedu_add_css() {\n\t\t\t\twp_enqueue_style( 'acf-faculty-selector', plugins_url( 'assets/css/acf-faculty-selector.css', __FILE__ ) );\n\t\t\t}", "function enqueues() {\n\t\twp_register_style( 'ks-thematic-actions', plugin_dir_url( __FILE__ ) . 'style.css' );\n\t wp_enqueue_style( 'ks-thematic-actions' );\n\t}", "public function enqueues() {\n\n\t\t// CSS.\n\t\twp_enqueue_style(\n\t\t\t'wpforms-builder-setup',\n\t\t\tWPFORMS_PLUGIN_URL . 'assets/css/admin-builder-setup.css',\n\t\t\tnull,\n\t\t\tWPFORMS_VERSION\n\t\t);\n\t}", "public function admin_enqueue()\n\t{\n\t\t// styles.\n\n\t}", "public function form_css(){\n\t\twp_register_style( 'lead_gen_plugin', plugin_dir_url( __FILE__ ) . 'css/style.css', false );\n\t\twp_enqueue_style( 'lead_gen_plugin' );\n\t}", "private function enqueueStyle() {\n wp_enqueue_style(\n 'shokka-forms',\n plugins_url( 'css/dist/style.css', 'shokka-forms/shokka-forms.php' ),\n array(),\n filemtime(\n sprintf(\n '%s%s%s',\n trailingslashit( WP_PLUGIN_DIR ),\n plugin_dir_path( 'shokka-forms/shokka-forms.php' ),\n wp_normalize_path( 'css/dist/style.css' )\n )\n )\n );\n }", "public function frontend_styles() {\n wp_enqueue_style( 'wc-label-gallery', $this->plugin_url() . '/assets/css/label-frontend.css' );\n }", "public function enqueue_styles() {\n\t\twp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/coinqvest.modal.css', array(), $this->version, 'all');\n\t}", "function css_files() {\n\t\twp_enqueue_style('escalate_network-admin-global', $this->plugin_url .'/css/styles-admin-global.css');\n\t}", "public function enqueueLicenseStyles()\n {\n wp_enqueue_style($this->pluginSlug, plugins_url('/assets/css/admin.css', __FILE__), array());\n }", "public function enqueue_styles()\n {\n wp_enqueue_style($this->andmoraho_vendors, plugin_dir_url(__FILE__) . 'css/andmoraho-vendors-admin.css', array(), $this->version, 'all');\n }", "function enqueue_admin_styles() {\n\t\twp_enqueue_style( 'lcarsframework', plugin_dir_url( dirname(__FILE__) ) . 'css/lcarsframework.css', array(), lcars_Framework::VERSION );\n\t\twp_enqueue_style( 'wp-color-picker' );\n\t}", "function duplicate_post_add_options_page_css() {\n\twp_enqueue_style( 'duplicate-post-options', plugins_url( '/duplicate-post-options.css', __FILE__ ), array(), DUPLICATE_POST_CURRENT_VERSION );\n}", "public function enqueueStyles() {\n\t\t\twp_enqueue_style('app', self::asset(\"css/app.css\"), NULL, '1.0.0', 'all');\n\t\t}", "function register_crunchpress_panel_styles(){\r\n\t\r\n\t\twp_enqueue_style('jquery-ui',CP_PATH_URL.'/framework/stylesheet/jquery-ui.css');\r\n\t\twp_enqueue_style('cp-panel',CP_PATH_URL.'/framework/stylesheet/cp-panel.css');\r\n\t\twp_enqueue_style('mini-color',CP_PATH_URL.'/framework/stylesheet/jquery.miniColors.css');\r\n\t\twp_enqueue_style('confirm-dialog',CP_PATH_URL.'/framework/stylesheet/jquery.confirm.css');\r\n\t\twp_enqueue_style('jquery-timepicker',CP_PATH_URL.'/framework/stylesheet/jquery.ui.timepicker.css');\r\n\t\t\r\n\t}", "public function enqueue_custom_style() {\n\t\t\t$custom_css = $this->_build_custom_css();\n\n\t\t\tif( $custom_css ) {\n\t\t\t\t$handle = wp_script_is( 'yith-wcwl-user-main' ) ? 'yith-wcwl-user-main' : 'yith-wcwl-main';\n\n\t\t\t\twp_add_inline_style( $handle, $custom_css );\n\t\t\t}\n\t\t}", "public function enqueue_styles()\n\t{\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Prosvit_Extension_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Prosvit_Extension_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style('style_select2', plugin_dir_url(__FILE__) . 'css/select2.min.css', array(), $this->version, 'all');\n\t\twp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/prosvit-extension-admin.css', array(), $this->version, 'all');\n\t}", "public function enqueueScripts()\n {\n wp_enqueue_style('gfbitpay-admin', $this->plugin->urlBase . 'style-admin.css', false, GFBITPAY_PLUGIN_VERSION);\n }", "public function enqueue_styles() {\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/deeppress-admin.css', array(), $this->version, 'all' );\n\t\twp_enqueue_style( \n\t\t\t$this->plugin_name.'-imageview', plugin_dir_url( __FILE__ ) . 'css/jquery.imageview.css', \n\t\t\tarray(), \n\t\t\t$this->version, 'all' \n\t\t);\n\t\twp_enqueue_style( \n\t\t\t$this->plugin_name.'-annotorious', plugin_dir_url( __FILE__ ) . 'css/jquery.selectareas.css', \n\t\t\tarray(), \n\t\t\t$this->version, 'all' \n\t\t);\n\t\twp_enqueue_style(\n\t\t\t$this->plugin_name.'-lightgallery', plugin_dir_url( __FILE__ ) . 'css/lightgallery.min.css',\n\t\t\tarray(),\n\t\t\t$this->version, 'all'\n\t\t);\n\n\t}", "function extamus_enqueue_admin_styles()\n {\n $the_theme = wp_get_theme();\n wp_enqueue_style('animate-on-scroll', \"https://unpkg.com/[email protected]/dist/aos.css\", array(), $the_theme->get('Version'));\n wp_enqueue_style('google-fonts', \"https://fonts.googleapis.com/css?family=Staatliches|Crushed|Abril+Fatface|Gothic+A1\", array(), $the_theme->get('Version'));\n if (is_singular() && comments_open() && get_option('thread_comments')) {wp_enqueue_script('comment-reply');\n }\n wp_enqueue_script('AOS', \"https://unpkg.com/[email protected]/dist/aos.js\", array(), $the_theme->get('Version'), false);\n }", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Fastnetmarketing_Admin_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Fastnetmarketing_Admin_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/fastnetmarketing-admin-admin.css', array(), $this->version, 'all' );\n\n\t}", "public function enqueue() {\n\t\t\twp_enqueue_style( 'mtm-custom-controls-css', $this->get_mtm_resource_url() . 'css/customizer.css', array(), '1.0', 'all' );\n\t\t\twp_enqueue_script( 'wp-color-picker-alpha', $this->get_mtm_resource_url() . 'js/wp-color-picker-alpha.js', array( 'wp-color-picker' ), '1.0', true );\n\t\t\twp_enqueue_style( 'wp-color-picker' );\n\t\t}", "function uvasomcmedept_styles() {\n\twp_enqueue_style( 'uvasomcmedept', plugins_url(). '/uvasomcmedept/uvasomcmedept.css');\n}", "public function css() {\n $swpm_settings = get_option('swpm-settings');\n wp_register_style('swpm-jqueryui-css', apply_filters('swpm-date-picker-css', SWPM_FORM_BUILDER_URL . '/css/smoothness/jquery-ui-1.10.3.min.css'), array(), '20131203');\n\t//check if Light CSS option enabled\n\t$is_light=SwpmFbSettings::get_setting('enable-light-css')!==false ? '-light' : '';\n wp_register_style('swpm-form-builder-css', apply_filters('swpm-form-builder-css', SWPM_FORM_BUILDER_URL . \"/css/swpm-form-builder$is_light$this->load_dev_files.css\"), array(), '20140412');\n\n // Settings - Always load CSS\n //if (isset($swpm_settings['always-load-css'])) {\n wp_enqueue_style('swpm-form-builder-css');\n wp_enqueue_style('swpm-jqueryui-css');\n return;\n //}\n // Settings - Disable CSS\n if (isset($swpm_settings['disable-css']))\n return;\n\n // Get active widgets\n $widget = is_active_widget(false, false, 'swpm_widget');\n\n // If no widget is found, test for shortcode\n if (empty($widget)) {\n // If WordPress 3.6, use internal function. Otherwise, my own\n if (function_exists('has_shortcode')) {\n global $post;\n\n // If no post exists, exit\n if (!$post)\n return;\n\n if (!has_shortcode($post->post_content, 'swpm'))\n return;\n } elseif (!$this->has_shortcode('swpm')) {\n return;\n }\n }\n\n wp_enqueue_style('swpm-form-builder-css');\n wp_enqueue_style('swpm-jqueryui-css');\n }", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public function enqueue_styles() {\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Nerd_Wp_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Nerd_Wp_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/contact-helpdesk-admin.css', array(),\n\t\t\t$this->version, 'all' );\n\t}", "function load_admin_styles() {\n\n\t\twp_enqueue_style('thickbox');\n\t\twp_enqueue_style( 'wppm-admin-styles', plugin_dir_url( __FILE__ ) . 'assets/css/admin.css', array(), '0.8' );\n\t\t\n\t}", "function vslider_admin_styles() {\r\n wp_enqueue_style('thickbox');\r\n wp_register_style('colorpicker-css', WP_PLUGIN_URL.'/vslider/picker/colorpicker.css');\r\n wp_enqueue_style( 'colorpicker-css');\r\n wp_register_style('tooltip-css', WP_PLUGIN_URL.'/vslider/css/tooltip.css');\r\n wp_enqueue_style( 'tooltip-css');\r\n}", "public function customize_styles() {\n wp_enqueue_style('admin-theme-css', get_template_directory_uri() . '/css/admin-theme.css', false, CHIANTI_THEME_VERSION, false);\n }", "function uds_pricing_admin_print_css()\n{\n\t$dir = UDS_PRICING_URL;\n\twp_enqueue_style('uds-pricing', $dir.'css/pricing-admin.css', false, false, 'screen');\n}", "public function enqueue_admin_css()\n\t{\t\twp_enqueue_style('mht-plist-css', MHT_PLIST_URL . '/assets/mht-plist.css', array(), wp_rand());\n\t}", "function propanel_of_style_only() {\n\twp_enqueue_style('admin-style', get_stylesheet_directory_uri().'/admin/admin-style.css');\n\twp_enqueue_style('color-picker', get_stylesheet_directory_uri().'/admin/colorpicker.css');\n}", "public function config_page_styles() {\n\t\twp_enqueue_style( 'yseo-gc-admin-css', HS_DOCS_API_DIR_URL . 'css/dist/admin.css', null, HS_DOCS_API_PLUGIN_VERSION );\n\t}", "public function enqueue_styles() {\n wp_enqueue_style(\n $this->plugin_name,\n plugin_dir_url(__FILE__) . 'css/update-monitor-admin.css',\n array(),\n $this->version,\n 'all'\n );\n }", "public function enqueue_scripts() {\n\n\t\twp_enqueue_style( 'kirki-field-dimensions', URL::get_from_path( dirname( __DIR__ ) . '/dist/control.css' ), array(), '1.0' );\n\n\t}", "public function styles(){\n //Enqueue styles\n /**\n * wp_enqueue_style('sample-style',$this->directory_uri . '/sample.css');\n * ...\n * ....\n */\n }", "public function enqueue() {\r\n\t\twp_enqueue_style( 'wfct-ei', WFC_EI_CSS_URL . 'environment-indicator.css', array(), WFC_EI_VERSION );\r\n\t}", "function ninja_forms_admin_css(){\n\t$plugin_settings = nf_get_settings();\n\n\twp_enqueue_style( 'jquery-smoothness', NINJA_FORMS_URL .'css/smoothness/jquery-smoothness.css' );\n\twp_enqueue_style( 'ninja-forms-admin', NINJA_FORMS_URL .'css/ninja-forms-admin.css?nf_ver=' . NF_PLUGIN_VERSION );\n\twp_enqueue_style( 'nf-admin-modal', NINJA_FORMS_URL .'assets/css/admin-modal.css?nf_ver=' . NF_PLUGIN_VERSION );\n\n\tadd_filter('admin_body_class', 'ninja_forms_add_class');\n\n}", "public function enqueueAssets()\n {\n wp_enqueue_style( WPADW_DOMAIN . '-admin-style', WPADW_URL . '/assets/style.css' );\n }", "function adventure_admin_enqueue_scripts( $hook_suffix ) {\r\n\twp_enqueue_style('adventure-theme-options', get_template_directory_uri() . '/theme-options.css', false, '1.0');}", "public function register_admin_styles() {\n wp_enqueue_style( 'wp-jquery-ui-dialog');\n }", "function play_admin_scripts() {\n\twp_enqueue_style( 'play-inc-admin', get_template_directory_uri() . '/inc/assets/css/custom-admin.css' );\n}", "function on_admin_enqueue_scripts ()\n{\n wp_register_style ('cap-meta-search-admin', plugins_url ('css/admin.css', __FILE__));\n wp_enqueue_style ('cap-meta-search-admin');\n}", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Plugin_Name_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Plugin_Name_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/drinkers-edition-admin.css', array(), $this->version, 'all' );\n\n\t}", "function ROMP_enquiry_form_admin_assets(){\n\t\twp_enqueue_style('CSS-bootstrap-min', 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css');\n\t\twp_enqueue_script('JS-bootstrap-min', 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js');\n\t\twp_enqueue_style( 'ROMP-enquiry-form-css', plugins_url( 'romp-enquiry-plugin/assets/css/style.css'), 20, 1 );\n\t}", "public function editor_enqueue()\n\t{\n\t\tadd_editor_style('assets/css/editor.css');\n\t}", "function WDA_admin_css_all_page() { \n wp_register_style($handle = 'WDA_admin-css-all', $src = plugins_url('css/WDA_style.css', __FILE__), $deps = array(), $ver = '1.0.0', $media = 'all');\n wp_enqueue_style('WDA_admin-css-all');\n}", "function admin_print_styles() {\n global $SlideDeckPlugin;\n\n wp_enqueue_style( \"{$this->namespace}-admin\" );\n\n if( $SlideDeckPlugin->is_plugin() ) {\n wp_enqueue_style( 'codemirror' );\n wp_enqueue_style( 'codemirror-theme-default' );\n wp_enqueue_style( 'jquery-minicolors' );\n }\n }", "function faculty_settings_styles() {\n wp_enqueue_style('farbtastic');\n wp_enqueue_style('faculty-admin', get_stylesheet_directory_uri() . '/lib/css/admin.css', array(), faculty_get_version());\n}", "function addcss()\n{\nwp_register_style('ahmed_css', plugin_dir_url(__file__).'/styles-ahmed.css');\nwp_enqueue_style('ahmed_css');\n}", "private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }", "public function addPluginFrontendStylesheets() {\n global $laterpay_version;\n wp_register_style(\n 'laterpay-post-view',\n LATERPAY_ASSET_PATH . '/static/css/laterpay-post-view.css',\n array(),\n $laterpay_version\n );\n wp_register_style(\n 'laterpay-dialogs',\n 'https://static.sandbox.laterpaytest.net/webshell_static/client/1.0.0/laterpay-dialog/css/dialog.css'\n );\n wp_enqueue_style('laterpay-post-view');\n wp_enqueue_style('laterpay-dialogs');\n }", "function ct_include_style () {\n\tif ( !is_admin() ) {\n\t\twp_enqueue_style( 'christatimmer', get_stylesheet_uri() );\n\t}\n}", "public static function wp_enqueue_scripts() {\n\t\t\t\n\t\t\tWPPFrontendUI::_register_styles();\n\t\t\t\n\t\t}", "function gre_search_styles()\n{\n\t// page it will not load the css script\n\tif(!is_admin())\n\t{\n\t\twp_enqueue_style('jquery-ui-css','/wp-content/plugins/gre-search/css-includes/jquery-ui-1.7.2.custom.css');\n\t\twp_enqueue_style('search-form','/wp-content/plugins/gre-search/css-includes/search-form.css');\n\t}\n}", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in SpaceAPI_WP_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The SpaceAPI_WP_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/spaceapi-wp-admin.css', array(), $this->version, 'all' );\n\n\t}", "public function enqueue_style() {\n\t\twp_enqueue_style( 'aztec-style', get_stylesheet_directory_uri() . '/assets/css/styles.css' );\n\t}", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Points_Of_Sale_Admin_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Points_Of_Sale_Admin_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/points-of-sale-admin.css', array(), $this->version, 'all');\n\n\t}", "function custom_admin_style() {\n wp_register_style('custom_admin_css', get_template_directory_uri() . '/dist/css/admin.css.php', false, '1.0.0');\n wp_enqueue_style('custom_admin_css');\n\n wp_register_script('custom_admin_scripts', get_template_directory_uri() . '/dist/js/admin.js', array('jquery'), '1.0.0', true );\n wp_enqueue_script('custom_admin_scripts');\n}", "public function enqueue_styles() {\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/sanoa-links-linter-public.css', array(), $this->version, 'all' );\n\t}", "function wm_customizer_panel_enqueue_assets() {\n $ctime = filemtime( get_template_directory() . '/customizer/css/wm-customizer-panel.css' );\n wp_enqueue_style( 'wm-customizer-panel-css', get_template_directory_uri() . '/customizer/css/wm-customizer-panel.css', array( 'customize-controls' ), $ctime );\n $ctime = filemtime( get_template_directory() . '/customizer/js/wm-customizer-panel.js' );\n wp_enqueue_script( 'wm-customizer-panel-js', get_template_directory_uri() . '/customizer/js/wm-customizer-panel.js', array( 'jquery', 'customize-controls' ), $ctime, true );\n }", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Nimiq_Miner_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Nimiq_Miner_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/nimiq-miner-public.css', array(), $this->version, 'all' );\n\n\t}", "function wpbooklist_jre_carousel_frontend_ui_style() {\n wp_register_style( 'wpbooklist-carousel-frontend-ui', CAROUSEL_ROOT_CSS_URL.'carousel-frontend-ui.css' );\n wp_enqueue_style('wpbooklist-carousel-frontend-ui');\n}", "function cinerama_edge_enqueue_admin_styles() {\n\t\twp_enqueue_style( 'wp-color-picker' );\n\n\t\t/**\n\t\t * @see CineramaEdgeClassSkinAbstract::enqueueStyles - hooked with 10\n\t\t */\n\t\tdo_action( 'cinerama_edge_action_enqueue_admin_styles' );\n\t}", "public function fusion_dynamic_css_head() {\n\n\t\t$css = '';\n\n\t\t// Append the user-entered dynamic CSS.\n\t\t$option = get_option( Avada::get_option_name(), [] );\n\t\tif ( isset( $option['custom_css'] ) && ! empty( $option['custom_css'] ) ) {\n\t\t\t$css = wp_strip_all_tags( $option['custom_css'] );\n\t\t}\n\n\t\techo '<style type=\"text/css\" id=\"fusion-builder-custom-css\">' . $css . '</style>'; // phpcs:ignore WordPress.Security.EscapeOutput\n\t}", "public function onLoad() {\n\t\t$this->plugin->wrapper = $this->plugin->factory->wrapper;\n\t\twp_enqueue_style( 'clrchs-admin', $this->plugin->wrapper->getURL('assets/admin.css'), [], $this->plugin->version);\n\t}", "function head_css()\n\t{\n\t\tqa_html_theme_base::head_css();\n\t\t// if if already added widgets have a css file activated\n\t\t$styles = array();\n\t\tforeach ($this->content['widgets'] as $region_key => $regions) {\n\t\t\tforeach ($regions as $template_key => $widgets) {\n\t\t\t\t$position = strtoupper(substr($region_key,0,1) . substr($template_key,0,1) );\n\t\t\t\tforeach ($widgets as $key => $widget) {\n\t\t\t\t\t$widget_name = get_class ($widget);\n\t\t\t\t\t$widget_key = $widget_name.'_'.$position;\n\t\t\t\t\t$file = get_widget_option($widget_key, 'uw_styles');\n\t\t\t\t\t// if file existed then put it into an array to prevent duplications\n\t\t\t\t\tif($file)\n\t\t\t\t\t\t$styles[$widget_name][$file]=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// add styling files to theme\n\t\tif($styles)\n\t\t\tforeach ($styles as $widget_name => $files)\n\t\t\t\tforeach ($files as $file => $verified)\n\t\t\t\t\tif( $file != 'none' )\n\t\t\t\t\t\t$this->output('<link rel=\"stylesheet\" href=\"'.UW_URL.'widgets/'.$widget_name.'/styles/'.$file.'\"/>');\n\t}", "function add_qoorate_stylesheet(){\n\t\t// TODO: make call to get styles from QOORATE\n\t\t// MAYBE TODO: cacheing ... place in DB options?\n\t\t\n\t\t//$styleUrl = plugins_url('/css/guthrie.css', __FILE__);\n\t\t//$styleFile = WP_PLUGIN_DIR . '/guthrie/css/guthrie.css';\n\t\t//if ( file_exists($styleFile) ) {\n\t\t//\t\t//echo($styleUrl.\"<br />\");\n\t\t//\t\twp_register_style('guthrie', $styleUrl);\n\t\t//\t\twp_enqueue_style('guthrie');\n\t\t//}\n\t\t// unregister our really old jquery bundled with WP\n\t\t// Maybe we can keep it? should it be an option?\n\t\twp_deregister_script( 'jquery' );\n\t\twp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' );\n\t\twp_enqueue_script( 'jquery' );\n\t}", "public function enqueue_scripts() {\n\t\twp_add_inline_style( 'at-main', $this->inline_css() );\n\t}", "function siteorigin_panels_admin_enqueue_styles() {\n\t$screen = get_current_screen();\n\tif ( in_array( $screen->id, siteorigin_panels_setting('post-types') ) || $screen->base == 'appearance_page_so_panels_home_page') {\n\t\twp_enqueue_style( 'posisive-panels-admin', POSITIVE_PANELS_URL.'css/admin.css' );\n\t\twp_enqueue_style( 'positive-panels-chosen', POSITIVE_PANELS_URL.'js/chosen/chosen.css' );\n\t\tdo_action( 'siteorigin_panel_enqueue_admin_styles' );\n\t}\n}", "public function register_admin_styles() {\n\t\n\t\twp_enqueue_style( 'jquery-ui-datepicker', 'http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css' );\n\t\twp_enqueue_style( 'wp-jquery-date-picker', plugins_url( 'WordPress-jQuery-Date-Picker/css/admin.css' ) );\t\n\t\twp_enqueue_style( 'wp-jquery-datetime-picker', plugins_url( 'WordPress-jQuery-Date-Picker/css/timepicker.css' ) );\t\n\t\t\n\t}", "public function enqueue_styles() {\n\n\t\t/**\n\t\t * This function is provided for demonstration purposes only.\n\t\t *\n\t\t * An instance of this class should be passed to the run() function\n\t\t * defined in Wp_User_Role_Customizer_Loader as all of the hooks are defined\n\t\t * in that particular class.\n\t\t *\n\t\t * The Wp_User_Role_Customizer_Loader will then create the relationship\n\t\t * between the defined hooks and the functions defined in this\n\t\t * class.\n\t\t */\n\n\t\twp_enqueue_style( $this->wp_user_role_customizer, plugin_dir_url( __FILE__ ) . 'css/wp-user-role-customizer-public.css', array(), $this->version, 'all' );\n\n\t}", "private function _addCss() {\r\n JHtml::styleSheet( Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');\r\n }", "public function admin_enqueue_scripts()\n\t{\n\t\twp_register_style( 'go-git', plugins_url( 'components/css/go-git.css', __DIR__ ), array(), 1 );\n\t\twp_enqueue_style( 'go-git' );\n\t}", "function aitRevSliderAdminStyles(){ wp_enqueue_style('ait-revolution-slider-admin-css', THEME_URL . '/design/admin-plugins/revslider.css'); }", "public function enqueue_styles() {\n\n\t\t\t/**\n\t\t\t * This function is provided for demonstration purposes only.\n\t\t\t *\n\t\t\t * An instance of this class should be passed to the run() function\n\t\t\t * defined in Advanced_Reviews_Pro_Loader as all of the hooks are defined\n\t\t\t * in that particular class.\n\t\t\t *\n\t\t\t * The Advanced_Reviews_Pro_Loader will then create the relationship\n\t\t\t * between the defined hooks and the functions defined in this\n\t\t\t * class.\n\t\t\t */\n\n\t\t\twp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/advanced-reviews-pro-public.css', array(), $this->version, 'all' );\n\t\t}", "function az_admin_scripts() {\n\twp_enqueue_style( 'az-admin', get_template_directory_uri() . '/_include/css/admin-style.css' );\n}", "public function info_lettreCSS(){\n wp_enqueue_style('info_lettre', plugins_url('info_lettre/css/info_lettre.css'));\n }", "public static function add_admin_css() {\n\t\tif ( ! self::should_include_photo_column() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_action( 'admin_enqueue_scripts', [ __CLASS__, 'admin_enqueue_scripts_and_styles' ] );\n\t}", "public function registerStylesAdmin() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style(\"wpjb-admin-css\", $p.\"admin.css\", array(), $v);\n wp_register_style(\"wpjb-colorpicker-css\", $p.\"colorpicker.css\", array(), $v);\n wp_register_style(\"wpjb-vendor-ve-css\", $x.\"visual-editor/visual-editor.css\", array(), $v);\n wp_register_style(\"wpjb-multi-level-accordion-menu\", $p.\"multi-level-accordion-menu.css\", array(), $v);\n }", "static function styles()\n\t{\n\t\twp_enqueue_style( 'jumplead_styles', self::$path . 'c/jumplead.css', array('dashicons'), JUMPLEAD_VERSION );\n\t}", "public function styles(){\n\n\t\t//wp_enqueue_style('component-header_fixed-style', $this->directory_uri . '/assets/dist/css/headerFixed.css');\n\t}", "public function enqueue_styles() {\n wp_enqueue_style(\n $this->plugin_name,\n plugin_dir_url(__FILE__) . 'css/update-monitor-public.css',\n array(),\n $this->version,\n 'all'\n );\n }", "public function enqueueScripts() {\n wp_register_style('rrze-faq-style', plugins_url('assets/css/rrze-faq.css', plugin_basename($this->pluginFile)));\n wp_enqueue_style('rrze-faq-style');\n }", "function admin_style() {\n wp_enqueue_style('admin-styles', get_template_directory_uri().'/css/admin.css');\n }", "public function adminStyles()\n\t{\n\t\twp_enqueue_style('wpm-sort_post_types', $this->cssUrl.'/sort-post-types.css');\n\t}", "public function enqueue_styles() {\n wp_enqueue_style(\n VSPI_BASENAME,\n plugins_url('includes/vspi-admin-styles.css', __FILE__),\n array(),\n VSPI_VERSION,\n 'all'\n );\n }", "public static function enqueue_styles() {\n\t\tif ( ! static::$enqueued && wp_style_is( 'cmb2-styles', 'enqueued' ) ) {\n\t\t\twp_enqueue_style( 'wplibs-form' );\n\t\t\twp_enqueue_script( 'wplibs-form' );\n\n\t\t\tstatic::$enqueued = true;\n\t\t}\n\t}", "function wpdocs_enqueue_custom_admin_style()\n{\n wp_register_style('custom_wp_admin_css', get_template_directory_uri() . '/css/font-awesome.min.css', false, '1.0.0');\n wp_enqueue_style('custom_wp_admin_css');\n wp_enqueue_style('admin-css', get_template_directory_uri() . '/css/admin.css', false, '1.0', 'all');\n}", "function styles() {\n\twp_enqueue_style(\n\t\t'deadpoo-main',\n\t\tDIE_URL . '/assets/css/dist/main.css',\n\t\t[],\n\t\tfalse\n\t);\n}", "function wp_enqueue_style() {\n\t}" ]
[ "0.7699237", "0.7510832", "0.75066817", "0.75066817", "0.75066817", "0.75066817", "0.74975693", "0.74897283", "0.7461102", "0.7436818", "0.7392922", "0.7386229", "0.73840547", "0.73785543", "0.73676395", "0.73404664", "0.7324752", "0.7301917", "0.7291882", "0.7284482", "0.72456795", "0.7226199", "0.72251207", "0.7221933", "0.7219122", "0.7206739", "0.7191974", "0.7178382", "0.7176268", "0.71762437", "0.716959", "0.71674633", "0.7167144", "0.7166284", "0.7158014", "0.7157929", "0.7152632", "0.7151771", "0.7129232", "0.7096367", "0.7096206", "0.70922124", "0.70824647", "0.70822114", "0.70704025", "0.7057428", "0.7057216", "0.7053484", "0.7052196", "0.70455337", "0.7041126", "0.70374113", "0.70337623", "0.7016338", "0.70157325", "0.6999704", "0.6999217", "0.69986415", "0.6996813", "0.6995639", "0.6994608", "0.6984778", "0.69842416", "0.6981919", "0.6981177", "0.6979564", "0.6977313", "0.69732636", "0.6970952", "0.6970702", "0.6970078", "0.6957149", "0.69513017", "0.6943668", "0.6941487", "0.69385654", "0.6938554", "0.6934534", "0.69342065", "0.693065", "0.69298065", "0.6929695", "0.6926899", "0.6918845", "0.69186366", "0.6916243", "0.6915126", "0.6912383", "0.6906848", "0.6903778", "0.6902762", "0.6901198", "0.6899181", "0.68973684", "0.6897088", "0.68962", "0.6892474", "0.68887156", "0.68885255", "0.6882592", "0.68816185" ]
0.0
-1
Display the UI for opting in / out of telemetry.
function render_opt_in_form() { $user = wp_get_current_user(); // Don't render if they've made a decision. if ( ! is_null( is_user_opted_in( $user ) ) ) { return; } ?> <div class="welcome altis-telemetry-opt-in"> <h2><?php echo esc_html( sprintf( __( 'Hi %s!', 'altis' ), $user->display_name ) ); ?></h2> <p><?php esc_html_e( 'To help us develop Altis, we would like to collect data on your usage of the software. This will help us build a better product for you.', 'altis' ); ?></p> <form method="post" action=""> <?php wp_nonce_field( 'altis_telemetry_opt_in' ); ?> <input type="submit" name="altis_telemetry_opt_in" class="button button-primary" value="<?php esc_attr_e( 'Sounds good to me!', 'altis' ); ?>" /> <input type="submit" name="altis_telemetry_opt_out" class="button button-secondary" value="<?php esc_attr_e( 'No thanks', 'altis' ); ?>" /> </form> <p><?php esc_html_e( 'You can change this setting at any time on your profile page.' ); ?></p> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handle_opt_in_form() {\n\tif ( isset( $_POST['altis_telemetry_opt_in'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( true );\n\t}\n\tif ( isset( $_POST['altis_telemetry_opt_out'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( false );\n\t}\n}", "public function display_analytics_options_page() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h2>WSU Analytics Settings</h2>\n\t\t\t<form method=\"post\" action=\"options.php\">\n\t\t<?php\n\t\twp_nonce_field( 'wsuwp-analytics-options' );\n\t\tdo_settings_sections( $this->settings_page );\n\n\t\tsubmit_button();\n\t\t?>\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"update\" />\n\t\t\t\t<input type=\"hidden\" name=\"option_page\" value=\"wsuwp-analytics\" />\n\t\t\t</form>\n\t\t</div>\n\t\t<?php\n\t}", "function infoScreen()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreenForward();\n\t}", "public function screen_options() {\n\n\t\t\tif ( ! $this->is_dashboard_page() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$args = array(\n\t\t\t\t'label' => __( 'Hide WooCart Dashboard', 'woocart-defaults' ),\n\t\t\t\t'default' => true,\n\t\t\t\t'option' => '_hide_custom_dashboard',\n\t\t\t);\n\t\t\tadd_screen_option( 'woocart_custom_dashboard', $args );\n\n\t\t}", "public function render_screen_options()\n {\n }", "public static function maybe_push_optin_notice() {\n\t\tif ( self::get_optIn_state() == false && apply_filters( 'xl_optin_notif_show', self::$should_show_optin ) ) {\n\t\t\tdo_action( 'maybe_push_optin_notice_state_action' );\n\t\t}\n\t}", "public function _settings_section_dashboard_widget() {\n _e( \"The Dashboard Widget can be changed depending on a User's capabilitites.\", 'zendesk' );\n }", "function infoScreenObject()\n\t{\n\t\t$this->checkPermission(\"visible\");\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreen();\n\t}", "public function monitorSigninForm() {\n\t\t$this->monitorView->displayLoginForm();\n\t}", "public function toolShow()\n {\n return $this->render('statistic-tool');\n }", "public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }", "public function verifyResultsPageInYourProjectShowsImpressionEvent(): void\n {\n print \"Go to your project's results page and verify decisions events are showing (5 min delay)\";\n }", "public function option_display() {\n\t\t// Check user capabilities.\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$current_story = get_option( 'current-top-story' );\n\n\t\techo '<input type=\"text\" name=\"current-top-story\" id=\"top-story-value\" value=\"' . esc_html( $current_story ) . '\" placeholder=\"search post by title\" size=\"70\" />';\n\t}", "public function render()\n {\n if (!current_user_can('manage_options')) {\n wp_die($this->translator->get('You do not have sufficient permissions to access this page.', true));\n }\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}", "function displayClientOverview()\n\t{\n\t\t$this->checkDisplayMode();\n\n\t\t// disable/enable button\n\t\t$btpl = new ilTemplate(\"tpl.buttons.html\", true, true, \"setup\");\n\t\t$btpl->setCurrentBlock(\"btn\");\n\t\t$btpl->setVariable(\"CMD\", \"changeaccess\");\n\t\t$access_button = ($this->setup->getClient()->status[\"access\"][\"status\"]) ? \"disable\" : \"enable\";\n\t\t$btpl->setVariable(\"TXT\", $this->lng->txt($access_button));\n\t\t$btpl->setVariable(\"FORMACTION\", \"setup.php?cmd=gateway\");\n\t\t$btpl->parseCurrentBlock();\n\t\t$this->tpl->setVariable(\"BUTTONS\", $btpl->get());\n\n\t\t$this->initClientOverviewForm();\n\t\t$this->tpl->setVariable(\"SETUP_CONTENT\", $this->form->getHTML());\n\n\t\t$this->displayStatusPanel();\n\t}", "public function testSettingsUI() {\n // Create a test user and log in.\n $account = $this->drupalCreateUser(array(\n 'access administration pages',\n 'administer monitoring',\n ));\n $this->drupalLogin($account);\n\n // Check the form.\n $this->drupalGet('admin/config/system');\n $this->assertText(t('Configure enabled monitoring products.'));\n $this->clickLink(t('Monitoring settings'));\n $this->assertField('sensor_call_logging');\n $this->assertOptionSelected('edit-sensor-call-logging', 'on_request');\n $this->assertText(t('Control local logging of sensor call results.'));\n }", "private function showWhyRequestForm() { $this->config->showPrinterFriendly = false;\r\n echo '<h2>Why are you requesting time?</h2>';\r\n $this->showTimeTypeDropDown();\r\n echo '<br/><br/><br/>';\r\n }", "function adminOptions() {\r\n\t\t\tTrackTheBookView::render('admin-options');\r\n\t\t}", "public function render_onboarding() {\n\t\t// Check if onboarding is already completed.\n\t\t$done = beehive_analytics()->settings->get( 'onboarding_done', 'misc', $this->is_network() );\n\n\t\t// Render modal.\n\t\tif ( ! $done ) {\n\t\t\t// Render onboarding setup modal.\n\t\t\t$this->view( 'modals/onboarding/setup', [\n\t\t\t\t'is_logged_in' => Google_Auth\\Helper::instance()->is_logged_in( $this->is_network() ),\n\t\t\t\t'network' => $this->is_network(),\n\t\t\t\t'ps_levels' => $this->is_network() ? Permission::get_ps_levels() : false,\n\t\t\t] );\n\t\t}\n\t}", "public function admin_options() {\n?>\n\t\t<h3><?php _e('Authorize SIM', WC_Authorize_SIM::TEXT_DOMAIN); ?></h3>\n \t<p><?php _e('Authorize SIM works by sending the user to Authorize to enter their payment information.', WC_Authorize_SIM::TEXT_DOMAIN); ?></p>\n \t<div class=\"updated\"><p>\n \t\t<strong><?php _e('Authorize.Net config:', WC_Authorize_SIM::TEXT_DOMAIN) ?></strong>\n \t\t<?php _e( 'Please login to Authorize and go to Account >> Settings >> Response/Receipt URLs' ); ?>\n \t\t<ol>\n\t \t\t<li><?php _e( 'Click \"Add URL\", and set this value for URL textbox: ') ?><strong><?php echo $this->notify_url ?></strong></li>\n\t \t\t<li><?php _e( 'Click \"Submit\" to complete', WC_Authorize_SIM::TEXT_DOMAIN ) ?></li>\n \t\t</ol>\n \t</p></div>\n \t<table class=\"form-table\">\n \t\t<?php $this->generate_settings_html(); ?>\n\t\t</table><!--/.form-table--> \t\n<?php\n }", "function infoScreenObject()\n\t{\n\t\t$this->ctrl->setCmd(\"showSummary\");\n\t\t$this->ctrl->setCmdClass(\"ilinfoscreengui\");\n\t\t$this->infoScreen();\n\t}", "public function admin_options()\n {\n global $current_section;\n\n if ($current_section == 'flagship_wc_shipping_method') {\n $this->ctx->alert()->view();\n }\n\n parent::admin_options();\n }", "public function options_page() {\n\t\t$this->render_settings();\n\t}", "public function index()\n {\n $view = Piwik_View::factory('CheckBox');\n $view->trackVisits = !Piwik_Tracker_Cookie::isIgnoreCookieFound();\n $view->nonce = Piwik_Nonce::getNonce('Piwik_OptOut', 3600);\n echo $view->render();\n }", "public function display_auth_page() {\n\t\t// Now grab the options based on what we're looking for\n\t\t$opts = get_option( 'emcl_settings' );\n\t\t$emc_auth_page = isset( $opts['emc_auth_page'] ) ? $opts['emc_auth_page'] : '';\n\t\t// And display the view\n\t\tinclude_once $this->views . 'settings-server-auth-page.php';\n\t}", "function lb_show_check_out_page_action() {\n\tlb_submit_check_out_form();\n\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'check-out',\n\t\t\t'regions' => lb_get_region(),\n\t\t)\n\t);\n}", "public function screen() {\n\t\tGFireMAutoComplete::getFreemius()->get_logger()->entrance();\n\t\tGFireMAutoComplete::getFreemius()->_account_page_load();\n\t\tGFireMAutoComplete::getFreemius()->_account_page_render();\n\t}", "function Show_All() \n\t{\n\t\tglobal $eTraffic;\n\t\t\n\t\t$this->ShowIf('Debug Log', $this->Show_Log());\n\t\t$this->ShowIf('Traffic Counters', $eTraffic->Display());\n\t\t$this->ShowIf('Time Analysis', $this->Show_Performance());\n\t\t$this->ShowIf('SQL Analysis', $this->Show_SQL_Details());\n\t\t$this->ShowIf('Shortcodes / BBCode',$this->Show_SC_BB());\n\t\t$this->ShowIf('Paths', $this->Show_PATH());\n\t\t$this->ShowIf('Deprecated Function Usage', $this->Show_DEPRECATED());\n\t\t$this->ShowIf('Included Files', $this->Show_Includes());\n\t}", "public function _showForm()\n\t{\n\t\t$this->registry->output->setTitle( \"Log In\" );\n\t\t$this->registry->output->setNextAction( 'index&do=login' );\n\t\t$this->registry->output->addContent( $this->registry->legacy->fetchLogInForm() );\n\t\t$this->registry->output->sendOutput();\n\t\texit();\n\t}", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display_token_page() {\n\t\t// Now grab the options based on what we're looking for\n\t\t$opts = get_option( 'emcl_settings' );\n\t\t$emc_token_page = isset( $opts['emc_token_page'] ) ? $opts['emc_token_page'] : '';\n\t\t// And display the view\n\t\tinclude_once $this->views . 'settings-server-token-page.php';\n\t}", "private function showOptions() : void\n {\n $selectedOption = $this->console->choice(__('Please cheoose your option:'), $this->getAllOptions() );\n $this->setSelectedOption($selectedOption);\n $this->handleOption();\n }", "function options_page() {\n\t\t$settings = __( 'AdControl Settings', 'adcontrol' );\n\t\t$notice = sprintf(\n\t\t\t__( 'AdControl requires %sJetpack%s to be installed and connected at this time. %sHelp getting started.%s', 'adcontrol' ),\n\t\t\t'<a href=\"https://jetpack.com/\" target=\"_blank\">', '</a>',\n\t\t\t'<a href=\"https://jetpack.com/support/getting-started-with-jetpack/\" target=\"_blank\">', '</a>'\n\t\t);\n\n\t\techo <<<HTML\n\t\t<div class=\"wrap\">\n\t\t\t<div id=\"icon-options-general\" class=\"icon32\"><br></div>\n\t\t\t<h2>$settings</h2>\n\t\t\t<p>$notice</p>\n\t\t</div>\nHTML;\n\t}", "function displayMenu()\n\t{\n\t\tshowInfo();\n\t\tshowActions();\n\t}", "public function acf_wpi_ui() {\n\t\tif ( ! get_field( 'acf_wpi_ui_enable', 'option' ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function user_profile_options( WP_User $user ) : void {\n\t?>\n\t<table class=\"form-table\">\n\t\t<tr>\n\t\t\t<th>\n\t\t\t\t<label for=\"altis_telemetry_opt_in\"><?php esc_html_e( 'Altis Telemetry', 'altis' ); ?></label>\n\t\t\t</th>\n\t\t\t<td>\n\t\t\t\t<input type=\"checkbox\" name=\"altis_telemetry_opt_in_toggle\" id=\"altis_telemetry_opt_in\" <?php checked( is_user_opted_in( $user ) ) ?> value=\"1\" />\n\t\t\t\t<label for=\"altis_telemetry_opt_in\"><?php esc_html_e( 'Opt in to Altis Telemetry', 'altis' ); ?></label>\n\t\t\t\t<p class=\"description\"><?php esc_html_e( 'To help us develop Altis, we would like to collect data on your usage of the software. This will help us build a better product for you.', 'altis' ); ?></p>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<?php\n}", "function wpcron_display_settings_page() {\n\n\t// check if user is allowed access\n\tif ( ! current_user_can( 'manage_options' ) ) return;\n\n\t?>\n\n\t<div class=\"wrap\">\n\n\t\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\n\t\t<?php echo wpcron_log(); ?>\n\n\t</div>\n\n<?php\n\n}", "function displayTools()\n\t{\n\t\t$this->checkDisplayMode();\n\n\t\t// output\n\t\tilUtil::sendInfo();\n\n\t\t// use property forms and add the settings type switch\n\t\t$ctrl_structure_form = $this->initControlStructureForm();\n\t\t$settings_type_form = $this->initSettingsTypeForm();\n\t\t$mp_ns_form = $this->initTreeImplementationForm();\n\n\t\t$this->tpl->setVariable(\"SETUP_CONTENT\",\n\t\t\t$ctrl_structure_form->getHTML() . \"<br />\" .\n\t\t\t$settings_type_form->getHTML().'<br />'.\n\t\t\t$mp_ns_form->getHTML());\n\n\t}", "public function adminNotices() {\n\t\tif ( ! empty( $this->admin_error ) ) {\n\t\t\tprintf( '<div class=\"error\"><p>%s</p></div>', implode( '<br />', $this->admin_error ) );\n\t\t}\n\t\tif ( ! empty( $this->admin_message ) ) {\n\t\t\tprintf( '<div class=\"updated\"><p>%s</p></div>', implode( '<br />', $this->admin_message ) );\n\t\t}\n\t\tif ( current_user_can( 'manage_options' ) && ! $this->option['enable'] ) {\n\t\t\tprintf(\n\t\t\t\t'<div class=\"error\"><p>%s</p></div>',\n\t\t\t\tsprintf(\n\t\t\t\t\t__( '<strong>[Never Let Me Go] Plugin is active but features are not enabled. Please go to <a href=\"%s\">setting page</a>.</strong>', 'never-let-me-go' ),\n\t\t\t\t\tadmin_url( 'options-general.php?page=nlmg' )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\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 adminPluginOptionsPage()\n {\n echo $this->_loadView('admin-settings-page');\n }", "function debug_output() {\n\t\tglobal $ac_tos_response, $ac_status_response;\n\t\t$response = 'tos' == $_GET['ac_debug'] ? $ac_tos_response : $ac_status_response;\n\t\tif ( empty( $response ) ) {\n\t\t\t$response = 'No response from API :(';\n\t\t} else {\n\t\t\t$response = print_r( $response, 1 );\n\t\t}\n\n\t\t$tos = $this->get_option( 'tos' ) ?\n\t\t\t'<span style=\"color:green;\">Yes</span>' :\n\t\t\t'<span style=\"color:red;\">No</span>';\n\t\t$status = $this->get_option( 'wordads_approved' ) ?\n\t\t\t'<span style=\"color:green;\">Yes</span>' :\n\t\t\t'<span style=\"color:red;\">No</span>';\n\t\t$house = $this->get_option( 'wordads_house' ) ? 'Yes' : 'No';\n\n\t\t$type = $this->get_option( 'tos' ) && $this->get_option( 'wordads_approved' ) ?\n\t\t\t'updated' :\n\t\t\t'error';\n\n\t\techo <<<HTML\n\t\t<div class=\"notice $type is-dismissible\">\n\t\t\t<p>TOS: $tos | Status: $status | House: $house</p>\n\t\t\t<pre>$response</pre>\n\t\t</div>\nHTML;\n\t}", "static function BeforePageDisplay( &$out ){\n\t\tglobal $wgRequest, $wgUser;\n\t\tglobal $wgUseAjax;\n\n\t\tif( $wgUser->isLoggedIn() && $wgUseAjax ){\n\t\t\t$out->addModules( 'ext.onlineStatus' );\n\t\t}\n\n\t\tif( !in_array( $wgRequest->getVal( 'action', 'view' ), array( 'view', 'purge' ) ) )\n\t\t\treturn true;\n\t\t$status = self::GetUserStatus( $out->getTitle(), true );\n\t\tif( $status === null )\n\t\t\treturn true;\n\t\t$out->setSubtitle( wfMsgExt( 'onlinestatus-subtitle-' . $status, array( 'parse' ) ) );\n\n\t\treturn true;\n\t}", "public function renderAdminPage()\n {\n if (!current_user_can('manage_options')) {\n wp_die(__('You do not have sufficient permissions to access this page.'));\n }\n\n // Our Vite app register itself to this element\n // and let it take care of the rest\n echo '<div id=\"windsor\"></div>';\n }", "function tos_menu() {\n\t\tadd_options_page(\n\t\t\t'AdControl',\n\t\t\t'AdControl',\n\t\t\t'manage_options',\n\t\t\t'adcontrol',\n\t\t\tarray( $this, 'userdash_tos' )\n\t\t);\n\t}", "public function show_in_panel() {\n\t\treturn false;\n\t}", "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}", "protected function displayMaintenancePage()\n {\n }", "protected function displayMaintenancePage()\n {\n }", "protected function displayMaintenancePage()\n {\n }", "public function admin_options() {\r\n echo '<h3>' . __('Mondido', 'mondido') . '</h3>';\r\n echo '<p>' . __('Mondido, Simple payments, smart functions', 'mondido') . '</p>';\r\n echo '<table class=\"form-table\">';\r\n // Generate the HTML For the settings form.\r\n $this->generate_settings_html();\r\n echo '</table>';\r\n }", "public function render_screen_options() {\n\t\t// Adds the screen options.\n\t\trequire_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\t\tadd_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );\n\n\t\t// Display screen options.\n\t\t$screen = WP_Screen::get( 'nav-menus.php' );\n\t\t$screen->render_screen_options( array( 'wrap' => false ) );\n\t}", "public function indexAction()\n {\n return '<i>Please select a display mode in the plugin.</i>';\n }", "protected function displayMaintenancePage()\n {\n return;\n }", "function display_analytics_html($args)\n\t\t{\n\t\t\techo '<textarea name=\"verify-meta-tags[analytics]\" class=\"analytics\" id=\"verify-meta-tags[analytics]\">' . esc_attr($this->options['analytics']) . '</textarea>';\n\t\t}", "public function optionsPage()\r\n {\r\n $this->updateOptions();\r\n include_once($this->path . '/views/options.php');\r\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 showDetails(){\n $this->_showDetails = true;\n }", "public function display_plugin_admin_page() {\n\t\t\tinclude_once( 'views/settings-page.php' );\n\t\t}", "public function display() {\n $actions = array();\n $html = '';\n if ( !$this->get_client_id() || !$this->get_client_secret() ) {\n $html .= $this->get_client_secret_form_view();\n } else {\n $this->oauth_access();\n\n if ( $this->is_connected() ) {\n $html .= $this->get_profile_details_view();\n\n $html .= $this->get_timezone_info_view();\n\n $html .= $this->get_options_form_view();\n\n $actions[] = 'logout';\n } else {\n $html .= $this->get_access_form_view();\n }\n\n $actions[] = 'delete-secret';\n }\n\n if ( !!$actions ) {\n $args = array(\n 'actions' => $actions,\n 'google_calendar' => $this,\n );\n\n $html .= $this->get_view( 'actions.php', $args );\n }\n\n echo $html;\n }", "public function setConfigDisplay($input) {\n\t\t$this->_configDisplay = ($input ? 1 : 0);\n\t}", "public function widget_content_no_auth() {\n\n\t\t$url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights-onboarding' ) : admin_url( 'admin.php?page=monsterinsights-onboarding' );\n\t\t$migrated = monsterinsights_get_option( 'gadwp_migrated', 0 );\n\t\tif ( $migrated > 0 ) {\n\t\t\t$url = admin_url( 'admin.php?page=monsterinsights-getting-started&monsterinsights-migration=1' );\n\t\t}\n\t\t?>\n\t\t<div class=\"mi-dw-not-authed\">\n\t\t\t<h2><?php esc_html_e( 'Website Analytics is not Setup', 'google-analytics-for-wordpress' ); ?></h2>\n\t\t\t<?php if ( current_user_can( 'monsterinsights_save_settings' ) ) { ?>\n\t\t\t\t<p><?php esc_html_e( 'To see your website stats, please connect MonsterInsights to Google Analytics.', 'google-analytics-for-wordpress' ); ?></p>\n\t\t\t\t<a href=\"<?php echo esc_url( $url ); ?>\" class=\"mi-dw-btn-large\"><?php esc_html_e( 'Setup Website Analytics', 'google-analytics-for-wordpress' ); ?></a>\n\t\t\t<?php } else { ?>\n\t\t\t\t<p><?php esc_html_e( 'To see your website stats, please ask your webmaster to connect MonsterInsights to Google Analytics.', 'google-analytics-for-wordpress' ); ?></p>\n\t\t\t<?php } ?>\n\t\t</div>\n\t\t<?php\n\t}", "public function bp_settings_tab_action() {\n\t\techo $this->get_instance( \\MyVideoRoomExtrasParking\\Library\\SectionTemplates::class )->account_centre_landing();\n\t}", "public static function display_network_settings() {\n\t\twp_nonce_field( 'cjur-network-settings', 'cjur-network-settings-nonce' );\n\n\t\tdo_settings_sections( 'cjur-network-settings-page' );\n\t}", "public function admin_options() {\n\n echo '<h3>'.__('MTN Mobile Money Settings', 'woocommerce').'</h3>';\n echo '<table class=\"form-table\">';\n\n $this->generate_settings_html();\n echo '</table>';\n }", "public function getapidetailsAction() {\n\t\t$this->loadLayout();\n\t\t$this->getLayout()->getBlock('logicbrokernotification')->setConfigValue(array(\n\t\t\t\t\t\t'scope' => 'default',\n\t\t\t\t\t\t'scope_id' => '0',\n\t\t\t\t\t\t'path' => 'logicbroker_integration/integration/notificationstatus',\n\t\t\t\t\t\t'value' => '0',\n\t\t\t\t));\n\t\tMage::app()->getCacheInstance()->cleanType('config');\t\t\n\t\tMage::getSingleton('adminhtml/session')->setNotification(false);\n\t\t$this->_redirectReferer();\n\t}", "public function display_analytics_settings() {\n\t\tadd_settings_field( 'wsuwp-ga-id', 'Google Analytics ID', array( $this, 'general_settings_ga_id' ), $this->settings_page, 'wsuwp-analytics', array(\n\t\t\t'label_for' => 'wsuwp_ga_id',\n\t\t) );\n\t\tadd_settings_field( 'wsuwp-ga4-id', 'GA4 Analytics ID', array( $this, 'general_settings_ga4_id' ), $this->settings_page, 'wsuwp-analytics', array(\n\t\t\t'label_for' => 'wsuwp_ga4_id',\n\t\t) );\n\t\tadd_settings_field( 'wsuwp-analytics-option-map', 'General Analytics Settings', array( $this, 'general_settings_inputs' ), $this->settings_page, 'wsuwp-analytics', array(\n\t\t\t'label_for' => 'wsuwp_analytics_option_map',\n\t\t) );\n\t}", "public function dashboard_page_mscr_intrusions() {\n\t\t// WordPress 3.3\n\t\tif ( function_exists( 'wp_suspend_cache_addition' ) ) {\n\t\t\t$args = array(\n\t\t\t\t'title' => 'Help',\n\t\t\t\t'id' => 'mscr_help',\n\t\t\t\t'content' => $this->get_contextual_help(),\n\t\t\t);\n\t\t\tget_current_screen()->add_help_tab( $args );\n\t\t}\n\t\t// WordPress 3.1 and later\n\t\telse if ( function_exists( 'get_current_screen' ) ) {\n\t\t\t// Add help to the intrusions list page\n\t\t\tadd_contextual_help( get_current_screen(), $this->get_contextual_help() );\n\t\t}\n\t}", "function privacyInformation($args, $request) {\n\t\t$this->validate(null, $request);\n\n\t\t// Check whether this is an opt-out request.\n\t\tif ($request->isPost()) {\n\t\t\tif ($request->getUserVar('opt-out')) {\n\t\t\t\t// Set a cookie that is valid for one year.\n\t\t\t\t$request->setCookieVar('usageStats-opt-out', true, time() + 60*60*24*365);\n\t\t\t}\n\t\t\tif ($request->getUserVar('opt-in')) {\n\t\t\t\t// Delete the opt-out cookie.\n\t\t\t\t$request->setCookieVar('usageStats-opt-out', false, time() - 60*60);\n\t\t\t}\n\t\t}\n\n\t\t$router = $request->getRouter(); /* @var $router PageRouter */\n\t\t$privacyStatementUrl = $router->url($request, null, 'about', 'submissions');\n\n\t\t// Display the privacy info page.\n\t\t$this->setupTemplate($request);\n\t\t$plugin = $this->_getPlugin();\n\t\t$templateMgr = TemplateManager::getManager($request);\n\t\t$templateMgr->assign('pageTitle', 'plugins.generic.usageStats.optout.title');\n\t\t$templateMgr->assign('usageStatsDisplayPrivacyInfo', true);\n\t\t$templateMgr->assign('hasOptedOut', ($request->getCookieVar('usageStats-opt-out') ? true : false));\n\t\t$templateMgr->assign('privacyStatementUrl', $privacyStatementUrl);\n\t\t$templateMgr->display($plugin->getTemplatePath(true).'privacyInformation.tpl');\n\t}", "public function swp_toolskit_admin_notice() {\n\t\t\n\t\tif ( !Medical_Toolskit::wpl_toolskit_ot_active() ) {\n\t\t\t$html = '<div class=\"update-nag\">';\n\t\t\t$html .= sprintf(__('You need to Install and Activate the Option Tree Plugin', 'medical-toolskit'), admin_url('options-general.php?page='));\n\t\t\t$html .= '</div>';\n\t\t\techo $html;\n\t\t}\n\t}", "public function info() {\n $plugin = $this->viewVars['vv_authenticator']['Authenticator']['plugin'];\n $this->Authenticator->$plugin->setConfig($this->viewVars['vv_authenticator']); \n \n $this->set('vv_status', $this->Authenticator->$plugin->status($this->request->params['named']['copersonid']));\n \n $this->set('title_for_layout', $this->viewVars['vv_authenticator']['Authenticator']['description']);\n }", "function wpei_create_options() {\n $titan = TitanFramework::getInstance( 'wpei' );\n\n // Create my admin panel\n $adminPanel = $titan->createAdminPanel( array(\n 'name' => 'Exit Intent Pro',\n 'icon' => 'dashicons-laptop'\n ) );\n\n // Create First Tab\n $globalTab = $adminPanel->createTab( array(\n 'name' => 'Global',\n ) );\n\n // Create options inside the First Tab\n $globalTab->createOption( array(\n 'name' => 'Aggressive mode',\n 'id' => 'is_aggresive',\n 'type' => 'enable',\n 'default' => false,\n 'desc' => \"By default, ExitIntentPro will only fire once for each visitor. When ExitIntentPro fires, a cookie is created to ensure a non obtrusive experience.<br>There are cases, however, when you may want to be more aggressive (as in, you want the modal to be elegible to fire anytime the page is loaded/ reloaded). An example use-case might be on your paid landing pages. If you enable aggressive, the modal will fire any time the page is reloaded, for the same user.\",\n ) );\n $globalTab->createOption( array(\n 'name' => 'Timer',\n 'id' => 'timer',\n 'type' => 'number',\n 'max' => '10000',\n 'step' => '500',\n 'size' => 'medium',\n 'unit' => 'ms', \n 'desc' => \"By default, ExitIntentPro won't fire in the first second to prevent false positives, as it's unlikely the user will be able to exit the page within less than a second. If you want to change the amount of time that firing is surpressed for, you can pass in a number of milliseconds to timer.\"\n ) );\n $globalTab->createOption( array(\n 'name' => 'Delay',\n 'id' => 'delay',\n 'type' => 'number',\n 'max' => '10000',\n 'size' => 'medium', \n 'step' => '500',\n 'unit' => 'ms',\n 'desc' => \"By default, ExitIntentPro will show the modal immediately. You could instead configure it to wait x milliseconds before showing the modal. If the user's mouse re-enters the body before delay ms have passed, the modal will not appear. This can be used to provide a 'grace period' for visitors instead of immediately presenting the modal window.\"\n ) ); \n\n\n // Create Second Tab\n $contentTab = $adminPanel->createTab( array(\n 'name' => 'Content',\n ) ); \n $contentTab->createOption( array(\n 'name' => \"Custom HTML\",\n // 'name' => \"Custom HTML<br><br><small><a href='#'>Click here</a> to see the documentation.</small>\", \n 'id' => 'wpei_custom_html',\n 'type' => 'textarea',\n 'is_code' => true\n ) ); \n\n\n // Create Third Tab\n $styleTab = $adminPanel->createTab( array(\n 'name' => 'Style',\n ) );\n\n $styleTab->createOption( array(\n 'name' => 'Default Modal',\n 'type' => 'heading',\n 'desc' => 'Styling the default modal' \n ) ); \n\n // Create options inside the Second Tab\n $styleTab->createOption( array(\n 'name' => 'Header Background Color',\n 'id' => 'modal_header_bg_color',\n 'type' => 'color',\n 'desc' => 'Choose a background color',\n 'default' => '#555555'\n ) );\n $styleTab->createOption( array(\n 'name' => 'Header Font Color',\n 'id' => 'modal_header_font_color',\n 'type' => 'color',\n 'desc' => 'Choose a font color',\n 'default' => '#ffffff'\n ) );\n $styleTab->createOption( array(\n 'name' => 'Body Background Color',\n 'id' => 'modal_body_bg_color',\n 'type' => 'color',\n 'desc' => 'Choose a font color',\n 'default' => '#f0f1f2'\n ) ); \n $styleTab->createOption( array(\n 'name' => 'Body Font Color',\n 'id' => 'modal_body_font_color',\n 'type' => 'color',\n 'desc' => 'Choose a font color',\n 'default' => '#344a5f'\n ) ); \n $styleTab->createOption( array(\n 'name' => 'Custom Modal',\n 'type' => 'heading',\n 'desc' => 'Using this fields below overrides the default style' \n ) ); \n $styleTab->createOption( array(\n 'name' => 'Custom CSS',\n 'id' => 'wpei_custom_css',\n 'type' => 'code',\n 'lang' => 'css',\n 'theme' => 'monokai'\n ) );\n $titan->createCSS( ' \n #ouibounce-modal .wpei-modal-title { \n background-color: $modal_header_bg_color; \n }\n #ouibounce-modal .wpei-modal-title h3 { \n color: $modal_header_font_color;\n } \n #ouibounce-modal .wpei-modal { \n background-color: $modal_body_bg_color;\n }\n #ouibounce-modal p { \n color: $modal_body_font_color;\n }\n #ouibounce-modal .wpei-modal-footer p {\n border-bottom-color: $modal_body_font_color;\n }\n\n ' );\n\n // create submit button\n $adminPanel->createOption( array(\n 'type' => 'save'\n ) );\n\n}", "function owa_options_page() {\r\n\t\r\n\t$owa = owa_getInstance();\r\n\t\r\n\t$params = array();\r\n\t$params['view'] = 'base.options';\r\n\t$params['subview'] = 'base.optionsGeneral';\r\n\techo $owa->handleRequest($params);\r\n\t\r\n\treturn;\r\n}", "public function admin_options() {\n\t\t\t?>\n\t\t\t\t<h3><?php esc_html_e('Cointopay Checkout', 'Cointopay'); ?></h3>\n\n\t\t\t\t<div id=\"wc_get_started\">\n\t\t\t\t<span class=\"main\"><?php esc_html_e('Provides a secure way to accept crypto currencies.', 'Cointopay'); ?></span>\n\t\t\t\t<p><a href=\"https://app.cointopay.com/index.jsp?#Register\" target=\"_blank\" class=\"button button-primary\"><?php esc_html_e('Join free', 'Cointopay'); ?></a> <a href=\"https://cointopay.com\" target=\"_blank\" class=\"button\"><?php esc_html_e('Learn more about WooCommerce and Cointopay', 'Cointopay'); ?></a></p>\n\t\t\t\t</div>\n\n\t\t\t\t<table class=\"form-table\">\n\t\t\t <?php $this->generate_settings_html(); ?>\n\t\t\t\t</table>\n\t\t\t\t<?php\n\n\t\t}", "public function display_plugin_setup_page() {\n\t\tinclude_once( 'partials/nerd-wp-admin-display.php' );\n\t}", "function sailthru_scout_options_callback() {\n\techo '<p>Scout is an on-site tool that displays relevant content to users when viewing a particular page.</p>';\n}", "public function admin_options() { ?>\n <h3><?php _e( 'Veritrans', 'woocommerce' ); ?></h3>\n <p><?php _e('Allows payments using Veritrans.', 'woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "function _wp_privacy_requests_screen_options()\n {\n }", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-settings-page.php';\n }", "public function statistics()\n {\n add_settings_field(\n 'statistics',\n apply_filters($this->plugin_name . 'label-statistics', esc_html__('Statistics', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-library',\n [\n 'description_raw' => 'Allow anonymous collection of plugin usage statistics. <a href=\"?page=wordpress-security-txt-help#statistics\">Learn more</a> about what is collected and how the data is used.',\n 'id' => 'statistics',\n 'class' => 'hide-when-disabled',\n 'value' => isset($this->options['statistics']) ? $this->options['statistics'] : false,\n ]\n );\n }", "function privacyInformation($args, $request) {\n\t\t$this->validate(null, $request);\n\n\t\t// Check whether this is an opt-out request.\n\t\tif ($request->isPost()) {\n\t\t\tif ($request->getUserVar('opt-out')) {\n\t\t\t\t// Set a cookie that is valid for one year.\n\t\t\t\t$request->setCookieVar('oas-opt-out', true, time() + 60*60*24*365);\n\t\t\t}\n\t\t\tif ($request->getUserVar('opt-in')) {\n\t\t\t\t// Delete the opt-out cookie.\n\t\t\t\t$request->setCookieVar('oas-opt-out', false, time() - 60*60);\n\t\t\t}\n\t\t}\n\n\t\t// Display the privacy info page.\n\t\t$this->setupTemplate($request);\n\t\t$plugin = $this->_getPlugin();\n\t\t$templateMgr = TemplateManager::getManager($request);\n\t\t$templateMgr->assign('pageTitle', 'plugins.generic.oas.optout.title');\n\t\t$templateMgr->assign('oasDisplayPrivacyInfo', true);\n\t\t$templateMgr->assign('hasOptedOut', ($request->getCookieVar('oas-opt-out') ? true : false));\n\t\t$templateMgr->assign('privacyMessage', $plugin->getSetting(0, 'privacyMessage'));\n\t\t$templateMgr->display($plugin->getTemplatePath().'privacyInformation.tpl');\n\t}", "public function admin_options(){\r\n echo '<h3>'.__('Netgíró Payment Gateway', 'netgiro').'</h3>';\r\n echo '<p>'.__('Verslaðu á netinu með Netgíró á einfaldan hátt.').'</p>';\r\n echo '<table class=\"form-table\">';\r\n $this -> generate_settings_html();\r\n echo '</table>';\r\n }", "public function SetPanelSettings()\n\t{\n\t\tif(gzte11(ISC_LARGEPRINT) && GetConfig('EnableGiftCertificates') != 0) {\n\t\t\t$GLOBALS['SNIPPETS']['TopMenuGiftCertificates'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"TopMenuGiftCertificates\");\n\t\t}\n\t\t// Show the login/logout link as required\n\n\t\t$GLOBALS['HideLogoutLink'] = 'display: none';\n\t\t\n\t\tif(!isset($GLOBALS['LoginOrLogoutText'])) {\n\n\t\t\tif(CustomerIsSignedIn()) {\n\t\t\t\t$usuarioLogado = true;\n\t\t\t\t// If they're a customer, set their name so it's available in the templates\n\t\t\t\t$c = GetClass('ISC_CUSTOMER');\n\t\t\t\t$customerData = $c->GetCustomerDataByToken();\n\t\t\t\t$GLOBALS['CurrentCustomerFirstName'] = isc_html_escape(ucwords(strtolower($customerData['custconfirstname'])));\n\t\t\t\t$GLOBALS['CurrentCustomerLastName'] = isc_html_escape(ucwords(strtolower($customerData['custconlastname'])));\n\t\t\t\t$GLOBALS['CurrentCustomerEmail'] = isc_html_escape(strtolower($customerData['custconemail']));\n\n\t\t\t\t$GLOBALS['LoginOrLogoutLink'] = \"login.php?action=logout\";\n\t\t\t\t//$GLOBALS['LoginOrLogoutText'] = sprintf(GetLang('LogoutLink'), $GLOBALS['ShopPathNormal']);\n\t\t\t\t$GLOBALS['LoginOrLogoutText'] = 'Ol&aacute; <b>'.$GLOBALS['CurrentCustomerFirstName'].'!</b> </a>\n\t\t\t\t\t\t ( <a href=\"'.$GLOBALS['ShopPathNormal'].'/account.php\">Meus Dados</a>\n\t\t\t\t\t\t <a href=\"'.$GLOBALS['ShopPathNormal'].'/account.php?action=order_status\">Meus Pedidos</a>\n\t\t\t\t\t\t <a href=\"'.$GLOBALS['ShopPathNormal'].'/login.php?action=logout\">Sair</a> )';\n\t\t\t\t\n\t\t\t\t$GLOBALS['HideLogoutLink'] = '';\n\t\t\t}else{\n\t\t\t\t$usuarioLogado = false;\n\t\t\t\t$loginLinkFunction = '';\n\t\t\t\t$createAccountLinkFunction = '';\n\t\t\t\t$GLOBALS['OptimizerLinkScript'] = $this -> insertOptimizerLinkScript();\n\t\t\t\tif($GLOBALS['OptimizerLinkScript'] != '') {\n\t\t\t\t\t$loginLinkFunction = \"gwoTracker._link(\\\"\".$GLOBALS['ShopPathSSL'].\"/login.php?tk=\".session_id().\"\\\"); return false;\";\n\t\t\t\t\t$createAccountLinkFunction = \"gwoTracker._link(\\\"\".$GLOBALS['ShopPathSSL'].\"/login.php?action=create_account&tk=\".session_id().\"\\\"); return false;\";\n\n\t\t\t\t}\n\t\t\t\t// If they're a guest, set their name to 'Guest'\n\t\t\t\t$GLOBALS['CurrentCustomerFirstName'] = GetLang('Guest');\n\t\t\t\t$GLOBALS['CurrentCustomerLastName'] = $GLOBALS['CurrentCustomerEmail'] = '';\n\n\t\t\t\t$GLOBALS['LoginOrLogoutLink'] = \"login.php\";\n\t\t\t\t$GLOBALS['LoginOrLogoutText'] = sprintf(GetLang('SignInOrCreateAccount'), $GLOBALS['ShopPath'], $loginLinkFunction, $GLOBALS['ShopPath'], $createAccountLinkFunction);\n\t\t\t}\n\t\t}else{\n\t\t\t$usuarioLogado = false;\n\t\t}\n\t\t\n\t\t/* EDAZCOMMERCE - CRIAR OS CAMPOS DE LOGIN NO HEADER POR AQUI, PARA NÃO ENTRAR EM CONFLITO COM O LOGIN DO CHECKOUT */\n\t\t$GLOBALS['FieldsLoginHeader'] = '<input type=\"text\" class=\"InputTexto InitialFocus\" name=\"login_email\" id=\"login_email\" size=\"35\" />\n\t\t\t\t\t\t<input type=\"password\" class=\"InputTexto\" name=\"login_pass\" id=\"login_pass\" />\n\t\t\t\t\t\t<input type=\"submit\" id=\"id=\"LoginButton\"\" value=\"Entrar\" />';\n\t\t\n\t\t/* EDAZCOMMERCE - USUÁRIO DESLOGADO DO SISTEMA */\n\t\t$GLOBALS['UsuarioLogado'] = $usuarioLogado;\n\t\tif($usuarioLogado){\n\t\t\t$GLOBALS['DisplayLoginHome'] \t\t= \"displayNone\";\n\t\t\t$GLOBALS['ClassWelcomeMessageUser'] = \"width600\";\n\t\t}else{\n\t\t\t/* DESABILITA OS CAMPOS PARA LOGIN NO HEADER QUANDO ESTIVER NO CHECKOUT */\n\t\t\tif(!isset($GLOBALS['PanelLoginJavaScript']) || (isset($GLOBALS['PanelLoginJavaScript']) && $GLOBALS['PanelLoginJavaScript'] != 'desabilitadoCheckout')){\n\t\t\t\t$GLOBALS['PanelLoginJavaScript'] = \"%%Panel.LoginJavaScript%%\";\n\t\t\t}\n\t\t}\n\t\tif($GLOBALS['PanelLoginJavaScript'] == 'desabilitadoCheckout'){\n\t\t\t$GLOBALS['FieldsLoginHeader']\t = \"\";\n\t\t\t$GLOBALS['PanelLoginJavaScript'] = \"\";\n\t\t}\n\n\t\t// Display our currency flags. Has been disabled for the time being. Theory being that this will include the whole locale (text aswell)\n\t\t$GLOBALS['CurrencyFlags'] = \"\";\n\t}", "public function displayAdminPanel() {}", "function showLongerSettings()\n\t{\n\t\tinclude_once(\"./Services/Administration/classes/class.ilSetting.php\");\n\t\t$this->longer_settings = ilSetting::_getLongerSettings();\n\t\t$this->displayTools();\n\t}", "function wpct_settings_section_render( $args ) {\n\t\techo __(\"Select checkboxes below for any toolbar sections to hide for the {$args['title']} role.\");\n\t}", "function execute()\n {\n plugin::execute();\n\n if($this->is_account && !$this->view_logged){\n $this->view_logged = TRUE;\n new log(\"view\",\"terminal/\".get_class($this),$this->dn);\n }\n\n /* Do we need to flip is_account state? */\n if (isset($_POST['modify_state'])){\n $this->is_account= !$this->is_account;\n }\n\n /* Do we represent a valid terminal? */\n if (!$this->is_account && $this->parent === NULL){\n $display= \"<img alt=\\\"\\\" src=\\\"images/small-error.png\\\" align=\\\"middle\\\">&nbsp;<b>\".\n _(\"This DN has no terminal features.\").\"</b>\";\n return ($display);\n }\n\n /* Show main page */\n $smarty= get_smarty();\n $smarty->assign(\"gotoLpdEnable_dialog\", $this->gotoLpdEnable_dialog->execute());\n\n /* Assign acls */\n $tmp= $this->plInfo();\n foreach($tmp['plProvidedAcls'] as $name => $translation){\n $smarty->assign($name.\"ACL\",$this->getacl($name));\n }\n\n if(isset($_POST['gotoXdmcpServer_add']) && isset($_POST['XdmcpAddServer'])){\n if(!in_array_strict($_POST['gotoXdmcpServer_add'],$this->selected_xdmcp_servers)){\n $this->selected_xdmcp_servers[] =get_post('gotoXdmcpServer_add');\n }\n }\n\n if(isset($_POST['selected_xdmcp_servers']) && isset($_POST['XdmcpDelServer'])){\n $tmp = array();\n foreach($this->selected_xdmcp_servers as $name){\n if(!in_array_strict($name,$_POST['selected_xdmcp_servers'])){\n $tmp[] = $name;\n }\n }\n $this->selected_xdmcp_servers = $tmp;\n }\n\n /* Arrays */ \n foreach(array(\"XMethods\", \"XDrivers\", \"XResolutions\", \"XColordepths\",\n \"XKbModels\",\"XKbVariants\",\"MouseTypes\", \"MousePorts\") as $val){\n $smarty->assign(\"$val\", set_post($this->$val));\n }\n $smarty->assign(\"XKbLayouts\", set_post($this->XKbLayouts));\n $smarty->assign(\"XKbLayoutKeys\",set_post(array_flip($this->XKbLayouts)));\n $smarty->assign(\"nfsservers\", set_post($this->config->data['SERVERS']['NFS']));\n\n\n /* Create a list of useable servers for the currently selected \n * connection type.\n */ \n $xdmcp_types = $this->config->data['SERVERS']['TERMINAL_SESSION_TYPES'];\n $available_servers = array();\n foreach($xdmcp_types as $servername =>$supported_types){\n if(in_array_strict(strtoupper($this->gotoXMethod),$supported_types)){\n $available_servers[] = $servername;\n }\n }\n\n /* Append additional information to invalid server selections.\n */\n $tmp = array();\n foreach($this->selected_xdmcp_servers as $server){\n if(in_array_strict($server,$available_servers)){\n $tmp[$server] = $server;\n }else{\n $tmp[$server] = $server.\"&nbsp;-&nbsp;\"._(\"Unsupported\");\n }\n }\n\n /* Remove already selected servers from available list. \n */\n foreach($available_servers as $key => $server){\n if(isset($tmp[$server])){\n unset($available_servers[$key]);\n }\n }\n\n $smarty->assign(\"selected_xdmcp_servers\", set_post($tmp));\n $smarty->assign(\"inherited_xdmcp_servers\",set_post($this->inherited_xdmcp_servers));\n $smarty->assign(\"available_xdmcp_servers\",set_post($available_servers));\n\n /* Variables - select */\n foreach(array(\"gotoXMethod\",\"gotoXDriver\", \"gotoXResolution\", \"gotoXColordepth\", \n \"gotoLpdServer\", \"gotoXKbModel\", \"gotoXKbLayout\",\n \"gotoXKbVariant\", \"gotoXMouseType\", \"gotoXMouseport\") as $val){\n\n $smarty->assign($val.\"_select\", set_post($this->$val));\n }\n\n /* Variables */\n foreach(array(\"gotoXHsync\", \"gotoXVsync\") as $val){\n $smarty->assign($val, set_post($this->$val));\n }\n\n /* Checkboxes */\n foreach(array(\"gotoScannerEnable\") as $val){\n if ($this->$val == TRUE) {\n $smarty->assign(\"$val\", \"checked\");\n } else {\n $smarty->assign(\"$val\", \"\");\n }\n }\n\n /* Phone stuff */\n $smarty->assign (\"goFonHardware\", set_post($this->goFonHardware));\n $hl= \"<select size=\\\"1\\\" name=\\\"goFonHardware\\\" title=\\\"\".\n _(\"Choose the phone located at the current terminal\").\"\\\" >\\n\";\n foreach ($this->hardware_list as $cn => $description){\n if ($cn == $this->goFonHardware){\n $selected= \"selected\";\n } else {\n $selected= \"\";\n }\n if (isset($this->used_hardware[$cn])){\n $color= \"style=\\\"color:#A0A0A0\\\"\";\n } else {\n $color= \"\";\n }\n $hl.= \" <option $color label=\\\"$cn\\\" value=\\\"$cn\\\" $selected>$description</option>\\n\";\n }\n $hl.= \"</select>\\n\";\n $smarty->assign (\"hardware_list\", $hl);\n $smarty->assign (\"gotoXMonitor\", set_post($this->gotoXMonitor));\n\n $smarty->assign(\"AutoSyncACL\",$this->getacl(\"AutoSync\"));\n\n $smarty->assign(\"AutoSyncCHK\",\" \");\n if($this->AutoSync){\n $smarty->assign(\"AutoSyncCHK\",\" checked \");\n $smarty->assign(\"gotoXVsyncACL\", preg_replace(\"/w/\",\"\",$this->getacl(\"gotoXVsync\")));\n $smarty->assign(\"gotoXHsyncACL\", preg_replace(\"/w/\",\"\",$this->getacl(\"gotoXHsync\")));\n }\n\n /* Show main page */\n return($smarty->fetch (get_template_path('terminalService.tpl', TRUE,dirname(__FILE__))));\n }", "public function _report_filters_ui()\n\t{\n\t\t$filter = View::factory('actionable_filter');\n\t\t$filter->render(TRUE);\n\t}", "protected function infoScreenAction() {}", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New Optin', 'mailoptin'));\n $this->register_core_settings($instance, true);\n $instance->build(true);\n }", "public function admin_menu(): void {\n\t\tif ( is_plugin_active_for_network( plugin_basename( WP_SENTRY_PLUGIN_FILE ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_management_page(\n\t\t\t'WP Sentry test',\n\t\t\t'WP Sentry test',\n\t\t\t'activate_plugins',\n\t\t\tself::ADMIN_PAGE_SLUG,\n\t\t\t[ $this, 'render_admin_page' ]\n\t\t);\n\t}", "public function show(iot $iot)\n {\n //\n }", "public function admin_options() {\n\n\t\tparent::admin_options();\n\n\t\tob_start();\n\t\t?>\n\t\t// Hide service labels if admin opts to show carrier service levels\n\t\t$( '.hide_service_labels_if_checked' ).change( function() {\n\n\t\t\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t\t\t$( this ).closest( 'tr' ).nextUntil( 'p' ).hide();\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).closest( 'tr' ).nextUntil( 'p' ).show();\n\t\t\t\t}\n\t\t} ).change();\n\t\t// Hide additional handling fee field if there's no base handling fee entered\n\t\t$( 'input[name=\"woocommerce_shipwire_handling_fee\"]' ).change( function() {\n\t\t\tif ( '' === $( this ).val() ) {\n\t\t\t\t$( 'input[name=\"woocommerce_shipwire_additional_handling_fee\"]' ).closest( 'tr' ).hide();\n\t\t\t} else {\n\t\t\t\t$( 'input[name=\"woocommerce_shipwire_additional_handling_fee\"]' ).closest( 'tr' ).show();\n\t\t\t}\n\t\t} ).change();\n\n\t\t<?php\n\t\twc_enqueue_js( ob_get_clean() );\n\t}", "public function isInformationVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_OPTIONS_DISPLAY_INFORMATION);\n }", "function activate() {\n\t\t\tadd_option('h2utp_options', json_encode($this->options));\n\t\t}", "public function option_page() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\twp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'top-story' ) );\n\t\t}\n\n\t\tinclude_once( \"{$this->plugin->dir_path}/templates/option-page.php\" );\n\t}", "function basic_ui() {\n\t\tif ( !isset( $_REQUEST['nonce'] ) || !wp_verify_nonce( $_REQUEST['nonce'], 'keyring-manage-' . $this->get_name() ) ) {\n\t\t\tKeyring::error( __( 'Invalid/missing management nonce.', 'keyring' ) );\n\t\t\texit;\n\t\t}\n\n\t\t// Common Header\n\t\techo '<div class=\"wrap\">';\n\t\tscreen_icon( 'ms-admin' );\n\t\techo '<h2>' . __( 'Keyring Service Management', 'keyring' ) . '</h2>';\n\t\techo '<p><a href=\"' . Keyring_Util::admin_url( false, array( 'action' => 'services' ) ) . '\">' . __( '&larr; Back', 'keyring' ) . '</a></p>';\n\t\techo '<h3>' . sprintf( __( '%s API Credentials', 'keyring' ), esc_html( $this->get_label() ) ) . '</h3>';\n\n\t\t// Handle actually saving credentials\n\t\tif ( isset( $_POST['api_key'] ) && isset( $_POST['api_secret'] ) ) {\n\t\t\t// Store credentials against this service\n\t\t\t$this->update_credentials( array(\n\t\t\t\t'key' => stripslashes( $_POST['api_key'] ),\n\t\t\t\t'secret' => stripslashes( $_POST['api_secret'] ),\n\t\t\t\t'redirect_uri' => stripslashes( $_POST['redirect_uri'] ),\n\t\t\t) );\n\t\t\techo '<div class=\"updated\"><p>' . __( 'Credentials saved.', 'keyring' ) . '</p></div>';\n\t\t}\n\n\t\t$api_key = $api_secret = $redirect_uri = '';\n\t\tif ( $creds = $this->get_credentials() ) {\n\t\t\t$api_key = $creds['key'];\n\t\t\t$api_secret = $creds['secret'];\n\t\t\t$redirect_uri = $creds['redirect_uri'];\n\t\t}\n\n\t\techo apply_filters( 'keyring_' . $this->get_name() . '_basic_ui_intro', '' );\n\n\t\tif ( ! $redirect_uri ) {\n\t\t\t$redirect_uri = Keyring_Util::admin_url( $this->get_name(), array( 'action' => 'verify' ) );\n\t\t}\n\n\t\t// Output basic form for collecting key/secret\n\t\techo '<form method=\"post\" action=\"\">';\n\t\techo '<input type=\"hidden\" name=\"service\" value=\"' . esc_attr( $this->get_name() ) . '\" />';\n\t\techo '<input type=\"hidden\" name=\"action\" value=\"manage\" />';\n\t\twp_nonce_field( 'keyring-manage', 'kr_nonce', false );\n\t\twp_nonce_field( 'keyring-manage-' . $this->get_name(), 'nonce', false );\n\t\techo '<table class=\"form-table\">';\n\t\techo '<tr><th scope=\"row\">' . __( 'Client ID', 'keyring' ) . '</th>';\n\t\techo '<td><input type=\"text\" name=\"api_key\" value=\"' . esc_attr( $api_key ) . '\" id=\"api_key\" class=\"regular-text\"></td></tr>';\n\t\techo '<tr><th scope=\"row\">' . __( 'Client Secret', 'keyring' ) . '</th>';\n\t\techo '<td><input type=\"text\" name=\"api_secret\" value=\"' . esc_attr( $api_secret ) . '\" id=\"api_secret\" class=\"regular-text\"></td></tr>';\n\t\techo '<tr><th scope=\"row\">' . __( 'Redirect URI', 'keyring' ) . '</th>';\n\t\techo '<td><input type=\"text\" name=\"redirect_uri\" value=\"' . esc_attr( $redirect_uri ) . '\" id=\"redirect_uri\" class=\"regular-text\"></td></tr>';\n\t\techo '</table>';\n\t\techo '<p class=\"submitbox\">';\n\t\techo '<input type=\"submit\" name=\"submit\" value=\"' . __( 'Save Changes', 'keyring' ) . '\" id=\"submit\" class=\"button-primary\">';\n\t\techo '<a href=\"' . esc_url( $_SERVER['HTTP_REFERER'] ) . '\" class=\"submitdelete\" style=\"margin-left:2em;\">' . __( 'Cancel', 'keyring' ) . '</a>';\n\t\techo '</p>';\n\t\techo '</form>';\n\t\techo '</div>';\n\t}", "private function showHowRequestForm() {\r\n $this->config->showPrinterFriendly = false;\r\n echo '<h2>How would you like to use this time?</h2>';\r\n $this->showSubTimeTypeDropDown();\r\n echo '<input type=\"hidden\" name=\"maxCalDays\" value=\"' . $this->maxCalDays . '\" />';\r\n echo '<br/><br/><br/>';\r\n }", "public function show_settings_page() : void {\n\t\t\t$categories = self::get_categories();\n\n\t\t\tSFWD_LMS::get_view(\n\t\t\t\t'support/help',\n\t\t\t\tarray(\n\t\t\t\t\t'categories' => $categories,\n\t\t\t\t),\n\t\t\t\ttrue\n\t\t\t);\n\t\t}" ]
[ "0.6087266", "0.59550387", "0.5897626", "0.56828916", "0.5653901", "0.5604799", "0.558112", "0.5469646", "0.54535294", "0.54532754", "0.5440054", "0.5440054", "0.53906614", "0.5389093", "0.5384395", "0.53698206", "0.5359816", "0.53589535", "0.5353292", "0.5351351", "0.5330402", "0.5324801", "0.5320534", "0.52985024", "0.52913827", "0.5279979", "0.52697045", "0.52505124", "0.5247441", "0.5228633", "0.52209896", "0.5216816", "0.5213922", "0.5210863", "0.5208503", "0.51992697", "0.5199109", "0.51936287", "0.51887375", "0.5184721", "0.51786363", "0.5167162", "0.51557887", "0.51553917", "0.5141706", "0.51246727", "0.5112445", "0.5112377", "0.510627", "0.510627", "0.510627", "0.5098206", "0.50977796", "0.50922155", "0.5082677", "0.5073032", "0.5030494", "0.50226367", "0.5020679", "0.50203663", "0.5019369", "0.50149006", "0.50116616", "0.50096947", "0.50085956", "0.50059813", "0.50017196", "0.49927473", "0.49887258", "0.49867418", "0.4983413", "0.49819028", "0.49744007", "0.49721542", "0.49710977", "0.4969473", "0.49672666", "0.49612996", "0.4960202", "0.4958948", "0.4956", "0.4954583", "0.4953819", "0.49455693", "0.49435443", "0.49390998", "0.49277985", "0.49232945", "0.4911891", "0.4907199", "0.4901884", "0.48998645", "0.48972702", "0.4890337", "0.48881575", "0.48876494", "0.48835996", "0.4881673", "0.4880687", "0.48791733" ]
0.6071838
1
Fires after the 'About the User' settings table on the 'Edit User' screen.
function user_profile_options( WP_User $user ) : void { ?> <table class="form-table"> <tr> <th> <label for="altis_telemetry_opt_in"><?php esc_html_e( 'Altis Telemetry', 'altis' ); ?></label> </th> <td> <input type="checkbox" name="altis_telemetry_opt_in_toggle" id="altis_telemetry_opt_in" <?php checked( is_user_opted_in( $user ) ) ?> value="1" /> <label for="altis_telemetry_opt_in"><?php esc_html_e( 'Opt in to Altis Telemetry', 'altis' ); ?></label> <p class="description"><?php esc_html_e( 'To help us develop Altis, we would like to collect data on your usage of the software. This will help us build a better product for you.', 'altis' ); ?></p> </td> </tr> </table> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionSettings()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t\n\t\t$record = SiteUser::model()->findByAttributes(array('id'=> Yii::app()->user->id));\n\t\t\n\t\tif($record===null)\n\t\t\t\tthrow new CHttpException(404, Yii::t('app', 'Internal server error.'));\n\n\t\t\n\t\tif(isset($_POST['SiteUser']))\n\t\t{\n\t\t\t$record->attributes=$_POST['SiteUser'];\n\t\t\n\t\t\t\n\n\t\t\tModeratorLogHelper::AddToLog('edited-user-'.$record->id,'Изменены данные пользователя '.$record->email,null,$record->id);\n\t\t\tif($record->save())\n\t\t\t\t$this->redirect(array('personal'));\n\t\t}\n\t\t\n\t\t$this->render('settings',array('user'=>$record));\n\t}", "public function user_settings()\n {\n\n //if existing user, go to settings\n if (Session::has('user'))\n {\n //remember url user is coming from\n Session::put('redirect', URL::previous());\n\n $user = Session::get('user');\n $failure = Session::get('failure');\n\n //specify whether user is new or not\n $user->new = 0;\n\n //get the grille's phone number, and put it in readable format\n $grille_num = Grille::where('id', $this->grille_id)->pluck('phone_number');\n $user->grille_number = '(' . substr($grille_num, 0, 3) . ') ' . substr($grille_num, 3, 3) \n . '-' . substr($grille_num, 6, 4);\n\n //format phone number to prefill\n $user->phone_formatted = '(' . substr($user->phone_number, 0, 3) . ') ' . substr($user->phone_number, 3, 3) \n . '-' . substr($user->phone_number, 6, 4);\n\n $this->layout->content = View::make('users.edit', ['user' => $user, 'failure' => $failure]);\n }\n //else redirect back to where came from\n else\n {\n try {\n return Redirect::back();\n }\n catch (Exception $e) {\n return Redirect::to('/');\n }\n\n }\n }", "function seun_edit_user_options() {\n\n\t\t\tglobal $user_id;\n\n\t\t\t$user_id = isset($user_id) ? (int) $user_id : 0;\n\n\t\t\tif ( ! current_user_can('edit_users') )\n\t\t\t\treturn;\n\n\t\t\tif ( ! ($userdata = get_userdata( $user_id ) ) )\n\t\t\t\treturn;\n\n\t\t\t$default_user_nicename = sanitize_title( $userdata->user_login );\n\n\t\t\techo '<h3>'.__('User Nicename', 'seun').'</h3>'\n\t\t\t\t.'<table class=\"form-table\">'.\"\\n\"\n\t\t\t\t\t.'<tr>'.\"\\n\"\n\t\t\t\t\t\t.'<th><label for=\"user_nicename\">'.__('User nicename/slug', 'seun').'</label></th>'.\"\\n\"\n\t\t\t\t\t\t.'<td>'\n\t\t\t\t\t\t\t.'<input id=\"user_nicename\" name=\"user_nicename\" class=\"regular-text code\" type=\"text\" value=\"'.sanitize_title($userdata->user_nicename, $default_user_nicename).'\"/> '\n\t\t\t\t\t\t\t.'<span class=\"description\">('.sprintf(__('Leave empty for default value: %s', 'seun'), $default_user_nicename).')</span> '\n\t\t\t\t\t\t\t.'<a href=\"'.get_author_posts_url($user_id).'\">'.__('Your Profile').'</a> '\n\t\t\t\t\t\t.\"</td>\\n\"\n\t\t\t\t\t.'</tr>'.\"\\n\"\n\t\t\t\t.'</table>'.\"\\n\";\n\n\t\t}", "public function post_edit() {\n //try to edit the user\n if (AuxUser::editUser()) {\n //if the edit process worked, redirect to the profile page\n echo '<script>alert(\"User data edited\");</script>';\n Response::redirect('/profile');\n } else {\n //if not, print the error message\n echo '<script>alert(\"No data was updated, Please confirm that you change at least one field\");</script>';\n Response::redirect('/user/edit', 'refresh');\n }\n }", "public function Edit_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId());\n\t}", "protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "public function onAttendeesEdit()\n\t{\n\t\tif ($this->perms->edit)\n\t\t{\n\t\t\tJToolBarHelper::save();\n\t\t}\n\n\t\tJToolBarHelper::cancel();\n\t\t$this->setToolbarTitle('Edit');\n\t}", "public function actionSettings(){\n $user = Users::findOne(\\Yii::$app->user->getId());\n return $this->render('settings', ['user'=>$user]);\n }", "public function editinformation() \n {\n UserModel::authentication();\n \n //get the session user\n $user = UserModel::user();\n\n UserModel::update_profile();\n }", "function ffl_settings_page()\n{\n\tif(!empty($_REQUEST['updateusers']) && current_user_can(\"manage_options\"))\n\t{\n\t\tglobal $wpdb;\n\t\t$user_ids = $wpdb->get_col(\"SELECT ID FROM $wpdb->users\");\n\t\t\n\t\tforeach($user_ids as $user_id)\n\t\t{\n\t\t\tffl_fix_user_display_name($user_id);\t\t \n\t\t\tset_time_limit(30);\t\t\t\n\t\t}\n\t\t\n\t\t?>\n\t\t<p><?php echo count($user_ids);?> users(s) fixed.</p>\n\t\t<?php\n\t}\n\t\n\t?>\n\t<p>The <em>Force First and Last Name as Display Name</em> plugin will only fix display names at registration or when a profile is updated.</p>\n\t<p>If you just activated this plugin, please click on the button below to update the display names of your existing users.</p>\n\t<p><a href=\"?page=ffl_settings&updateusers=1\" class=\"button-primary\">Update Existing Users</a></p>\n\t<p><strong>WARNING:</strong> This may take a while! If you have a bunch of users or a slow server, <strong>this may hang up or cause other issues with your site</strong>. Use at your own risk.</p>\t\n\t<?php\n}", "function change_user_info( $user, $key, $config )\n {\n //Unimplemented\n }", "public function test_edit_settings_send_as_user()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user)\n ->post('/settings/save', $this->settings_list())\n ->assertStatus(404);\n }", "public function settings()\r\n {\r\n if ($this->request->is('post')) {\r\n\r\n $settingsChanged = false;\r\n\r\n $userId = $this->Session->read('Auth.User.id');\r\n\r\n $this->User->id = $userId;\r\n\r\n if ($this->request->data['User']['Clear All']) {\r\n $this->User->Reminder->deleteAll(\r\n array('Reminder.user_id' => $this->Session->read('Auth.User.id'), false)\r\n );\r\n }\r\n\r\n if (!empty($this->request->data['User']['email'])) {\r\n\r\n $this->User->set($this->request->data);\r\n $this->OpauthUser->set($this->request->data);\r\n\r\n $validUser = $this->User->validates(array('fieldList' => array('email')));\r\n $validOpauth = $this->OpauthUser->validates(array('fieldList' => array('email')));\r\n\r\n if ($this->Session->read('User.authType') == 'opauth') {\r\n\r\n $this->OpauthUser->id = $userId;\r\n\r\n if ($validOpauth && $validUser) {\r\n $this->OpauthUser->saveField('email', $this->request->data['User']['email'], false);\r\n $settingsChanged = true;\r\n }\r\n\r\n } else {\r\n\r\n if ($validUser && $validOpauth) {\r\n $this->User->saveField('email', $this->request->data['User']['email'], false);\r\n $settingsChanged = true;\r\n }\r\n }\r\n }\r\n\r\n if (!empty($this->request->data['User']['password'])) {\r\n\r\n if ($this->User->saveField('password', $this->request->data['User']['password'], true)) {\r\n $settingsChanged = true;\r\n }\r\n }\r\n\r\n if ($this->request->data['User']['timezone'] !== \"empty\") {\r\n\r\n if ($this->Session->read('User.authType') == 'opauth') {\r\n\r\n $this->OpauthUser->id = $userId;\r\n\r\n if ($this->OpauthUser->saveField('timezone', $this->request->data['User']['timezone'], false)) {\r\n $this->Session->write('Auth.User.timezone', $this->request->data['User']['timezone']);\r\n $settingsChanged = true;\r\n }\r\n\r\n } else {\r\n if ($this->User->saveField('timezone', $this->request->data['User']['timezone'], true)) {\r\n $this->Session->write('Auth.User.timezone', $this->request->data['User']['timezone']);\r\n $settingsChanged = true;\r\n }\r\n }\r\n }\r\n\r\n if ($this->request->data['User']['Clear All']) {\r\n $settingsChanged = true;\r\n $this->Session->setFlash('Cleared all reminders', 'successFlash');\r\n }\r\n\r\n if ($settingsChanged) {\r\n $this->Session->setFlash('Settings Changed', 'successFlash');\r\n\r\n } else {\r\n $this->Session->setFlash('Nothing to update', 'failureFlash');\r\n }\r\n }\r\n }", "function saveSettings()\n {\n\t if ( wfReadOnly() ) {\n\t\treturn;\n\t }\n\t if ( 0 == $this->mCedarId ) {\n\t\treturn;\n\t }\n\t \n\t $dbw =& wfGetDB( DB_MASTER );\n\t $dbw->update( 'cedar_user_info',\n\t\t array( /* SET */\n\t\t\t 'user_id' => $this->mId,\n\t\t\t 'organization' => $this->mOrg,\n\t\t\t 'address1' => $this->mAddress1,\n\t\t\t 'address2' => $this->mAddress2,\n\t\t\t 'city' => $this->mCity,\n\t\t\t 'state' => $this->mState,\n\t\t\t 'country' => $this->mCountry,\n\t\t\t 'postal_code' => $this->mPostalCode,\n\t\t\t 'phone' => $this->mPhone,\n\t\t\t 'mobile_phone' => $this->mMobilePhone,\n\t\t\t 'fax' => $this->mFax,\n\t\t\t 'supervisor_name' => $this->mSupervisorName,\n\t\t\t 'supervisor_email' => $this->mSupervisorEmail\n\t\t ), array( /* WHERE */\n\t\t\t 'user_info_id' => $this->mCedarId\n\t\t ), __METHOD__\n\t );\n\t $this->clearSharedCache();\n }", "public function afterSave()\n\t{\n\t\t//annoying on every edit, move to a checkbox on form and handle in controller\n\t}", "public function settings_page() {\r\n\t\tif ( ! isset( $this->hook_suffix ) )\r\n\t\t\treturn;\r\n\r\n\t\tadd_action( 'inf_member_settings_after_header_' . $this->hook_suffix, array( 'Inf_Member_App_Settings', 'after_header' ) );\r\n\r\n Inf_Member_Settings::settings_page_template( $this->hook_suffix, __( 'Inf Member Settings', 'inf-member' ) );\r\n\t}", "function user_edit($user_info)\n {\n }", "function OnAfterEdit(){\n }", "protected function admin_page_action() {\n\n\t\tif ( $this->is_admin_request_for_users_forget() ) {\n\t\t\t$this->users_forget();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_send_email() ) {\n\t\t\t$this->users_send_email();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_remove() ) {\n\t\t\t$this->users_remove_from_list();\n\t\t}\n\n\t\t/* Default settings page */\n\t\t$this->add_view_option( 'data', $this->get_all_requested_users_data( $confirmed_only = true ) );\n\n\t}", "function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}", "function notification_user_settings_save() {\n\tglobal $CONFIG;\n\t//@todo Wha??\n\tinclude($CONFIG->path . \"actions/notifications/settings/usersettings/save.php\");\n}", "function __editUserModal()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //template file\n $this->data['template_file'] = PATHS_COMMON_THEME . 'users.modal.html';\n\n //get client id\n $user_id = $this->uri->segment(4);\n\n //flow control\n $next = true;\n\n /** CLIENT CHECK PERMISSION **/\n if (!$this->permissions->usersEdit($user_id)) {\n\n //permission denied\n $this->notifications('wi_notification', $this->permissions->reason);\n\n //halt\n $next = false;\n }\n\n //load from database\n if ($next) {\n $this->data['reg_fields'][] = 'profile';\n $this->data['fields']['profile'] = $this->users_model->userDetails($user_id);\n $this->data['debug'][] = $this->users_model->debug_data;\n\n //visibility - show table or show nothing found\n if (!empty($this->data['fields']['profile'])) {\n $this->data['visible']['wi_edit_user_details_table'] = 1;\n } else {\n $this->notifications('wi_notification', $this->data['lang']['lang_no_results_found']);\n }\n }\n }", "public function actionAbout()\n {\n if (($model = Setting::find()->where(['type' => 'About'])->one()) == null)\n $model = new Setting();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->user_id = Yii::$app->user->identity->getId();\n $model->type = 'About';\n $model->save();\n Yii::$app->session->setFlash('success', Yii::t('app', 'Thank you! Update successfully completed!'));\n\n return $this->redirect(['setting/about']);\n } else {\n return $this->render('about', [\n 'model' => $model,\n ]);\n }\n }", "function onEndShowPasswordsettings($action) { }", "public function setLastActionUser(){\n\t\t// nilai authtimeout user\n\t\tYii::$app->user->authTimeout;\n\n\t\t$user = User::findOne(Yii::$app->user->id);\n\t\t$user->last_action = date('Y-m-d H:i:s');\n\t\t$user->update();\n\t}", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }", "function power_user_options_fields( $user ) {\n\n\tif ( current_user_can( 'edit_users', $user->ID ) ) {\n\t\tpower_meta_boxes()->show_meta_box( 'power-user-settings', $user );\n\t}\n\n}", "public function edit(WxUser $wxUser)\n {\n //\n }", "function users_beforeForm($data,$db){\n\tif(empty($data->user['id'])){\n\t\tcommon_loadPhrases($data,$db,'users');\n\t\t$data->output['responseMessage']=\n\t\t\tsprintf($data->phrases['users']['requiresLogin'],$data->phrases['users']['updateProfile']);\n\t\treturn FALSE;\n\t}\n\t$data->output['editingField']=TRUE;\n}", "public function settings() {\n \n // Verify if is a team's member\n if ( $this->session->userdata( 'member' ) ) {\n redirect('user/app/dashboard');\n }\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n // Load Team Model\n $this->load->model('team');\n \n if ( file_exists( APPPATH . 'language/' . $this->config->item('language') . '/default_settings_lang.php') ) {\n $this->lang->load( 'default_settings', $this->config->item('language') );\n }\n \n // Get User Information\n $getdata = $this->user->get_user_info($this->user_id);\n\n // Get User's options\n $options = $this->user_meta->get_all_user_options($this->user_id);\n\n // display user data in settings page\n $this->content = array(\n 'udata' => $getdata,\n 'options' => $options\n );\n\n // Load view/user/settings.php file\n $this->body = 'user/settings';\n\n $this->user_layout();\n \n }", "function BeforeEdit(&$values, $where, &$oldvalues, &$keys, &$message, $inline, &$pageObject)\n{\n\n\t\t// We need to get ID of the organization associated with this user\n\n\t\t$values['updated_by_id'] = $_SESSION['organizationLoggedInUser'];\n\n\t// When was the record created?\n\n\t\t$values['syst_updated_datetime'] = NOW() ;\n\n\t// What is the system that we use to updat this record:\n // This should be an INT (default is 1 (unknown)\n\n\t\t$values['update_system_id'] = 'Unee-T Enterprise Portal' ;\n\n\t// What is the creation method\n\n\t\t$values['update_method'] = 'Super Admin - Manage Organization';\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\nreturn true;\n;\t\t\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}", "function account_edit()\n {\n }", "public function admin_profile() {\n\n // nothing done here, everything happens in the view\n\n $user = $this->User->findById($this->Auth->user('id'));\n $this->set(compact('user'));\n }", "function edituseremail()\n {\n // Auth::handleLogin() makes sure that only logged in users can use this action/method and see that page\n Auth::handleLogin();\n $this->view->render('login/edituseremail');\n }", "public function edit(UserSetting $userSetting)\n {\n //\n }", "public function edit_self(ProfileUser $editted_profile) {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"UPDATE `users` SET program = '$editted_profile->program' AND level = '$editted_profile->level' AND commuter = '$editted_profile->commuter' AND bio = '$editted_profile->bio' WHERE user_id = '$this->user_id' LIMIT 1\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t}\r\n\t}", "function settings_menu() {\n#\tregister_js(HD_PLUGIN_URL.'production/production.js',100);\n\thd_user_menu('System', 'admin_users','settings_gui', 55);\n}", "public function edituser(){\n\t\t$id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/edit_londontec_users';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Edit Londontec users',\n\t\t\t'londontec_users' => $this->setting_model->Get_Single('londontec_users','user_id',$id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "function before_edit_configuration() { }", "function display_user_profile_fields() {\r\n global $wpdb, $user_id, $wpi_settings;\r\n $profileuser = get_user_to_edit($user_id);\r\n\r\n include($wpi_settings['admin']['ui_path'] . '/profile_page_content.php');\r\n }", "function docdirect_save_custom_user_profile_fields($user_id){\n\t\tif(!current_user_can('manage_options'))\n\t\t\treturn false;\n\t\n\t\t# save my custom field\n\t\tupdate_user_meta($user_id, 'verify_user', 'off');\n\t\tupdate_user_meta( $user_id, 'show_admin_bar_front', false );\n\t}", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "public function test_edit_settings_page_show_as_user()\n {\n $user = factory(User::class)->create();\n $this->actingAs($user)\n ->get('/settings')\n ->assertStatus(404);\n }", "public function ChangeActiveEditPortal()\n {\n if ($this->global->UserDataExists('activePortalID')) {\n $portalID = $this->global->GetUserData('activePortalID');\n $oActiveUser = TCMSUser::GetActiveUser();\n\n $oActiveUser->SetActiveEditPortalID($portalID);\n } else {\n unset($_SESSION['_cms_ActiveEditPortalID']);\n }\n }", "function edit($actionValue) \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n $this->viewData['editrecord']=UserModel::Create()->SelectUser($actionValue);\n // Render the action with template\n $this->renderWithTemplate('users/edit', 'AdminPageBaseTemplate');\n }", "function onEndAccountSettingsNav($action)\n {\n $action->menuItem(\n common_local_url('contextiosettings'),\n // TRANS: Menu item in settings navigation panel.\n _m('MENU','ContextIO setttings'),\n // TRANS: Menu item title in settings navigation panel.\n _('ContextIO settings'),\n $actionName == 'contextiosettings'\n );\n }", "function user_action_user_edit_own($env, $vars) {\n user_action_user_edit($env, $vars);\n}", "public function admin_referral() {\n \tif (!empty($this->request->data)) {\n \t\tif ($this->__save()) {\n \t\t\t$this->__setMessage(__('Settings saved.', true));\n \t\t} else {\n \t\t\t$this->__setError(__('can\\'t save settings.', true));\n \t\t}\n \t}\n \t$data = $this->Setting->getReferralSettings();\n \t$this->request->data = $data;\n \t$this->set('data', $data);\n \t$this->set('tabs', $this->Setting->getTabs($this->params));\n }", "public function menu_entry_for_admin() {\n\t\tglobal $current_site, $wpdb;\n\t\t// $current_site is not the right way to do this - it is internal, and could be anything\n\t\tif (is_multisite() && (!is_super_admin() || !is_object($wpdb) || !isset($wpdb->blogid) || 1 != $wpdb->blogid)) return;\n\n\t\tadd_action( 'admin_init', array($this, 'tfaRegisterTwoFactorAuthSettings' ));\n\n\t\tadd_options_page(\n\t\t\t__('Two Factor Authentication', 'two-factor-authentication'),\n\t\t\t__('Two Factor Authentication', 'two-factor-authentication'),\n\t\t\t'manage_options',\n\t\t\t'two-factor-auth',\n\t\t\tarray($this, 'tfaShowAdminSettingsPage')\n\t\t);\n\t}", "public function userinfo()\n {\n if($user = $this->Session->read('user')){\n if(!empty($this->request->data)){\n //update thong tin\n }\n $this->set('user', $user);\n }else{\n $this->redirect(array('action' => 'login', ''));\n }\n }", "public function afterRegistry()\n {\n parent::afterRegistry();\n\n if ($this->showForRespondents && is_bool($this->showForRespondents)) {\n $this->showForRespondents = $this->_('Respondents');\n }\n if ($this->showForStaff && is_bool($this->showForStaff)) {\n $this->showForStaff = $this->_('Staff');\n }\n if ($this->showForTracks && is_bool($this->showForTracks)) {\n $this->showForTracks = $this->_('Tracks');\n }\n if ($this->showTitle && is_bool($this->showTitle)) {\n $this->showTitle = $this->_('Add');\n }\n }", "function savesettings()\r\n {\r\n\t\t$this->_savesettings();\r\n $this->setRedirect('index.php?option=com_jfusionconnect&view=cpanel');\r\n }", "function editInfo()\n {\n $this->view->load('frontend/user/editInfo');\n }", "function external_db_auth_add_menu()\n{\n add_options_page(\"External DB settings\", \"External DB settings\", 'manage_options', __FILE__, \"external_db_auth_display_options\");\n}", "function setUserAdmin( $value )\n {\n $this->UserAdmin = $value;\n }", "public function profile_edit() {\n $this->template->content = View::instance('v_users_profile_edit');\n $this->template->title = \"Edit Profile\";\n\n // Render the view\n echo $this->template;\n\n }", "public function change()\n {\n $AdminTable = TableRegistry::get('Bakkerij/CakeAdmin.Administrators');\n $user = $AdminTable->newEntity([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => 'test',\n 'active' => 1\n ]);\n $AdminTable->save($user);\n }", "public function administration()\n {\n\t\t// user connecter\n\t\tif (!$this->isUserConnected()) {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\treturn ;\n\t\t}\n\t\t// user admin\n\t\tif ($this->getUserInfo('droit') != 'ARW' && $this->getUserInfo('droit') != 'MASTER') {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\treturn ;\n\t\t}\n\n $this->loadModel('user');\n\n $result = $this->getModel()->getAllUsersInfos();\n\n\t\t$arrobj = new ArrayObject($result);\n for($i = $arrobj->getIterator(); $i->valid(); $i->next())\n {\n \t$usersInfos[] = array(\n \t\t'subject' => $i->current()->subject->getUri(),\n \t\t'pseudo' => $i->current()->pseudo->getValue(),\n \t\t'givenName' => $this->getModel()->getUserInfo($i->current()->pseudo->getValue(), 'givenName'),\n \t\t'familyName' => $this->getModel()->getUserInfo($i->current()->pseudo->getValue(), 'familyName'),\n \t\t'droit' => $i->current()->droit->getValue()\n \t\t);\n }\n\n \t$this->set('userPseudo', $this->getUserInfo('pseudo'));\n\n \t$this->set('usersInfos', $usersInfos);\n\n // On set la variable a afficher sur dans la vue\n $this->set('title', 'Administration des utilisateurs');\n // On fait le rendu de la vue signup.php\n $this->render('adminUser');\n }", "public function edit()\n\t{\n\t\t// Initialize variables.\n\t\t$app\t= &JFactory::getApplication();\n\t\t$cid\t= JRequest::getVar('cid', array(), '', 'array');\n\n\t\t// Get the id of the user to edit.\n\t\t$userId = (int) (count($cid) ? $cid[0] : JRequest::getInt('user_id'));\n\n\t\t// Set the id for the user to edit in the session.\n\t\t$app->setUserState('com_users.edit.user.id', $userId);\n\t\t$app->setUserState('com_users.edit.user.data', null);\n\n\t\t// Redirect to the edit screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false));\n\t}", "function BitTicket_plugin_settings() {\r\n add_menu_page('BitTicket', 'BitTicket', 'administrator', 'BitTicket_settings', 'BitTicket_display_settings');\r\n}", "function OnBeforeEdit(){\n }", "public function testSettingsPage() {\n $this->drupalGet('admin/structure/icecat/settings');\n\n $form_data = [\n 'edit-username' => 'TestUserName',\n 'edit-password' => 'TestPassWord',\n ];\n $this->submitForm($form_data, 'edit-submit');\n\n $this->assertSession()->pageTextContains('The configuration options have been saved.');\n\n // Check form fields.\n $this->assertSession()->fieldValueEquals('edit-username', 'TestUserName');\n $this->assertSession()->fieldValueNotEquals('edit-password', 'TestPassWord');\n }", "function edit() {\n\t\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\r\n\t\n\t\t// Get annonce\r\n\t\t$this->fetchAnnonce();\n\t\t\n\t\t// We should have write access to this annonce\n\t\t$this->checkWriteAccess();\r\n\t\r\n\t\t// Redirect to the annonce\r\n\t\t$this->renderView(\"editAnnonce\");\r\n\t\r\n\t}", "public function account_update_info()\n\t{\n\t\t$data = $this->input->post();\n\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t{\n\t\t\t$messages = $this->ion_auth->messages();\n\t\t\t$this->system_message->set_success($messages);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = $this->ion_auth->errors();\n\t\t\t$this->system_message->set_error($errors);\n\t\t}\n\n\t\tredirect('admin/panel/account');\n\t}", "public function onPaymentsEdit()\n\t{\n\t\tif ($this->perms->edit)\n\t\t{\n\t\t\t//JToolBarHelper::save();\n\t\t}\n\n\t\tJToolBarHelper::cancel();\n\t\t$this->setToolbarTitle('Edit');\n\t}", "public function updateFieldsPersonalization()\n\t{\n\t\tConfiguration::updateValue('PS_MR_SHOP_NAME', Tools::getValue('Expe_ad1'));\n\t\t$this->_html .= '<div class=\"conf confirm\"><img src=\"'._PS_ADMIN_IMG_.'/ok.gif\" alt=\"\" /> '.$this->l('Settings updated').'</div>';\t\t\n\t}", "function owa_userProfileUpdateActionTracker($user_id, $old_user_data = '') {\r\n\r\n\t$owa = owa_getInstance();\r\n\t$user = get_userdata($user_id);\r\n\tif (!empty($user->first_name) && !empty($user->last_name)) {\r\n\t\t$label = $user->first_name.' '.$user->last_name;\t\r\n\t} else {\r\n\t\t$label = $user->display_name;\r\n\t}\r\n\t\r\n\t$owa->trackAction('wordpress', 'User Profile Update', $label);\r\n}", "function isa_editor_manage_users()\n{\n if (get_option('isa_add_cap_editor_once') != 'done') {\n // let editor manage users\n $edit_editor = get_role('editor'); // Get the user role\n $edit_editor->add_cap('edit_users');\n $edit_editor->add_cap('list_users');\n $edit_editor->add_cap('promote_users');\n $edit_editor->add_cap('create_users');\n $edit_editor->add_cap('add_users');\n $edit_editor->add_cap('delete_users');\n\n update_option('isa_add_cap_editor_once', 'done');\n }\n}", "function ed_setting_section_callback(){\n\techo '<p>Settings for the Employee Display plugin</p>';\n}", "function power_user_seo_fields( $user ) {\n\n\tif ( current_user_can( 'edit_users', $user->ID ) ) {\n\t\tpower_meta_boxes()->show_meta_box( 'power-user-seo', $user );\n\t}\n\n}", "function wp_user_settings()\n {\n }", "public function test_edit_settings_send_as_admin()\n {\n $admin = User::find(1);\n\n $this->actingAs($admin)\n ->post('/settings/save', $this->settings_list())\n ->assertStatus(302)\n ->assertSessionHas('success');\n }", "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 initialize_settings_page()\n {\n }", "public function save_settings()\n\t{\n\t\tif ( $_POST && wp_verify_nonce( $_POST['save-confirm-user-registration-settings-nonce'], 'save-confirm-user-registration-settings' ) ) :\n\t\t\t$options = array(\n\t\t\t\t'error' => $_POST['error'],\n\t\t\t\t'from' => $_POST['from'],\n\t\t\t\t'subject' => $_POST['subject'],\n\t\t\t\t'message' => $_POST['message']\n\t\t\t);\n\n\t\t\t$options = apply_filters( 'confirm-user-registration-save-options', $options );\n\t\t\tupdate_site_option( 'confirm-user-registration', $options);\n\n\t\t\t?>\n\t\t\t<div class=\"updated message\">\n\t\t\t\t<p><?php _e( 'Saved' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\t}", "public function settings() \n {\n if (!isset($_SESSION)) { \n session_start(); \n }\n $title = 'User Settings';\n require('../src/View/UserSettingsView.php');\n }", "function tracker_settings_callback(){\n _e('Configure Tracker', 'se');\n}", "public function save()\n {\n $this->validate();\n $this->user->save();\n\n $this->toast('Your information has been updated!', 'success');\n }", "function pass_change()\r\n\t{\r\n\t\tglobal $ibforums, $std;\r\n\r\n\t\tif ($ibforums->member['disable_mail'])\r\n\t\t{\r\n\t\t\t$ibforums->lang['no_mail'] = sprintf($ibforums->lang['no_mail'], $ibforums->member['disable_mail_reason']);\r\n\r\n\t\t\t$this->output .= View::make(\"global.warn_window\", ['message' => $ibforums->lang['no_mail']]);\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$this->output .= View::make(\"ucp.pass_change\");\r\n\t\t}\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\r\n\t}", "function applysettings()\r\n {\r\n\t\t$this->_savesettings();\r\n $this->setRedirect('index.php?option=com_jfusionconnect&view=settings');\r\n }", "public function settingsAction ()\n {\n $this->_pageTitle = ['Healthcheck', 'Settings'];\n $this->_navigation->setActiveStep(HealthCheckStepsModel::STEP_SETTINGS);\n\n if ($this->getRequest()->isPost())\n {\n $postData = $this->getRequest()->getPost();\n\n if (!isset($postData['goBack']))\n {\n $this->saveClientSettingsForm($postData);\n $this->saveHealthcheck();\n\n if (isset($postData['saveAndContinue']))\n {\n $this->updateHealthcheckStepName();\n $this->saveHealthcheck();\n $this->gotoNextNavigationStep($this->_navigation);\n }\n }\n else\n {\n $this->gotoPreviousNavigationStep($this->_navigation);\n }\n }\n else\n {\n $this->showClientSettingsForm();\n }\n }", "public function edit()\n {\n return view('user.settings', ['user' => Auth::user()]);\n }", "public function display()\n\t{\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users', false));\n\t}", "function set_editor_profile() {\n\tif (!current_user_can('manage_options')) { ?>\n \t<style type=\"text/css\">\n \t\t.user-rich-editing-wrap, .user-comment-shortcuts-wrap, .show-admin-bar, .user-admin-bar-front-wrap,\n \t\t.user-nickname-wrap, .user-display-name-wrap, .user-url-wrap, .user-description-wrap, #profile-page h2 {\n\t\t\t\tdisplay:none !important;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}\n}", "public function edit(UserPersonalInfo $userPersonalInfo)\n {\n //\n }", "public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function user_info_edit($id) {\n if ($this->request->is('post')) {\n $data = $this->request->data;\n $id = $data['id'];\n $update = $this->User->updateUser($id, $data);\n\n $this->redirect(array(\n 'action' => 'user_dashboard?msg=succesmsg',\n ));\n }\n }", "function admin_edit($id = null) {\n\n\t\t/**\n\t\t * If $id is not set and $this->data is empty, an error message is displayed.\n\t\t * $this->data = Datas from the form\n\t\t * $id = The user ID\n\t\t */\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__d('core', 'Invalid user.', true), 'default', array('class' => 'error'));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t/**\n\t\t\t * Save the user after edit.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * Insert the edit action in the \"logs\" table.\n\t\t\t\t */\n\t\t\t\t$this->Logs->insert($this->Auth->user('id'), '<strong>[ ' . $this->data['User']['name'] . ' ]</strong> ' . __d('core', 'User edited by (' . $this->Auth->user('name') . ').', true) , 'CORE', $_SERVER[\"REMOTE_ADDR\"]);\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is edited, 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 edited.', 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 edited, 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 edited.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Display datas.\n\t\t */\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\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}", "function eventclass_TambahPergerakan()\n\t{\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "function AfterAdd(&$values, &$keys, $inline, &$pageObject)\n{\n\n\t\t\n\t// We update the values that allow us to find the MEFE master user for this organization\n\n\t\t// what was the ID of the last inserted record?\n\n\t\t\t$rs_organization_id = $values['id_organization'];\n\t\t\n\t\t// We update the value\n\n\t\t\t$table_name = 'uneet_enterprise_organizations' ;\n\n\t\t\t$data = array();\n\t\t\t\t$data[\"mefe_master_user_external_person_id\"] = (0 . '-' . $rs_organization_id) ;\n\t\t\t\t$data[\"mefe_master_user_external_person_system\"] = 'Setup' ;\n\t\t\t\t$data[\"mefe_master_user_external_person_table\"] = 'Setup' ;\n\t\t\t$keyvalues = array();\n\t\t\t\t$keyvalues[\"id_organization\"] = $rs_organization_id;\n\n\t\t\t// Command to do the update\n\t\t\t\t\n\t\t\t\tDB::Update($table_name, $data, $keyvalues);\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n;\t\t\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 bp_settings_tab_action() {\n\t\techo $this->get_instance( \\MyVideoRoomExtrasParking\\Library\\SectionTemplates::class )->account_centre_landing();\n\t}", "function editusername()\n {\n // Auth::handleLogin() makes sure that only logged in users can use this action/method and see that page\n Auth::handleLogin();\n $this->view->render('login/editusername');\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 testUpdateUser()\n {\n }", "function wise_chat_after_setup_theme_action() {\n /** @var WiseChatUserService $userService */\n\t$userService = WiseChatContainer::get('services/user/WiseChatUserService');\n\t$userService->initMaintenance();\n\t$userService->switchUser();\n}", "public function edit(Server_User $server_User)\n {\n //\n }", "public static function editActionListener(): void {\n\t\telgg_register_event_handler('update:after', 'group', self::class . '::acceptMembershipRequests');\n\t}", "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}" ]
[ "0.6699961", "0.6699569", "0.64587224", "0.644287", "0.6365173", "0.6298299", "0.62842834", "0.624624", "0.6156812", "0.61467344", "0.6112758", "0.60756165", "0.6050464", "0.6047492", "0.60346025", "0.6023177", "0.60222626", "0.5996846", "0.5976023", "0.59676117", "0.5966703", "0.59608006", "0.5912629", "0.59059435", "0.5902664", "0.5889193", "0.5851198", "0.5838476", "0.58268034", "0.58125955", "0.58107513", "0.5800004", "0.5799668", "0.5798713", "0.57782936", "0.57768476", "0.5771226", "0.5770889", "0.57695025", "0.5752618", "0.5749691", "0.57378334", "0.5731093", "0.57269835", "0.57251877", "0.5724016", "0.57114923", "0.5709252", "0.56957984", "0.56939864", "0.5688843", "0.56866324", "0.56820196", "0.5674225", "0.5666387", "0.56588036", "0.56546605", "0.56488556", "0.5639103", "0.56310177", "0.5624891", "0.5621557", "0.5617961", "0.5616192", "0.56127566", "0.5611147", "0.5601797", "0.559505", "0.55943245", "0.5594178", "0.5592851", "0.5591088", "0.5590712", "0.5588548", "0.5581871", "0.55800575", "0.55776364", "0.556712", "0.5566348", "0.5565687", "0.55602515", "0.55601406", "0.5552676", "0.5550429", "0.5549005", "0.5548215", "0.5544067", "0.5543038", "0.5541662", "0.5540645", "0.5529891", "0.5529255", "0.55257934", "0.55207354", "0.5515539", "0.5514245", "0.55114484", "0.55056024", "0.5494889", "0.5493091", "0.5489049" ]
0.0
-1
Handle opt in form submission.
function handle_opt_in_form() { if ( isset( $_POST['altis_telemetry_opt_in'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) { opt_in( true ); } if ( isset( $_POST['altis_telemetry_opt_out'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) { opt_in( false ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handle_options()\r\n {\r\n $options = $this->get_options();\r\n \r\n if (isset($_POST['submitted'])) {\r\n \t\t\r\n \t\t//check security\r\n \t\tcheck_admin_referer('snazzy-nonce');\r\n \t\t\r\n $options = array();\r\n \r\n $options['years'] = htmlspecialchars($_POST['years']);\r\n $options['mini'] = $_POST['mini'];\r\n $options['posts'] = $_POST['posts'];\r\n $options['pages'] = $_POST['pages'];\r\n \r\n update_option($this->db_option, $options);\r\n \r\n echo '<div class=\"updated fade\"><p>Plugin settings saved.</p></div>';\r\n }\r\n \r\n $layout = $options['layout'];\r\n $years = stripslashes($options['years']);\r\n $mini = $options['mini'] == 'on' ? 'checked' : '';\r\n $posts = $options['posts'] == 'on' ? 'checked' : '';\r\n $pages = $options['pages'] == 'on' ? 'checked' : '';\r\n \r\n // URL for form submit, equals our current page\r\n $action_url = $_SERVER['REQUEST_URI'];\r\n \r\n include('snazzy-archives-options.php');\r\n }", "function handle_form() {\n\t\tglobal $wpdb;\n\t\t\n\t\t// Exit if user not logged in\n\t\t// TODO: GET THIS WORKING TO AVOID NON-ADMINS USING IT\n/*\t\tif( ! is_user_logged_in() ) {\n\t\t\tcpd_not_logged_in_message();\n\t\t\treturn;\t\n\t\t}\n*/\n\t\t// Exit if the Cancel button was pressed, and redirect to page that lists all orgs\n\t\tif( isset( $_POST['submit'] ) && 'Cancel' == $_POST['submit'] ) {\n\t\t\t\n\t\t\t// TODO: Check destination\n\t\t\twp_safe_redirect( site_url() . '/admin/list-orgs' );\n\t\t\texit();\n\t\t}\n\n\t\t$org = new Organisation();\n\n\t\t$org->save_org_from_post();\n\t\t\n\t}", "private function handleOption() : void\n {\n switch ($this->selectedOption) {\n case QAOptionsEnum::ADD:\n $this->addQuestion();\n break;\n\n case QAOptionsEnum::VIEW:\n $this->viewQuestion();\n break;\n\n case QAOptionsEnum::SHOW_ANSWERS:\n $this->showAnswers();\n break;\n\n case QAOptionsEnum::QA_EXIT:\n $this->exit();\n break;\n }\n\n $this->showOptions($this->console);\n }", "function handle($args)\n {\n parent::handle($args);\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $this->trySave();\n } else {\n $this->showForm();\n }\n }", "function form_option($option)\n {\n }", "function zdtw_menu_options_callback() {\n echo '<form id=\"'.$this->prefix.'-form\" class=\"zd-settings-form\" method=\"POST\" action=\"options.php\">'.\"\\n\";\n\n// print_r( $this->options );\n// echo $this->settings_page_id;\n\n // settings_fields( $option_group )\n settings_fields( $this->settings_page_id );\n// settings_fields( $this->prefix . '-general-section' );\n\n do_settings_fields( $this->settings_page_id, $this->prefix .'-general-section' );\n\n submit_button();\n\n echo '</form>'.\"\\n\";\n }", "private function _handleFormPost()\n {\n // see submit.php\n // 'FILE_OBJECTS' => 'handle_file_post',\n // 'BASE64_ENCODED_FILE_OBJECTS' => 'handle_base64_encoded_file_post',\n // 'TRANSFER_IDS' => 'handle_transfer_ids_post'\n }", "public function valiteForm();", "public function formSubmit() {\n\n check_admin_referer('ncstate-wrap-authentication');\n\n $newOptions = array(\n 'autoCreateUser' => (bool)$_POST['nwa_autoCreateUser'],\n );\n\n update_option('ncstate-wrap-authentication', $newOptions);\n\n wp_safe_redirect(add_query_arg('updated', 'true', wp_get_referer()));\n }", "public static function handleInput()\n {\n switch ($_REQUEST[\"cmd\"]) {\n //cancella il profilo del cliente \n case 'cancella':\n self::cancella();\n break;\n //modifica il profilo del cliente \n case 'back_home_page':\n case 'showrecensioni':\n self::showHomePage();\n break;\n //modifica il profilo personale\n case 'modifica_profilo_personale':\n self::modificaProfiloPersonale();\n break;\n //modifca il profilo dell'azienda\n case 'modifica_profilo_azienda':\n self::modificaProfiloAzienda();\n break;\n //modifica i servizi offerti\n case 'modifica_servizi':\n self::modificaServizi();\n break;\n //aggiorna profilo personale\n case 'update_profilo_personale':\n self::updateProfiloPersonale();\n break;\n //aggiorna profilo azienda\n case 'update_profilo_azienda':\n self::updateProfiloAzienda();\n break;\n //aggiorna servizi\n case 'update_servizi':\n self::updateServizi();\n break;\n }\n }", "public function saveOptionsForm(Request $request);", "public function displayOptionsForm()\n {\n $prefix = $this->getOptionsPrefix();\n $helper = new UserHelper($this->app());\n\n ob_start();\n ?>\n\n<form action=\"index.php\" method=\"post\">\n\n<fieldset id=\"front-end-signup\" class=\"\">\n <legend>Front-end signup</legend>\n <p>\n <label\n class=\"inline\"\n for=\"options_<?php echo $prefix; ?>frontendsignup_enable\"\n >\n Enable:\n </label>\n <input\n type=\"radio\"\n name=\"options_<?php echo $prefix; ?>frontendsignup_enable\"\n value=\"1\"\n <?php if ($this->options[$prefix.\"frontendsignup_enable\"]) : ?>\n checked=\"checked\"\n <?php endif; ?>\n /> Yes /\n <input\n type=\"radio\"\n name=\"options_<?php echo $prefix; ?>frontendsignup_enable\"\n value=\"0\"\n <?php if (!$this->options[$prefix.\"frontendsignup_enable\"]) : ?>\n checked=\"checked\"\n <?php endif; ?>\n /> No\n </p>\n <p>\n <label class=\"inline\" for=\"options_<?php echo $prefix; ?>frontendsignup_show_billing\">\n Show billing details:\n </label>\n <input\n type=\"radio\"\n name=\"options_<?php echo $prefix; ?>frontendsignup_show_billing\"\n value=\"1\"\n <?php if ($this->options[$prefix.\"frontendsignup_show_billing\"]) : ?>\n checked=\"checked\"\n <?php endif; ?>\n /> Yes /\n <input\n type=\"radio\"\n name=\"options_<?php echo $prefix; ?>frontendsignup_show_billing\"\n value=\"0\"\n <?php if (!$this->options[$prefix.\"frontendsignup_show_billing\"]) : ?>\n checked=\"checked\"\n <?php endif; ?>\n /> No\n </p>\n <p>\n <label class=\"inline\" for=\"options_<?php echo $prefix; ?>frontendsignup_def_group\">\n Default group for new users:\n </label>\n <?php\n echo $helper->getGroupsSelect(\n \"options_\".$prefix.\"frontendsignup_def_group\",\n $this->options[$prefix.\"frontendsignup_def_group\"]\n );\n ?>\n </p>\n </fieldset>\n\n <p>\n <input type=\"button\" value=\"&larr; Back\" onclick=\"window.history.back();\" />\n <input type=\"submit\" value=\"Save &rarr;\" />\n </p>\n\n <input type=\"hidden\" name=\"controller\" value=\"plugins\" />\n <input type=\"hidden\" name=\"action\" value=\"save_options\" />\n</form>\n\n <?php\n $str = ob_get_contents();\n ob_end_clean();\n\n return $str;\n }", "public function public_form_response_handler() {\n\n\t\t$nonce = $_POST['_wpnonce'];\n if (!wp_verify_nonce( $nonce, 'submit_coinqvest_checkout_8b%kj@')) {\n exit; // Get out of here, the nonce is rotten!\n }\n\n\t\t$this->checkout_form = new Checkout_Form($this->plugin_name_url);\n\t\t$this->checkout_form->process_checkout();\n\n\t}", "public function handle_post_action_options() {\n\t\tIggoGrid::check_nonce( 'options' );\n\n\t\tif ( ! current_user_can( 'iggogrid_access_options_screen' ) ) {\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.', 'default' ) );\n\t\t}\n\n\t\tif ( empty( $_POST['options'] ) || ! is_array( $_POST['options'] ) ) {\n\t\t\tIggoGrid::redirect( array( 'action' => 'options', 'message' => 'error_save' ) );\n\t\t} else {\n\t\t\t$posted_options = wp_unslash( $_POST['options'] );\n\t\t}\n\n\t\t// Valid new options that will be merged into existing ones\n\t\t$new_options = array();\n\n\t\t// Check each posted option value, and (maybe) add it to the new options\n\t\tif ( ! empty( $posted_options['admin_menu_parent_page'] ) && '-' != $posted_options['admin_menu_parent_page'] ) {\n\t\t\t$new_options['admin_menu_parent_page'] = $posted_options['admin_menu_parent_page'];\n\t\t\t// re-init parent information, as IggoGrid::redirect() URL might be wrong otherwise\n\t\t\t/** This filter is documented in classes/class-controller.php */\n\t\t\t$this->parent_page = apply_filters( 'iggogrid_admin_menu_parent_page', $posted_options['admin_menu_parent_page'] );\n\t\t\t$this->is_top_level_page = in_array( $this->parent_page, array( 'top', 'middle', 'bottom' ), true );\n\t\t}\n\t\tif ( ! empty( $posted_options['plugin_language'] ) && '-' != $posted_options['plugin_language'] ) {\n\t\t\t// only allow \"auto\" language and all values that have a translation\n\t\t\tif ( 'auto' == $posted_options['plugin_language'] || array_key_exists( $posted_options['plugin_language'], $this->get_plugin_languages() ) ) {\n\t\t\t\t$new_options['plugin_language'] = $posted_options['plugin_language'];\n\t\t\t}\n\t\t}\n\n\t\t// Custom CSS can only be saved if the user is allowed to do so\n\t\t$update_custom_css_files = false;\n\t\tif ( current_user_can( 'iggogrid_edit_options' ) ) {\n\t\t\t// Checkbox\n\t\t\t$new_options['use_custom_css'] = ( isset( $posted_options['use_custom_css'] ) && 'true' === $posted_options['use_custom_css'] );\n\n\t\t\tif ( isset( $posted_options['custom_css'] ) ) {\n\t\t\t\t$new_options['custom_css'] = $posted_options['custom_css'];\n\n\t\t\t\t$iggogrid_css = IggoGrid::load_class( 'IggoGrid_CSS', 'class-css.php', 'classes' );\n\t\t\t\t$new_options['custom_css'] = $iggogrid_css->sanitize_css( $new_options['custom_css'] ); // Sanitize and tidy up Custom CSS\n\t\t\t\t$new_options['custom_css_minified'] = $iggogrid_css->minify_css( $new_options['custom_css'] ); // Minify Custom CSS\n\n\t\t\t\t// Maybe update CSS files as well\n\t\t\t\t$custom_css_file_contents = $iggogrid_css->load_custom_css_from_file( 'normal' );\n\t\t\t\tif ( false === $custom_css_file_contents ) {\n\t\t\t\t\t$custom_css_file_contents = '';\n\t\t\t\t}\n\t\t\t\tif ( $new_options['custom_css'] !== $custom_css_file_contents ) { // don't write to file if it already has the desired content\n\t\t\t\t\t$update_custom_css_files = true;\n\t\t\t\t\t// Set to false again. As it was set here, it will be set true again, if file saving succeeds\n\t\t\t\t\t$new_options['use_custom_css_file'] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// save gathered new options (will be merged into existing ones), and flush caches of caching plugins, to make sure that the new Custom CSS is used\n\t\tif ( ! empty( $new_options ) ) {\n\t\t\tIggoGrid::$model_options->update( $new_options );\n\t\t\tIggoGrid::$model_table->_flush_caching_plugins_caches();\n\t\t}\n\n\t\tif ( $update_custom_css_files ) { // capability check is performed above\n\t\t\tIggoGrid::redirect( array( 'action' => 'options', 'item' => 'save_custom_css' ), true );\n\t\t}\n\n\t\tIggoGrid::redirect( array( 'action' => 'options', 'message' => 'success_save' ) );\n\t}", "public function handleDataSubmission() {}", "public function process_admin_options() {\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ) update_option( 'jigoshop_tgm_custom_gateway_enabled', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_enabled' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_title'] ) ) update_option( 'jigoshop_tgm_custom_gateway_title', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_title'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_title' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_description'] ) ) update_option( 'jigoshop_tgm_custom_gateway_description', \tjigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_description'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_description' );\n \t}", "function process_form()\n {\n }", "function render_opt_in_form() {\n\t$user = wp_get_current_user();\n\n\t// Don't render if they've made a decision.\n\tif ( ! is_null( is_user_opted_in( $user ) ) ) {\n\t\treturn;\n\t}\n\n\t?>\n\t<div class=\"welcome altis-telemetry-opt-in\">\n\t\t<h2><?php echo esc_html( sprintf( __( 'Hi %s!', 'altis' ), $user->display_name ) ); ?></h2>\n\t\t<p><?php esc_html_e( 'To help us develop Altis, we would like to collect data on your usage of the software. This will help us build a better product for you.', 'altis' ); ?></p>\n\t\t<form method=\"post\" action=\"\">\n\t\t\t<?php wp_nonce_field( 'altis_telemetry_opt_in' ); ?>\n\t\t\t<input type=\"submit\" name=\"altis_telemetry_opt_in\" class=\"button button-primary\" value=\"<?php esc_attr_e( 'Sounds good to me!', 'altis' ); ?>\" />\n\t\t\t<input type=\"submit\" name=\"altis_telemetry_opt_out\" class=\"button button-secondary\" value=\"<?php esc_attr_e( 'No thanks', 'altis' ); ?>\" />\n\t\t</form>\n\t\t<p><?php esc_html_e( 'You can change this setting at any time on your profile page.' ); ?></p>\n\t</div>\n\t<?php\n}", "function options_submit(&$form, &$form_state) {\n // It is very important to call the parent function here:\n parent::options_submit($form, $form_state);\n switch ($form_state['section']) {\n case 'block_sets':\n $this->set_option('block_sets', $form_state['values']['block_sets']);\n break;\n }\n }", "function handle_post($indata) {\n// showDebug('form_class POST:');\n// showArray($indata); \n return;\n }", "public function formAction() {}", "function doOptionsPage()\r\n\t{\r\n\t\t/*\tDeclare the different settings\t*/\r\n\t\tregister_setting('wpklikandpay_store_config_group', 'storeTpe', '' );\r\n\t\t// register_setting('wpklikandpay_store_config_group', 'storeRang', '' );\r\n\t\t// register_setting('wpklikandpay_store_config_group', 'storeIdentifier', '' );\r\n\t\tregister_setting('wpklikandpay_store_config_group', 'environnement', '' );\r\n\t\t// register_setting('wpklikandpay_store_config_group', 'urlSuccess', '' );\r\n\t\t// register_setting('wpklikandpay_store_config_group', 'urlDeclined', '' );\r\n\t\t// register_setting('wpklikandpay_store_config_group', 'urlCanceled', '' );\r\n\t\tsettings_fields( 'wpklikandpay_url_config_group' );\r\n\r\n\t\t/*\tAdd the section about the store main configuration\t*/\r\n\t\tadd_settings_section('wpklikandpay_store_config', __('Informations de la boutique', 'wpklikandpay'), array('wpklikandpay_option', 'storeConfigForm'), 'wpklikandpayStoreConfig');\r\n\r\n\t\t/*\tAdd the section about the back url\t*/\r\n\t\t// add_settings_section('wpklikandpay_url_config', __('Urls de retour apr&eacute;s un paiement', 'wpklikandpay'), array('wpklikandpay_option', 'urlConfigForm'), 'wpklikandpayUrlConfig');\r\n?>\r\n<form action=\"\" method=\"post\" >\r\n<input type=\"hidden\" name=\"saveOption\" id=\"saveOption\" value=\"save\" />\r\n\t<?php \r\n\t\tdo_settings_sections('wpklikandpayStoreConfig'); \r\n \r\n\t\t/*\tSave the configuration in case that the form has been send with \"save\" action\t*/\r\n\t\tif(isset($_POST['saveOption']) && ($_POST['saveOption'] == 'save'))\r\n\t\t{\r\n\t\t\t/*\tSave the store main configuration\t*/\r\n\t\t\tunset($optionList);$optionList = array();\r\n\t\t\t$optionList['storeTpe'] = $_POST['storeTpe'];\r\n\t\t\t$optionList['storeRang'] = $_POST['storeRang'];\r\n\t\t\t$optionList['storeIdentifier'] = $_POST['storeIdentifier'];\r\n\t\t\t$optionList['environnement'] = $_POST['environnement'];\r\n\t\t\twpklikandpay_option::saveStoreConfiguration('wpklikandpay_store_mainoption', $optionList);\r\n\t\t}\r\n\t?>\r\n\t<table summary=\"Store main configuration form\" cellpadding=\"0\" cellspacing=\"0\" class=\"storeMainConfiguration\" >\r\n\t\t<?php do_settings_fields('wpklikandpayStoreConfig', 'mainWKlikAndPayStoreConfig'); ?>\r\n\t</table>\r\n\t<br/><br/><br/>\r\n<!--\r\n\t<?php \r\n\t\t// do_settings_sections('wpklikandpayUrlConfig');\r\n\r\n\t\t/*\tSave the configuration in case that the form has been send with \"save\" action\t*/\r\n\t\tif(isset($_POST['saveOption']) && ($_POST['saveOption'] == 'save'))\r\n\t\t{\r\n\t\t\t/*\tSave the configuration for bakc url after payment\t*/\r\n\t\t\tunset($optionList);$optionList = array();\r\n\t\t\t$optionList['urlSuccess'] = $_POST['urlSuccess'];\r\n\t\t\t$optionList['urlDeclined'] = $_POST['urlDeclined'];\r\n\t\t\t$optionList['urlCanceled'] = $_POST['urlCanceled'];\r\n\t\t\twpklikandpay_option::saveStoreConfiguration('wpklikandpay_store_urloption', $optionList);\r\n\t\t}\r\n\t?>\r\n\t<table summary=\"Back url main configuration form\" cellpadding=\"0\" cellspacing=\"0\" class=\"storeMainConfiguration\" >\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" >\r\n\t\t<?php echo sprintf(__('Ajouter : %s dans les pages que vous allez cr&eacute;er.', 'wpklikandpay'), '<span class=\" bold\" >[wp-klikandpay_payment_return title=\"KlikAndPay return page\" ]</span>'); ?>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\" >&nbsp;</td>\r\n\t\t</tr>\r\n<?php \r\n\t\tdo_settings_fields('wpklikandpayUrlConfig', 'backUrlConfig'); \r\n?>\r\n\t</table>\r\n-->\r\n\t<br/><br/><br/>\r\n\t<input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Enregistrer les options', 'wpklikandpay'); ?>\" />\r\n</form>\r\n<?php\r\n\t}", "protected function _handlePostAction()\n {\n $postData = $this->getRequest()->getPost();\n\n switch (true) {\n case array_key_exists('_cancel', $postData);\n $this->_goto($this->_getBrowseAction());\n break;\n }\n }", "public static function add_option() {\n\t\tFrmAppHelper::permission_check('frm_edit_forms');\n check_ajax_referer( 'frm_ajax', 'nonce' );\n\n\t\t$id = FrmAppHelper::get_post_param( 'field_id', 0, 'absint' );\n\t\t$opt_type = FrmAppHelper::get_post_param( 'opt_type', '', 'sanitize_text_field' );\n\t\t$opt_key = FrmAppHelper::get_post_param( 'opt_key', 0, 'absint' );\n\n $field = FrmField::getOne($id);\n\n if ( 'other' == $opt_type ) {\n\t\t\t$opt = __( 'Other', 'formidable' );\n $other_val = '';\n $opt_key = 'other_' . $opt_key;\n } else {\n\t\t\t$opt = __( 'New Option', 'formidable' );\n }\n $field_val = $opt;\n\n $field_data = $field;\n\t\t$field = (array) $field;\n\t\t$field['separate_value'] = isset( $field_data->field_options['separate_value'] ) ? $field_data->field_options['separate_value'] : 0;\n\t\tunset( $field_data );\n\n\t\t$field_name = 'item_meta[' . $id . ']';\n\t\t$html_id = FrmFieldsHelper::get_html_id( $field );\n $checked = '';\n\n if ( 'other' == $opt_type ) {\n\t\t\tinclude( FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-fields/other-option.php' );\n } else {\n\t\t\trequire( FrmAppHelper::plugin_path() . '/classes/views/frm-fields/single-option.php' );\n }\n wp_die();\n }", "public function process_cmb_form() {\n\t\t$cmb = $this->get_cmb_object();\n\n\t\tif (\n\t\t\tisset( $_REQUEST['object_id'], $_REQUEST[ $cmb->nonce() ] )\n\t\t\t&& wp_verify_nonce( $_REQUEST[ $cmb->nonce() ], $cmb->nonce() )\n\t\t\t&& $_REQUEST['object_id'] == $this->button_slug\n\t\t) {\n\t\t\twp_send_json_success( $this->sanitize_cmb_fields() );\n\t\t}\n\n\t\twp_send_json_error( __( 'failed verification' ) );\n\t}", "function afap_form_action() {\n\n if (!empty($_POST) && wp_verify_nonce($_POST['afap_form_nonce'], 'afap_form_action')) {\n\n include('inc/cores/save-settings.php');\n\n } else {\n\n die('No script kiddies please!!');\n\n }\n\n }", "function sss_options () {\n\techo '<div class=\"wrap\"><h2>Social Share Starter by KK</h2>';\n\tif(isset($_POST['submit'])) {\n\t\tupdate_sss_options();\n\t}\n\tprint_sss_form();\n\techo '</div>';\n}", "public function postOptionsAction()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$userModel = new Application_Model_User;\r\n\t\t\t$user = $userModel->getAuth();\r\n\r\n\t\t\tif ($user == null || !$user['is_admin'])\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('You are not authorized to access this action');\r\n\t\t\t}\r\n\r\n\t\t\t$user_id = $this->_request->getParam('user_id');\r\n\r\n\t\t\tif (!v::optional(v::intVal())->validate($user_id))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect user ID value');\r\n\t\t\t}\r\n\r\n\t\t\tif (trim($user_id) !== '')\r\n\t\t\t{\r\n\t\t\t\tif (!$userModel->checkId($user_id, $customUser))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new RuntimeException('Incorrect user ID: ' .\r\n\t\t\t\t\t\tvar_export($user_id, true));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->view->customUser = $customUser;\r\n\t\t\t}\r\n\r\n\t\t\t$this->view->layout()->setLayout('iframe');\r\n\t\t\t$this->view->headLink()->appendStylesheet(My_Layout::assetUrl(\r\n\t\t\t\t'bower_components/jquery-ui/themes/base/jquery-ui.min.css'));\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\tdie($e instanceof RuntimeException ? $e->getMessage() :\r\n\t\t\t\t'Internal Server Error');\r\n\t\t}\r\n\t}", "function subway_redirect_option_form() {\n\t?>\n\n\t<style>\n\t\t\n\t\t.subway-redirect-option-section {\n\t\t\tbackground: #fff;\n\t\t\tpadding: 15px 20px;\n\t\t\tmargin: 15px 0;\n\t\t}\n\n\t</style>\n\t\n\t<p class=\"subway-redirect-type-choices\">\n\n\t\t<!-- Page -->\n\t\t<label for=\"subway_use_page\">\n\t\t\t\n\t\t\t<input <?php checked( 'page', get_option( 'subway_redirect_type' ), true ); ?> value=\"page\" name=\"subway_redirect_type\" id=\"subway_use_page\" type=\"radio\" class=\"code\" /> \n\t\t\t\n\t<?php esc_html_e( 'Custom Page', 'subway' ); ?>\n\n\t\t</label>\n\n\t\t<!-- Custom URL -->\n\n\t\t&nbsp;&nbsp;&nbsp;\n\n\t\t<label for=\"subway_use_custom_url\">\n\t\t\t\n\t\t\t<input <?php checked( 'custom_url', get_option( 'subway_redirect_type' ), true ); ?> value=\"custom_url\" name=\"subway_redirect_type\" id=\"subway_use_custom_url\" type=\"radio\" class=\"code\" /> \n\t\t\t\n\t<?php esc_html_e( 'Custom URL', 'subway' ); ?>\n\n\t\t</label>\n\n\t\t<!-- Default Behavior -->\n\n\t\t&nbsp;&nbsp;&nbsp;\n\n\t\t<label for=\"subway_use_default\">\n\t\t\t\n\t\t\t<input <?php checked( 'default', get_option( 'subway_redirect_type' ), true ); ?> value=\"default\" name=\"subway_redirect_type\" id=\"subway_use_default\" type=\"radio\" class=\"code\" /> \n\t\t\t\n\t<?php esc_html_e( 'Default Behavior', 'subway' ); ?>\n\n\t\t</label>\n\n\t</p>\n\n\t<p class=\"description\">\n\t<?php\n\tesc_html_e('Where do you want your members to go after logging-in? You can pick a page, a Custom URL, or just a WordPress Default behavior. Page and Custom URL has its settings.', 'subway'\n\t);\n\t?>\n\t</p>\n\t\n\t<div id=\"subway_redirect_page_option_section\" class=\"hidden subway-redirect-option-section\">\n\t\t<label for=\"subway_redirect_page_id\">\n\t<?php esc_html_e( 'Select Page' ); ?>\n\t\t</label>\n\n\t<?php\n\t// Choosing page for redirect.\n\twp_dropdown_pages(\n\t\tarray(\n\t\t\t\t'name' => 'subway_redirect_page_id',\n\t\t\t\t'selected' => intval( get_option( 'subway_redirect_page_id' ) ),\n\t\t\t\t'show_option_none' => esc_html__( '-', 'subway' ),\n\t\t)\n\t);\n\t?>\n\t\t<p class=\"description\">\n\t<?php _e( 'The selected page will be used as the redirect endpoint for all of your users. Selecting blank (-) will redirect the user to the default redirect defined in WordPress or other plugins. Choose \"Custom URL\" if you want to redirect to a custom URL or domain.', 'subway' ); ?>\n\t\t</p>\n\t</div>\n\n\t<div id=\"subway_redirect_custom_url_option_section\" class=\"hidden subway-redirect-option-section\">\n\t\t\n\t\t<label for=\"subway_redirect_custom_url\">\n\t<?php esc_attr_e( 'Enter Redirect URL:', 'subway' ); ?>\n\t\t</label>\n\n\t\t<input value=\"<?php echo esc_attr( esc_url( get_option( 'subway_redirect_custom_url' ) ) ); ?>\" type=\"text\" name=\"subway_redirect_custom_url\" placeholder=\"<?php esc_attr_e( 'http://', 'subway' ); ?>\" \n\t\tid=\"subway_redirect_custom_url\" size=\"75\" />\n\n\t\t<p class=\"description\"><br>\n\n\t\t<?php\n\t\techo sprintf( __( 'When entering a custom domain, you can use a variable string such us: %1$s and %2$s. For example, http://yoursiteurl.com/members/<strong>%2$s</strong> will translate to http://yoursiteurl/members/<strong>admin</strong> where \"admin\" is equal to the %2$s variable; http://yoursiteurl.com/users/<strong>%1$s</strong> will translate to http://yoursiteurl.com/users/<strong>4</strong> where \"4\" is equal to the %1$s. Both variables refer to the current user that is logged-in.', 'subway' ), '%user_id%', '%user_name%' );\n\t\t?>\n\n\t\t</p><br>\n\n\t\t<p class=\"description\">\n\t<?php esc_attr_e( 'Leave empty to use existing WordPress or other 3rd party plugin redirect option.', 'subway' ); ?>\n\t\t</p><br>\n\n\t\t<p class=\"description\">\n\t<?php esc_html_e( 'Warning: External URLs are not supported by WordPress Function (wp_safe_redirect) and will be redirected back to default WordPress behavior.', 'subway' ); ?>\n\t\t</p> \n\n\t</div>\n\n\t<!-- Subway Use Default -->\n\t<div id=\"subway_redirect_default_option_section\" class=\"hidden subway-redirect-option-section\">\n\t\t<p>\n\t<?php\n\tesc_html_e( \"By choosing the default behavior, the redirect type will be set to the default WordPress' behavior. For example, if you have plugins like Peter's Login Redirect. This option will disable Subway's redirect and use the Peter's Login Redirect Instead.\", 'subway' );\n\t?>\n\t\t</p>\n\t</div>\n\n\n\t<script>\n\t\tjQuery(document).ready( function( $ ) {\n\n\t\t\t\"use strict\";\n\n\t\t\tsubway_toggle_use_custom_page(); \n\t\t\tsubway_toggle_use_custom_url();\n\t\t\tsubway_toggle_use_default();\n\n\t\t\t$(\"#subway_use_page\").on('click', function(){\n\t\t\t\tsubway_toggle_use_custom_page(); \n\t\t\t});\n\n\t\t\t$(\"#subway_use_custom_url\").on('click', function(){\n\t\t\t\tsubway_toggle_use_custom_url();\n\t\t\t});\n\n\t\t\t$(\"#subway_use_default\").on('click', function(){\n\t\t\t\tsubway_toggle_use_default();\n\t\t\t});\n\n\t\t\tfunction subway_toggle_use_default() {\n\n\t\t\t\tif( $('#subway_use_default').is(':checked')) {\n\n\t\t\t\t\t$('#subway_redirect_custom_url_option_section').addClass('hidden');\n\t\t\t\t\t$('#subway_redirect_default_option_section').removeClass('hidden');\n\t\t\t\t\t$('#subway_redirect_page_option_section').addClass('hidden');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction subway_toggle_use_custom_url() {\n\n\t\t\t\tif( $('#subway_use_custom_url').is(':checked')) { \n\t\t\t\t\t\n\t\t\t\t\t$('#subway_redirect_custom_url_option_section').removeClass('hidden');\n\t\t\t\t\t$('#subway_redirect_default_option_section').addClass('hidden');\n\t\t\t\t\t$('#subway_redirect_page_option_section').addClass('hidden');\n\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction subway_toggle_use_custom_page() {\n\n\t\t\t\tif( $('#subway_use_page').is(':checked')) { \n\n\t\t\t\t\t$('#subway_redirect_custom_url_option_section').addClass('hidden');\n\t\t\t\t\t$('#subway_redirect_default_option_section').addClass('hidden');\n\t\t\t\t\t$('#subway_redirect_page_option_section').removeClass('hidden');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t});\n\t</script>\n\t<?php\n}", "public function updateOptionsWithPost() {\n if (isset($_POST[$this->selectedProviderOptName])) {\n $selected = (string)$_POST[$this->selectedProviderOptName];\n $this->setSelectedProvider($selected);\n }\n if (isset($_POST[$this->updateUrlOverrideOptName])) {\n $url = (string)$_POST[$this->updateUrlOverrideOptName];\n $this->setUpdateUrlOverride($url);\n }\n }", "private function _submitHandler() {\n // Checking if this is a valid settings submit handler.\n if (!empty($_POST) && isset($_POST['type']) && $_POST['type'] == 'pii_settings' && (isset( $_POST['pii_settings_nonce'] ) \n || wp_verify_nonce( $_POST['pii_settings_nonce'], 'pii_settings' )) ) {\n update_option('pii_fields', $_POST['options']);\n $encryption = new EncryptDecrypt();\n $encryption->updateFields($_POST['options']);\n }\n // Meta fields saving.\n else if (!empty($_POST) && isset($_POST['type']) && $_POST['type'] == 'pii_custom_meta_fields' && (isset( $_POST['pii_custom_meta_fields_nonce'] ) \n || wp_verify_nonce( $_POST['pii_custom_meta_fields_nonce'], 'pii_custom_meta_fields' )) ) {\n update_option('pii_custom_meta_fields', trim($_POST['pii_custom_meta_fields'])); \n }\n }", "function wtr_validate_options( $input ) {\r\n\r\n\t\t\tswitch( $_POST['submitControl'] ){\r\n\r\n\t\t\t\t//restore default settings\r\n\t\t\t\tcase 'default-settings':\r\n\t\t\t\t\tupdate_option( $this->settings->get_WP_ERROR(), 'default' );\r\n\t\t\t\t\tupdate_option( $this->settings->get_WP_REWRITE_FLUSH(), 1 );\r\n\t\t\t\t\tdo_action( 'wtr_default_settings' );\r\n\t\t\t\t\treturn null;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t// writing by ajax\r\n\t\t\t\tcase 'ajax':\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t// restore settings from the backup system\r\n\t\t\t\tcase 'import-auto':\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\t\t$input = wtr_get_export_theme_settings( $_POST[ 'wtr_export_theme_settings' ] );\r\n\t\t\t\t\t$status = 'import_data' ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\t// restore settings from text\r\n\t\t\t\tcase 'import-text':\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\t\t$input = wtr_decode_theme_settings( wp_remote_fopen( $_POST[ 'wtr_admin_import_settings_text' ] ) );\r\n\t\t\t\t\t$status = 'import_data' ;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$opt_a = $this->settings->get( 'opt_a' );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t$flaga\t\t\t= false;\r\n\t\t\t$new_opt\t\t= array();\r\n\t\t\t$status_flush\t= 0;\r\n\t\t\t$opt\t\t\t= $this->settings->get( 'opt' );\r\n\r\n\r\n\t\t\tforeach ( $opt as $group ) {\r\n\t\t\t\tforeach ( (array ) $group->get('sections') as $section ) {\r\n\t\t\t\t\tforeach ( ( array ) $section->get('fields') as $field ) {\r\n\r\n\t\t\t\t\t\t$id_field\t= $field->get( 'id' );\r\n\t\t\t\t\t\t$allow\t\t= $field->get( 'allow' );\r\n\t\t\t\t\t\t$value\t\t= $field->get( 'value' );\r\n\r\n\t\t\t\t\t\tif( isset( $input[ $id_field ] ) ){\r\n\t\t\t\t\t\t\t$new_value = ( ! is_array( $input[ $id_field ] ) ) ? trim ( $input[ $id_field ] ) : $input[ $id_field ];\r\n\r\n\t\t\t\t\t\t\tif( $allow == 'between' ){\r\n\t\t\t\t\t\t\t\t$min\t\t\t= $field->get( 'min' );\r\n\t\t\t\t\t\t\t\t$max\t\t\t= $field->get( 'max' );\r\n\t\t\t\t\t\t\t\t$has_attr\t\t= $field->get( 'has_attr' );\r\n\t\t\t\t\t\t\t\t//$input[ $key ]\t= trim( $input[ $key ] );\r\n\r\n\t\t\t\t\t\t\t\t$flaga = WTR_Validate::check( $allow, $new_value, $max, $min, $has_attr );\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$flaga = WTR_Validate::check( $allow, $new_value ) ;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//default value\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$new_value\t= $field->get( 'default_value' );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$new_opt[ $id_field ]\t= $new_value;\r\n\t\t\t\t\t\t$new_opt\t\t\t\t= $this->settings->set_opt_a( $new_opt, $field, $new_value );\r\n\r\n\t\t\t\t\t\t//checking slug\r\n\t\t\t\t\t\tif( $status_flush != 1 AND strpos( $id_field, '_Slug' ) AND $value != $new_value ){\r\n\t\t\t\t\t\t\t$status_flush = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( ! $flaga ){\r\n\t\t\t\t\t\t\tbreak 3;\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\r\n\t\t\tif( ! $flaga ){\r\n\r\n\t\t\t\t$new_opt = $this->settings->get( 'opt_a' );\r\n\r\n\t\t\t\tif( isset( $status ) AND 'import_data' == $status ) {\r\n\t\t\t\t\tupdate_option( $this->settings->get_WP_ERROR(), 'import_error' );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif( empty( $status ) OR 'import_data' != $status ){\r\n\t\t\t\t\techo 'wtr_save_option_error';\r\n\t\t\t\t\texit;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ( isset( $status ) ){\r\n\r\n\t\t\t\tupdate_option( $this->settings->get_WP_ERROR(), $status );\r\n\t\t\t\tdo_action( 'wtr_import_data', $input );\r\n\t\t\t}\r\n\r\n\t\t\tif( $flaga AND isset( $status_flush ) ){\r\n\t\t\t\tupdate_option( $this->settings->get_WP_REWRITE_FLUSH(), $status_flush );\r\n\t\t\t}\r\n\r\n\t\t\treturn base64_encode( serialize( $new_opt ) );\r\n\t\t}", "function handlePOSTRequest() {\n if (array_key_exists('submitProjectionRequest', $_POST)) {\n handleProjectionRequest();\n }\n }", "function options_form(&$form, &$form_state) {\r\n // It is very important to call the parent function here:\r\n parent::options_form($form, $form_state);\r\n\r\n switch ($form_state['section']) {\r\n // Only add if section is allow because this is called for all sections for some reason.\r\n case 'allow':\r\n // Add allow option to the form.\r\n $form['allow']['#options']['expose_imagestyle'] = t('Expose imagestyle settings');\r\n break;\r\n }\r\n }", "public function handleSubmit()\n {\n // process: just display the form.\n if ((!empty($_POST[\"fromHome\"])) ||\n (!empty($_POST[\"fromStaffHomePage\"]))) {\n $this->fromHomePage = true;\n }\n if ($this->fromHomePage) {\n return;\n }\n\n // Clear camper ID from the session, in case multiple campers are\n // being added in the same browser.\n unset($_SESSION[\"camper_id\"]);\n\n // Check for submitted values. Fire an error if required inputs\n // are missing, and grab defaults if applicable.\n foreach ($this->columns as $col) {\n $val = test_input($_POST[$col->name]);\n if ($val === null) {\n if ($col->required) {\n $this->colName2Error[$col->name] = errorString(\"Missing value for required field\");\n continue;\n }\n if (!is_null($col->defaultValue)) {\n $val = $col->defaultValue;\n } else {\n continue;\n }\n }\n $this->col2Val[$col->name] = $val;\n }\n if (!empty($this->colName2Error)) {\n // If we hit any errors, stop here and display, so the user\n // can correct them.\n return;\n }\n\n // Check to see if this camper registration is a duplicate, which\n // we define as having the same first and last name, and edah. If\n // a dup is detected, display an overlay that lets the user either\n // continue to the edit-camper page, with the ID set to the existing\n // camper ID, or else lets them start the add form again, with the\n // fields cleared.\n $db = new DbConn();\n $db->isSelect = true;\n $db->addColVal($this->col2Val[\"first\"], 's');\n $db->addColVal($this->col2Val[\"last\"], 's');\n $db->addColVal($this->col2Val[\"edah_id\"], 'i');\n $sql = \"SELECT c.camper_id camper_id, e.name edah_name FROM campers c, edot e WHERE c.edah_id = e.edah_id AND \" .\n \"c.first = ? AND c.last = ? AND c.edah_id = ?\";\n $result = $db->doQuery($sql, $err);\n if (($result !== false) && ($result->num_rows > 0)) {\n // If the query succeeded and returned one or more rows, then\n // we've found a duplicate.\n $row = mysqli_fetch_assoc($result);\n $this->duplicateCamperDesc = $this->col2Val[\"first\"] . \" \" . $this->col2Val[\"last\"] . \" in \" . $row[\"edah_name\"];\n return;\n }\n\n // At this point, we have valid new-camper data. Set all our\n // column data in the SESSION hash, so that ajax methods can pick it\n // up.\n foreach ($this->col2Val as $colName => $colVal) {\n $_SESSION[$colName] = $colVal;\n }\n\n // Go to the choice-ranking page.\n $rankChoicesUrl = urlIfy(\"rankCamperChoices.html\");\n echo (\"<script type=\\\"text/javascript\\\">window.location.replace(\\\"$rankChoicesUrl\\\");</script>\");\n exit();\n }", "function handlePOSTRequest() {\n if (array_key_exists('submitGroupByRequest', $_POST)) {\n handleGroupByRequest();\n }\n }", "protected function Form_Run() {}", "public function handle() {\n $params = getopt(implode($this->options));\n if(!empty($params) && is_array($params)) {\n foreach($params as $key => $value) {\n $obj = KeysFactory::parameter($key, $value);\n $this->params[KeysFactory::key($obj)] = $obj;\n }\n }\n }", "public static function handle_form_submission(){\n\t\tglobal $post;\n\n\t\t// Setup $_POST & $_REQUEST to appear as if the form had been submitted in the traditional way... yep, all sorts of fudge\n\t\tparse_str( $_POST['data'], $data );\n\t\t$_POST = array_merge( $_POST, $data );\n\t\tunset( $_POST['action'] );\n\t\tunset( $_POST['data'] );\n\t\t$_REQUEST['_wpnonce'] = $_POST['_wpnonce'];\n\n\t\t// Setup the post global for Grunion\n\t\t$post = get_post( $_POST['contact-form-id'] );\n\t\tsetup_postdata( $post );\n\n\t\t// Dirty dirty hack to work around Grunion's style printing that breaks ajax\n\t\t$old_request = $_REQUEST['action'];\n\t\t$_REQUEST['action'] = 'grunion_shortcode_to_json';\n\n\t\t$content = do_shortcode( wpautop( $post->post_content ) );\n\n\t\t// Now we can restore the real action\n\t\t$_REQUEST['action'] = $old_request;\n\n\t\t// We have an error in the contact form\n\t\tif ( strpos( $content, 'form-errors' ) !== false ) {\n\t\t\t$result = 'error';\n\t\t\tpreg_match( '%((\\<ul class=\\'form-errors)(.|' . PHP_EOL . ')*?\\</ul\\>)%', $content, $matches );\n\t\t\t$content = \"<div class='form-error'><h3>\" . __( 'Error!' ) . \"</h3>\";\n\t\t\t$content .= $matches[0];\n\t\t\t$content .= \"</div>\";\n\t\t} else {\n\t\t\t$result = 'success';\n\t\t\tpreg_match( '%((\\<div id=\\'contact-form)(.|' . PHP_EOL . ')*?\\</div\\>)%', $content, $matches );\n\t\t\t$content = $matches[0];\n\t\t}\n\n\t\t$content = apply_filters( 'grunion_ajax_confirmation', $content );\n\n\t\t$response = array( 'result' => $result, 'html' => $content );\n\n\t\t$response = json_encode( $response );\n\n\t\theader( \"Content-Type: application/json\" );\n\t\techo $response;\n\n\t\texit();\n\t}", "abstract public function isValidForm($input, $siteInfo = [], $option = []);", "protected function onSubmit()\r {\r }", "function skcw_request_handler() {\n\tif (current_user_can('manage_options') && !empty($_POST['sk_action'])) {\n\t\tswitch ($_POST['sk_action']) {\n\t\t\tcase 'update_code_widget':\n\t\t\t\tif (check_admin_referer('skcw_update_settings')) {\n\t\t\t\t\tupdate_option('skcw_template_directory', stripslashes($_POST['skcw_template_directory']));\n\t\t\t\t\twp_redirect(admin_url('options-general.php?page=code-to-widget&skcw_message=updated'));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\twp_redirect(admin_url('options-general.php?page=code-to-widget&skcw_message=failure'));\n\t\t\t\t}\n\t\t\t\tdie();\n\t\t\t\tbreak;\n\t\t\tcase 'check_directory':\n\t\t\t\tif (!empty($_POST['directory'])) {\n\t\t\t\t\techo intval(skcw_check_directory(stripslashes($_POST['directory'])));\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t\techo intval(false);\n\t\t\t\tdie();\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "function save_option() {\n\t\t\tcheck_ajax_referer('ajax-nonce', 'nonce');\n\t\t\tif (isset($_POST['option']) && isset($_POST['value'])) {\n\t\t\t\tupdate_option($_POST['option'], stripslashes($_POST['value']));\n\t\t\t\techo 'saved';\n\t\t\t} else {\n\t\t\t\techo 'notsaved';\n\t\t\t}\n\t\t\tdie();\n\t\t}", "function form_options($options) {\n }", "public function handle_actions() {\n if ( !empty( $_REQUEST[ 'yith-wcbk-google-calendar-action' ] ) && $this->check_nonce() ) {\n $credentials_options = array( 'client-id', 'client-secret' );;\n switch ( $_REQUEST[ 'yith-wcbk-google-calendar-action' ] ) {\n case 'save-options':\n $options = array( 'calendar-id' );\n foreach ( $options as $option ) {\n $value = !empty( $_REQUEST[ $option ] ) ? $_REQUEST[ $option ] : '';\n $this->set_option( $option, $value );\n }\n break;\n case 'save-settings':\n $settings = !empty( $_REQUEST[ 'settings' ] ) ? $_REQUEST[ 'settings' ] : array();\n $default_settings = array(\n 'debug' => 'no',\n 'add-note-on-sync' => 'no',\n 'booking-events-to-synchronize' => array(),\n );\n $settings = wp_parse_args( $settings, $default_settings );\n foreach ( $settings as $option => $value ) {\n $this->set_option( $option, $value );\n }\n break;\n case 'save-credentials':\n foreach ( $credentials_options as $option ) {\n $value = !empty( $_REQUEST[ $option ] ) ? $_REQUEST[ $option ] : '';\n $this->set_option( $option, $value );\n }\n break;\n\n case 'delete-client-secret':\n foreach ( $credentials_options as $option ) {\n $this->set_option( $option, '' );\n }\n break;\n\n case 'logout':\n $this->set_option( 'access-token', '' );\n $this->set_option( 'refresh-token', '' );\n delete_transient( 'yith-wcbk-gcal-access-token' );\n break;\n }\n }\n }", "public function process()\n\t{\n\t\tif(isset($_POST[$this->input_name()])) {\n\t\t\t$this->value = $_POST[$this->input_name()];\n\t\t}\n\t\telse {\n\t\t\t$this->value = false;\n\t\t}\n\t}", "public function updateOptions()\r\n {\r\n if ($_SERVER['REQUEST_METHOD'] !== 'POST')\r\n return;\r\n\r\n update_option('ohs_newsletter_sendgrid_api', $_POST['ohs_newsletter_sendgrid_api']);\r\n update_option('ohs_newsletter_sendgrid_list', $_POST['ohs_newsletter_sendgrid_list']);\r\n update_option('ohs_newsletter_redirect', $_POST['ohs_newsletter_redirect']);\r\n }", "function dirtag_cms_form_action (&$this, $args)\n{\n $ui =& $app->ui;\n\n return $ui->url (new event ('form_parser'));\n}", "public function form_submission() {\n\n\t\t// Check to see if this is a new post or has already been created.\n\t\tif ( isset( $_POST['object_id'] ) && ( get_post_type( $_POST['object_id'] ) !== 'tm-events-entries' ) && ( $_POST['object_id'] < 0 ) ) {\n\t\t\tremove_query_arg( 'entry' );\n\t\t\twp_redirect( home_url( $path = 'nominate/entry' ) );\n\t\t}\n\n\t\t// If no form submission, bail.\n\t\tif ( empty( $_POST ) || ! isset( $_POST['submit-cmb'], $_POST['object_id'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if hidden form is present.\n\t\t// If it is then this has been submitted by a bot.\n\t\tif ( empty( $_POST ) || isset( $_POST['_nsa_entries_2016_hidden_check'] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get CMB2 metabox object.\n\t\t$cmb = $this->get_current_form( $this->meta_prefix, 'fake-object-id' );\n\t\t$post_data = array();\n\n\t\t// Check security nonce.\n\t\tif ( ! isset( $_POST[ $cmb->nonce() ] ) || ! wp_verify_nonce( $_POST[ $cmb->nonce() ], $cmb->nonce() ) ) {\n\t\t\treturn $cmb->prop( 'submission_error', new WP_Error( 'security_fail', __( 'Security check failed.' ) ) );\n\t\t}\n\n\t\t// Check hidden box is NOT ticked.\n\t\tif ( ! isset( $_POST[ $cmb->nonce() ] ) || ! wp_verify_nonce( $_POST[ $cmb->nonce() ], $cmb->nonce() ) ) {\n\t\t\treturn $cmb->prop( 'submission_error', new WP_Error( 'security_fail', __( 'Security check failed.' ) ) );\n\t\t}\n\n\t\t// Check Post ID is valid.\n\t\t/*if ( (! is_int( $_POST['object_id'] ) ) || ( ! $_POST['object_id'] >= 0 ) || floor( $_POST['object_id'] ) !== $_POST['object_id'] ) {\n\t\t\treturn $cmb->prop( 'submission_error', new WP_Error( 'post_data_missing', __( 'Cannot submit your entry. Please try again' ) ) );\n\t\t}*/\n\n\t\t/**\n\t\t * Fetch sanitized values\n\t\t */\n\t\t$sanitized_values = $cmb->get_sanitized_values( $_POST );\n\n\t\t// Set our post data arguments.\n\t\t// If we are updating a post supply the id from our hidden field.\n\t\t$post_data['ID'] = absint( $_POST['object_id'] );\n\n\t\t$post_data['post_title'] = $sanitized_values['submitted_post_title'];\n\t\tunset( $sanitized_values['submitted_post_title'] );\n\t\t$post_data['post_content'] = '';\n\n\t\t// Set the post type we want to submit.\n\t\t$post_data['post_type'] = 'tm-events-entries';\n\t\t// Set the status of of post.\n\t\t$post_data['post_status'] = 'publish';\n\n\t\t// Create the new post.\n\t\t$new_submission_id = wp_insert_post( $post_data, true );\n\n\t\t// If we hit a snag, update the user.\n\t\tif ( is_wp_error( $new_submission_id ) ) {\n\t\t\treturn $cmb->prop( 'submission_error', $new_submission_id );\n\t\t} else {\n\n\t\t\t// Loop through remaining (sanitized) data, and save to post-meta.\n\t\t\tforeach ( $sanitized_values as $key => $value ) {\n\t\t\t\tif ( is_array( $value ) ) {\n\t\t\t\t\t$value = array_filter( $value );\n\t\t\t\t\tif ( ! empty( $value ) ) {\n\t\t\t\t\t\tupdate_post_meta( $new_submission_id, $key, $value );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tupdate_post_meta( $new_submission_id, $key, $value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove any previous entry query arguments.\n\t\t\tremove_query_arg( 'entry' );\n\n\t\t\t// Send confirmation email out.\n\t\t\t$confirm_email = $this->send_confirmation( $post_data['post_title'], $sanitized_values );\n\n\t\t\t/**\n\t\t\t * Redirect back to the form page with a query variable with the new post ID.\n\t\t\t * This will help double-submissions with browser refreshes\n\t\t\t */\n\t\t\twp_redirect(\n\t\t\t\tesc_url_raw(\n\t\t\t\t\tadd_query_arg(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'entry' => $new_submission_id,\n\t\t\t\t\t\t),\n\t\t\t\t\t\thome_url( '/nominate/confirm/' )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\texit;\n\t\t}\n\n\t}", "function makeForm($request, $formOpts){\n\t\t#print_r ($request);\n\t\t$formDescriptor = array(\n\t\t\t'radioForm' => array(\n \t\t\t\t'type' => 'radio',\n \t\t\t\t'label' => 'Select a search type:',\n \t\t\t\t'options' => array( # The options available within the checkboxes (displayed => value)\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 0' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 1' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 2' => 2,\n\t\t\t\t\t\t\t\t\t\t\t),\n \t\t\t\t'default' => 0 # The option selected by default (identified by value)\n \t\t\t),\n 'textfield1' => array(\n\t\t\t\t\t\t\t\t'label' => 'textfield 1 label', # What's the label of the field\n\t\t\t\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t\t\t\t),\n\t\t\t'textfield2' => array(\n\t\t\t\t\t'label' => 'textfield 2 label', # What's the label of the field\n\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t), \t\t\t\t\n \t\t);\n\t\t\n\t\tswitch($formOpts){\n\t\t\tcase '1':\n\t\t\t\t$formDescriptor['textfield1']['label'] = 'textfield 1 label'; # What's the label of the field\n\t\t\t\t$formDescriptor['textfield2']['label'] = 'textfield 2 label'; # What's the label of the field\t\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t#same as case 1\n\t\t\tdefault:\n\t\t}\n\n\t\t#Submit button structure and page callback. \n $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform'); # We build the HTMLForm object, calling the form 'myform'\n $htmlForm->setSubmitText( 'Submit button text' ); # What text does the submit button display\n\t\t\n\t\t/* We set a callback function */ \n\t\t#This code has no function to the special page. It used to produce red wiki text callback such as \"Try Again\" commented-out below under processInput function. \n\t\t$htmlForm->setSubmitCallback( array( 'specialpagetemplate', 'processInput' ) ); # Call processInput() in specialpagetemplate on submit\n $htmlForm->show(); # Displaying the form\n\t}", "function handle_profile_form( int $user_id ) {\n\tif ( ! check_admin_referer( 'update-user_' . $user_id ) ) {\n\t\treturn;\n\t}\n\n\tif ( isset( $_POST['altis_telemetry_opt_in_toggle'] ) ) {\n\t\topt_in( true );\n\t} else {\n\t\topt_in( false );\n\t}\n}", "function shibboleth_options_page() {\n\tglobal $wp_roles;\n\t$message = null;\n\t$type = null;\n\n\tif ( isset( $_POST['submit'] ) ) {\n\t\tcheck_admin_referer( 'shibboleth_update_options' );\n\n\t\tif ( isset ( $_GET['tab'] ) )\n\t\t\t$tab = $_GET['tab'];\n\t\telse\n\t\t\t$tab = 'general';\n\n\t\tswitch ( $tab ) {\n\t\t\tcase 'general' :\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_ATTRIBUTE_ACCESS_METHOD' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_attribute_access_method', $_POST['attribute_access'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_ATTRIBUTE_ACCESS_METHOD_FALLBACK' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_attribute_access_method_fallback', $_POST['attribute_access_fallback'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_ATTRIBUTE_CUSTOM_ACCESS_METHOD' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_attribute_custom_access_method', $_POST['attribute_custom_access'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_LOGIN_URL' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_login_url', $_POST['login_url'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_LOGOUT_URL' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_logout_url', $_POST['logout_url'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_SPOOF_KEY' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_spoof_key', $_POST['spoofkey'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_PASSWORD_CHANGE_URL' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_password_change_url', $_POST['password_change_url'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_PASSWORD_RESET_URL' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_password_reset_url', $_POST['password_reset_url'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_DEFAULT_TO_SHIB_LOGIN' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_default_to_shib_login', ! empty( $_POST['default_login'] ) );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_AUTO_LOGIN' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_auto_login', ! empty( $_POST['auto_login'] ) );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_BUTTON_TEXT' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_button_text', $_POST['button_text'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_DISABLE_LOCAL_AUTH' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_disable_local_auth', ! empty( $_POST['disable_local_auth'] ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'user' :\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_HEADERS' ) ) {\n\t\t\t\t\t$shib_headers = (array) get_site_option( 'shibboleth_headers' );\n\t\t\t\t\t$shib_headers = array_merge( $shib_headers, $_POST['headers'] );\n\t\t\t\t\t/**\n\t\t\t\t\t * filter shibboleth_form_submit_headers\n\t\t\t\t\t * @param $shib_headers array\n\t\t\t\t\t * @since 1.4\n\t\t\t\t\t * Hint: access $_POST within the filter.\n\t\t\t\t\t */\n\t\t\t\t\t$shib_headers = apply_filters( 'shibboleth_form_submit_headers', $shib_headers );\n\t\t\t\t\tupdate_site_option( 'shibboleth_headers', $shib_headers );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_CREATE_ACCOUNTS' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_create_accounts', ! empty( $_POST['create_accounts'] ) );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_AUTO_COMBINE_ACCOUNTS' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_auto_combine_accounts', $_POST['auto_combine_accounts'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_MANUALLY_COMBINE_ACCOUNTS' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_manually_combine_accounts', $_POST['manually_combine_accounts'] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'authorization' :\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_ROLES' ) ) {\n\t\t\t\t\t$shib_roles = (array) get_site_option( 'shibboleth_roles' );\n\t\t\t\t\t$shib_roles = array_merge( $shib_roles, $_POST['shibboleth_roles'] );\n\t\t\t\t\t/**\n\t\t\t\t\t * filter shibboleth_form_submit_roles\n\t\t\t\t\t * @param $shib_roles array\n\t\t\t\t\t * @since 1.4\n\t\t\t\t\t * Hint: access $_POST within the filter.\n\t\t\t\t\t */\n\t\t\t\t\t$shib_roles = apply_filters( 'shibboleth_form_submit_roles', $shib_roles );\n\t\t\t\t\tupdate_site_option( 'shibboleth_roles', $shib_roles );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_DEFAULT_ROLE' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_default_role', $_POST['default_role'] );\n\t\t\t\t}\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_UPDATE_ROLES' ) ) {\n\t\t\t\t\tupdate_site_option( 'shibboleth_update_roles', ! empty( $_POST['update_roles'] ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'logging' :\n\t\t\t\tif ( ! defined( 'SHIBBOLETH_LOGGING' ) ) {\n\t\t\t\t\tif ( isset( $_POST['logging'] ) ) {\n\t\t\t\t\t\tupdate_site_option( 'shibboleth_logging', $_POST['logging'] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tupdate_site_option( 'shibboleth_logging', array() );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t$type = 'updated';\n\t\t$message = __( 'Settings saved.', 'shibboleth' );\n\n\t\tif ( function_exists( 'add_settings_error' ) ) {\n\t\t\tadd_settings_error( 'shibboleth_settings_updated', esc_attr( 'shibboleth_settings_updated' ), $message, $type );\n\t\t\tsettings_errors( 'shibboleth_settings_updated' );\n\t\t}\n\n\t\t/**\n\t\t * action shibboleth_form_submit\n\t\t * @since 1.4\n\t\t * Hint: use global $_POST within the action.\n\t\t */\n\t\tdo_action( 'shibboleth_form_submit' );\n\n\t}\n\n\t$shibboleth_plugin_path = apply_filters( 'shibboleth_plugin_path', plugins_url( 'shibboleth' ) );\n\n?>\n\t<div class=\"wrap\">\n\t\t<form method=\"post\">\n\n\t\t\t<h1><?php _e( 'Shibboleth Options', 'shibboleth' ); ?></h1>\n\n\t\t\t<?php\n\t\t\tif ( isset ( $_GET['tab'] ) ) {\n\t\t\t\tshibboleth_admin_tabs( $_GET['tab'] );\n\t\t\t} else {\n\t\t\t\tshibboleth_admin_tabs( 'general' );\n\t\t\t}\n\t\t\tif ( isset ( $_GET['tab'] ) ) {\n\t\t\t\t$tab = $_GET['tab'];\n\t\t\t} else {\n\t\t\t\t$tab = 'general';\n\t\t\t}\n\n\t\t\tswitch ( $tab ) {\n\t\t\t\tcase 'general' :\n\t\t\t\t\t$constant = false;\n\t\t\t\t\tlist( $login_url, $from_constant ) = shibboleth_getoption( 'shibboleth_login_url', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $logout_url, $from_constant ) = shibboleth_getoption( 'shibboleth_logout_url', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $password_change_url, $from_constant ) = shibboleth_getoption( 'shibboleth_password_change_url', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $password_reset_url, $from_constant ) = shibboleth_getoption( 'shibboleth_password_reset_url', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $attribute_access, $from_constant ) = shibboleth_getoption( 'shibboleth_attribute_access_method', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $attribute_access_fallback, $from_constant ) = shibboleth_getoption( 'shibboleth_attribute_access_method_fallback', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $attribute_custom_access, $from_constant ) = shibboleth_getoption( 'shibboleth_attribute_custom_access_method', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $spoofkey, $from_constant ) = shibboleth_getoption( 'shibboleth_spoof_key', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $default_login, $from_constant ) = shibboleth_getoption( 'shibboleth_default_to_shib_login', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $auto_login, $from_constant ) = shibboleth_getoption( 'shibboleth_auto_login', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $disable_local_auth, $from_constant ) = shibboleth_getoption( 'shibboleth_disable_local_auth', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $button_text, $from_constant ) = shibboleth_getoption( 'shibboleth_button_text', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\t?>\n\n\t\t\t<h3><?php _e( 'General Configuration', 'shibboleth' ); ?></h3>\n\t\t\t<?php if ( $constant ) { ?>\n\t\t\t\t<div class=\"notice notice-warning\">\n\t\t\t\t\t<p><?php _e( '<strong>Note:</strong> Some options below are defined in the <code>wp-config.php</code> file as constants and cannot be modified from this page.', 'shibboleth' ); ?></p>\n\t\t\t\t</div>\n\t\t\t<?php } ?>\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"login_url\"><?php _e( 'Login URL', 'shibboleth' ); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"text\" id=\"login_url\" name=\"login_url\" value=\"<?php echo esc_url( $login_url ); ?>\" size=\"50\" <?php if ( defined( 'SHIBBOLETH_LOGIN_URL' ) ) { disabled( $login_url, SHIBBOLETH_LOGIN_URL ); } ?> /><br />\n\t\t\t\t\t\t<?php _e('This URL is constructed from values found in your main Shibboleth'\n\t\t\t\t\t\t\t. ' SP configuration file: your site hostname, the Sessions handlerURL,'\n\t\t\t\t\t\t\t. ' and the SessionInitiator Location.', 'shibboleth'); ?>\n\t\t\t\t\t\t<br /><?php _e('Wiki Documentation', 'shibboleth'); ?>:\n\t\t\t\t\t\t<a href=\"https://spaces.internet2.edu/display/SHIB/SessionInitiator\" target=\"_blank\">Shibboleth 1.3</a> |\n\t\t\t\t\t\t<a href=\"https://spaces.internet2.edu/display/SHIB2/NativeSPSessionInitiator\" target=\"_blank\">Shibboleth 2</a>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"logout_url\"><?php _e('Logout URL', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"text\" id=\"logout_url\" name=\"logout_url\" value=\"<?php echo esc_url( $logout_url ); ?>\" size=\"50\" <?php if ( defined( 'SHIBBOLETH_LOGOUT_URL' ) ) { disabled( $logout_url, SHIBBOLETH_LOGOUT_URL ); } ?> /><br />\n\t\t\t\t\t\t<?php _e('This URL is constructed from values found in your main Shibboleth'\n\t\t\t\t\t\t\t. ' SP configuration file: your site hostname, the Sessions handlerURL,'\n\t\t\t\t\t\t\t. ' and the LogoutInitiator Location (also known as the'\n\t\t\t\t\t\t\t. ' SingleLogoutService Location in Shibboleth 1.3).', 'shibboleth'); ?>\n\t\t\t\t\t\t<br /><?php _e('Wiki Documentation', 'shibboleth'); ?>:\n\t\t\t\t\t\t<a href=\"https://spaces.internet2.edu/display/SHIB/SPMainConfig\" target=\"_blank\">Shibboleth 1.3</a> |\n\t\t\t\t\t\t<a href=\"https://spaces.internet2.edu/display/SHIB2/NativeSPLogoutInitiator\" target=\"_blank\">Shibboleth 2</a>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"password_change_url\"><?php _e('Password Change URL', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"text\" id=\"password_change_url\" name=\"password_change_url\" value=\"<?php echo esc_url( $password_change_url ); ?>\" size=\"50\" <?php if ( defined( 'SHIBBOLETH_PASSWORD_CHANGE_URL' ) ) { disabled( $password_change_url, SHIBBOLETH_PASSWORD_CHANGE_URL ); } ?> /><br />\n\t\t\t\t\t\t<?php _e('If this option is set, Shibboleth users will see a \"change password\" link on their profile page directing them to this URL.', 'shibboleth') ?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"password_reset_url\"><?php _e('Password Reset URL', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"text\" id=\"password_reset_url\" name=\"password_reset_url\" value=\"<?php echo esc_url( $password_reset_url ); ?>\" size=\"50\" <?php if ( defined( 'SHIBBOLETH_PASSWORD_RESET_URL' ) ) { disabled( $password_reset_url, SHIBBOLETH_PASSWORD_RESET_URL ); } ?> /><br />\n\t\t\t\t\t\t<?php _e('If this option is set, wp-login.php will send <b><i>ALL</i></b> users here to reset their password.', 'shibboleth'); ?>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"attribute_access\"><?php _e('Attribute Access', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<select id=\"attribute_access\" name=\"attribute_access\" <?php if ( defined( 'SHIBBOLETH_ATTRIBUTE_ACCESS_METHOD' ) ) { disabled( $attribute_access, SHIBBOLETH_ATTRIBUTE_ACCESS_METHOD ); } ?> >\n\t\t\t\t\t\t\t<option value=\"standard\" <?php selected( $attribute_access, 'standard' ); ?>><?php _e('Environment Variables', 'shibboleth'); ?></option>\n\t\t\t\t\t\t\t<option value=\"redirect\" <?php selected( $attribute_access, 'redirect' ); ?>><?php _e('Redirected Environment Variables', 'shibboleth'); ?></option>\n\t\t\t\t\t\t\t<option value=\"http\" <?php selected( $attribute_access, 'http' ); ?>><?php _e('HTTP Headers', 'shibboleth'); ?></option>\n\t\t\t\t\t\t\t<option value=\"custom\" <?php selected( $attribute_access, 'custom' ); ?>><?php _e('Custom Prefix', 'shibboleth'); ?></option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t\t<p><?php _e('By default, attributes passed from your Shibboleth Service Provider will be accessed using standard environment variables. '\n\t\t\t\t\t\t. 'For most users, leaving these defaults is perfectly fine. If you are running a special server configuration that results in environment variables '\n\t\t\t\t\t\t. 'being sent with the prefix <code>REDIRECT_</code>, you should select the \"Redirected Environment Variables\" option. If you are running '\n\t\t\t\t\t\t. 'your Shibboleth Service Provider on a reverse proxy, you should select the \"HTTP Headers\" option and, if at all possible, add a spoofkey below. '\n\t\t\t\t\t\t. ' If you are running Shibboleth with a custom prefix, you should select the \"Custom Prefix\" option and complete the \"Custom Attribute Access Prefix\" field that appears below.', 'shibboleth'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"attribute_custom_access_row\" <?php echo ( $attribute_access === 'custom' ?: 'style=\"display:none;\"' ); ?>>\n\t\t\t\t\t<th scope=\"row\"><label for=\"attribute_custom_access\"><?php _e('Custom Attribute Access Prefix', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"text\" id=\"attribute_custom_access\" name=\"attribute_custom_access\" value=\"<?php echo esc_attr( $attribute_custom_access ); ?>\" size=\"50\" <?php if ( defined( 'SHIBBOLETH_ATTRIBUTE_CUSTOM_ACCESS_METHOD' ) ) { disabled( $attribute_custom_access, SHIBBOLETH_ATTRIBUTE_CUSTOM_ACCESS_METHOD ); } ?> /><br />\n\t\t\t\t\t\t<p><?php _e('If you wish to use a custom attribute access prefix, enter it here. This field is case-insensitive.'\n\t\t\t\t\t\t. '<br /><b>WARNING:</b> If you incorrectly set this option, you will force <b><i>ALL</i></b> attempts to authenticate with Shibboleth to fail.', 'shibboleth'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"spoofkey_row\" <?php echo ( $attribute_access === 'http' ?: 'style=\"display:none;\"' ); ?>>\n\t\t\t\t\t<th scope=\"row\"><label for=\"spoofkey\"><?php _e('Spoof Key', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"text\" id=\"spoofkey\" name=\"spoofkey\" value=\"<?php echo esc_attr( $spoofkey ); ?>\" size=\"50\" <?php if ( defined( 'SHIBBOLETH_SPOOF_KEY' ) ) { disabled( $spoofkey, SHIBBOLETH_SPOOF_KEY ); } ?> /><br />\n\t\t\t\t\t\t<p><?php _e('For more details on setting a spoof key on the Shibboleth Service Provider, see <a href=\"https://wiki.shibboleth.net/confluence/display/SHIB2/NativeSPSpoofChecking\">this wiki document</a>. '\n\t\t\t\t\t\t. '<br /><b>WARNING:</b> If you incorrectly set this option, you will force <b><i>ALL</i></b> attempts to authenticate with Shibboleth to fail.', 'shibboleth'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr id=\"attribute_access_fallback_row\" <?php if( $attribute_access === 'standard' ) echo 'style=\"display:none;\"'; ?>>\n\t\t\t\t<th scope=\"row\"><label for=\"attribute_access_fallback\"><?php _e('Enable Fallback Attribute Access', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"attribute_access_fallback\" name=\"attribute_access_fallback\" <?php echo $attribute_access_fallback ? ' checked=\"checked\"' : '' ?> <?php if ( defined( 'SHIBBOLETH_ATTRIBUTE_ACCESS_METHOD_FALLBACK' ) ) { disabled( $attribute_access_fallback, SHIBBOLETH_ATTRIBUTE_ACCESS_METHOD_FALLBACK ); } ?> />\n\t\t\t\t\t\t<label for=\"attribute_access_fallback\"><?php _e('Allow the standard environment variables to be used as a fallback for attribute access.', 'shibboleth'); ?></label>\n\n\t\t\t\t\t\t<p><?php _e('If set, this will fallback to standard environment variables when the selected'\n\t\t\t\t\t\t\t. ' attribute access method fails.', 'shibboleth'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"default_login\"><?php _e('Default Login Method', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"default_login\" name=\"default_login\" <?php echo $default_login ? ' checked=\"checked\"' : '' ?> <?php if ( defined( 'SHIBBOLETH_DEFAULT_TO_SHIB_LOGIN' ) ) { disabled( $default_login, SHIBBOLETH_DEFAULT_TO_SHIB_LOGIN ); } ?> />\n\t\t\t\t\t\t<label for=\"default_login\"><?php _e('Use Shibboleth as the default login method for users.', 'shibboleth'); ?></label>\n\n\t\t\t\t\t\t<p><?php _e('If set, this will cause all standard WordPress login links to initiate Shibboleth'\n\t\t\t\t\t\t\t. ' login instead of local WordPress authentication. Shibboleth login can always be'\n\t\t\t\t\t\t\t. ' initiated from the WordPress login form by clicking the \"Log in with Shibboleth\" link.', 'shibboleth'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"auto_login\"><?php _e('Automatic Login', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"auto_login\" name=\"auto_login\" <?php echo $auto_login ? ' checked=\"checked\"' : '' ?> <?php if ( defined( 'SHIBBOLETH_AUTO_LOGIN' ) ) { disabled( $auto_login, SHIBBOLETH_AUTO_LOGIN ); } ?> />\n\t\t\t\t\t\t<label for=\"auto_login\"><?php _e('Use Shibboleth to auto-login users.', 'shibboleth'); ?></label>\n\n\t\t\t\t\t\t<p><?php _e('If set, this option checks to see if a Shibboleth session exists on every page load, and, '\n\t\t\t\t\t\t. 'if it does, forces a <code>wp_signon()</code> call and <code>wp_safe_redirect()</code> back to the <code>$_SERVER[\\'REQUEST_URI\\']</code>.' , 'shibboleth'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"disable_local_auth\"><?php _e('Disable Local Authentication', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"disable_local_auth\" name=\"disable_local_auth\" <?php echo $disable_local_auth ? ' checked=\"checked\"' : '' ?> <?php if ( defined( 'SHIBBOLETH_DISABLE_LOCAL_AUTH' ) ) { disabled( $disable_local_auth, SHIBBOLETH_DISABLE_LOCAL_AUTH ); } ?> />\n\t\t\t\t\t\t<label for=\"disable_local_auth\"><?php _e('Disables local WordPress authentication.', 'shibboleth'); ?></label>\n\t\t\t\t\t\t<p><?php _e('<b>WARNING:</b> Disabling local authentication can potentially lock you out of WordPress if you have misconfigured the plugin or have a non-functional Shibboleth Service Provider. '\n\t\t\t\t\t\t. 'Make sure that you are confident your configuration is functional before enabling this option.', 'shibboleth'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"button_text\"><?php _e('Button Text', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"text\" id=\"button_text\" name=\"button_text\" value=\"<?php echo esc_attr( $button_text ); ?>\" size=\"50\" <?php if ( defined( 'SHIBBOLETH_BUTTON_TEXT' ) ) { disabled( $button_text, SHIBBOLETH_BUTTON_TEXT ); } ?> /><br />\n\t\t\t\t\t\t<p><?php _e('Set the text of the button that appears on the <code>wp-login.php</code> page.', 'shibboleth'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n<?php\n\t\t\t\t/**\n\t\t\t\t * action shibboleth_options_table\n\t\t\t\t * Add your own Shibboleth options items to the Shibboleth options table.\n\t\t\t\t * Note: This is in a <table> so add a <tr> with appropriate styling.\n\t\t\t\t *\n\t\t\t\t * @param $shib_headers array\n\t\t\t\t * @param $shib_roles array\n\t\t\t\t * @since 1.4\n\t\t\t\t * @todo support new structure of table and tabs\n\t\t\t\t */\n\t\t\t\t#do_action( 'shibboleth_options_table', $shib_headers, $shib_roles );\n?>\n\t\t\t</table>\n\n\t\t\t<br class=\"clear\" />\n\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tvar attribute_access = document.getElementById(\"attribute_access\");\n\t\t\t\tattribute_access.onchange=AttributeAccessMethod;\n\t\t\t\tfunction AttributeAccessMethod()\n\t\t\t\t{\n\t\t\t\t var attribute_access = document.getElementById(\"attribute_access\");\n\t\t\t\t var selectedValue = attribute_access.options[attribute_access.selectedIndex].value;\n\n\t\t\t\t if (selectedValue == \"custom\")\n\t\t\t\t {\n\t\t\t\t\t\tdocument.getElementById(\"attribute_custom_access_row\").style.display = \"table-row\";\n\t\t\t\t\t\tdocument.getElementById(\"attribute_access_fallback_row\").style.display = \"table-row\";\n\t\t\t\t \tdocument.getElementById(\"spoofkey_row\").style.display = \"none\";\n\t\t\t\t }\n\t\t\t\t else if (selectedValue == \"http\")\n\t\t\t\t {\n\t\t\t\t\t\tdocument.getElementById(\"attribute_custom_access_row\").style.display = \"none\";\n\t\t\t\t\t\tdocument.getElementById(\"attribute_access_fallback_row\").style.display = \"table-row\";\n\t\t\t\t \tdocument.getElementById(\"spoofkey_row\").style.display = \"table-row\";\n\t\t\t\t\t}\n\t\t\t\t else if (selectedValue == \"standard\")\n\t\t\t\t {\n\t\t\t\t\t\tdocument.getElementById(\"attribute_custom_access_row\").style.display = \"none\";\n\t\t\t\t\t\tdocument.getElementById(\"attribute_access_fallback_row\").style.display = \"none\";\n\t\t\t\t\t\tdocument.getElementById(\"spoofkey_row\").style.display = \"none\";\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t document.getElementById(\"attribute_custom_access_row\").style.display = \"none\";\n\t\t\t\t\t document.getElementById(\"attribute_access_fallback_row\").style.display = \"table-row\";\n\t\t\t\t document.getElementById(\"spoofkey_row\").style.display = \"none\";\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t</script>\n\n<?php\n\t\t\tbreak;\n\t\t\t\tcase 'user' :\n\t\t\t\t\t$constant = false;\n\t\t\t\t\tlist( $shib_headers, $shib_headers_constant ) = shibboleth_getoption( 'shibboleth_headers', array(), true, true );\n\t\t\t\t\t$constant = $constant || $shib_headers_constant;\n\t\t\t\t\tlist( $create_accounts, $from_constant ) = shibboleth_getoption( 'shibboleth_create_accounts', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $auto_combine_accounts, $from_constant ) = shibboleth_getoption( 'shibboleth_auto_combine_accounts', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $manually_combine_accounts, $from_constant ) = shibboleth_getoption( 'shibboleth_manually_combine_accounts', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\t?>\n\n\n\t\t\t<h2><?php _e('User Configuration', 'shibboleth'); ?></h2>\n\t\t\t<?php if ( $constant ) { ?>\n\t\t\t\t<div class=\"notice notice-warning\">\n\t\t\t\t\t<p><?php _e( '<strong>Note:</strong> Some options below are defined in the <code>wp-config.php</code> file as constants and cannot be modified from this page.', 'shibboleth' ); ?></p>\n\t\t\t\t</div>\n\t\t\t<?php } ?>\n\t\t\t<h4><?php _e('User Profile Data', 'shibboleth'); ?></h4>\n\n\t\t\t<p><?php _e('Define the Shibboleth headers which should be mapped to each user profile attribute. These'\n\t\t\t\t. ' header names are configured in <code>attribute-map.xml</code> (for Shibboleth 2.x) or'\n\t\t\t\t. ' <code>AAP.xml</code> (for Shibboleth 1.x).', 'shibboleth'); ?></p>\n\n\t\t\t<p>\n\t\t\t\t<?php _e('Wiki Documentation', 'shibboleth'); ?>:\n\t\t\t\t<a href=\"https://spaces.internet2.edu/display/SHIB/AttributeAcceptancePolicy\" target=\"_blank\">Shibboleth 1.3</a> |\n\t\t\t\t<a href=\"https://spaces.internet2.edu/display/SHIB2/NativeSPAddAttribute\" target=\"_blank\">Shibboleth 2</a>\n\t\t\t</p>\n\n\t\t\t<table class=\"form-table optiontable editform\" cellspacing=\"2\" cellpadding=\"5\">\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"username\"><?php _e('Username') ?></label></th>\n\t\t\t\t\t<td><input type=\"text\" id=\"username\" name=\"headers[username][name]\" value=\"<?php echo\n\t\t\t\t\t\tesc_attr( $shib_headers['username']['name'] ); ?>\" <?php disabled( $shib_headers_constant ); ?>/></td>\n\t\t\t\t\t\t<td width=\"60%\"><input type=\"checkbox\" id=\"username_managed\" name=\"headers[username][managed]\" checked=\"checked\" disabled=\"true\" <?php disabled( $shib_headers_constant ); ?>/> <?php _e('Managed', 'shibboleth') ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"first_name\"><?php _e('First name') ?></label></th>\n\t\t\t\t\t<td><input type=\"text\" id=\"first_name\" name=\"headers[first_name][name]\" value=\"<?php echo\n\t\t\t\t\t\tesc_attr( $shib_headers['first_name']['name'] ); ?>\" <?php disabled( $shib_headers_constant ); ?>/></td>\n\t\t\t\t\t<td><input type=\"checkbox\" id=\"first_name_managed\" name=\"headers[first_name][managed]\" <?php\n\t\t\t\t\t\tif (isset($shib_headers['first_name']['managed'])) checked($shib_headers['first_name']['managed'], 'on') ?> <?php disabled( $shib_headers_constant ); ?>/> <?php _e('Managed', 'shibboleth') ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"last_name\"><?php _e('Last name') ?></label></th>\n\t\t\t\t\t<td><input type=\"text\" id=\"last_name\" name=\"headers[last_name][name]\" value=\"<?php echo\n\t\t\t\t\t\tesc_attr( $shib_headers['last_name']['name'] ); ?>\" <?php disabled( $shib_headers_constant ); ?>/></td>\n\t\t\t\t\t<td><input type=\"checkbox\" id=\"last_name_managed\" name=\"headers[last_name][managed]\" <?php\n\t\t\t\t\t\tif (isset($shib_headers['last_name']['managed'])) checked($shib_headers['last_name']['managed'], 'on') ?> <?php disabled( $shib_headers_constant ); ?> /> <?php _e('Managed', 'shibboleth') ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"nickname\"><?php _e('Nickname') ?></label></th>\n\t\t\t\t\t<td><input type=\"text\" id=\"nickname\" name=\"headers[nickname][name]\" value=\"<?php echo\n\t\t\t\t\t\tesc_attr( $shib_headers['nickname']['name'] ); ?>\" <?php disabled( $shib_headers_constant ); ?>/></td>\n\t\t\t\t\t<td><input type=\"checkbox\" id=\"nickname_managed\" name=\"headers[nickname][managed]\" <?php\n\t\t\t\t\t\tif (isset($shib_headers['nickname']['managed'])) checked($shib_headers['nickname']['managed'], 'on') ?> <?php disabled( $shib_headers_constant ); ?>/> <?php _e('Managed', 'shibboleth') ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"_display_name\"><?php _e('Display name', 'shibboleth') ?></label></th>\n\t\t\t\t\t<td><input type=\"text\" id=\"_display_name\" name=\"headers[display_name][name]\" value=\"<?php echo\n\t\t\t\t\t\tesc_attr( $shib_headers['display_name']['name'] ); ?>\" <?php disabled( $shib_headers_constant ); ?>/></td>\n\t\t\t\t\t<td><input type=\"checkbox\" id=\"display_name_managed\" name=\"headers[display_name][managed]\" <?php\n\t\t\t\t\t\tif (isset($shib_headers['display_name']['managed'])) checked($shib_headers['display_name']['managed'], 'on') ?> <?php disabled( $shib_headers_constant ); ?>/> <?php _e('Managed', 'shibboleth') ?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><label for=\"email\"><?php _e('Email Address', 'shibboleth') ?></label></th>\n\t\t\t\t\t<td><input type=\"text\" id=\"email\" name=\"headers[email][name]\" value=\"<?php echo\n\t\t\t\t\t\tesc_attr( $shib_headers['email']['name'] ); ?>\" <?php disabled( $shib_headers_constant ); ?>/></td>\n\t\t\t\t\t<td><input type=\"checkbox\" id=\"email_managed\" name=\"headers[email][managed]\" <?php\n\t\t\t\t\t\tif (isset($shib_headers['email']['managed'])) checked($shib_headers['email']['managed'], 'on') ?> <?php disabled( $shib_headers_constant ); ?>/> <?php _e('Managed', 'shibboleth') ?></td>\n\t\t\t\t</tr>\n\t\t\t</tr>\n\t\t</table>\n\n\t\t<p><?php _e('<em>Managed</em> profile fields are updated each time the user logs in using the current'\n\t\t\t. ' data provided by Shibboleth. Additionally, users will be prevented from manually updating these'\n\t\t\t. ' fields from within WordPress. Note that Shibboleth data is always used to populate the user'\n\t\t\t. ' profile during initial account creation.', 'shibboleth'); ?></p>\n\n\t\t<table class=\"form-table\">\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<th scope=\"row\"><label for=\"create_accounts\"><?php _e('Automatically Create Accounts', 'shibboleth') ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"create_accounts\" name=\"create_accounts\" <?php echo $create_accounts ? ' checked=\"checked\"' : '' ?> <?php if ( defined( 'SHIBBOLETH_CREATE_ACCOUNTS' ) ) { disabled( $create_accounts, SHIBBOLETH_CREATE_ACCOUNTS ); } ?>/>\n\t\t\t\t\t\t<label for=\"create_accounts\"><?php _e('Automatically create new users if they do not exist in the WordPress database.', 'shibboleth'); ?></label>\n\t\t\t\t\t\t<p><?php _e('Automatically created users will be provisioned with the role that they map to, as defined on the <a href=\"?page=shibboleth-options&tab=authorization\">Authorization</a> tab. '\n\t\t\t\t\t\t. 'If a user does not match any mappings, they will be placed into the role selected under \"Default Role\" on the <a href=\"?page=shibboleth-options&tab=authorization\">Authorization</a> tab.', 'shibboleth') ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"auto_combine_accounts\"><?php _e('Combine Local and Shibboleth Accounts', 'shibboleth') ?></label></th>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<select id=\"auto_combine_accounts\" name=\"auto_combine_accounts\" <?php if ( defined( 'SHIBBOLETH_AUTO_COMBINE_ACCOUNTS' ) ) { disabled( $auto_combine_accounts, SHIBBOLETH_AUTO_COMBINE_ACCOUNTS ); } ?>>\n\t\t\t\t\t\t\t\t<option value=\"prevent\" <?php selected( $auto_combine_accounts, 'disallow' ); ?>>Prevent Automatic Account Merging</option>\n\t\t\t\t\t\t\t\t<option value=\"allow\" <?php selected( $auto_combine_accounts, 'allow' ); ?>>Allow Automatic Account Merging</option>\n\t\t\t\t\t\t\t\t<option value=\"bypass\" <?php selected( $auto_combine_accounts, 'bypass' ); ?>>Allow Automatic Account Merging (Bypass Username Management)</option>\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t<p><?php _e('By default, users will receive an error if they log in via Shibboleth and have a pre-existing local WordPress user account that has not previously been linked with Shibboleth. <br /><br />'\n\t\t\t\t\t\t\t. '<code>Prevent Automatic Account Merging</code>: This option prevents automatic merging of accounts.<br /> '\n\t\t\t\t\t\t\t. '<code>Allow Automatic Account Merging</code>: This option prevents users from experiencing an error if they share a username with both a local and a Shibboleth account. '\n\t\t\t\t\t\t\t. 'This option <b>WILL NOT</b> prevent an error if another user shares the email passed via Shibboleth attributes.<br /> '\n\t\t\t\t\t\t\t. '<code>Allow Automatic Account Merging (Bypass Username Management)</code>: Occasionally, users have pre-existing local WordPress user accounts with a different username than that provided via Shibboleth attributes. '\n\t\t\t\t\t\t\t. 'This option prevents users from experiencing an error in this case by bypassing the username management requirement.', 'shibboleth') ?></p>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<th scope=\"row\"><label for=\"manually_combine_accounts\"></label></th>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<select id=\"manually_combine_accounts\" name=\"manually_combine_accounts\" <?php if ( defined( 'SHIBBOLETH_MANUALLY_COMBINE_ACCOUNTS' ) ) { disabled( $manually_combine_accounts, SHIBBOLETH_MANUALLY_COMBINE_ACCOUNTS ); } ?>>\n\t\t\t\t\t\t\t\t\t<option value=\"prevent\" <?php selected( $manually_combine_accounts, 'disallow' ); ?>>Prevent Manual Account Merging</option>\n\t\t\t\t\t\t\t\t\t<option value=\"allow\" <?php selected( $manually_combine_accounts, 'allow' ); ?>>Allow Manual Account Merging</option>\n\t\t\t\t\t\t\t\t\t<option value=\"bypass\" <?php selected( $manually_combine_accounts, 'bypass' ); ?>>Allow Manual Account Merging (Bypass Username Management)</option>\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t<p><?php _e('This option offers users the ability to manually link their local accounts to Shibboleth from their profile page.<br /><br />'\n\t\t\t\t\t\t\t\t. '<code>Prevent Manual Account Merging</code>: This option does not allow users to manually link accounts.<br /> '\n\t\t\t\t\t\t\t\t. '<code>Allow Manual Account Merging</code>: This option allows users to manually link accounts if they share a username with both a local and a Shibboleth account. '\n\t\t\t\t\t\t\t\t. 'This option <b>WILL NOT</b> prevent an error if another user shares the email passed via Shibboleth attributes.<br /> '\n\t\t\t\t\t\t\t\t. '<code>Allow Manual Account Merging (Bypass Username Management)</code>: Occasionally, users have pre-existing local WordPress user accounts with a different username than that provided via Shibboleth attributes. '\n\t\t\t\t\t\t\t\t. 'This option allows users to manually link accounts by bypassing the username management requirement.', 'shibboleth') ?></p>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t</table>\n\n<?php \tbreak;\n\tcase 'authorization' :\n\t\t\t\t\t$constant = false;\n\t\t\t\t\tlist( $shib_roles, $shib_roles_constant ) = shibboleth_getoption( 'shibboleth_roles', array(), true, true );\n\t\t\t\t\t$constant = $constant || $shib_roles_constant;\n\t\t\t\t\tlist( $default_role, $from_constant ) = shibboleth_getoption( 'shibboleth_default_role', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\tlist( $update_roles, $from_constant ) = shibboleth_getoption( 'shibboleth_update_roles', false, false, true );\n\t\t\t\t\t$constant = $constant || $from_constant;\n\t\t\t\t\t?>\n\n\t\t\t<h3><?php _e('User Role Mappings', 'shibboleth') ?></h3>\n\t\t\t<?php if ( $constant ) { ?>\n\t\t\t\t<div class=\"notice notice-warning\">\n\t\t\t\t\t<p><?php _e( '<strong>Note:</strong> Some options below are defined in the <code>wp-config.php</code> file as constants and cannot be modified from this page.', 'shibboleth' ); ?></p>\n\t\t\t\t</div>\n\t\t\t<?php }\n\n/**\n * filter shibboleth_role_mapping_override\n * Return true to override the default user role mapping form\n *\n * @param boolean - default value false\n * @return boolean - true if override\n * @since 1.4\n *\n * Use in conjunction with shibboleth_role_mapping_form action below\n */\nif ( apply_filters('shibboleth_role_mapping_override',false) === false ):\n?>\n\n\t\t\t<p><?php _e('Users can be placed into one of WordPress\\'s internal roles based on any'\n\t\t\t\t. ' attribute. For example, you could define a special eduPersonEntitlement value'\n\t\t\t\t. ' that designates the user as a WordPress Administrator. Or you could automatically'\n\t\t\t\t. ' place all users with an eduPersonAffiliation of \"faculty\" in the Author role.', 'shibboleth'); ?></p>\n\n\t\t\t<p><?php _e('<strong>Current Limitations:</strong> While WordPress supports users having'\n\t\t\t\t. ' multiple roles, the Shibboleth plugin will only place the user in the highest ranking'\n\t\t\t\t. ' role. Only a single header/value pair is supported for each user role. This may be'\n\t\t\t\t. ' expanded in the future to support multiple header/value pairs or regular expression'\n\t\t\t\t. ' values. In the meantime, you can use the <em>shibboleth_roles</em> and'\n\t\t\t\t. ' <em>shibboleth_user_role</em> WordPress filters to provide your own logic for assigning'\n\t\t\t\t. ' user roles.', 'shibboleth'); ?></p>\n\n\t\t\t<style type=\"text/css\">\n\t\t\t\t#role_mappings { padding: 0; }\n\t\t\t\t#role_mappings thead th { padding: 5px 10px; }\n\t\t\t\t#role_mappings td, #role_mappings th { border-bottom: 0px; }\n\t\t\t</style>\n\n\t\t\t<table class=\"form-table optiontable editform\" cellspacing=\"2\" cellpadding=\"5\" width=\"100%\">\n\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\"><?php _e('Role Mappings', 'shibboleth') ?></th>\n\t\t\t\t\t<td id=\"role_mappings\">\n\t\t\t\t\t\t<table id=\"\">\n\t\t\t\t\t\t<col width=\"10%\"></col>\n\t\t\t\t\t\t<col></col>\n\t\t\t\t\t\t<col></col>\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th></th>\n\t\t\t\t\t\t\t\t<th scope=\"column\"><?php _e('Header Name', 'shibboleth') ?></th>\n\t\t\t\t\t\t\t\t<th scope=\"column\"><?php _e('Header Value', 'shibboleth') ?></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n<?php\n\n\t\t\t\t\tforeach ($wp_roles->role_names as $key => $name) {\n\t\t\t\t\t\techo '\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<th scope=\"row\">' . __($name) . '</th>\n\t\t\t\t\t\t\t<td><input type=\"text\" id=\"role_'.$key.'_header\" name=\"shibboleth_roles['.$key.'][header]\" value=\"' . @$shib_roles[$key]['header'] . '\" style=\"width: 100%\" '. disabled( $shib_roles_constant, true, false) .'/></td>\n\t\t\t\t\t\t\t<td><input type=\"text\" id=\"role_'.$key.'_value\" name=\"shibboleth_roles['.$key.'][value]\" value=\"' . @$shib_roles[$key]['value'] . '\" style=\"width: 100%\" '. disabled( $shib_roles_constant, true, false) .'/></td>\n\t\t\t\t\t\t</tr>';\n\t\t\t\t\t}\n?>\n\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\"><?php _e('Default Role', 'shibboleth') ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<select id=\"default_role\" name=\"default_role\" <?php if ( defined( 'SHIBBOLETH_DEFAULT_ROLE' ) ) { disabled( $default_role, SHIBBOLETH_DEFAULT_ROLE ); } ?>>\n\t\t\t\t\t\t\t<option value=\"\"><?php _e('(no role)', 'shibboleth') ?></option>\n\t\t\t\t\t\t\t<option value=\"_no_account\" <?php selected( $default_role, \"_no_account\" ); ?>><?php _e('(skip \\'no role\\' account creation)', 'shibboleth') ?></option>\n<?php\n\t\t\tforeach ($wp_roles->role_names as $key => $name) {\n\t\t\t\techo '\n\t\t\t\t\t\t<option value=\"' . $key . '\"' . selected( $default_role, $key ) . '>' . __($name) . '</option>';\n\t\t\t}\n?>\n\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t<p><?php _e('If a user does not map into any of the roles above, they will'\n\t\t\t\t\t\t\t. ' be placed into the default role. If there is no default role, the'\n\t\t\t\t\t\t\t. ' user will not be assigned a role when creating an account with'\n\t\t\t\t\t\t\t. ' Shibboleth. If \"(skip \\'no role\\' account creation)\" is selected, the user'\n\t\t\t\t\t\t\t. ' will not be able to create an account with Shibboleth.', 'shibboleth'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"row\"><label for=\"update_roles\"><?php _e('Update User Roles', 'shibboleth') ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"update_roles\" name=\"update_roles\" <?php echo $update_roles ? ' checked=\"checked\"' : '' ?> <?php if ( defined( 'SHIBBOLETH_UPDATE_ROLES' ) ) { disabled( $update_roles, SHIBBOLETH_UPDATE_ROLES ); } ?>/>\n\t\t\t\t\t\t<label for=\"update_roles\"><?php _e('Use Shibboleth data to update user role mappings each time the user logs in.', 'shibboleth') ?></label>\n\n\t\t\t\t\t\t<p><?php _e('Be aware that if you use this option, you should <strong>not</strong> update user roles manually,'\n\t\t\t\t\t\t. ' since they will be overwritten from Shibboleth the next time the user logs in. Note that Shibboleth data'\n\t\t\t\t\t \t. ' is always used to populate the initial user role during account creation.', 'shibboleth') ?></p>\n\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\n<?php\nelse:\n\t/**\n\t * action shibboleth_role_mapping_form\n\t * Roll your own custom Shibboleth role mapping admin UI\n\t *\n\t * @param $shib_headers array\n\t * @param $shib_roles array\n\t * @since 1.4\n\t *\n\t * Use in conjunction with shibboleth_role_mapping_override filter\n\t */\n\tdo_action( 'shibboleth_role_mapping_form', $shib_headers, $shib_roles );\nendif; // if ( form override )\n?>\n<?php break;\n\tcase 'logging' :\n\t\t$constant = false;\n\t\tlist( $shib_logging, $shib_logging_constant ) = shibboleth_getoption( 'shibboleth_logging', array(), true, true );\n\t\t$constant = $constant || $shib_logging_constant;\n\t\t?>\n\t\t<h3><?php _e('Logging Configuration', 'shibboleth') ?></h3>\n\t\t<?php if ( $constant ) { ?>\n\t\t\t<div class=\"notice notice-warning\">\n\t\t\t\t<p><?php _e( '<strong>Note:</strong> Some options below are defined in the <code>wp-config.php</code> file as constants and cannot be modified from this page.', 'shibboleth' ); ?></p>\n\t\t\t</div>\n\t\t<?php } ?>\n\t\t<table class=\"form-table\">\n\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"log_auth\"><?php _e('Log Authentication Attempts', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"log_auth\" name=\"logging[]\" value=\"auth\" <?php echo in_array( 'auth', $shib_logging ) ? ' checked=\"checked\"' : '' ?> <?php if ( defined( $shib_logging_constant ) ) { disabled( $shib_logging_constant, true, false); } ?> />\n\t\t\t\t\t\t<label for=\"log_auth\"><?php _e('Log when a user attempts to authenticate using Shibboleth.', 'shibboleth'); ?></label>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"log_account_merge\"><?php _e('Log Account Merges', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"log_account_merge\" name=\"logging[]\" value=\"account_merge\" <?php echo in_array( 'account_merge', $shib_logging ) ? ' checked=\"checked\"' : '' ?> <?php if ( defined( $shib_logging_constant ) ) { disabled( $shib_logging_constant, true, false); } ?> />\n\t\t\t\t\t\t<label for=\"log_account_merge\"><?php _e('Log when a user attempts to merge their account, either manually or automatically.', 'shibboleth'); ?></label>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"log_account_create\"><?php _e('Log Account Creation', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"log_account_create\" name=\"logging[]\" value=\"account_create\" <?php echo in_array( 'account_create', $shib_logging ) ? ' checked=\"checked\"' : '' ?> <?php if ( defined( $shib_logging_constant ) ) { disabled( $shib_logging_constant, true, false); } ?> />\n\t\t\t\t\t\t<label for=\"log_account_create\"><?php _e('Log when new accounts are created.', 'shibboleth'); ?></label>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t<th scope=\"row\"><label for=\"log_role_update\"><?php _e('Log Role Update', 'shibboleth'); ?></label></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"log_role_update\" name=\"logging[]\" value=\"role_update\" <?php echo in_array( 'role_update', $shib_logging ) ? ' checked=\"checked\"' : '' ?> <?php if ( defined( $shib_logging_constant ) ) { disabled( $shib_logging_constant, true, false); } ?> />\n\t\t\t\t\t\t<label for=\"log_role_update\"><?php _e('Log when the plugin updates a user\\'s role.', 'shibboleth'); ?></label>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t\t<?php \n\t\tbreak; }\n\n\t\t\twp_nonce_field('shibboleth_update_options') ?>\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" name=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes') ?>\" />\n\t\t\t</p>\n\t\t</form>\n\t</div>\n\n<?php\n}", "function smartchoice_user_submit_response($formanswer, $choice, $cm) {\n global $DB;\n\n $continueurl = new moodle_url('/mod/smartchoice/view.php', array('id' => $cm->id));\n\n // No answers selected.\n if (empty($formanswer)) {\n print_error('atleastoneoption', 'smartchoice', $continueurl);\n }\n\n if (is_array($formanswer)) {\n if (!$choice->allowmultiple) {\n print_error('multiplenotallowederror', 'smartchoice', $continueurl);\n }\n $formanswers = $formanswer;\n } else {\n $formanswers = array($formanswer);\n }\n\n $options = $DB->get_records('smartchoice_options', array('choiceid' => $choice->id), '', 'id');\n foreach ($formanswers as $key => $val) {\n if (!isset($options[$val])) {\n print_error('cannotsubmit', 'smartchoice', $continueurl);\n }\n }\n\n // Add new answer.\n foreach ($formanswers as $answer) {\n $newanswer = new stdClass();\n $newanswer->choiceid = $choice->id;\n $newanswer->optionid = $answer;\n $DB->insert_record('smartchoice_answers', $newanswer);\n }\n}", "public function selectLanguageFormSubmitted($form) \r\n {\r\n $values = $form->getValues();\r\n $this->redirect('this', array(\"lang\" => $values['language']));\r\n }", "public function form()\r\n {\r\n $this->switch('field_select_create', Support::trans('main.select_create'))\r\n ->default(admin_setting('field_select_create'));\r\n }", "public static abstract function postSubmit(Form $form);", "public function editpoll_submit(){\n SiteController::loggedInCheck();\n\n\t\tif (isset($_POST['Cancel'])) {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\texit();\n\t\t}\n\n\t\t$pollid = $_POST['pollid'];\n\t\t$poll = Poll::loadById($pollid);\n\n\t\t$title = $_POST['title'];\n\t\t$options = $_POST['options'];\n\t\t$timestamp = date(\"Y-m-d\", time());\n\n\t\t$poll->set('title', $title);\n\t\t$poll->set('timestamp', $timestamp);\n\t\t$poll->save();\n\n //remove old options\n $old_options = Poll::getPollOptions();\n foreach($old_options as $opt){\n $opt->delete();\n }\n\n //update options\n foreach ($options as $option){\n $poll_option = new PollOption();\n $poll_option->set('pollId', $pollid);\n $poll_option->set('poll_option', $option);\n $poll_option->save();\n }\n\n\t\theader('Location: '.BASE_URL);\n\t}", "public function processChangeOptinVal()\n {\n }", "function zoekBalkAdmin(){\n\n\tprint(\"<select name='database' class='ui search dropdown' method='POST'>\n\t\t\t <option onchange='this.form.submit()'> Zoeken in </option>\n <option value='gebruiker' method='POST' onchange='this.form.submit()'> Account gegevens </option>\n <option value='categorie' method='POST' onchange='this.form.submit()'> Categorieën </option>\n <option value='veiling' method='POST' onchange='this.form.submit()'> Veilingen </option>\n </select>\n <div class='ui input'>\n\t\t\t\t<input placeholder='Zoeken' type='text' name='zoeken' value='' method='POST'>\n\t\t\t\t<input type='submit' name='knopZoeken' method='REQUEST'>\n\t\t\t</div><br/><br/>\"); \n\nif(isset($_POST['database'])){\n $select = $_POST['database'];\n switch ($select) {\n case 'gebruiker':\n \tif(isset($_REQUEST['knopZoeken']) ) {\n \t\t$zoekinput = $_POST['zoeken'];\n \t\t $zoekresultaten = adminZoekenGebruiker($zoekinput, getAantalGebruikers());\n \t\t tabelGebruikers($zoekresultaten, getAantalGebruikers());\n \t\t }\n break;\n case 'categorie':\n\t if(isset($_REQUEST['knopZoeken']) ) {\n\t \t$zoekinput = $_POST['zoeken'];\n\t \t $zoekresultaten = adminZoekenCategorie($zoekinput, getAantalCategorieen());\n\t tabelCategorieen($zoekresultaten, getAantalCategorieen());\n\t }\n break;\n case 'veiling':\n\t if(isset($_REQUEST['knopZoeken']) ) {\n\t \t$zoekinput = $_POST['zoeken'];\n\t \t$zoekresultaten = adminZoekenVeiling($zoekinput, getAantalVeilingen());\n\t tabelVeilingen($zoekresultaten, getAantalVeilingen());\n\t }\n break;\n default :\n \tbreak;\n }\n}\n\n}", "public function processForm(ServerData $server);", "function proceed($data, $form, $request) {\n\t\treturn $this->processForm($data, $form, $request, CheckoutPage::find_link());\n\t}", "function proceed($data, $form, $request) {\n\t\treturn $this->processForm($data, $form, $request, CheckoutPage::find_link());\n\t}", "public function handleUserEntry()\n {\n $sessionClass = ReporticoSession();\n\n // First look for a parameter beginning \"submit_\". This will identify\n // What the user wanted to do.\n\n $hide_area = false;\n $show_area = false;\n $maintain_sql = false;\n $xmlsavefile = false;\n $xmldeletefile = false;\n if (($k = $this->getMatchingPostItem(\"/^submit_/\"))) {\n // Strip off \"_submit\"\n preg_match(\"/^submit_(.*)/\", $k, $match);\n\n // Now we should be left with a field element and an action\n // Lets strip the two\n $match1 = preg_split('/_/', $match[0]);\n $fld = $match1[1];\n $action = $match1[2];\n\n switch ($action) {\n case \"ADD\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->addMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"DELETE\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->deleteMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"MOVEUP\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->moveupMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"MOVEDOWN\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->movedownMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"SET\":\n // We have chosen to set a block of data so pass through Request set and see which\n // fields belong to this set and take appropriate action\n $this->updateMaintainFields($fld);\n $show_area = $fld;\n break;\n\n case \"REPORTLINK\":\n case \"REPORTLINKITEM\":\n // Link in an item from another report\n $this->linkInReportFields(\"link\", $fld, $action);\n $show_area = $fld;\n break;\n\n case \"REPORTIMPORT\":\n case \"REPORTIMPORTITEM\":\n // Link in an item from another report\n $this->linkInReportFields(\"import\", $fld, $action);\n $show_area = $fld;\n break;\n\n case \"SAVE\":\n $xmlsavefile = $this->query->xmloutfile;\n if (!$xmlsavefile) {\n trigger_error(ReporticoLang::templateXlate(\"UNABLE_TO_SAVE\") . ReporticoLang::templateXlate(\"SPECIFYXML\"), E_USER_ERROR);\n }\n\n break;\n\n case \"PREPARESAVE\":\n $xmlsavefile = $this->query->xmloutfile;\n $sessionClass::setReporticoSessionParam(\"execute_mode\", \"PREPARE\");\n\n if (!$xmlsavefile) {\n header(\"HTTP/1.0 404 Not Found\", true);\n echo '<div class=\"reportico-error-box\">' . ReporticoLang::templateXlate(\"UNABLE_TO_SAVE\") . ReporticoLang::templateXlate(\"SPECIFYXML\") . \"</div>\";\n die;\n }\n\n break;\n\n case \"DELETEREPORT\":\n $xmldeletefile = $this->query->xmloutfile;\n break;\n\n case \"HIDE\":\n $hide_area = $fld;\n break;\n\n case \"SHOW\":\n $show_area = $fld;\n break;\n\n case \"SQL\":\n $show_area = $fld;\n if ($fld == \"mainquerqury\") {\n // Main Query SQL Generation.\n $sql = stripslashes($_REQUEST[\"mainquerqury_SQL\"]);\n\n $maintain_sql = $sql;\n if (Authenticator::login()) {\n $p = new SqlParser($sql);\n if ($p->parse()) {\n $p->importIntoQuery($qr);\n if ($this->query->datasource->connect()) {\n $p->testQuery($this->query, $sql);\n }\n\n }\n }\n } else {\n // It's a lookup\n if (preg_match(\"/mainquercrit(.*)qury/\", $fld, $match1)) {\n $lookup = (int) $match1[1];\n $lookup_char = $match1[1];\n\n // Access the relevant crtieria item ..\n $qc = false;\n $ak = array_keys($this->query->lookup_queries);\n if (array_key_exists($lookup, $ak)) {\n $q = $this->query->lookup_queries[$ak[$lookup]]->lookup_query;\n } else {\n $q = new Reportico();\n }\n\n // Parse the entered SQL\n $sqlparm = $fld . \"_SQL\";\n $sql = $_REQUEST[$sqlparm];\n $q->maintain_sql = $sql;\n $q = new Reportico();\n $p = new SqlParser($sql);\n if ($p->parse()) {\n if ($p->testQuery($this->query, $sql)) {\n $p->importIntoQuery($q);\n $this->query->setCriteriaLookup($ak[$lookup], $q, \"WHAT\", \"NOW\");\n }\n }\n }\n }\n\n break;\n\n }\n }\n\n // Now work out what the maintainance screen should be showing by analysing\n // whether user pressed a SHOW button a HIDE button or keeps a maintenance item\n // show by presence of a shown value\n if (!$show_area) {\n // User has not pressed SHOW_ button - this would have been picked up in previous submit\n // So look for longest shown item - this will allow us to draw the maintenace screen with\n // the correct item maximised\n foreach ($_REQUEST as $k => $req) {\n if (preg_match(\"/^shown_(.*)/\", $k, $match)) {\n $containee = \"/^\" . $hide_area . \"/\";\n $container = $match[1];\n if (!preg_match($containee, $container)) {\n if (strlen($match[1]) > strlen($show_area)) {\n $show_area = $match[1];\n }\n }\n }\n }\n\n }\n\n if (!$show_area) {\n $show_area = \"mainquer\";\n }\n\n $xmlout = new XmlWriter($this->query);\n $xmlout->prepareXmlData();\n\n // If Save option has been used then write data to the named file and\n // use this file as the defalt input for future queries\n if ($xmlsavefile) {\n if ($this->query->allow_maintain != \"SAFE\" && $this->query->allow_maintain != \"DEMO\" && ReporticoApp::getConfig('allow_maintain')) {\n $xmlout->writeFile($xmlsavefile);\n $sessionClass::setReporticoSessionParam(\"xmlin\", $xmlsavefile);\n $sessionClass::unsetReporticoSessionParam(\"xmlintext\");\n } else {\n trigger_error(ReporticoLang::templateXlate(\"SAFENOSAVE\"), E_USER_ERROR);\n }\n\n }\n\n // If Delete Report option has been used then remove the file\n // use this file as the defalt input for future queries\n if ($xmldeletefile) {\n if ($this->query->allow_maintain != \"SAFE\" && $this->query->allow_maintain != \"DEMO\" && ReporticoApp::getConfig('allow_maintain')) {\n $xmlout->removeFile($xmldeletefile);\n $sessionClass::setReporticoSessionParam(\"xmlin\", false);\n $sessionClass::unsetReporticoSessionParam(\"xmlintext\");\n } else {\n trigger_error(ReporticoLang::templateXlate(\"SAFENODEL\"), E_USER_ERROR);\n }\n\n }\n\n $xml = $xmlout->getXmldata();\n $this->query->xmlintext = $xml;\n\n $this->query->xmlin = new XmlReader($this->query, false, $xml);\n $this->query->xmlin->show_area = $show_area;\n $this->query->maintain_sql = false;\n }", "function manage_form( ) {\n\t\t\n\t\t// Exit if user not logged in\n\t\t// TODO: MAKE THIS WORK\n/*\t\tif( ! current_user_can( 'administrator' ) ) {\n\t\t\tcpd_not_logged_in_message();\n\t\t\treturn;\n\t\t}\n*/\n\n\t\t$org = new Organisation();\n\n\t\t// Check if an Org has been selected - ie: has a number value for $_GET['id']\n\t\t// This covers resposnes both when selecting an org for editing, or for saving an org\n\t\tif( isset( $_REQUEST['id'] ) && is_int( (int) $_REQUEST['id'] ) ) {\n\t\t\t$org->load_org_details( $_REQUEST['id'] );\n\t\t}\n\n\t\t$this->display_form( $org );\n\t}", "function wp_translate_options_page() {\r\n\r\n // variables for the field and option names \r\n $opt_name = 'mt_translate_main';\r\n\t$opt_name_4 = 'mt_translate_title';\r\n $opt_name_5 = 'mt_translate_plugin_support';\r\n $hidden_field_name = 'mt_translate_submit_hidden';\r\n $data_field_name = 'mt_translate_main';\r\n\t$data_field_name_4 = 'mt_translate_title';\r\n $data_field_name_5 = 'mt_translate_plugin_support';\r\n\r\n // Read in existing option value from database\r\n $opt_val = get_option( $opt_name );\r\n\t$opt_val_4 = get_option($opt_name_4);\r\n $opt_val_5 = get_option($opt_name_5);\r\n\r\n // See if the user has posted us some information\r\n // If they did, this hidden field will be set to 'Y'\r\n if( $_POST[ $hidden_field_name ] == 'Y' ) {\r\n // Read their posted value\r\n $opt_val = $_POST[ $data_field_name ];\r\n\t\t$opt_val_4 = $_POST[$data_field_name_4];\r\n $opt_val_5 = $_POST[$data_field_name_5];\r\n\r\n // Save the posted value in the database\r\n update_option( $opt_name, $opt_val );\r\n\t\tupdate_option( $opt_name_4, $opt_val_4 );\r\n update_option( $opt_name_5, $opt_val_5 );\r\n\r\n // Put an options updated message on the screen\r\n\r\n?>\r\n<div class=\"updated\"><p><strong><?php _e('Options saved.', 'mt_trans_domain' ); ?></strong></p></div>\r\n<?php\r\n\r\n }\r\n\r\n // Now display the options editing screen\r\n\r\n echo '<div class=\"wrap\">';\r\n\r\n // header\r\n\r\n echo \"<h2>\" . __( 'WP Translate Plugin Settings', 'mt_trans_domain' ) . \"</h2>\";\r\n\n // options form\r\n \r\n\r\n $change1 = get_option(\"mt_translate_plugin_support\");\r\n\r\nif ($change1==\"Yes\" || $change1==\"\") {\r\n$change1=\"checked\";\r\n$change11=\"\";\r\n} else {\r\n$change1=\"\";\r\n$change11=\"checked\";\r\n}\r\n\r\n ?>\r\n<form name=\"form1\" method=\"post\" action=\"\">\r\n<input type=\"hidden\" name=\"<?php echo $hidden_field_name; ?>\" value=\"Y\">\r\n\r\n<p><?php _e(\"Widget Title:\", 'mt_trans_domain' ); ?> \r\n<input type=\"text\" name=\"<?php echo $data_field_name_4; ?>\" value=\"<?php echo $opt_val_4; ?>\" size=\"50\">\r\n</p><hr />\r\n\r\n<p><?php _e(\"Support the Plugin?\", 'mt_trans_domain' ); ?> \r\n<input type=\"radio\" name=\"<?php echo $data_field_name_5; ?>\" value=\"Yes\" <?php echo $change1; ?>>Yes\r\n<input type=\"radio\" name=\"<?php echo $data_field_name_5; ?>\" value=\"No\" <?php echo $change11; ?>>No\r\n</p><hr />\r\n\r\n<p class=\"submit\">\r\n<input type=\"submit\" name=\"Submit\" value=\"<?php _e('Update Options', 'mt_trans_domain' ) ?>\" />\r\n</p><hr />\r\n\r\n</form>\r\n</div>\r\n<?php\r\n \r\n}", "public function Handler() {\n\t\tif(isset($_POST['doAdd']) && empty($_POST['email'])) {\n\t\t $this->guestbookModel->Add(strip_tags($_POST['newEntry']));\n\t\t}\n\t\telseif(isset($_POST['doClear'])) {\n\t\t $this->guestbookModel->DeleteAll();\n\t\t}\n\t\telseif(isset($_POST['doCreate'])) {\n\t\t $this->guestbookModel->Init();\n\t\t} \n\t\t$this->RedirectTo($this->request->CreateUrl($this->request->controller));\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 }", "function worldlogger_options() {\n\t $opt_name = 'worldlogger_hash';\n\t $hidden_field_name = 'mt_submit_hidden';\n\t $data_field_name = 'worldlogger_hash';\n\n\t // Read in existing option value from database\n\t $opt_val = get_option( $opt_name );\n\n\t // See if the user has posted us some information\n\t // If they did, this hidden field will be set to 'Y'\n\t if( $_POST[ $hidden_field_name ] == 'Y' ) {\n\t // Read their posted value\n\t $opt_val = $_POST[ $data_field_name ];\n\t // Save the posted value in the database\n\t update_option( $opt_name, $opt_val );\n\n\t // Put an options updated message on the screen\n\n\t?>\n\t<div class=\"updated\"><p><strong><?php _e('Options saved.', 'mt_trans_domain' ); ?></strong></p></div>\n\t<?php } ?>\n\t<div class=\"wrap\">\n\t<h2><?= __( 'Worldlogger Options', 'worldlogger_domain' ) ?></h2>\n\tTo install Worldlogger, please create an account at <a href=\"http://www.worldlogger.com/signup\">worldlogger.com</a> and copy the hash in the \"Settings\" page of a website.\n\t<form name=\"form1\" method=\"post\" action=\"\">\n\t\t<table class=\"form-table\"> \n\t\t<tr valign=\"top\"> \n\t\t<th scope=\"row\"><label for=\"blogname\">Worldlogger Hash</label></th> \n\t\t<td><input type=\"text\" name=\"<?php echo $data_field_name; ?>\" value=\"<?php echo $opt_val; ?>\" size=\"40\"></td> \n\t\t</tr> \n\t\t</table>\n\t\t<input type=\"hidden\" name=\"<?php echo $hidden_field_name; ?>\" value=\"Y\">\n\t\t<p class=\"submit\"> \n\t\t<input type=\"submit\" name=\"Submit\" class=\"button-primary\" value=\"Save Changes\" /> \n\t\t</p>\n\t</form>\n\t</div>\n\n\t<?php\n\n}", "protected function _handle_forms()\n\t{\n\t\tif (!strlen($this->_form_posted)) return;\n\t\t$method = 'on_'.$this->_form_posted.'_submit';\n\n\t\tif (method_exists($this, $method))\n\t\t{\n\t\t\tcall_user_func(array($this, $method), $this->_form_action);\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ($this->controls as $k=>$v)\n\t\t{\n\t\t\t$ctl = $this->controls[$k];\n\n\t\t\tif (method_exists($ctl, $method))\n\t\t\t{\n\t\t\t\t$ctl->page = $this;\n\t\t\t\tcall_user_func(array($ctl, $method), $this->_form_action);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (DEBUG) dwrite(\"Method '$method' not defined\");\n\t}", "public function onSubmit();", "function bp_custom_notifications_sort_order_form() {\n\n \t// Setup local variables.\n \t$orders = array( 'DESC', 'ASC' );\n \t$selected = 'DESC';\n\n \t// Check for a custom sort_order.\n \tif ( !empty( $_REQUEST['sort_order'] ) ) {\n \t\tif ( in_array( $_REQUEST['sort_order'], $orders ) ) {\n \t\t\t$selected = $_REQUEST['sort_order'];\n \t\t}\n \t} ?>\n\n \t<form action=\"\" method=\"get\" id=\"notifications-sort-order\">\n\n \t\t<select id=\"notifications-sort-order-list\" name=\"sort_order\" onchange=\"this.form.submit();\">\n \t\t\t<option value=\"DESC\" <?php selected( $selected, 'DESC' ); ?>><?php _e( 'Newest First', 'zola' ); ?></option>\n \t\t\t<option value=\"ASC\" <?php selected( $selected, 'ASC' ); ?>><?php _e( 'Oldest First', 'zola' ); ?></option>\n \t\t</select>\n\n \t\t<noscript>\n \t\t\t<input id=\"submit\" type=\"submit\" name=\"form-submit\" class=\"submit\" value=\"<?php esc_attr_e( 'Go', 'zola' ); ?>\" />\n \t\t</noscript>\n \t</form>\n\n <?php\n }", "public function formHandler()\n {\n $_SESSION['title'] = \"Caiman: Dashboard\";\n $this->allowAccessTo(array(1, 3));\n\n $oldPassword = null;\n $newPasswordRepeat = null;\n $newPassword = null;\n\n if (isset($_GET['e'])) {\n $this->e = filter_input(INPUT_GET, 'e', FILTER_SANITIZE_SPECIAL_CHARS);\n }\n // form update\n if ($this->e == \"updatePassword\") {\n $_SESSION['title'] = \"Caiman: Update password\";\n if (isset($_POST['oldPassword'])) {\n $oldPassword = filter_input(INPUT_POST, 'oldPassword', FILTER_SANITIZE_STRING);\n }\n if (isset($_POST['newPassword'])) {\n $newPassword = filter_input(INPUT_POST, 'newPassword', FILTER_SANITIZE_STRING);\n }\n if (isset($_POST['newPasswordRepeat'])) {\n $newPasswordRepeat = filter_input(INPUT_POST, 'newPasswordRepeat', FILTER_SANITIZE_STRING);\n }\n\n if (isset($oldPassword) && isset($newPassword) && isset($newPasswordRepeat)) {\n $_SESSION['user']->updatePassword($newPassword, $newPasswordRepeat, $oldPassword);\n }\n }\n\n // update if account if visible or not\n if ($this->e == \"updatePrivateAccount\") {\n\n if ($_SESSION['user']->idUser != -1) {\n $_SESSION['user']->updatePrivateAccount();\n header('Location:' . $_SERVER['HTTP_REFERER']);\n }\n }\n }", "protected function handleFormAction(): void\n {\n $action = $_REQUEST['action'] ?? null;\n $editableColumns = $this->editableColumns();\n\n $isFormAction = in_array($action, ['edit', 'create']);\n $isAdmin = current_user_can('manage_options');\n $shouldSkip = 'GET' === $_SERVER['REQUEST_METHOD']\n || empty($_POST)\n || is_null($action);\n\n if ($shouldSkip || !$isFormAction || !$isAdmin) {\n return;\n }\n\n try {\n $this->validateEditableColumns($editableColumns, $_POST);\n } catch (\\Throwable $e) {\n $this->displayResourceNotice($e->getMessage());\n return;\n }\n\n $primaryKey = $this->newModel()->getPrimaryColumn();\n preg_match('/\\w+/', $_POST[$primaryKey] ?? '', $matches);\n\n $resourceId = $matches[0] ?? '';\n $values = $this->filterGuardedAttributes($editableColumns, $_POST);\n\n $model = !strlen($resourceId)\n ? $this->newModel()\n : $this->model::find($resourceId);\n\n $model->fill($values);\n $model->saveOrUpdate();\n\n $this->displayResourceNotice('Resource was updated', 'success');\n\n // to display the edit page after creating new resources\n if ($action === 'create') {\n $this->model = $model;\n }\n }", "function pickup_submit()\n\t{\n\t\t$name = '_f_'.$this->name;\n\t\t$this->value = $GLOBALS[$name];\n\t}", "function parse_submit()\n\t\t{\n\t\t\t//inside the select box for submits\n\t\t\t$this->t->set_block('run_activity', 'block_submit_options', 'submit_options');\n\t\t\t//the select submit box\n\t\t\t$this->t->set_block('run_activity', 'block_submit_select_area', 'submit_select_area');\n\t\t\t//submit as buttons\n\t\t\t$this->t->set_block('run_activity', 'block_submit_buttons_area', 'submit_buttons_area');\n\t\t\t//the whole zone\n\t\t\t$this->t->set_block('run_activity', 'block_submit_zone', 'submit_zone');\n\t\t\t\n\t\t\tif (!($this->conf['use_automatic_parsing'])) \n\t\t\t{\n\t\t\t\t// the user decided he'll do it his own way\n\t\t\t\t//empty the whole zone\n\t\t\t\t$this->t->set_var(array('submit_zone' => ''));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$buttons = '';\n\t\t\t\tif (count($this->submit_array)==0)\n\t\t\t\t{\n\t\t\t\t\t//the user didn't give us any instruction\n\t\t\t\t\t// we draw a simple submit button\n\t\t\t\t\t$this->t->set_var(array('submit_area',''));\n\t\t\t\t\t$buttons .= '<td class=\"wf_submit_buttons_button\">';\n\t\t\t\t\t$buttons .= '<input name=\"wf_submit\" type=\"submit\" value=\"'.lang('Submit').'\"/>';\n\t\t\t\t\t$buttons .= '</td>';\n\t\t\t\t\t//set the buttons\n\t\t\t\t\t$this->t->set_var(array('submit_buttons' => $buttons));\n\t\t\t\t\t// hide the select box zone\n\t\t\t\t\t$this->t->set_var(array('submit_select_area'=> ''));\n\t\t\t\t\t//show the buttons zone\n\t\t\t\t\t$this->t->parse('submit_buttons_area', 'block_submit_buttons_area', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//now we have another user choice. he can choose multiple submit buttons\n\t\t\t\t\t//or a select with only one submit\n\t\t\t\t\tif ( ($this->conf['show_multiple_submit_as_select']) && (count($this->submit_array) > 1) )\n\t\t\t\t\t{\n\t\t\t\t\t\t//multiple submits in a select box\n\t\t\t\t\t\t//handling the select box \n\t\t\t\t\t\tforeach ($this->submit_array as $submit_button_name => $submit_button_value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->t->set_var(array(\n\t\t\t\t\t\t\t\t'submit_option_value'\t=> $submit_button_value,\n\t\t\t\t\t\t\t\t'submit_option_name'\t=> $submit_button_name,\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t//show the select box\n\t\t\t\t\t\t\t$this->t->parse('submit_options','block_submit_options',true);\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\t//we need at least one submit button\n\t\t\t\t\t\t$this->t->set_var(array(\n\t\t\t\t\t\t\t'submit_button_name'\t=> 'wf_submit',\n\t\t\t\t\t\t\t'submit_button_value'\t=> lang('submit'),\n\t\t\t\t\t\t));\n\t\t\t\t\t\t// hide the multiple buttons zone\n\t\t\t\t\t\t$this->t->set_var(array('submit_buttons_area'=> ''));\n\t\t\t\t\t\t//show the select box zone\n\t\t\t\t\t\t$this->t->parse('submit_select_area', 'block_submit_select_area', true);\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//multiple buttons with no select box or just one\n\t\t\t\t\t\t//draw input button for each entry\n\t\t\t\t\t\tforeach ($this->submit_array as $submit_button_name => $submit_button_value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//now we can have some special options, like jscode\n\t\t\t\t\t\t\tif (is_array($submit_button_value))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$button_val = $submit_button_value['label'];\n\t\t\t\t\t\t\t\t$confirm = $submit_button_value['confirm'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$button_val = $submit_button_value;\n\t\t\t\t\t\t\t\t$confirm = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t \t$buttons .= '<td class=\"wf_submit_buttons_button\">';\n\t\t\t\t\t\t\t$buttons .= '<input name=\"'.$submit_button_name.'\" type=\"submit\" value=\"'.$button_val.'\" ';\n\t\t\t\t\t\t\tif (!!($confirm))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$buttons .= 'onClick=\"return confirmSubmit(\\''.$submit_button_name.'\\',\\''.$confirm.'\\')\"/>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$buttons .= '/>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$buttons .= '</td>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//set the buttons\n\t\t\t\t\t\t$this->t->set_var(array('submit_buttons' => $buttons));\n\t\t\t\t\t\t// hide the select box zone\n\t\t\t\t\t\t$this->t->set_var(array('submit_select_area'=> ''));\n\t\t\t\t\t\t//show the buttons zone\n\t\t\t\t\t\t$this->t->parse('submit_buttons_area', 'block_submit_buttons_area', true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//show the whole submit zone\n\t\t\t\t$this->t->parse('submit_zone', 'block_submit_zone', true);\n\t\t\t}\n\t\t}", "function submit()\n {\n\t\t//all data is handled by submit2()\n }", "function openlayers_component_form_options_submit($form, &$form_state) {\n if (isset($form_state['values']['options'])) {\n $form_state['item']->options = array_merge((array) $form_state['item']->options, (array) $form_state['values']['options']);\n }\n\n if (isset($form_state['item']->attachToMap)) {\n $map = ctools_export_crud_load('openlayers_maps', $form_state['item']->attachToMap);\n $map->options['components'][] = $form_state['item']->machine_name;\n ctools_export_crud_save('openlayers_maps', $map);\n unset($form_state['item']->attachToMap);\n }\n\n $component = openlayers_object_load('Component', $form_state['item']);\n $component->optionsFormSubmit($form, $form_state);\n}", "function wpsc_merchant_paymentsense_settings_form_submit() {\r\n\treturn wpsc_merchant_paymentsense::submit_paymentsense_settings_form();\r\n}", "public function action() {\r\n parent::action();\r\n switch (SQ_Classes_Tools::getValue('action')) {\r\n case 'sq_settingsseo_option':\r\n SQ_Classes_Tools::setHeader('json');\r\n\r\n if (!current_user_can('manage_options')) {\r\n echo json_encode(array('error' => __(\"You don't have enough pemission to activate this feature\", _SQ_PLUGIN_NAME_)));\r\n exit();\r\n }\r\n\r\n $option = SQ_Classes_Tools::getValue('option');\r\n $value = (int)SQ_Classes_Tools::getValue('value');\r\n SQ_Classes_Tools::saveOptions($option, $value);\r\n\r\n echo json_encode(array('saved' => true));\r\n exit();\r\n case 'sq_settingsseo_update':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n if (!SQ_Classes_Tools::getIsset('sq_use')) {\r\n return;\r\n }\r\n SQ_Classes_Tools::saveOptions('sq_use', (int)SQ_Classes_Tools::getValue('sq_use'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_title', (int)SQ_Classes_Tools::getValue('sq_auto_title'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_description', (int)SQ_Classes_Tools::getValue('sq_auto_description'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_keywords', (int)SQ_Classes_Tools::getValue('sq_auto_keywords'));\r\n SQ_Classes_Tools::saveOptions('sq_keywordtag', (int)SQ_Classes_Tools::getValue('sq_keywordtag'));\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_canonical', (int)SQ_Classes_Tools::getValue('sq_auto_canonical'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_noindex', (int)SQ_Classes_Tools::getValue('sq_auto_noindex'));\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_amp', (int)SQ_Classes_Tools::getValue('sq_auto_amp'));\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_meta', (int)SQ_Classes_Tools::getValue('sq_auto_meta'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_favicon', (int)SQ_Classes_Tools::getValue('sq_auto_favicon'));\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////SOCIAL OPTION\r\n SQ_Classes_Tools::saveOptions('sq_auto_facebook', (int)SQ_Classes_Tools::getValue('sq_auto_facebook'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_twitter', (int)SQ_Classes_Tools::getValue('sq_auto_twitter'));\r\n SQ_Classes_Tools::saveOptions('sq_og_locale', SQ_Classes_Tools::getValue('sq_og_locale'));\r\n\r\n $socials = array_merge(SQ_Classes_Tools::getOption('socials'), SQ_Classes_Tools::getValue('sq_socials', array()));\r\n\r\n if (isset($socials['twitter_site'])) $socials['twitter_site'] = $this->model->checkTwitterAccount($socials['twitter_site']);\r\n if (isset($socials['twitter_site'])) $socials['twitter'] = $this->model->checkTwitterAccountName($socials['twitter_site']);\r\n if (isset($socials['facebook_site'])) $socials['facebook_site'] = $this->model->checkFacebookAccount($socials['facebook_site']);\r\n if (isset($socials['google_plus_url'])) $socials['google_plus_url'] = $this->model->checkGoogleAccount($socials['google_plus_url']);\r\n if (isset($socials['pinterest_url'])) $socials['pinterest_url'] = $this->model->checkPinterestAccount($socials['pinterest_url']);\r\n if (isset($socials['instagram_url'])) $socials['instagram_url'] = $this->model->checkInstagramAccount($socials['instagram_url']);\r\n if (isset($socials['linkedin_url'])) $socials['linkedin_url'] = $this->model->checkLinkeinAccount($socials['linkedin_url']);\r\n if (isset($socials['myspace_url'])) $socials['myspace_url'] = $this->model->checkMySpaceAccount($socials['myspace_url']);\r\n if (isset($socials['youtube_url'])) $socials['youtube_url'] = $this->model->checkYoutubeAccount($socials['youtube_url']);\r\n\r\n $fb_admins = SQ_Classes_Tools::getValue('sq_fb_admins', array());\r\n $socials['fb_admins'] = array();\r\n if (!empty($fb_admins)) {\r\n $fb_admins = array_unique($fb_admins);\r\n foreach ($fb_admins as $index => $value) {\r\n if (isset($value) && $value == '') {\r\n unset($socials['fb_admins'][$index]);\r\n } else {\r\n $socials['fb_admins'][$index]['id'] = $this->model->checkFavebookAdminCode($value);\r\n }\r\n }\r\n }\r\n\r\n //get the facebook app id for sharing\r\n if (SQ_Classes_Tools::getIsset('sq_fbadminapp')) $socials['fbadminapp'] = SQ_Classes_Tools::getValue('sq_fbadminapp');\r\n if (SQ_Classes_Tools::getIsset('twitter_card_type')) $socials['twitter_card_type'] = SQ_Classes_Tools::getValue('twitter_card_type');\r\n\r\n\r\n SQ_Classes_Tools::saveOptions(\"socials\", $socials);\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////FIRST PAGE OPTIMIZATION\r\n if ($pageId = get_option('page_on_front')) {\r\n $sq_hash = md5($pageId);\r\n } elseif ($post_id = get_option('page_for_posts')) {\r\n $sq_hash = md5($pageId);\r\n } else {\r\n $sq_hash = md5('wp_homepage');\r\n }\r\n\r\n if ($sq_hash <> '') {\r\n $url = home_url();\r\n $sq = SQ_Classes_ObjController::getClass('SQ_Models_Frontend')->getSqSeo($sq_hash);\r\n\r\n $sq->doseo = 1;\r\n $sq->title = urldecode(SQ_Classes_Tools::getValue('sq_fp_title', false));\r\n $sq->description = urldecode(SQ_Classes_Tools::getValue('sq_fp_description', false));\r\n $sq->keywords = SQ_Classes_Tools::getValue('sq_fp_keywords', false);\r\n $sq->og_media = SQ_Classes_Tools::getValue('sq_fp_ogimage', false);\r\n\r\n $this->model->db_insert(\r\n $url,\r\n $sq_hash,\r\n (int)$pageId,\r\n maybe_serialize($sq->toArray()),\r\n gmdate('Y-m-d H:i:s')\r\n );\r\n }\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////SITEMAP OPTION\r\n SQ_Classes_Tools::saveOptions('sq_auto_sitemap', (int)SQ_Classes_Tools::getValue('sq_auto_sitemap'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_feed', (int)SQ_Classes_Tools::getValue('sq_auto_feed'));\r\n SQ_Classes_Tools::saveOptions('sq_sitemap_frequency', SQ_Classes_Tools::getValue('sq_sitemap_frequency'));\r\n SQ_Classes_Tools::saveOptions('sq_sitemap_ping', (int)SQ_Classes_Tools::getValue('sq_sitemap_ping'));\r\n SQ_Classes_Tools::saveOptions('sq_sitemap_perpage', (int)SQ_Classes_Tools::getValue('sq_sitemap_perpage'));\r\n\r\n\r\n foreach (SQ_Classes_Tools::$options['sq_sitemap'] as $key => $value) {\r\n if ($key == 'sitemap') {\r\n continue;\r\n }\r\n SQ_Classes_Tools::$options['sq_sitemap'][$key][1] = 0;\r\n if ($key == 'sitemap-product' && !$this->model->isEcommerce()) {\r\n SQ_Classes_Tools::$options['sq_sitemap'][$key][1] = 2;\r\n }\r\n }\r\n if (SQ_Classes_Tools::getIsset('sq_sitemap')) {\r\n foreach (SQ_Classes_Tools::getValue('sq_sitemap') as $key) {\r\n if (isset(SQ_Classes_Tools::$options['sq_sitemap'][$key][1])) {\r\n SQ_Classes_Tools::$options['sq_sitemap'][$key][1] = 1;\r\n }\r\n }\r\n }\r\n\r\n foreach (SQ_Classes_Tools::$options['sq_sitemap_show'] as $key => $value) {\r\n SQ_Classes_Tools::$options['sq_sitemap_show'][$key] = 0;\r\n }\r\n if (SQ_Classes_Tools::getIsset('sq_sitemap_show')) {\r\n foreach (SQ_Classes_Tools::getValue('sq_sitemap_show') as $key) {\r\n if (isset(SQ_Classes_Tools::$options['sq_sitemap_show'][$key])) {\r\n SQ_Classes_Tools::$options['sq_sitemap_show'][$key] = 1;\r\n }\r\n }\r\n }\r\n\r\n ///////////////////////////////////////////\r\n ///////SAVE THE CODE\r\n $codes = array_merge(SQ_Classes_Tools::getOption('codes'), SQ_Classes_Tools::getValue('sq_codes', array()));\r\n\r\n if (!empty($codes)) {\r\n //if (isset($codes['facebook_pixel'])) $codes['facebook_pixel'] = $codes['facebook_pixel'];\r\n if (isset($codes['google_analytics'])) $codes['google_analytics'] = $this->model->checkGoogleAnalyticsCode($codes['google_analytics']);\r\n if (isset($codes['pinterest_verify'])) $codes['pinterest_verify'] = $this->model->checkPinterestCode($codes['pinterest_verify']);\r\n if (isset($codes['google_wt'])) $codes['google_wt'] = $this->model->checkGoogleWTCode($codes['google_wt']);\r\n if (isset($codes['bing_wt'])) $codes['bing_wt'] = $this->model->checkBingWTCode($codes['bing_wt']);\r\n if (isset($codes['alexa_verify'])) $codes['alexa_verify'] = $this->model->checkBingWTCode($codes['alexa_verify']);\r\n\r\n SQ_Classes_Tools::saveOptions(\"codes\", $codes);\r\n }\r\n\r\n\r\n ///////////////////////////////////////////JSONLD\r\n SQ_Classes_Tools::saveOptions('sq_auto_jsonld', (int)SQ_Classes_Tools::getValue('sq_auto_jsonld'));\r\n if (SQ_Classes_Tools::getIsset('sq_jsonld_type') && isset(SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')])) {\r\n\r\n foreach (SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')] as $key => $value) {\r\n if (isset(SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')][$key])) {\r\n SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')][$key] = SQ_Classes_Tools::getValue('sq_jsonld_' . $key);\r\n }\r\n }\r\n if (isset(SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone']) &&\r\n SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone'] <> ''\r\n ) {\r\n SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone'] = '+' . SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone'];\r\n }\r\n }\r\n SQ_Classes_Tools::saveOptions('sq_jsonld_type', SQ_Classes_Tools::getValue('sq_jsonld_type'));\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////FAVICON OPTION\r\n\r\n /* if there is an icon to upload */\r\n if (!empty($_FILES['favicon'])) {\r\n\r\n $return = $this->model->addFavicon($_FILES['favicon']);\r\n if ($return['favicon'] <> '') {\r\n SQ_Classes_Tools::saveOptions('favicon', strtolower(basename($return['favicon'])));\r\n }\r\n if ($return['message'] <> '') {\r\n define('SQ_MESSAGE_FAVICON', $return['message']);\r\n SQ_Classes_Error::setError(SQ_MESSAGE_FAVICON . \" <br /> \");\r\n }\r\n }\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n if (SQ_Classes_Tools::isAjax()) {\r\n SQ_Classes_Tools::setHeader('json');\r\n echo json_encode(array('saved' => true));\r\n exit();\r\n } else {\r\n //Update the rewrite rules with the new options\r\n add_filter('rewrite_rules_array', array($this, 'rewrite_rules'), 999, 1);\r\n //Flush the rewrite with the new favicon and sitemap\r\n flush_rewrite_rules();\r\n //empty the cache on settings changed\r\n SQ_Classes_Tools::emptyCache();\r\n\r\n }\r\n break;\r\n case 'sq_setstickysla':\r\n SQ_Classes_Tools::saveUserMeta('sq_auto_sticky', (int)SQ_Classes_Tools::getValue('sq_auto_sticky'));\r\n\r\n break;\r\n case 'sq_checkissues':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_checkedissues', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n /* Load the error class */\r\n SQ_Classes_Tools::checkErrorSettings();\r\n\r\n break;\r\n case 'sq_fixautoseo':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_use', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fixprivate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n update_option('blog_public', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fixcomments':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n update_option('comments_notify', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fixpermalink':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n $GLOBALS['wp_rewrite'] = new WP_Rewrite();\r\n global $wp_rewrite;\r\n $permalink_structure = ((get_option('permalink_structure') <> '') ? get_option('permalink_structure') : '/') . \"%postname%/\";\r\n $wp_rewrite->set_permalink_structure($permalink_structure);\r\n $permalink_structure = get_option('permalink_structure');\r\n\r\n flush_rewrite_rules();\r\n break;\r\n case 'sq_fix_ogduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_facebook', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fix_tcduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_twitter', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fix_titleduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_title', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fix_descduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_description', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_active_help' :\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('active_help', SQ_Classes_Tools::getValue('active_help'));\r\n break;\r\n case 'sq_warnings_off':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('ignore_warn', 1);\r\n break;\r\n case 'sq_copyright_agreement':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_copyright_agreement', 1);\r\n break;\r\n case 'sq_get_snippet':\r\n\r\n if (SQ_Classes_Tools::getValue('url') <> '') {\r\n $url = SQ_Classes_Tools::getValue('url');\r\n } else {\r\n $url = get_bloginfo('url');\r\n }\r\n $snippet = SQ_Classes_Tools::getSnippet($url);\r\n\r\n SQ_Classes_Tools::setHeader('json');\r\n echo json_encode($snippet);\r\n exit();\r\n case 'sq_backup':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::setHeader('text');\r\n header(\"Content-Disposition: attachment; filename=squirrly-settings-\" . gmdate('Y-m-d') . \".txt\");\r\n\r\n if (function_exists('base64_encode')) {\r\n echo base64_encode(json_encode(SQ_Classes_Tools::$options));\r\n } else {\r\n echo json_encode(SQ_Classes_Tools::$options);\r\n }\r\n exit();\r\n break;\r\n case 'sq_restore':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n if (!empty($_FILES['sq_options']) && $_FILES['sq_options']['tmp_name'] <> '') {\r\n $fp = fopen($_FILES['sq_options']['tmp_name'], 'rb');\r\n $options = '';\r\n while (($line = fgets($fp)) !== false) {\r\n $options .= $line;\r\n }\r\n try {\r\n if (function_exists('base64_encode') && base64_decode($options) <> '') {\r\n $options = @base64_decode($options);\r\n }\r\n $options = json_decode($options, true);\r\n if (is_array($options) && isset($options['sq_api'])) {\r\n if (SQ_Classes_Tools::getOption('sq_api') <> '') {\r\n $options['sq_api'] = SQ_Classes_Tools::getOption('sq_api');\r\n }\r\n SQ_Classes_Tools::$options = $options;\r\n SQ_Classes_Tools::saveOptions();\r\n\r\n //Check if there is an old backup from Squirrly\r\n SQ_Classes_Tools::getOptions();\r\n SQ_Classes_Tools::checkUpgrade();\r\n\r\n //Update the rewrite rules with the new options\r\n add_filter('rewrite_rules_array', array($this, 'rewrite_rules'), 999, 1);\r\n //Flush the rewrite with the new favicon and sitemap\r\n flush_rewrite_rules();\r\n\r\n SQ_Classes_Error::setError(__('Great! The backup is restored.', _SQ_PLUGIN_NAME_) . \" <br /> \", 'success');\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } catch (Exception $e) {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! You have to enter a previous saved backup file.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n break;\r\n case 'sq_backup_sql':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n header('Content-Type: application/octet-stream');\r\n header(\"Content-Transfer-Encoding: Binary\");\r\n header(\"Content-Disposition: attachment; filename=squirrly-seo-\" . gmdate('Y-m-d') . \".sql\");\r\n\r\n if (function_exists('base64_encode')) {\r\n echo base64_encode($this->model->createTableBackup());\r\n } else {\r\n echo $this->model->createTableBackup();\r\n }\r\n exit();\r\n break;\r\n case 'sq_restore_sql':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n if (!empty($_FILES['sq_sql']) && $_FILES['sq_sql']['tmp_name'] <> '') {\r\n $fp = fopen($_FILES['sq_sql']['tmp_name'], 'rb');\r\n $sql_file = '';\r\n while (($line = fgets($fp)) !== false) {\r\n $sql_file .= $line;\r\n }\r\n\r\n if (function_exists('base64_encode')) {\r\n $sql_file = @base64_decode($sql_file);\r\n }\r\n\r\n if ($sql_file <> '' && strpos($sql_file, 'CREATE TABLE IF NOT EXISTS') !== false) {\r\n try {\r\n $queries = explode(\";\\n\", $sql_file);\r\n $this->model->executeSql($queries);\r\n SQ_Classes_Error::setError(__('Great! The SEO backup is restored.', _SQ_PLUGIN_NAME_) . \" <br /> \", 'success');\r\n\r\n } catch (Exception $e) {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! You have to enter a previous saved backup file.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n break;\r\n case 'sq_dataupgrade':\r\n //Check if there is an old backup from Squirrly\r\n SQ_Classes_Tools::getOptions();\r\n SQ_Classes_Tools::checkUpgrade();\r\n SQ_Classes_Error::setError(__('Great! Squirrly Data Settings is up to date now.', _SQ_PLUGIN_NAME_) . \" <br /> \", 'success');\r\n\r\n break;\r\n case 'sq_resetsettings':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::$options = SQ_Classes_Tools::getOptions('reset');\r\n SQ_Classes_Tools::saveOptions();\r\n break;\r\n }\r\n }", "function submit() {\n\t\t\n\t\t//print_r($_POST);\n\t\t//die();\n\n\n \tglobal $searchArgList;\n \t\n \tif($this->input->post('searchQuery')) { // this is a quick search\n\n \t\tredirect(\"/search/quickSearch/\".$this->input->post('searchQuery'));\n \t\n \t\n \t} else if($this->input->post('opmid')) { // redirect to OPM ID\n\n \t\t\n \t\tredirect(\"/products/view/\".$this->input->post('opmid'));\n \t\n \t\n \t} else {\n \t \t\n \n\t\t\tforeach ($searchArgList as $key=>$data) {\n\t\t\t\t\n\t\t\t\tif ($this->input->post($data))\n\t\t\t\t\t$segments[$data] = $this->input->post($data);\n\t\t\t\telse\n\t\t\t\t\t$segments[$data] = 0;\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->input->post('isWholesaleSearch')) {\n\t\t\t\n\t\t\t\t$url = \"/search/doWSSearch/\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$url = \"/search/doSearch/\";\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tforeach ($segments as $data)\n\t\t\t\t$url .= $data . \"/\";\n\t\t\t\t\n\t\t\t\n\t\t\tredirect($url);\n\t\t\t\n\t\t}\n \n }", "function submit($data, $form, $request) {\n\t\treturn $this->processForm($data, $form, $request, \"\");\n\t}", "function submit($data, $form, $request) {\n\t\treturn $this->processForm($data, $form, $request, \"\");\n\t}", "function envision_wsclient_pane_checkout_form_submit($form, &$form_state, $checkout_pane, $order) {\n\n}", "public function mappingFormSubmit(array &$form, FormStateInterface $form_state);", "function form_request(){\n\t$form = \"\";\n\tif(isset($_REQUEST[\"service\"])){\n\t\t$form = $_REQUEST[\"service\"];\n\t}\n\n\tswitch ($form) {\n\t\t\tcase 'Electricity':\n\t\t\t\tdo_disco_input_form(\"id\", \"service\", \"add_disco\", \"Add\");\n\t\t\t\tbreak;\n\t\t\tcase 'Networks':\n\t\t\t\tdo_network_input_form(\"id\", \"service\", \"add_network\", \"Add\");\n\t\t\t\tbreak;\n\t\t\tcase 'Tvs':\n\t\t\t\tdo_tv_input_form(\"id\", \"service\", \"add_tv\", \"Add\");\n\t\t\t\tbreak;\n\t\t\tcase 'Flights':\n\t\t\t\tdo_flight_input_form(\"id\", \"service\", \"add_airline\", \"Add\");\n\t\t\t\tbreak;\n\t\t\tcase 'Events':\n\t\t\t\tdo_event_input_form(\"id\", \"service\", \"add_events\", \"Add\");\n\t\t\t\tbreak;\n\t\t\tcase \"Movies\":\n\t\t\t\tdo_movie_input_form(\"id\", \"service\", \"add_movie\", \"Add\");\n\t\t\t\tbreak;\n\t\t\tcase 'Education':\n\t\t\t\tdo_education_input_form(\"id\", \"service\", \"add_school\", \"Add\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tpage();\n\t\t\t\tbreak;\n\t}\n}", "public function custom_option_import_code() {\n\t\t$option_name = Fusion_Settings::get_option_name();\n\t\t$nonce_name = 'fusionredux_ajax_nonce' . $option_name;\n\t\tif ( ! isset( $_REQUEST['security'] ) || ! wp_verify_nonce( wp_unslash( $_REQUEST['security'] ), $nonce_name ) ) { // phpcs:ignore WordPress.Security\n\t\t\techo wp_json_encode(\n\t\t\t\t[\n\t\t\t\t\t'status' => 'failed',\n\t\t\t\t\t'action' => 'reload',\n\t\t\t\t]\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\tif ( isset( $_POST['data'] ) && ! empty( $_POST['data'] ) ) {\n\t\t\t$values = [];\n\t\t\t$fusionredux = FusionReduxFrameworkInstances::get_instance( $option_name );\n\n\t\t\t$values = $fusionredux->fields;\n\t\t\t$values = wp_parse_args(\n\t\t\t\tget_option( $option_name ),\n\t\t\t\t$values\n\t\t\t);\n\n\t\t\tif ( isset( $_POST['data']['import_code'] ) && '' !== $_POST['data']['import_code'] ) {\n\t\t\t\t$import_code = stripslashes( $_POST['data']['import_code'] ); // phpcs:ignore WordPress.Security\n\t\t\t\t$values['import_code'] = $import_code;\n\t\t\t} elseif ( isset( $_POST['data']['import_link'] ) && '' !== $_POST['data']['import_link'] ) {\n\t\t\t\t$values['import_link'] = $_POST['data']['import_link']; // phpcs:ignore WordPress.Security\n\t\t\t} else {\n\t\t\t\techo wp_json_encode(\n\t\t\t\t\t[\n\t\t\t\t\t\t'status' => 'failed',\n\t\t\t\t\t\t'action' => 'reload',\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\tif ( isset( $fusionredux->validation_ran ) ) {\n\t\t\t\tunset( $fusionredux->validation_ran );\n\t\t\t}\n\n\t\t\t$fusionredux->set_options( $fusionredux->_validate_options( $values ) );\n\n\t\t\techo wp_json_encode(\n\t\t\t\t[\n\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t'action' => 'reload',\n\t\t\t\t]\n\t\t\t);\n\t\t} else {\n\t\t\techo wp_json_encode(\n\t\t\t\t[\n\t\t\t\t\t'status' => 'failed',\n\t\t\t\t\t'action' => 'reload',\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t\tdie();\n\t}", "function receive() {\n // Input type 1.\n if ($this->method == 'POST' && isset($_POST[$this->id . '-form_id']) && $_POST[$this->id . '-form_id'] == $this->id) {\n $this->request['raw_input'] = $_POST;\n }\n // Input types 2 and 3.\n else {\n $this->request['raw_input'] = $_GET;\n }\n }", "public function populateForm() {}", "function formulize_save_postdata($post_id) {\n\t//verify if this is an auto save routine \n\t//If our form hasn't been submitted we don't want to do anything\n\t if (defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n return;\n\n // if our nonce isn't there, or we can't verify it, bail \n if (!isset($_POST['formulize_nonce']) \n \t|| !wp_verify_nonce($_POST['formulize_nonce'], 'my_formulize_nonce' )) return; \n \n // now we can actually save the data \n $allowed = array( \n 'a' => array( // on allow a tags \n 'href' => array() // and those anchors can only have href attribute \n ) \n ); \n \n if (isset( $_POST['formulize_select'])) \n update_post_meta($post_id, 'formulize_select', esc_attr( $_POST['formulize_select'])); \n}", "function options_form() {\n return array(\n );\n }", "function category_browsing_options_form()\r\n\t//admin options for category_browsing_options module\r\n\t{\r\n\t\t$this->body .= \"<tr><td class=\\\"col_hdr\\\" colspan=\\\"2\\\" style=\\\"width: 100%; font-weight: bold; text-align: center;\\\">Options selected below will be applied to the Category Browsing Options Module</td></tr>\";\r\n\t\t$show_options = array (\r\n\t\t\t'cat_browse_opts_as_ddl' => $this->db->get_site_setting('cat_browse_opts_as_ddl'),\r\n\t\t\t'cat_browse_all_listings' => $this->db->get_site_setting('cat_browse_all_listings'),\r\n\t\t\t'cat_browse_end_today' => $this->db->get_site_setting('cat_browse_end_today'),\r\n\t\t\t'cat_browse_has_pics' => $this->db->get_site_setting('cat_browse_has_pics'),\r\n\t\t\t'cat_browse_has_pics' => $this->db->get_site_setting('cat_browse_has_pics'),\r\n\t\t\t'cat_browse_class_only' => $this->db->get_site_setting('cat_browse_class_only'),\r\n\t\t\t'cat_browse_auc_only' => $this->db->get_site_setting('cat_browse_auc_only'),\r\n\t\t\t'cat_browse_buy_now' => $this->db->get_site_setting('cat_browse_buy_now'),\r\n\t\t\t'cat_browse_buy_now_only' => $this->db->get_site_setting('cat_browse_buy_now_only'),\r\n\t\t\t'cat_browse_auc_bids' => $this->db->get_site_setting('cat_browse_auc_bids'),\r\n\t\t\t'cat_browse_auc_no_bids' => $this->db->get_site_setting('cat_browse_auc_no_bids')\r\n\t\t\t\r\n\t\t);\r\n\t\t$ddlTooltip = geoHTML::showTooltip('Show as Dropdown', 'Choose yes to display the module\\'s options in a dropdown list, or no to show them as a text-based, delimeter-separated list.');\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_opts_as_ddl\",\"Show as Dropdown $ddlTooltip\");\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_all_listings\",\"All listings\");\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_end_today\",\"Listings Ending within 24 hours\");\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_has_pics\",\"Listings with Photos\");\r\n\t\t\r\n\t\tif(geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t{\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_class_only\",\"Classifieds only\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_auc_only\",\"Auctions only\");\r\n\t\t}\r\n\t\tif(geoMaster::is('auctions'))\r\n\t\t{\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_buy_now\",\"Auctions using Buy Now\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_buy_now_only\",\"Auctions using Buy Now Only\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_auc_bids\",\"Auctions with Bids\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_auc_no_bids\",\"Auctions without Bids\");\r\n\t\t}\r\n\t\t\r\n\t}", "public function optIn() {\n return !empty($this->args['send_optin']);\n }", "private function setOptions()\n\t{\n\t\t$this->site = ( isset($_POST['site']) ) ? sanitize_text_field($_POST['site']) : null;\n\t\t$this->feed_type = ( isset($_POST['type']) && $_POST['type'] !== 'search' ) ? sanitize_text_field($_POST['type']) : 'search';\n\t\t$this->post_id = ( isset($_POST['id']) ) ? sanitize_text_field($_POST['id']) : null;\n\t\t$this->feed_format = ( isset($_POST['format']) && $_POST['format'] !== 'unformatted' ) ? sanitize_text_field($_POST['format']) : 'unformatted';\n\t}", "function pickup_submit()\n\t{\n\t\t$year = $this->name . '_year';\n\t\t$month = $this->name . '_month';\n\t\t$day = $this->name . '_day';\n\t\tglobal $$year, $$month, $$day;\n\n\t\t$this->value = $$year . \".\" . $$month . \".\" . $$day;\n\t}", "public function postProcess() {\n\t\t//\t\t$this->setSubmittedValue(strtoupper($this->getSubmittedValue()));\n\t}", "function harvest_handle_on_project_options(&$options, &$project, &$logged_user)\n{\n\tif($logged_user->getSystemPermission('can_submit_harvest') && $logged_user->getSystemPermission('project_management'))\n\t{\n\t\t$options->add('harvest', array\n\t\t(\n\t\t\t'text'\t=> lang('Harvest Settings'),\n\t\t\t'url'\t=> assemble_url('project_harvest', array('project_id' => $project->getId())),\n\t\t));\n\t}\n}", "public function post_action() {\n\t\tcheck_ajax_referer( self::POST_ACTION_ID );\n\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\twp_die( esc_html__( 'You are not allowed to do that.', 'autowpdb-example-plugin' ), '', 403 );\n\t\t}\n\n\t\t$add_entry = filter_input( INPUT_POST, 'add_entry', FILTER_SANITIZE_STRING );\n\t\t$delete_entry = filter_input( INPUT_POST, 'delete_entry', FILTER_SANITIZE_STRING );\n\n\t\tif ( null !== $add_entry ) {\n\t\t\t// Insert a new entry into the table.\n\t\t\t$result = $this->action_insert_entry();\n\n\t\t\t$this->action_insert_entry_message( $result );\n\t\t} elseif ( null !== $delete_entry ) {\n\t\t\t// Delete the oldest entry.\n\t\t\t$result = $this->action_delete_entry();\n\n\t\t\t$this->action_delete_entry_message( $result );\n\t\t} else {\n\t\t\t$this->invalid_action_message();\n\t\t}\n\n\t\tset_transient( 'settings_errors', get_settings_errors( self::POST_ACTION_ID ), 30 );\n\n\t\t$goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() );\n\t\twp_safe_redirect( esc_url_raw( $goback ) );\n\t\texit;\n\t}", "public function optInAction()\n {\n\n $tokenYes = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_yes') ? $this->request->getArgument('token_yes') : ''));\n $tokenNo = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_no') ? $this->request->getArgument('token_no') : ''));\n $userSha1 = preg_replace('/[^a-zA-Z0-9]/', '', $this->request->getArgument('user'));\n\n /** @var \\RKW\\RkwRegistration\\Tools\\Registration $register */\n $register = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('RKW\\\\RkwRegistration\\\\Tools\\\\Registration');\n $check = $register->checkTokens($tokenYes, $tokenNo, $userSha1, $this->request, $data);\n\n // set hash value for changing subscriptions without login\n $hash = '';\n if ($check == 1) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionSaved',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n if (!$frontendUser->getTxRkwnewsletterHash()) {\n $hash = sha1($frontendUser->getUid() . $frontendUser->getEmail() . rand());\n $frontendUser->setTxRkwnewsletterHash($hash);\n $this->frontendUserRepository->update($frontendUser);\n\n } else {\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n }\n\n\n } elseif ($check == 2) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionCanceled',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n\n } else {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.error.subscriptionError',\n 'rkw_newsletter'\n ),\n '',\n \\TYPO3\\CMS\\Core\\Messaging\\AbstractMessage::ERROR\n );\n }\n\n $this->redirect('message', null, null, array('hash' => $hash));\n //===\n }", "function method_optout($request)\n{\n $log = Loggermanager::getLogger('swim.optout');\n \n checkSecurity($request, false, true);\n \n RequestCache::setNoCache();\n \n if (!$request->hasQueryVar('section'))\n {\n $log->warn('No section specified.');\n displayNotFound($request);\n return;\n }\n \n $section = FieldSetManager::getSection($request->getQueryVar('section'));\n if (($section === null) || ($section->getType() !== 'mailing'))\n {\n $log->warn('No valid section specified.');\n displayNotFound($request);\n return;\n }\n \n if (!$request->hasQueryVar('email'))\n {\n $log->warn('No email specified.');\n displayNotFound($request);\n return;\n }\n \n $email = $request->getQueryVar('email');\n $items = Item::findItems($section, null, null, 'emailaddress', $email);\n if (count($items) == 0)\n {\n $log->warn('Email '.$email.' not found.');\n displayNotFound($request);\n return;\n }\n \n if (count($items) > 1)\n $log->warn('More than one contact with the same email address.');\n \n foreach ($items as $itemversion)\n {\n $newversion = $itemversion->getVariant()->createNewVersion($itemversion);\n $newversion->setFieldValue('optedin', false);\n $newversion->setComplete(true);\n $newversion->setCurrent(true);\n }\n\n if ($request->hasQueryVar('redirect'))\n redirect($request->getQueryVar('redirect'));\n else\n redirect($request->getNested());\n}", "public function display_options_page() {\n if (! current_user_can('manage_options')) {\n wp_die(__('You do not have sufficient permissions to access this page.'));\n }\n?>\n<div class=\"wrap\">\n <h2><?php esc_attr_e($this->title); ?> Options</h2>\n <form action=\"options.php\" method=\"post\">\n <?php if (function_exists('settings_errors')): settings_errors(); endif; ?>\n <?php settings_fields($this->group); ?>\n <?php foreach ($this->sections as $section): do_settings_sections($section); endforeach; ?>\n <p class=\"submit\">\n <input type=\"submit\" name=\"Submit\" value=\"<?php esc_attr_e('Save Changes'); ?>\" class=\"button-primary\" />\n </p>\n </form>\n</div>\n<?php\n }" ]
[ "0.66251546", "0.6449752", "0.6154613", "0.6076456", "0.59473896", "0.59358746", "0.58982074", "0.588039", "0.5877093", "0.58577025", "0.5822784", "0.580767", "0.5758748", "0.5723165", "0.56965995", "0.56743944", "0.56427306", "0.56351435", "0.5632585", "0.5610411", "0.5584676", "0.5540274", "0.55328065", "0.5532604", "0.553088", "0.5516258", "0.55014694", "0.54987013", "0.5486594", "0.54814243", "0.5479112", "0.54728067", "0.5460411", "0.54433477", "0.5442761", "0.5408677", "0.5405528", "0.53917754", "0.53841", "0.53810024", "0.53683925", "0.5360781", "0.53566396", "0.5353419", "0.53504515", "0.5348414", "0.5345312", "0.5344864", "0.53335106", "0.5331436", "0.5327503", "0.531864", "0.5316194", "0.53155494", "0.5315204", "0.53125536", "0.5302539", "0.5295548", "0.52900904", "0.5289832", "0.5287177", "0.5287177", "0.52790684", "0.527143", "0.5258832", "0.5257504", "0.5256806", "0.525545", "0.5247562", "0.52469397", "0.5246381", "0.5241672", "0.52324814", "0.52287203", "0.52160436", "0.52136713", "0.52052873", "0.5202792", "0.5195618", "0.5194081", "0.5188363", "0.5188363", "0.51864445", "0.51836646", "0.51831627", "0.51755977", "0.5175237", "0.5174042", "0.5173247", "0.51730174", "0.51679593", "0.51584953", "0.51561064", "0.5154671", "0.5153043", "0.5151189", "0.5150694", "0.5147191", "0.51378465", "0.5131064" ]
0.6757193
0
Handle user profile opt in field.
function handle_profile_form( int $user_id ) { if ( ! check_admin_referer( 'update-user_' . $user_id ) ) { return; } if ( isset( $_POST['altis_telemetry_opt_in_toggle'] ) ) { opt_in( true ); } else { opt_in( false ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_profile($field, $user = \\false)\n {\n }", "function user_profile_options( WP_User $user ) : void {\n\t?>\n\t<table class=\"form-table\">\n\t\t<tr>\n\t\t\t<th>\n\t\t\t\t<label for=\"altis_telemetry_opt_in\"><?php esc_html_e( 'Altis Telemetry', 'altis' ); ?></label>\n\t\t\t</th>\n\t\t\t<td>\n\t\t\t\t<input type=\"checkbox\" name=\"altis_telemetry_opt_in_toggle\" id=\"altis_telemetry_opt_in\" <?php checked( is_user_opted_in( $user ) ) ?> value=\"1\" />\n\t\t\t\t<label for=\"altis_telemetry_opt_in\"><?php esc_html_e( 'Opt in to Altis Telemetry', 'altis' ); ?></label>\n\t\t\t\t<p class=\"description\"><?php esc_html_e( 'To help us develop Altis, we would like to collect data on your usage of the software. This will help us build a better product for you.', 'altis' ); ?></p>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<?php\n}", "function opt_in( bool $did_opt_in, ?WP_User $user = null ) {\n\t$user = $user ?? wp_get_current_user();\n\tupdate_user_meta( $user->ID, META_OPT_IN, $did_opt_in ? 1 : 0 );\n\n\t// Alias previously unknown user if they opted in.\n\tif ( $did_opt_in ) {\n\t\tif ( ! initialize() ) {\n\t\t\treturn;\n\t\t}\n\t\tSegment::alias( [\n\t\t\t'userId' => get_id(),\n\t\t\t'previousId' => get_anonymous_id(),\n\t\t] );\n\t}\n}", "function seun_edit_user_options() {\n\n\t\t\tglobal $user_id;\n\n\t\t\t$user_id = isset($user_id) ? (int) $user_id : 0;\n\n\t\t\tif ( ! current_user_can('edit_users') )\n\t\t\t\treturn;\n\n\t\t\tif ( ! ($userdata = get_userdata( $user_id ) ) )\n\t\t\t\treturn;\n\n\t\t\t$default_user_nicename = sanitize_title( $userdata->user_login );\n\n\t\t\techo '<h3>'.__('User Nicename', 'seun').'</h3>'\n\t\t\t\t.'<table class=\"form-table\">'.\"\\n\"\n\t\t\t\t\t.'<tr>'.\"\\n\"\n\t\t\t\t\t\t.'<th><label for=\"user_nicename\">'.__('User nicename/slug', 'seun').'</label></th>'.\"\\n\"\n\t\t\t\t\t\t.'<td>'\n\t\t\t\t\t\t\t.'<input id=\"user_nicename\" name=\"user_nicename\" class=\"regular-text code\" type=\"text\" value=\"'.sanitize_title($userdata->user_nicename, $default_user_nicename).'\"/> '\n\t\t\t\t\t\t\t.'<span class=\"description\">('.sprintf(__('Leave empty for default value: %s', 'seun'), $default_user_nicename).')</span> '\n\t\t\t\t\t\t\t.'<a href=\"'.get_author_posts_url($user_id).'\">'.__('Your Profile').'</a> '\n\t\t\t\t\t\t.\"</td>\\n\"\n\t\t\t\t\t.'</tr>'.\"\\n\"\n\t\t\t\t.'</table>'.\"\\n\";\n\n\t\t}", "function display_user_profile_fields() {\r\n global $wpdb, $user_id, $wpi_settings;\r\n $profileuser = get_user_to_edit($user_id);\r\n\r\n include($wpi_settings['admin']['ui_path'] . '/profile_page_content.php');\r\n }", "public function mtii_utilities_show_extra_profile_fields($user) {\n $gender = get_the_author_meta('gender', $user->ID);\n $gender_label = $gender=='' ? 'Pick a Gender' : $gender;\n $phone_number = get_the_author_meta('phone_number', $user->ID);\n $state_city = get_the_author_meta('state_city', $user->ID);\n ?>\n <h3><?php esc_html_e('Personal Information (for Mtii Utilities User)', 'mtii-utilities-josbiz'); ?></h3>\n\n <table class=\"form-table\">\n <tr>\n <th>\n <label for=\"gender\"><?php _e( 'Gender', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <select name=\"gender\" id=\"gender\" class=\"input\">\n <option disabled value=\"<?php _e($gender, 'mtii-utilities-josbiz'); ?>\"><?php echo $gender_label; ?></option>\n <option value=\"<?php _e('Male', 'mtii-utilities-josbiz'); ?>\">Male</option>\n <option value=\"<?php _e('Female', 'mtii-utilities-josbiz'); ?>\">Female</option>\n </select>\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"phone_number\"><?php _e( 'Phone Number', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"number\" name=\"phone_number\" id=\"phone_number\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($phone_number)); ?>\" size=\"25\" />\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"state_city\"><?php _e( 'State/City', 'mtii-utilities-josbiz') ?></label>\n <span class=\"description\"><?php esc_html_e('(required)', 'mtii-utilities-josbiz'); ?></span>\n </th>\n <td>\n <input\n type=\"text\" name=\"state_city\" id=\"state_city\" class=\"input\"\n value=\"<?php echo esc_attr(wp_unslash($state_city)); ?>\" size=\"25\" />\n </td>\n </tr>\n </table>\n <?php\n }", "public static function edit_profile() {\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'ur-my-account' );\n\n\t\t$user_id = get_current_user_id();\n\t\t$form_id = ur_get_form_id_by_userid( $user_id );\n\n\t\t$profile = user_registration_form_data( $user_id, $form_id );\n\n\t\t$user_data = get_userdata( $user_id );\n\t\t$user_data = $user_data->data;\n\n\t\t$form_data_array = ( $form_id ) ? UR()->form->get_form( $form_id, array( 'content_only' => true ) ) : array();\n\n\t\tif ( ! empty( $form_data_array ) ) {\n\n\t\t\tif ( count( $profile ) < 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare values.\n\t\t\tforeach ( $profile as $key => $field ) {\n\t\t\t\t$value = get_user_meta( get_current_user_id(), $key, true );\n\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t$new_key = str_replace( 'user_registration_', '', $key );\n\n\t\t\t\tif ( in_array( $new_key, ur_get_registered_user_meta_fields() ) ) {\n\t\t\t\t\t$value = get_user_meta( get_current_user_id(), ( str_replace( 'user_', '', $new_key ) ), true );\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );\n\t\t\t\t} elseif ( isset( $user_data->$new_key ) && in_array( $new_key, ur_get_user_table_fields() ) ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );\n\n\t\t\t\t} elseif ( isset( $user_data->display_name ) && 'user_registration_display_name' === $key ) {\n\t\t\t\t\t$profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tur_get_template(\n\t\t\t\t'myaccount/form-edit-profile.php',\n\t\t\t\tarray(\n\t\t\t\t\t'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),\n\t\t\t\t\t'form_data_array' => $form_data_array,\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\techo '<h1>' . esc_html__( 'No profile details found.', 'user-registration' ) . '</h1>';\n\t\t}\n\t}", "function custom_user_profile_fields($user){\n if ( current_user_can('edit_posts') ) { // if current user can activate plugins they are admin\n ?>\n <h3>Learner Number</h3>\n <table class=\"form-table\">\n <tr>\n <th><label for=\"learner\">Learner Number</label></th>\n <td><input type=\"text\" name=\"learner\" value=\"<?php echo esc_attr(get_the_author_meta( 'learner', $user->ID )); ?>\"></td>\n </tr>\n </table>\n <?php\n }\n}", "function extra_profile_fields( $user ) { ?>\n <h3>Author Information Display</h3>\n <table class=\"form-table\">\n <tbody>\n <tr>\n <th>\n <label for=\"list_author_single\">Show author bio on article pages</label>\n </th>\n <td>\n <input type=\"checkbox\" name=\"list_author_single\" id=\"list_author_single\" value=\"true\" <?php if ( esc_attr( get_the_author_meta('list_author_single', $user->ID) ) == true ) echo 'checked'; ?> />\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"list_author_about\">Show author on About page</label>\n </th>\n <td>\n <input type=\"checkbox\" name=\"list_author_about\" id=\"list_author_about\" value=\"true\" <?php if ( esc_attr( get_the_author_meta('list_author_about', $user->ID) ) == true ) echo 'checked'; ?> />\n </td>\n </tr>\n <tr>\n <th>\n <label for=\"display_author_as\">List author on About Page as</label>\n </th>\n <td>\n <?php \n //get dropdown saved value\n $selected = get_the_author_meta( 'display_author_as', $user->ID ); \n ?>\n <select name=\"display_author_as\" id=\"display_author_as\">\n <option value=\"editor\" <?php echo ($selected == \"editor\")? 'selected=\"selected\"' : '' ?>>Editor</option>\n <option value=\"writer\" <?php echo ($selected == \"writer\")? 'selected=\"selected\"' : '' ?>>Writer</option>\n <option value=\"photographer\" <?php echo ($selected == \"photographer\")? 'selected=\"selected\"' : '' ?>>Photographer</option>\n <span class=\"description\">Simple text field</span>\n </td>\n </tr>\n </tbody>\n </table>\n <br />\n<?php }", "abstract protected function getUserProfile();", "function power_user_options_fields( $user ) {\n\n\tif ( current_user_can( 'edit_users', $user->ID ) ) {\n\t\tpower_meta_boxes()->show_meta_box( 'power-user-settings', $user );\n\t}\n\n}", "public function api_entry_setprofile() {\n parent::validateParams(array('user'));\n\n $user = $this->Mdl_Users->get($_POST[\"user\"]);\n\n if ($user == null)\n parent::returnWithErr(\"User id is not valid.\");\n\n $arg = $this->safeArray(array('fullname', 'avatar', 'church', 'city', 'province', 'bday', 'mood'), $_POST);\n\n $arg['id'] = $_POST[\"user\"];\n\n if (count($arg) == 1)\n parent::returnWithErr(\"You should pass the profile 1 entry at least to update.\");\n\n $user = $this->Mdl_Users->update($arg);\n\n if ($user == null)\n parent::returnWithErr(\"Profile has not been updated.\");\n\n parent::returnWithoutErr(\"Profile has been updated successfully.\", $user);\n }", "function docdirect_save_custom_user_profile_fields($user_id){\n\t\tif(!current_user_can('manage_options'))\n\t\t\treturn false;\n\t\n\t\t# save my custom field\n\t\tupdate_user_meta($user_id, 'verify_user', 'off');\n\t\tupdate_user_meta( $user_id, 'show_admin_bar_front', false );\n\t}", "function addProfileFields($user) {\n\t\tif($this->checkPermissions()) {\n\t\t\techo '<h3>LePress Teacher</h3>';\n\t\t\techo '<table class=\"form-table\">';\n\t\t\techo '<tr>';\n\t\t\techo\t'<th><label for=\"lepress-organization\">'.__('Organization', lepress_textdomain).'</label></th>';\n\t\t\techo '<td><input type=\"text\" name=\"lepress-organization\" id=\"lepress-organization\" value=\"'.esc_attr( get_the_author_meta( 'lepress-organization', $user->ID)).'\" class=\"regular-text\"/><br />';\n\t\t\techo '<span class=\"description\">'.__('Your organization - university, college, high school, primary school etc..', lepress_textdomain).'</span></td>';\n\t\t\techo '</tr></table>';\n\t\t}\n\t}", "function itstar_extra_user_profile_fields( $user ) {\n?>\n <h3><?php _e(\"Extra profile information\", \"itstar\"); ?></h3>\n <table class=\"form-table\">\n <tr>\n <th><label for=\"birthday\"><?php echo __(\"birthday\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthday\" id=\"Birth Day\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthday' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birthday.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthmonth\"><?php echo __(\"Birth Month\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthmonth\" id=\"birthmonth\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthmonth' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Month.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"birthyear\"><?php echo __(\"Birth Year\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"birthyear\" id=\"birthyear\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID,'birthyear' ,true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Birth Year.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"phone\"><?php echo __(\"Phone\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"phone\" id=\"phone\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'phone',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your phone.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"job\"><?php echo __(\"Job\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" name=\"job\" id=\"job\" class=\"regular-text\" \n value=\"<?php echo esc_attr( get_user_meta( $user->ID ,'job',true) ); ?>\" /><br />\n <span class=\"description\"><?php echo __(\"Please enter your Job.\",\"itstar\"); ?></span>\n </td>\n </tr>\n <tr>\n <th><label for=\"viraclub\"><?php __(\"Vira club ID\",'itstar'); ?></label></th>\n <td>\n <input type=\"text\" disabled name=\"viraclub\" id=\"viraclub\" class=\"regular-text\" \n value=\"<?php echo 'V'.esc_attr( get_user_meta( $user->ID,'viraclub' ,true) ); ?>\" /><br />\n \n </td>\n </tr>\n </table>\n<?php\n}", "function d4os_io_db_070_users_add_extra_fields(&$user) {\n if (module_exists('d4os_io_services_profile')) {\n $properties = d4os_io_db_070_os_profile_services_avatar_properties_request(array('avatar_id' => $user->UUID));\n if (isset($properties['data'][0])) {\n $user->profileURL = $properties['data'][0]['ProfileUrl'];\n $user->profileImage = $properties['data'][0]['Image'];\n $user->profileAboutText = $properties['data'][0]['AboutText'];\n $user->profileFirstImage = $properties['data'][0]['FirstLifeImage'];\n $user->profileFirstText = $properties['data'][0]['FirstLifeAboutText'];\n $user->profilePartner = $properties['data'][0]['Partner'];\n\n //$user->profileAllowPublish = $properties['data'][0]['profileAllowPublish'];\n //$user->profileMaturePublish = $properties['data'][0]['profileMaturePublish'];\n\n // interests\n $user->profileWantDoMask = $properties['data'][0]['wantmask'];\n $user->profileWantToText = $properties['data'][0]['wanttext'];\n $user->profileSkillsMask = $properties['data'][0]['skillsmask'];\n $user->profileSkillsText = $properties['data'][0]['skillstext'];\n $user->profileLanguages = $properties['data'][0]['languages'];\n }\n }\n}", "public function controlProfile(){\n\t\t$profilePage = \\Utility\\Singleton::getInstance('\\View\\Main');\n\t\t$data=\"\";\n\t\t\n\t\tswitch($profilePage->get('profileAction'))\n\t\t{\t\n\t\t\tcase 'hasAlreadyVoted':\n\t\t\t\t$data=$this->hasVoted();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'getProfilePage':\n\t\t\t\t$data=$this->setProfileInformation();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'rateUser':\n\t\t\t\t$data=$this->rateUser();\n\t\t\t\tbreak;\n\n\t\t}\n\t\n\t\treturn $data;\n\t\t\n\t}", "public static function js_user_field($auth, $args, $tabalias, $options, $path) {\n static $done_js_user_field = FALSE;\n if (empty($options['fieldName']))\n return 'Please provide a setting @fieldName for the js_user_field control.';\n if (!function_exists('hostsite_get_user_field'))\n return 'Can\\'t use the js_user_field extension without a hostsite_get_user_field function.';\n $val = hostsite_get_user_field($options['fieldName']);\n if ($val === TRUE) {\n $val = 'true';\n }\n elseif ($val === FALSE) {\n $val = 'false';\n }\n elseif (is_string($val)) {\n $val = \"'$val'\";\n }\n if (!$done_js_user_field) {\n data_entry_helper::$javascript .= \"if (typeof indiciaData.userFields==='undefined') {\n indiciaData.userFields={};\n}\\n\";\n $done_js_user_field = TRUE;\n }\n data_entry_helper::$javascript .= \"indiciaData.userFields['$options[fieldName]']=$val;\\n\";\n return '';\n }", "function classiera_save_extra_profile_fields( $user_id ) {\r\n\tupdate_user_meta( $user_id, 'price_plan' );\r\n\tadd_user_meta( $user_id, 'price_plan_id' );\r\n}", "function users_beforeForm($data,$db){\n\tif(empty($data->user['id'])){\n\t\tcommon_loadPhrases($data,$db,'users');\n\t\t$data->output['responseMessage']=\n\t\t\tsprintf($data->phrases['users']['requiresLogin'],$data->phrases['users']['updateProfile']);\n\t\treturn FALSE;\n\t}\n\t$data->output['editingField']=TRUE;\n}", "function print_profilefield_row($basename, $profilefield, $userfield = '')\n{\n\tglobal $vbphrase;\n\n\t$data = unserialize($profilefield['data']);\n\t$fieldname = 'field' . $profilefield['profilefieldid'];\n\t$profilefieldname = $basename . '[field' . $profilefield['profilefieldid'] . ']';\n\t$optionalname = $basename . '[field' . $profilefield['profilefieldid'] . '_opt]';\n\t$output = '';\n\n\tif (!is_array($userfield))\n\t{\n\t\t$userfield = array($fieldname => '');\n\t}\n\n\tif ($profilefield['type'] == 'input')\n\t{\n\n\t\tprint_input_row($profilefield['title'], $profilefieldname, $userfield[\"$fieldname\"], 0);\n\n\t}\n\telse if ($profilefield['type'] == 'textarea')\n\t{\n\n\t\tprint_textarea_row($profilefield['title'], $profilefieldname, $userfield[\"$fieldname\"], $profilefield['height'], 40, 0);\n\n\t}\n\telse if ($profilefield['type'] == 'select')\n\t{\n\t\tforeach ($data AS $key => $val)\n\t\t{\n\t\t\t$key++;\n\t\t\t$selected = '';\n\t\t\tif ($userfield[\"$fieldname\"])\n\t\t\t{\n\t\t\t\tif (trim($val) == $userfield[\"$fieldname\"])\n\t\t\t\t{\n\t\t\t\t\t$selected = 'selected=\"selected\"';\n\t\t\t\t\t$foundselect = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($key == 0)\n\t\t\t{\n\t\t\t\t$selected = 'selected=\"selected\"';\n\t\t\t\t$foundselect = 1;\n\t\t\t}\n\t\t\t$selectbits .= \"<option value=\\\"$key\\\" $selected>$val</option>\";\n\t\t}\n\t\tif ($profilefield['optional'])\n\t\t{\n\t\t\tif (!$foundselect AND $userfield[\"$fieldname\"])\n\t\t\t{\n\t\t\t\t$optional = $userfield[\"$fieldname\"];\n\t\t\t}\n\t\t\t$optionalfield = \"<dfn>$vbphrase[other_please_specify]:</dfn><input type=\\\"text\\\" name=\\\"$optionalname\\\" class=\\\"bginput\\\" value=\\\"$optional\\\" size=\\\"$profilefield[size]\\\" maxlength=\\\"$profilefield[maxlength]\\\" tabindex=\\\"1\\\" />\";\n\t\t}\n\n\n\t\tif (!$foundselect)\n\t\t{\n\t\t\t$selected = 'selected=\"selected\"';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$selected = '';\n\t\t}\n\t\t$output = \"<select name=\\\"$profilefieldname\\\" tabindex=\\\"1\\\" class=\\\"bginput\\\">\n\t\t\t<option value=\\\"0\\\" $selected></option>\n\t\t\t$selectbits\n\t\t\t</select>\n\t\t\t$optionalfield\";\n\t\tprint_label_row($profilefield['title'], $output);\n\n\t}\n\telse if ($profilefield['type'] == 'radio')\n\t{\n\n\t\t$radiobits = '';\n\t\t$foundfield = 0;\n\t\tforeach ($data AS $key => $val)\n\t\t{\n\t\t\t$key++;\n\t\t\t$checked = '';\n\t\t\tif (!$userfield[\"$fieldname\"] AND $key == 1 AND $profilefield['def'] == 1)\n\t\t\t{\n\t\t\t\t$checked = 'checked=\"checked\"';\n\t\t\t}\n\t\t\telse if (trim($val) == $userfield[\"$fieldname\"])\n\n\t\t\t{\n\t\t\t\t$checked = 'checked=\"checked\"';\n\t\t\t\t$foundfield = 1;\n\t\t\t}\n\t\t\t$radiobits .= \"<label for=\\\"rb_{$key}_$profilefieldname\\\"><input type=\\\"radio\\\" name=\\\"$profilefieldname\\\" value=\\\"$key\\\" id=\\\"rb_{$key}_$profilefieldname\\\" tabindex=\\\"1\\\" $checked>$val</label>\";\n\t\t}\n\t\tif ($profilefield['optional'])\n\t\t{\n\t\t\tif (!$foundfield AND $userfield[\"$fieldname\"])\n\t\t\t{\n\t\t\t\t$optional = $userfield[\"$fieldname\"];\n\t\t\t}\n\t\t\t$optionalfield = \"<dfn>$vbphrase[other_please_specify]:</dfn><input type=\\\"text\\\" name=\\\"$optionalname\\\" class=\\\"bginput\\\" value=\\\"$optional\\\" size=\\\"$profilefield[size]\\\" maxlength=\\\"$profilefield[maxlength]\\\" tabindex=\\\"1\\\" />\";\n\t\t}\n\t\tprint_label_row($profilefield['title'], \"$radiobits$optionalfield\");\n\n\t}\n\telse if ($profilefield['type'] == 'checkbox')\n\t{\n\n\t\t$checkboxbits = '';\n\t\t$perline = 0;\n\t\tforeach ($data AS $key => $val)\n\t\t{\n\t\t\tif ($userfield[\"$fieldname\"] & pow(2, $key))\n\t\t\t{\n\t\t\t\t$checked = 'checked=\"checked\"';\n\t\t\t}\n\t\t\telse\n\n\t\t\t{\n\t\t\t\t$checked = '';\n\t\t\t}\n\t\t\t$key++;\n\t\t\t$checkboxbits .= \"<label for=\\\"cb_{$key}_$profilefieldname\\\"><input type=\\\"checkbox\\\" name=\\\"{$profilefieldname}[]\\\" value=\\\"$key\\\" id=\\\"cb_{$key}_$profilefieldname\\\" tabindex=\\\"1\\\" $checked>$val</label> \";\n\t\t\t$perline++;\n\t\t\tif ($profilefield['def'] > 0 AND $perline >= $profilefield['def'])\n\t\t\t{\n\t\t\t\t$checkboxbits .= '<br />';\n\t\t\t\t$perline = 0;\n\t\t\t}\n\t\t}\n\t\tprint_label_row($profilefield['title'], $checkboxbits);\n\n\t}\n\telse if ($profilefield['type'] == 'select_multiple')\n\t{\n\n\t\t$selectbits = '';\n\t\tforeach ($data AS $key => $val)\n\t\t{\n\t\t\tif ($userfield[\"$fieldname\"] & pow(2,$key))\n\t\t\t{\n\t\t\t\t$selected = 'selected=\"selected\"';\n\t\t\t}\n\t\t\telse\n\n\t\t\t{\n\t\t\t\t$selected = '';\n\t\t\t}\n\t\t\t$key++;\n\t\t\t$selectbits .= \"<option value=\\\"$key\\\" $selected>$val</option>\";\n\t\t}\n\t\t$output = \"<select name=\\\"{$profilefieldname}[]\\\" multiple=\\\"multiple\\\" size=\\\"$profilefield[height]\\\" tabindex=\\\"1\\\" class=\\\"bginput\\\">\n\t\t\t$selectbits\n\t\t\t</select>\";\n\t\tprint_label_row($profilefield['title'], $output);\n\n\t}\n}", "function save_custom_user_profile_fields($user_id){\n if(!current_user_can('edit_posts'))\n return false;\n\n // save my custom field\n update_user_meta($user_id, 'learner', esc_html($_POST['learner']));\n}", "function the_champ_social_avatar_options(){\r\n\tglobal $user_ID, $theChampLoginOptions;\r\n\tif(isset($theChampLoginOptions['enable']) && isset($theChampLoginOptions['avatar']) && isset($theChampLoginOptions['avatar_options'])){\r\n\t\tif(isset($_POST['ss_dontupdate_avatar'])){\r\n\t\t\t$dontUpdateAvatar = intval($_POST['ss_dontupdate_avatar']);\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_dontupdate_avatar', $dontUpdateAvatar);\r\n\t\t}else{\r\n\t\t\t$dontUpdateAvatar = get_user_meta($user_ID, 'thechamp_dontupdate_avatar', true);\r\n\t\t}\r\n\t\tif(isset($_POST['ss_small_avatar']) && heateor_ss_validate_url($_POST['ss_small_avatar']) !== false){\r\n\t\t\t$updatedSmallAvatar = str_replace('http://', '//', esc_url(trim($_POST['ss_small_avatar'])));\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_avatar', $updatedSmallAvatar);\r\n\t\t}\r\n\t\tif(isset($_POST['ss_large_avatar']) && heateor_ss_validate_url($_POST['ss_large_avatar']) !== false){\r\n\t\t\t$updatedLargeAvatar = str_replace('http://', '//', esc_url(trim($_POST['ss_large_avatar'])));\r\n\t\t\tupdate_user_meta($user_ID, 'thechamp_large_avatar', $updatedLargeAvatar);\r\n\t\t}\r\n\t\t?>\r\n\t\t<div class=\"profile\" style=\"margin-bottom:20px\">\r\n\t\t\t<form action=\"\" method=\"post\" class=\"standard-form base\">\r\n\t\t\t\t<h4><?php _e('Social Avatar', 'super-socializer') ?></h4>\r\n\t\t\t\t<div class=\"clear\"></div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_dontupdate_avatar_1\"><input id=\"ss_dontupdate_avatar_1\" style=\"margin-right:5px\" type=\"radio\" name=\"ss_dontupdate_avatar\" value=\"1\" <?php echo $dontUpdateAvatar ? 'checked' : '' ?> /><?php _e('Do not fetch and update social avatar from my profile, next time I Social Login', 'super-socializer') ?></label>\r\n\t\t\t\t\t<label for=\"ss_dontupdate_avatar_0\"><input id=\"ss_dontupdate_avatar_0\" style=\"margin-right:5px\" type=\"radio\" name=\"ss_dontupdate_avatar\" value=\"0\" <?php echo ! $dontUpdateAvatar ? 'checked' : '' ?> /><?php _e('Update social avatar, next time I Social Login', 'super-socializer') ?></label>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_small_avatar\"><?php _e('Small Avatar', 'super-socializer') ?></label>\r\n\t\t\t\t\t<input id=\"ss_small_avatar\" type=\"text\" name=\"ss_small_avatar\" value=\"<?php echo isset($updatedSmallAvatar) ? $updatedSmallAvatar : get_user_meta($user_ID, 'thechamp_avatar', true) ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"editfield field_name visibility-public field_type_textbox\">\r\n\t\t\t\t\t<label for=\"ss_large_avatar\"><?php _e('Large Avatar', 'super-socializer') ?></label>\r\n\t\t\t\t\t<input id=\"ss_large_avatar\" type=\"text\" name=\"ss_large_avatar\" value=\"<?php echo isset($updatedLargeAvatar) ? $updatedLargeAvatar : get_user_meta($user_ID, 'thechamp_large_avatar', true) ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"submit\">\r\n\t\t\t\t\t<input type=\"submit\" value=\"<?php _e('Save Changes', 'super-socializer') ?>\" />\r\n\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\t\t<?php\r\n\t}\r\n}", "public function profile (request $request) {\n\t\t$userInfo = resolve('userInfo');\n\n\t\tif ($request->isMethod('post') && $request->tab == \"profile\") {\n\n\t\t\tif ($userInfo->usr_role == 'AD') {\n\t\t\t\t$usr_role = $request->usr_role;\n\t\t\t} else {\n\t\t\t\t$usr_role = 'CP';\n\t\t\t}\n\n\t\t\tif ($userInfo->usr_role == 'AD') {\n\t\t\t\t$dataProfile = array(\n\t\t\t\t\t'usr_employment_id' => $request->usr_employment_id,\n\t\t\t\t\t'usr_role' \t\t\t\t\t=> $usr_role,\n\t\t\t\t\t'usr_firstname' \t\t=> $request->usr_firstname,\n\t\t\t\t\t'usr_lastname' \t\t\t=> $request->usr_lastname,\n\t\t\t\t\t'usr_nric' \t\t\t\t\t=> $request->usr_nric,\n\t\t\t\t\t'usr_dob' \t\t\t\t\t=> $request->usr_dob,\n\t\t\t\t\t'usr_citizen' \t\t\t=> $request->usr_citizen,\n\t\t\t\t\t'usr_add1' \t\t\t\t\t=> $request->usr_add1,\n\t\t\t\t\t'usr_add2' \t\t\t\t\t=> $request->usr_add2,\n\t\t\t\t\t'usr_postcode' \t\t\t=> $request->usr_postcode,\n\t\t\t\t\t'usr_state' \t\t\t\t=> $request->usr_state,\n\t\t\t\t\t'usr_country' \t\t\t=> $request->usr_country,\n\t\t\t\t\t'usr_education' \t\t=> $request->usr_education,\n\t\t\t\t\t'usr_qualification' => $request->usr_qualification,\n\t\t\t\t\t'usr_jobtitle' \t\t\t=> $request->usr_jobtitle,\n\t\t\t\t\t'usr_division' \t\t\t=> $request->usr_division,\n\t\t\t\t\t'usr_employment' \t\t=> $request->usr_employment,\n\t\t\t\t\t'usr_mobile' \t\t\t\t=> $request->usr_mobile,\n\t\t\t\t\t'usr_email' \t\t\t\t=> $request->usr_email,\n\t\t\t\t\t'usr_bank_name' \t\t=> $request->usr_bank_name,\n\t\t\t\t\t'usr_bank_acc_no' \t=> $request->usr_bank_acc_no,\n\t\t\t\t\t'usr_kwsp_no' \t\t\t=> $request->usr_kwsp_no,\n\t\t\t\t\t'usr_updated' \t\t\t=> Carbon::now()\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\t$dataProfile = array(\n\t\t\t\t\t'usr_firstname' \t\t=> $request->usr_firstname,\n\t\t\t\t\t'usr_lastname' \t\t\t=> $request->usr_lastname,\n\t\t\t\t\t'usr_nric' \t\t\t\t\t=> $request->usr_nric,\n\t\t\t\t\t'usr_dob' \t\t\t\t\t=> $request->usr_dob,\n\t\t\t\t\t'usr_citizen' \t\t\t=> $request->usr_citizen,\n\t\t\t\t\t'usr_add1' \t\t\t\t\t=> $request->usr_add1,\n\t\t\t\t\t'usr_add2' \t\t\t\t\t=> $request->usr_add2,\n\t\t\t\t\t'usr_postcode' \t\t\t=> $request->usr_postcode,\n\t\t\t\t\t'usr_state' \t\t\t\t=> $request->usr_state,\n\t\t\t\t\t'usr_country' \t\t\t=> $request->usr_country,\n\t\t\t\t\t'usr_education' \t\t=> $request->usr_education,\n\t\t\t\t\t'usr_qualification' => $request->usr_qualification,\n\t\t\t\t\t'usr_jobtitle' \t\t\t=> $request->usr_jobtitle,\n\t\t\t\t\t'usr_mobile' \t\t\t\t=> $request->usr_mobile,\n\t\t\t\t\t'usr_email' \t\t\t\t=> $request->usr_email,\n\t\t\t\t\t'usr_bank_name' \t\t=> $request->usr_bank_name,\n\t\t\t\t\t'usr_bank_acc_no' \t=> $request->usr_bank_acc_no,\n\t\t\t\t\t'usr_kwsp_no' \t\t\t=> $request->usr_kwsp_no,\n\t\t\t\t\t'usr_updated' \t\t\t=> Carbon::now()\n\t\t\t\t);\n\t\t\t}\n\t\t\t// echo '<pre>'; print_r($request->usr_role); die();\n\t\t\t$updateProfile = DB::table('users')->where('usr_id', $request->usr_id)->update($dataProfile);\n\n\t\t\tLog::doAddLog (\"Update profile\", $request->usr_id, $request->usr_firstname.' '.$request->usr_lastname);\n\n\t\t\tif ($userInfo->usr_role == 'AD') {\n\t\t\t\treturn redirect('view-profile/'.$request->usr_id)->with('success', \"Successfully update user profile.\");\n\t\t\t} else {\n\t\t\t\treturn redirect('profile')->with('success', \"Successfully update user profile.\");\n\t\t\t}\n\n\n\t\t} else if ($request->isMethod('post') && $request->tab == \"password\"){\n\n\t\t\t// echo $request->password2; die();\n\t\t\tif($request->password1 != $request->password2){\n\t\t\t\treturn redirect('profile')->with('error', \"Password confirmation didnt match. Please try again.\");\n\t\t\t} else {\n\t\t\t\t$pass = hash('sha256', $request->password1);\n\n\t\t\t\t$dataPassword = array (\n\t\t\t\t\t'usr_pword' => $pass\n\t\t\t\t);\n\t\t\t\t$updatePassword = DB::table('users')->where('usr_id', $request->usr_id)->update($dataPassword);\n\t\t\t\tLog::doAddLog (\"Update password\", $request->usr_id);\n\t\t\t\treturn redirect('profile#t02')->with('success', \"Successfully update new password.\");\n\t\t\t}\n\t\t} else if ($request->isMethod('post') && $request->tab == \"bank\"){\n\n\t\t\t$dataBank = array (\n\t\t\t\t'usr_bank_name' \t=> $request->usr_bank_name,\n\t\t\t\t'usr_bank_acc_no' => $request->usr_bank_acc_no,\n\t\t\t\t'usr_kwsp_no' \t\t=> $request->usr_kwsp_no\n\t\t\t);\n\n\t\t\t$updateBank = DB::table('users')->where('usr_id', $request->usr_id)->update($dataBank);\n\t\t\treturn redirect('profile#t04')->with('success', \"Successfully update Bank & KWSP info.\");\n\t\t}\n\n return view('profile')->with('user',$userInfo);\n }", "function getfaircoin_edd_save_extra_profile_fields( $user_id ) {\r\n if ( ! current_user_can( 'edit_user', $user_id ) )\r\n return false;\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $_POST['_edd_user_fairaddress'] );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $_POST['_edd_user_fairsaving'] );\r\n}", "public function profileAction(){\n /** @var Object_User $user */\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['phone'])){\n $user->setPhone($data['phone']);\n }\n if(isset($data['email'])){\n $user->setPhone($data['email']);\n }\n if(isset($data['workphone'])){\n $user->setWorkPhone($data['workphone']);\n }\n if(isset($data['workemail'])){\n $user->setWorkEmail($data['workemail']);\n }\n if(!$user->save()){\n $this->setErrorResponse('Cannot update user profile');\n }\n $this->_helper->json($user);\n }", "function ghactivity_app_settings_username_callback() {\n\t$options = (array) get_option( 'ghactivity' );\n\tprintf(\n\t\t'<input type=\"text\" name=\"ghactivity[username]\" value=\"%s\" />',\n\t\tisset( $options['username'] ) ? esc_attr( $options['username'] ) : ''\n\t);\n}", "function ffl_save_extra_profile_fields( $user_id ) \n{\n\tif ( !current_user_can( 'edit_user', $user_id ) )\n\t\treturn false;\n\n\t//set the display name\n\t$display_name = trim($_POST['first_name'] . \" \" . $_POST['last_name']);\n\tif(!$display_name)\n\t\t$display_name = $_POST['user_login'];\n\t\t\n\t$_POST['display_name'] = $display_name;\n\t\n\t$args = array(\n\t\t\t'ID' => $user_id,\n\t\t\t'display_name' => $display_name\n\t); \n\twp_update_user( $args ) ;\n}", "function sh_custom_user_name_callback() {\n $userName = esc_attr( get_option( 'user_name' ) );\n echo '<input type=\"text\" name=\"user_name\" value=\"'.$userName.'\" placeholder=\"Full Name\" />';\n}", "public function handleProfile()\n\t{\n\t\t$profile = $this->profile;\n\t\t$data = Input::only(array('email', 'location', 'website', 'quote'));\n\n\t\tif($profile->program->type->name == 'vmbo')\n\t\t{\n\t\t\t// if(Input::has('quote'))\n\t\t\t// {\n\t\t\t// \t$data['quote'] = Input::get('quote');\n\t\t\t// }\n\t\t\tif(Input::has('next_program'))\n\t\t\t{\n\t\t\t\t$data['next_program'] = Input::get('next_program');\n\t\t\t}\n\t\t}\n\n\t\t$profileData = $data;\n\t\t$socialMediaData = Input::get('social_media');\n\n\t\t$this->profileService->updateProfile($profile, $profileData);\n\t\t$this->profileService->syncSocialMedia($profile, $socialMediaData);\n\n\t\treturn Redirect::action('datacollector.controller@index');\n\t}", "public function user_extra_profile_fields( $user ) {\n\t\t$fields = $this->create_extra_profile_fields();\n\t\trequire_once( H3_MGMT_ABSPATH . '/templates/frontend-profile.php' );\n\t}", "function get_profile_form($user) {\n \n $language = $this->get_user_language($user);\n $options = NewsletterSubscription::instance()->get_options('profile', $language);\n\n $buffer = '';\n\n $buffer .= '<div class=\"tnp tnp-profile\">';\n $buffer .= '<form action=\"' . $this->build_action_url('ps') . '\" method=\"post\" onsubmit=\"return newsletter_check(this)\">';\n $buffer .= '<input type=\"hidden\" name=\"nk\" value=\"' . esc_attr($user->id . '-' . $user->token) . '\">';\n\n $buffer .= '<div class=\"tnp-field tnp-field-email\">';\n $buffer .= '<label>' . esc_html($options['email']) . '</label>';\n $buffer .= '<input class=\"tnp-email\" type=\"text\" name=\"ne\" required value=\"' . esc_attr($user->email) . '\">';\n $buffer .= \"</div>\\n\";\n\n\n if ($options['name_status'] >= 1) {\n $buffer .= '<div class=\"tnp-field tnp-field-firstname\">';\n $buffer .= '<label>' . esc_html($options['name']) . '</label>';\n $buffer .= '<input class=\"tnp-firstname\" type=\"text\" name=\"nn\" value=\"' . esc_attr($user->name) . '\"' . ($options['name_rules'] == 1 ? ' required' : '') . '>';\n $buffer .= \"</div>\\n\";\n }\n\n if ($options['surname_status'] >= 1) {\n $buffer .= '<div class=\"tnp-field tnp-field-lastname\">';\n $buffer .= '<label>' . esc_html($options['surname']) . '</label>';\n $buffer .= '<input class=\"tnp-lastname\" type=\"text\" name=\"ns\" value=\"' . esc_attr($user->surname) . '\"' . ($options['surname_rules'] == 1 ? ' required' : '') . '>';\n $buffer .= \"</div>\\n\";\n }\n\n if ($options['sex_status'] >= 1) {\n $buffer .= '<div class=\"tnp-field tnp-field-gender\">';\n $buffer .= '<label>' . esc_html($options['sex']) . '</label>';\n $buffer .= '<select name=\"nx\" class=\"tnp-gender\">';\n $buffer .= '<option value=\"f\"' . ($user->sex == 'f' ? ' selected' : '') . '>' . esc_html($options['sex_female']) . '</option>';\n $buffer .= '<option value=\"m\"' . ($user->sex == 'm' ? ' selected' : '') . '>' . esc_html($options['sex_male']) . '</option>';\n $buffer .= '<option value=\"n\"' . ($user->sex == 'n' ? ' selected' : '') . '>' . esc_html($options['sex_none']) . '</option>';\n $buffer .= '</select>';\n $buffer .= \"</div>\\n\";\n }\n\n // Profile\n for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {\n if ($options['profile_' . $i . '_status'] == 0) {\n continue;\n }\n\n $buffer .= '<div class=\"tnp-field tnp-field-profile\">';\n $buffer .= '<label>' . esc_html($options['profile_' . $i]) . '</label>';\n\n $field = 'profile_' . $i;\n\n if ($options['profile_' . $i . '_type'] == 'text') {\n $buffer .= '<input class=\"tnp-profile tnp-profile-' . $i . '\" type=\"text\" name=\"np' . $i . '\" value=\"' . esc_attr($user->$field) . '\"' .\n ($options['profile_' . $i . '_rules'] == 1 ? ' required' : '') . '>';\n }\n\n if ($options['profile_' . $i . '_type'] == 'select') {\n $buffer .= '<select class=\"tnp-profile tnp-profile-' . $i . '\" name=\"np' . $i . '\"' .\n ($options['profile_' . $i . '_rules'] == 1 ? ' required' : '') . '>';\n $opts = explode(',', $options['profile_' . $i . '_options']);\n for ($j = 0; $j < count($opts); $j++) {\n $opts[$j] = trim($opts[$j]);\n $buffer .= '<option';\n if ($opts[$j] == $user->$field)\n $buffer .= ' selected';\n $buffer .= '>' . esc_html($opts[$j]) . '</option>';\n }\n $buffer .= '</select>';\n }\n\n $buffer .= \"</div>\\n\";\n }\n\n // Lists\n $lists = $this->get_lists_for_profile($language);\n $tmp = '';\n foreach ($lists as $list) {\n\n $tmp .= '<div class=\"tnp-field tnp-field-list\">';\n $tmp .= '<label><input class=\"tnp-list tnp-list-' . $list->id . '\" type=\"checkbox\" name=\"nl[]\" value=\"' . $list->id . '\"';\n $field = 'list_' . $list->id;\n if ($user->$field == 1) {\n $tmp .= ' checked';\n }\n $tmp .= '><span class=\"tnp-list-label\">' . esc_html($list->name) . '</span></label>';\n $tmp .= \"</div>\\n\";\n }\n\n if (!empty($tmp)) {\n $buffer .= '<div class=\"tnp-lists\">' . \"\\n\" . $tmp . \"\\n\" . '</div>';\n }\n\n $extra = apply_filters('newsletter_profile_extra', array(), $user);\n foreach ($extra as $x) {\n $buffer .= '<div class=\"tnp-field\">';\n $buffer .= '<label>' . $x['label'] . \"</label>\";\n $buffer .= $x['field'];\n $buffer .= \"</div>\\n\";\n }\n \n $local_options = $this->get_options('', $this->get_user_language($user));\n\n // Privacy\n $privacy_url = NewsletterSubscription::instance()->get_privacy_url();\n if (!empty($local_options['privacy_label']) && !empty($privacy_url)) {\n $buffer .= '<div class=\"tnp-field tnp-field-privacy\">';\n if ($privacy_url) {\n $buffer .= '<a href=\"' . $privacy_url . '\" target=\"_blank\">';\n }\n\n $buffer .= $local_options['privacy_label'];\n\n if ($privacy_url) {\n $buffer .= '</a>';\n }\n $buffer .= \"</div>\\n\";\n }\n\n $buffer .= '<div class=\"tnp-field tnp-field-button\">';\n $buffer .= '<input class=\"tnp-submit\" type=\"submit\" value=\"' . esc_attr($local_options['save_label']) . '\">';\n $buffer .= \"</div>\\n\";\n\n $buffer .= \"</form>\\n</div>\\n\";\n\n return $buffer;\n }", "function saveExtraProfileFields($user_id) {\n\t\tif($this->checkPermissions()) {\n\t\t\tif ( !current_user_can( 'edit_user', $user_id ) ) { return false; }\n\t\t\tupdate_usermeta( $user_id, 'lepress-organization', $_POST['lepress-organization'] );\n\t\t}\n\t}", "public static function add_filters_get_user_option()\n\t\t\t\t{\n\t\t\t\t\tif(!($fields = json_decode($GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"o\"][\"custom_reg_fields\"], TRUE)))\n\t\t\t\t\t\treturn; // Nothing to do in this case.\n\n\t\t\t\t\tforeach($fields as $_field => $_config)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tadd_filter('get_user_option_' . $_field, 'c_ws_plugin__s2member_custom_reg_fields::do_filter_get_user_option', 20, 3);\n\t\t\t\t\t\t\tadd_filter('get_user_option_s2_' . $_field, 'c_ws_plugin__s2member_custom_reg_fields::do_filter_get_user_option', 20, 3);\n\t\t\t\t\t\t}\n\t\t\t\t\tunset($_field, $_config); // Housekeeping.\n\t\t\t\t}", "public function admin_extra_profile_fields( $user ) {\n\t\t$fields = $this->create_extra_profile_fields();\n\t\trequire_once( H3_MGMT_ABSPATH . '/templates/admin-profile.php' );\n\t}", "public function edit_self(ProfileUser $editted_profile) {\r\n\t\tif ($this->user_id) {\r\n\t\t\t$sql = \"UPDATE `users` SET program = '$editted_profile->program' AND level = '$editted_profile->level' AND commuter = '$editted_profile->commuter' AND bio = '$editted_profile->bio' WHERE user_id = '$this->user_id' LIMIT 1\";\r\n\t\t\t$result = $this->dbc->query($sql)\r\n\t\t\tor die ($this->dbc->error);\r\n\t\t}\r\n\t}", "public function getUserProfile();", "function pmpromd_show_extra_profile_fields($user)\r\n{\r\n\tglobal $pmpro_pages;\r\n\r\n\tif ( empty( $pmpro_pages['member_profile_edit'] ) || ! is_page( $pmpro_pages['member_profile_edit'] ) ) {\r\n?>\r\n\t<h3><?php echo get_the_title($pmpro_pages['directory']); ?></h3>\r\n <table class=\"form-table\">\r\n <tbody>\r\n <tr class=\"user-hide-directory-wrap\">\r\n <th scope=\"row\"></th>\r\n <td>\r\n <?php\r\n $directory_page = !empty( get_the_title($pmpro_pages['directory']) ) ? esc_html( get_the_title($pmpro_pages['directory']) ) : __( 'directory', 'pmpro-member-directory' ); ?>\r\n <label for=\"hide_directory\">\r\n <input name=\"hide_directory\" type=\"checkbox\" id=\"hide_directory\" <?php checked( get_user_meta($user->ID, 'pmpromd_hide_directory', true), 1 ); ?> value=\"1\"><?php printf(__('Hide from %s?','pmpromd'), $directory_page ); ?>\r\n </label>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n<?php\r\n\t} else { //If we're on the front-end page edit lets use div instead.\r\n?>\r\n\t<div class=\"pmpro_member_profile_edit-field pmpro_member_profile_edit-field-hide_directory\">\r\n\t<?php $directory_page = !empty( get_the_title($pmpro_pages['directory']) ) ? esc_html( get_the_title($pmpro_pages['directory']) ) : __( 'directory', 'pmpro-member-directory' ); ?>\r\n\t<label for=\"hide_directory\">\r\n\t\t<input name=\"hide_directory\" type=\"checkbox\" id=\"hide_directory\" <?php checked( get_user_meta($user->ID, 'pmpromd_hide_directory', true), 1 ); ?> value=\"1\"><?php printf(__('Hide from %s?','pmpromd'), $directory_page ); ?>\r\n\t</label>\r\n\t</div> <!-- end pmpro_member_profile_edit-field-hide_directory -->\r\n<?php\r\n\t}\r\n}", "abstract function getUserProfileProperty($user, $property_name);", "function itstar_save_extra_user_profile_fields( $user_id ) {\n $saved = false;\n if ( current_user_can( 'edit_user', $user_id ) ) {\n update_user_meta( $user_id, 'birthday', $_POST['birthday'] );\n update_user_meta( $user_id, 'birthmonth', $_POST['birthmonth'] );\n update_user_meta( $user_id, 'birthyear', $_POST['birthyear'] );\n update_user_meta( $user_id, 'phone', $_POST['phone'] );\n update_user_meta( $user_id, 'job', $_POST['job'] );\n $saved = true;\n }\n return true;\n}", "function wponion_user_profile( $instance_id_or_args = array(), $fields = array() ) {\n\t\tif ( is_string( $instance_id_or_args ) && empty( $fields ) ) {\n\t\t\treturn wponion_user_profile_registry( $instance_id_or_args );\n\t\t}\n\t\treturn new User_Profile( $instance_id_or_args, $fields );\n\t}", "function getfaircoin_edd_pre_update_user_profile( $user_id, $userdata ) {\r\n $fairaddress = isset( $_POST['edd_fairaddress'] ) ? $_POST['edd_fairaddress'] : '';\r\n $fairsaving = isset( $_POST['edd_fairsaving'] ) ? $_POST['edd_fairsaving'] : '0';\r\n // Make sure user enters a fairaddress number\r\n if ( ! $fairsaving && ! $fairaddress ) {\r\n edd_set_error( 'fairaddress_required', __( 'Please enter a Faircoin Address', 'edd-getfaircoin' ) );\r\n }\r\n // update fairaddress number\r\n update_user_meta( $user_id, '_edd_user_fairaddress', $fairaddress );\r\n update_user_meta( $user_id, '_edd_user_fairsaving', $fairsaving );\r\n}", "public function changeOptionsForUser(array $form, FormStateInterface $form_state){\n return $form['username'];\n }", "function save_extra_user_profile_fields( $user_id ) {\n if ( !current_user_can( 'edit_user', $user_id ) ) { \n return false; \n }\n\n\n $socialLinks=array(\"twitter\" => $_POST['twitter'] , \"facebook\" => $_POST['facebook'],\"instagram\" => $_POST['instagram']);\n\n \n update_user_meta(\n $user_id,\n 'social_links',\n $socialLinks\n );\n}", "public function profile(){\n\t\t$this->common_lib->profile($this->user,$this->menu,$this->group->name);\n\t}", "function dialogue_add_user_picture_fields(stdClass &$user) {\n global $PAGE;\n\n $user->fullname = fullname($user);\n $userpic = new user_picture($user);\n $imageurl = $userpic->get_url($PAGE);\n $user->imageurl = $imageurl->out();\n if (empty($user->imagealt)) {\n $user->imagealt = get_string('pictureof', '', $user->fullname);\n }\n return;\n}", "public function Edit_My_Profile()\n\t{\n\t\t$this->_CheckLogged();\n\t\t\n\t\t$this->_processInsert($this->instructors_model->getMyPostId());\n\t}", "function save_profile() {\n global $wpdb;\n\n // Get the current subscriber, fail if not found\n $user = $this->get_user_from_request(true);\n\n // Conatains the cleaned up user data to be saved\n $data = array();\n $data['id'] = $user->id;\n\n $options_profile = get_option('newsletter_profile', array());\n $options_main = get_option('newsletter_main', array());\n\n // Not an elegant interaction between modules but...\n $subscription_module = NewsletterSubscription::instance();\n\n if (!$this->is_email($_REQUEST['ne'])) {\n $user->alert = $this->options['profile_error'];\n return $user;\n }\n\n $email = $this->normalize_email(stripslashes($_REQUEST['ne']));\n $email_changed = ($email != $user->email);\n\n // If the email has been changed, check if it is available\n if ($email_changed) {\n $tmp = $this->get_user($email);\n if ($tmp != null && $tmp->id != $user->id) {\n // TODO: Move the label on profile setting panel\n $user->alert = $this->options['error'];\n return $user;\n }\n $data['status'] = Newsletter::STATUS_NOT_CONFIRMED;\n }\n\n // General data\n $data['email'] = $email;\n if (isset($_REQUEST['nn'])) {\n $data['name'] = $this->normalize_name(stripslashes($_REQUEST['nn']));\n if ($subscription_module->is_spam_text($data['name'])) {\n die();\n }\n }\n if (isset($_REQUEST['ns'])) {\n $data['surname'] = $this->normalize_name(stripslashes($_REQUEST['ns']));\n if ($subscription_module->is_spam_text($data['surname'])) {\n die();\n }\n }\n if ($options_profile['sex_status'] >= 1) {\n $data['sex'] = $_REQUEST['nx'][0];\n // Wrong data injection check\n if ($data['sex'] != 'm' && $data['sex'] != 'f' && $data['sex'] != 'n') {\n die('Wrong sex field');\n }\n }\n\n // Lists. If not list is present or there is no list to choose or all are unchecked.\n $nl = array();\n if (isset($_REQUEST['nl']) && is_array($_REQUEST['nl'])) {\n $nl = $_REQUEST['nl'];\n }\n\n // Every possible list shown in the profile must be processed\n $lists = $this->get_lists_for_profile();\n foreach ($lists as $list) {\n $field_name = 'list_' . $list->id;\n $data[$field_name] = in_array($list->id, $nl) ? 1 : 0;\n }\n\n // Profile\n for ($i = 1; $i <= NEWSLETTER_PROFILE_MAX; $i++) {\n // Private fields cannot be changed by the subscriber\n if ($options_profile['profile_' . $i . '_status'] == 0) {\n continue;\n }\n $data['profile_' . $i] = stripslashes($_REQUEST['np' . $i]);\n }\n\n\n // Feed by Mail service is saved here\n $data = apply_filters('newsletter_profile_save', $data);\n\n if ($user->status == TNP_User::STATUS_NOT_CONFIRMED) {\n $data['status'] = TNP_User::STATUS_CONFIRMED;\n }\n\n $user = $this->save_user($data);\n $this->add_user_log($user, 'profile');\n\n // Send the activation again only if we use double opt-in, otherwise it has no meaning\n // TODO: Maybe define a specific email for that and not the activation email\n if ($email_changed && $subscription_module->is_double_optin()) {\n $subscription_module->send_activation_email($user);\n // TODO: Move this option on new profile configuration panel\n $alert = $this->options['profile_email_changed'];\n }\n\n if (isset($alert)) {\n $user->alert = $alert;\n } else {\n // TODO: Move this label on profile settings panel\n $user->alert = $this->options['saved'];\n }\n return $user;\n }", "protected function handlePrivacy() : void // public visibility\n {\n if (!User::$id || empty($this->_get['id'][0]))\n {\n trigger_error('AjaxProfile::handlePrivacy - profileId empty or user not logged in', E_USER_ERROR);\n return;\n }\n\n $uid = User::$id;\n if ($this->_get['user'] && User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU))\n {\n if (!($uid = DB::Aowow()->selectCell('SELECT id FROM ?_account WHERE user = ?', $this->_get['user'])))\n {\n trigger_error('AjaxProfile::handlePrivacy - user \"'.$this->_get['user'].'\" does not exist', E_USER_ERROR);\n return;\n }\n }\n\n if ($this->undo)\n {\n DB::Aowow()->query('UPDATE ?_account_profiles SET extraFlags = extraFlags & ?d WHERE profileId IN (?a) AND accountId = ?d', ~PROFILER_CU_PUBLISHED, $this->_get['id'], $uid);\n DB::Aowow()->query('UPDATE ?_profiler_profiles SET cuFlags = cuFlags & ?d WHERE id IN (?a) AND user = ?d', ~PROFILER_CU_PUBLISHED, $this->_get['id'], $uid);\n }\n else\n {\n DB::Aowow()->query('UPDATE ?_account_profiles SET extraFlags = extraFlags | ?d WHERE profileId IN (?a) AND accountId = ?d', PROFILER_CU_PUBLISHED, $this->_get['id'], $uid);\n DB::Aowow()->query('UPDATE ?_profiler_profiles SET cuFlags = cuFlags | ?d WHERE id IN (?a) AND user = ?d', PROFILER_CU_PUBLISHED, $this->_get['id'], $uid);\n }\n }", "static function allowShowingProfile($agentoptin)\n\t{\n global $configClass;\n if($configClass['show_agent_details'] == 1)\n\t\t{\n if($configClass['use_privacy_policy'] == 1) \n\t\t\t{\n if ($configClass['allow_user_profile_optin'] && $agentoptin == 0) \n\t\t\t\t{\n return true;\n }\n\t\t\t\telse\n\t\t\t\t{\n return false;\n }\n }\n\t\t\telse\n\t\t\t{\n return true;\n }\n }\n return false;\n }", "public function load_profile_fields( $value, $post_id, $field )\n\t{\n\t\tif ( ! $value && in_array($field['name'], $this->settings['profile_fields']) )\n\t\t{\n\t\t\t$user = get_user_by( 'id', $post_id );\n\t\t\tif ( $user )\n\t\t\t{\n\t\t\t\tif ( 'username' == $field['name'] || 'login' == $field['name'] ) {\n\t\t\t\t\t$key = 'user_login';\n\t\t\t\t} elseif ( 'email' == $field['name'] ) {\n\t\t\t\t\t$key = 'user_email';\n\t\t\t\t}\n\n\t\t\t\tif (! empty($user->$key) ) {\n\t\t\t\t\t$value = $user->$key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}", "function get_profile_fname($fname){\r\n\t\r\n}", "function profileUser() {\n if (SSession::getInstance()->__isset(\"role\")) {\n $model = new UserModel;\n $result = $model->selectUser(SSession::getInstance()->mail);\n $this->view->show(\"profileView.php\", $result);\n } else {\n $this->view->show(\"indexView.php\");\n }\n }", "function user_edit($user_info)\n {\n }", "function wck_fep_output_user_profile(){\n\n\t$nonce = wp_create_nonce( 'wck-fep-user-action' );\n\n\t$current_user = wp_get_current_user();\n\t$user_data = get_userdata( $current_user->ID );\n\n\t$user_profile = '<div id=\"wck-fep-update-form\">';\n\t$user_profile .= '<p><span class=\"wck-welcome\">'. sprintf( __( 'Welcome %1$s! ', 'wck' ), $current_user->display_name ) .'</span><a href=\"'. wp_logout_url( wck_fep_cur_page_url() ).'\" class=\"wck-logout\">'. __( 'Logout', 'wck' ) .'</a></p>';\n\n\t$user_profile .= '<p id=\"wck-fep-update-messages\"></p>';\n\t$user_profile .= '<p id=\"wck-fep-update-errors\"></p>';\n\n\t$user_profile .= '<ul>';\n\t$user_profile .= '<li><label for=\"email\">'. __( 'Email:', 'wck' ) .'</label>';\n\t$user_profile .= '<input type=\"text\" id=\"email\" name=\"email\" value=\"'. esc_attr( $current_user->user_email ) .'\" /></li>';\n\n\t$user_profile .= '<li><label for=\"password\">'. __( 'Password:', 'wck' ) .'</label>';\n\t$user_profile .= '<input type=\"password\" id=\"password\" name=\"password\"/></li>';\n\n\t$user_profile .= '<li><label for=\"confirm-password\">'. __( 'Password Confirm:', 'wck' ) .'</label>';\n\t$user_profile .= '<input type=\"password\" id=\"confirm-password\" name=\"confirm-password\"/></li>';\n\n\t$user_profile .= '<li><label for=\"description\">'. __( 'Description', 'wck' ) .'</label>';\n\t$user_profile .= '<textarea id=\"description\" name=\"description\">'. esc_textarea( $user_data->user_description ) .'</textarea></li>';\n\n\t$user_profile .= '<li><input type=\"submit\" value=\"'. __( 'Update', 'wck' ) .'\" onclick=\"wckFepUpdateUser(\\''. $nonce .'\\')\" /></li>';\n\t$user_profile .= '</ul></div>';\n\n\treturn apply_filters( 'wck_fep_user_profile', $user_profile );\n}", "public function setUserfield($value);", "function get_profile_usrnm($usrname){\r\n\t\r\n}", "function user_user_profile($CI,$user){\n\t\t$CI->user->head($user);\n\t}", "function ajax_genmapper_user_country_selected() {\n\t\n\t$choosed_country = isset($_POST['choosed_country']) ? $_POST['choosed_country'] : '';\n\t\n\tif ( $choosed_country )\n\t{\n\t\t\t$meta=get_user_meta(get_current_user_id(), 'genmapper_country_code', true);\n\t\t\tif ( $meta == '' || (is_array($meta) && count($meta)==0 ) )\n\t\t\t{\n\t\t \tupdate_user_meta(get_current_user_id(), 'genmapper_country_code',$choosed_country);\n\t\t\t\techo 'country_set';\n\t\t\t}\n\n\t}\n\telse\n\t{\n\t\t\n\t}\n\t\n\twp_die();\n}", "public static function show_user_extra_field( $user ) {\n\t\t$phone = get_user_meta( $user->ID, 'phone', true );\n\t\tif ( empty( $phone ) ) {\n\t\t\treturn;\n\t\t}\n\t\t?>\n\t\t<h3><?php echo esc_html__( 'Extra profile information', 'uael' ); ?></h3>\n\t\t<table class=\"form-table\">\n\t\t\t<tr>\n\t\t\t\t<th><label for=\"phone\"><?php echo esc_html__( 'Phone Number', 'uael' ); ?></label></th>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" name=\"phone\" id=\"phone\" value=\"<?php echo esc_attr( $phone ); ?>\" class=\"regular-text\" placeholder=\"<?php echo esc_attr( 'Enter your phone number' ); ?>\" /><br />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<?php\n\t}", "public function setProfileInformation()\n {\n $view = \\Utility\\Singleton::getInstance(\"\\View\\Main\");\n\t\t$username=$view->get('userProfile');\n\t\t$this->getUserInformations($view,$username);\n\t\t$this->setResourcesUploaded($view,$username);\n\t\treturn $view->fetch('profile.tpl');\n\t}", "function owa_userProfileUpdateActionTracker($user_id, $old_user_data = '') {\r\n\r\n\t$owa = owa_getInstance();\r\n\t$user = get_userdata($user_id);\r\n\tif (!empty($user->first_name) && !empty($user->last_name)) {\r\n\t\t$label = $user->first_name.' '.$user->last_name;\t\r\n\t} else {\r\n\t\t$label = $user->display_name;\r\n\t}\r\n\t\r\n\t$owa->trackAction('wordpress', 'User Profile Update', $label);\r\n}", "function power_user_seo_fields( $user ) {\n\n\tif ( current_user_can( 'edit_users', $user->ID ) ) {\n\t\tpower_meta_boxes()->show_meta_box( 'power-user-seo', $user );\n\t}\n\n}", "function link_wp_org_callback() {\n\t\t$wp_link_option_value = bp_get_option( 'thaim_link_wordpress_org', '' );\n\t\t?>\n\t\t<input id=\"thaim_link_wordpress_org\" name=\"thaim_link_wordpress_org\" type=\"text\" value=\"<?php echo esc_attr( $wp_link_option_value ); ?>\" />\n\t\t<label for=\"thaim_link_wordpress_org\"><?php esc_html_e( 'WordPress.org username', 'thaim-utilities' ); ?></label>\n\t\t<?php\n\t}", "public function profile()\n\t{\n\t\t// echo $this->fungsi->user_login()->nik;\n\t\t$query = $this->user_m->get($this->fungsi->user_login()->nik);\n\t\t$data['data'] = $query->row();\n\t\t$this->template->load('template2', 'profile', $data);\n\t}", "public function Profile()\n\t{\n\t\t$user = $this->user;\n\t\t$profileForm = new CForm(array(\n\t\t\t'action'\t=> $this->request->CreateUrl('user/profile'),\n\t\t\t),\n\t\tarray(\n\t\t\t'acronym'\t=> new CFormElementText('Acronym', array(\n\t\t\t\t'readonly'\t=> true,\n\t\t\t\t'value'\t\t=> $this->user->GetAcronym(),\n\t\t\t\t)\n\t\t\t),\n\t\t\t'OldPw'\t\t=> new CFormElementPassword('OldPw',array(\n\t\t\t\t'label'\t\t=> 'Old Password',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Pw'\t\t=> new CFormElementPassword('Pw', array(\n\t\t\t\t'label'\t\t=> 'Password',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Pw2'\t\t=> new CFormElementPassword('Pw2', array(\n\t\t\t\t'label'\t\t=> 'Password again',\n\t\t\t\t)\n\t\t\t),\n\t\t\tnew CFormElementSubmit('doChangePassword', array(\n\t\t\t\t'value'\t\t=> 'Change password',\n\t\t\t\t'callback'\t=> array($this, 'DoChangePassword'),\n\t\t\t\t)\n\t\t\t),\n\t\t));\n\t\t\n\t\t$profileForm->SetValidation('OldPw',array('not_empty'));\n\t\t$profileForm->SetValidation('Pw',array('not_empty'));\n\t\t$profileForm->SetValidation('Pw2',array('not_empty'));\n\t\t\n\t\t$profileForm->Check();\n\t\t\n\t\t$userProfileForm = new CForm(array(\n\t\t\t'action'\t=> $this->request->CreateUrl('user/profile')), array(\n\t\t\t'Name'\t\t=> new CFormElementText('Name', array(\n\t\t\t\t'label'\t\t=> 'Name:*',\n\t\t\t\t'value'\t\t=> $user['name'],\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Email'\t\t=> new CFormElementText('Email', array(\n\t\t\t\t'label'\t\t=> 'Email:*',\n\t\t\t\t'value'\t\t=> $user['email'],\n\t\t\t\t)\n\t\t\t),\n\t\t\tnew CFormElementSubmit('doSaveProfile', array(\n\t\t\t\t'value'\t\t=> 'Save',\n\t\t\t\t'callback'\t=> array($this, 'DoSaveProfile'),\n\t\t\t\t)\n\t\t\t),\n\t\t));\n\t\t\n\t\t$userProfileForm->SetValidation('Name',array('not_empty'));\n\t\t$userProfileForm->SetValidation('Email',array('not_empty'));\n\t\t\n\t\t$userProfileForm->Check();\n\t\t\n\t\t$this->views->SetTitle('Profile');\n\t\t$this->views->AddView('user/profile.tpl.php', array(\n\t\t\t'profileForm'\t\t=> $profileForm->GetHTML().$userProfileForm->GetHTMl(),\n\t\t\t'user'\t\t\t\t=> $this->user,\n\t\t\t'is_authenticated'\t=> $this->user['isAuthenticated'],\n\t\t\t),\n\t\t'primary'\n\t\t);\n\t}", "function personal()\r\n\t{\r\n\t\tglobal $ibforums, $std, $print;\r\n\r\n\t\t//-----------------------------------------------\r\n\t\t// Check to make sure that we can edit profiles..\r\n\t\t//-----------------------------------------------\r\n\r\n\t\tif (empty($ibforums->member['g_edit_profile']))\r\n\t\t{\r\n\t\t\t$std->Error(array('LEVEL' => 1, 'MSG' => 'cant_use_feature'));\r\n\t\t}\r\n\r\n\t\t//-----------------------------------------------\r\n\t\t// Format the birthday drop boxes..\r\n\t\t//-----------------------------------------------\r\n\r\n\t\t$date = getdate();\r\n\r\n\t\t$day = \"<option value='0'>--</option>\";\r\n\t\t$mon = \"<option value='0'>--</option>\";\r\n\t\t$year = \"<option value='0'>--</option>\";\r\n\r\n\t\tfor ($i = 1; $i < 32; $i++)\r\n\t\t{\r\n\t\t\t$day .= \"<option value='$i'\";\r\n\r\n\t\t\t$day .= $i == $this->member['bday_day']\r\n\t\t\t\t? \"selected>$i</option>\"\r\n\t\t\t\t: \">$i</option>\";\r\n\t\t}\r\n\r\n\t\tfor ($i = 1; $i < 13; $i++)\r\n\t\t{\r\n\t\t\t$mon .= \"<option value='$i'\";\r\n\r\n\t\t\t$mon .= $i == $this->member['bday_month']\r\n\t\t\t\t? \"selected>{$ibforums->lang['month'.$i]}</option>\"\r\n\t\t\t\t: \">{$ibforums->lang['month'.$i]}</option>\";\r\n\t\t}\r\n\r\n\t\tfor ($i = $date['year'] - 1, $j = $date['year'] - 100; $j < $i; $i--)\r\n\t\t{\r\n\t\t\t$year .= \"<option value='$i'\";\r\n\r\n\t\t\t$year .= $i == $this->member['bday_year']\r\n\t\t\t\t? \"selected>$i</option>\"\r\n\t\t\t\t: \">$i</option>\";\r\n\t\t}\r\n\r\n\t\t//-----------------------------------------------\r\n\t\t// Custom profile fields stuff\r\n\t\t//-----------------------------------------------\r\n\r\n\t\t$required_output = \"\";\r\n\t\t$optional_output = \"\";\r\n\t\t$field_data = array();\r\n\r\n\t\t$stmt = $ibforums->db->query(\r\n\t\t \"SELECT *\r\n\t\t\tFROM ibf_pfields_content\r\n WHERE member_id='\" . $ibforums->member['id'] . \"'\"\r\n );\r\n\r\n\t\twhile ($content = $stmt->fetch())\r\n\t\t{\r\n\t\t\tforeach ($content as $k => $v)\r\n\t\t\t{\r\n\t\t\t\tif (preg_match(\"/^field_(\\d+)$/\", $k, $match))\r\n\t\t\t\t{\r\n\t\t\t\t\t$field_data[$match[1]] = $v;\r\n\t\t\t\t\t//break;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$stmt = $ibforums->db->query(\r\n\t\t \"SELECT *\r\n\t\t\tFROM ibf_pfields_data\r\n WHERE fedit=1\r\n\t\t\tORDER BY forder\"\r\n );\r\n\r\n\t\twhile ($row = $stmt->fetch())\r\n\t\t{\r\n\t\t\t$form_element = \"\";\r\n\r\n\t\t\tif ($row['freq'] == 1)\r\n\t\t\t{\r\n\t\t\t\t$ftype = 'required_output';\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\t$ftype = 'optional_output';\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['ftype'] == 'drop')\r\n\t\t\t{\r\n\t\t\t\t$carray = explode('|', trim($row['fcontent']));\r\n\r\n\t\t\t\t$d_content = \"\";\r\n\r\n\t\t\t\tforeach ($carray as $entry)\r\n\t\t\t\t{\r\n\t\t\t\t\t$value = explode('=', $entry);\r\n\r\n\t\t\t\t\t$ov = trim($value[0]);\r\n\t\t\t\t\t$td = trim($value[1]);\r\n\r\n\t\t\t\t\tif ($ov != \"\" and $td != \"\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$d_content .= ($field_data[$row['fid']] == $ov)\r\n\t\t\t\t\t\t\t? \"<option value='$ov' selected>$td</option>\\n\"\r\n\t\t\t\t\t\t\t: \"<option value='$ov'>$td</option>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($d_content != \"\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$form_element = View::make(\r\n\t\t\t\t\t\t\"ucp.field_dropdown\",\r\n\t\t\t\t\t\t['name' => 'field_' . $row['fid'], 'options' => $d_content]\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($row['ftype'] == 'area')\r\n\t\t\t\t{\r\n\t\t\t\t\t$form_element = View::make(\r\n\t\t\t\t\t\t\"ucp.field_textarea\",\r\n\t\t\t\t\t\t['name' => 'field_' . $row['fid'], 'value' => $field_data[$row['fid']]]\r\n\t\t\t\t\t);\r\n\t\t\t\t} else\r\n\t\t\t\t{\r\n\t\t\t\t\t$form_element = View::make(\r\n\t\t\t\t\t\t\"ucp.field_textinput\",\r\n\t\t\t\t\t\t['name' => 'field_' . $row['fid'], 'value' => $field_data[$row['fid']]]\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t${$ftype} .= View::make(\r\n\t\t\t\t\"ucp.field_entry\",\r\n\t\t\t\t['title' => $row['ftitle'], 'desc' => $row['fdesc'], 'content' => $form_element]\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t//-----------------------------------------------\r\n\t\t// Format the interest / location boxes\r\n\t\t//-----------------------------------------------\r\n\r\n\t\t$this->member['location'] = $this->parser->unconvert($this->member['location']);\r\n\t\t$this->member['interests'] = $this->parser->unconvert($this->member['interests']);\r\n\r\n\t\t$this->member['key'] = $this->md5_check;\r\n\r\n\t\t//-----------------------------------------------\r\n\t\t// Suck up the HTML and swop some tags if need be\r\n\t\t//-----------------------------------------------\r\n\r\n\t\t$this->output .= View::make(\"ucp.personal_panel\", ['Profile' => $this->member]);\r\n\r\n\t\tif (($ibforums->vars['post_titlechange'] and $this->member['posts'] > $ibforums->vars['post_titlechange']) or\r\n\t\t ($ibforums->vars['rep_titlechange'] and $this->member['rep'] >= $ibforums->vars['rep_titlechange'])\r\n\t\t)\r\n\t\t{\r\n\t\t\t$t_html = View::make(\"ucp.member_title\", ['title' => $this->member['title']]);\r\n\t\t\t$this->output = preg_replace(\"/<!--\\{MEMBERTITLE\\}-->/\", $t_html, $this->output);\r\n\t\t}\r\n\r\n\t\t$t_html = View::make(\"ucp.birthday\", ['day' => $day, 'month' => $mon, 'year' => $year]);\r\n\r\n\t\t$this->output = preg_replace(\"/<!--\\{BIRTHDAY\\}-->/\", $t_html, $this->output);\r\n\r\n\t\t//-----------------------------------------------\r\n\t\t// Format the Gender radio buttons..\r\n\t\t//-----------------------------------------------\r\n\r\n\t\t$t_html = View::make(\"ucp.gender\", ['gender' => $this->member['gender']]);\r\n\r\n\t\t$this->output = preg_replace(\"/<!--\\{GENDER\\}-->/\", $t_html, $this->output);\r\n\r\n\t\t//-----------------------------------------------\r\n\t\t// Add in the custom fields if we need to.\r\n\t\t//-----------------------------------------------\r\n\r\n\t\t//echo \"required_output =\".$required_output.\"<br>\";\r\n\r\n\t\tif ($required_output != \"\")\r\n\t\t{\r\n\t\t\t$this->output = str_replace(\"<!--{REQUIRED.FIELDS}-->\", View::make(\r\n\t\t\t\t\t\"ucp.required_title\"\r\n\t\t\t\t) . \"\\n\" . View::make(\r\n\t\t\t\t\t\"ucp.personal_panel_username\",\r\n\t\t\t\t\t['name' => $this->member['name']]\r\n\t\t\t\t) . \"\\n\" . $required_output . View::make(\"ucp.required_end\"), $this->output);\r\n\t\t}\r\n\r\n\t\tif ($optional_output != \"\")\r\n\t\t{\r\n\t\t\t$this->output = str_replace(\"<!--{OPTIONAL.FIELDS}-->\", \"\\n\" . $optional_output, $this->output);\r\n\t\t}\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\t}", "function vdtestim_use_gravatar_field () {\n\n\t$vdtestim_options = get_option( 'vdtestim_global_settings' );\n\n\t?>\n\n\t<h4>Use Gravatar Image In Profile If No Profile Images Is Uploaded</h4>\n\n\t<select name=\"vdtestim_global_settings[use_gravatar]\">\n\t\t<option name=\"vdtestim_global_settings[use_gravatar]\" value=\"yes\"<?php selected( $vdtestim_options['use_gravatar'], 'yes' ); ?> >Yes</option>\n\t\t<option name=\"vdtestim_global_settings[use_gravatar]\" value=\"no\"<?php selected( $vdtestim_options['use_gravatar'], 'no' ); ?> >No</option>\n\t</select>\n\n\t<?php\n}", "public function r_user(){\n\t\tif (!empty($this -> user)) {\n\t\t\techo 'value = \"'.$this -> user.'\"';\n\t\t}\n\t}", "public function updateProfile($user, array $profile);", "public function profile()\n {\n $view_data = [\n 'form_errors' => []\n ];\n // Check input data\n if ($this->input->is_post()) {\n $gender = '';\n\n if (!empty($this->input->post('sex'))) {\n $gender = $this->input->post('sex');\n }\n\n if(mb_strlen($this->input->post('nickname')) <= 10) {\n // Call API to register for parent\n $res = $this->_api('user')->update_profile([\n 'id' => $this->current_user->id,\n 'nickname' => $this->input->post('nickname'),\n 'sex' => $gender,\n ]);\n } else {\n $view_data['form_errors'] = ['nickname' => 'ニックネーム欄は10文字以内で入力してください'];\n }\n\n if (isset($res['result'])) {\n $this->session->set_flashdata('get_trophy', $res['result']['trophy']);\n $this->session->set_flashdata('get_point', $res['result']['point']);\n redirect('setting');\n return;\n } elseif (isset($res)) {\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n }\n $view_data['post'] = $this->input->post();\n\n }\n\n $user_res = $this->get_current_user_detail();\n\n $view_data['user'] = $user_res['result'];\n\n $this->_render($view_data);\n }", "function userAccountField(&$Model, $field = 'username', $data) {\r\n\t\t$field = $this->settings[$Model->alias]['fields'][$field];\r\n\t\t$alias = $Model->alias;\r\n\t\tif (strpos('.', $field)) {\r\n\t\t\tlist($alias, $field) = explode($field, '.');\r\n\t\t}\r\n\t\tif (!$data[$alias][$field]) {\r\n\t\t\t$missing = true;\r\n\t\t\tif ($alias == $Model->alias) {\r\n\t\t\t\t$Model->invalidate($field, 'missing');\r\n\t\t\t} else {\r\n\t\t\t\t$Model->$alias->invalidate($field, 'missing');\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $Model->field($field);\r\n\t}", "public function myprofileAction()\n {\n \tZend_Registry::set('Category', Category::ACCOUNT);\n \tZend_Registry::set('SubCategory', SubCategory::NONE);\n\n $album = $this->_user->getProfileAlbum();\n if(!$album->isReadableBy($this->_user, $this->_acl)){\n $album = null;\n \t}\n\n $blog = $this->_user->getBlog();\n if(!$blog->isReadableBy($this->_user, $this->_acl)){\n $blog = null;\n \t}\n\n $this->view->profilee = $this->_user;\n $this->view->album = $album;\n $this->view->blog = $blog;\n $this->view->medias = $album->getItemSet();\n\n $this->renderScript('user/profile.phtml');\n }", "public function setProfile($data)\n {\n if (isset($data['identifier'])) $this->setIdentifier ($data['identifier']);\n if (isset($data['providerName'])) $this->setProvider ($data['providerName']);\n if (isset($data['displayName'])) $this->setDisplayName($data['displayName']);\n if (isset($data['preferredUsername'])) $this->setUserName ($data['preferredUsername']);\n if (isset($data['verifiedEmail'])) $this->setEmail ($data['verifiedEmail']);\n }", "function editUserName($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$fname = $this->modify(mysqli_real_escape_string($conn, $data['fname']));\n\t\t\t$lname = $this->modify(mysqli_real_escape_string($conn, $data['lname']));\n\t\t\tif(empty($fname) || empty($lname)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z]+(\\.)?( )?[a-z]*$/i\", $fname) && preg_match(\"/^[a-z]+$/i\", $lname)) {\n\t\t\t\t\tif($this->length($fname, 25, 4) && $this->length($lname, 25, 4)) {\n\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_fname\", $fname , $_SESSION['userid']);\n\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_lname\", $lname , $_SESSION['userid']);\n\t\t\t\t\t\tif($result == false || $result1 == false) {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Successfull\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"Error=toobigOrtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=name\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function create_extra_profile_fields() {\n\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'About you', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'type' => 'section'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'City', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'id' => 'city',\n\t\t\t\t'type' => 'text'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'Mobile Phone', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'id' => 'mobile',\n\t\t\t\t'type' => 'text'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'Date of Birth', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'id' => 'birthday',\n\t\t\t\t'type' => 'date'\n\t\t\t),\n\t\t\tarray (\n\t\t\t\t'label'\t=> _x( 'Shirt Size', 'Team Profile Form', 'h3-mgmt' ),\n\t\t\t\t'id'\t=> 'shirt_size',\n\t\t\t\t'type'\t=> 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t0 => array(\n\t\t\t\t\t\t'value' => 0,\n\t\t\t\t\t\t'label' => _x( 'Please select your size...', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'ms',\n\t\t\t\t\t\t'label' => _x( \"Unisex S\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'mm',\n\t\t\t\t\t\t'label' => _x( \"Unisex M\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'ml',\n\t\t\t\t\t\t'label' => _x( \"Unisex L\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'mx',\n\t\t\t\t\t\t'label' => _x( \"Unisex XL\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'gs',\n\t\t\t\t\t\t'label' => _x( 'Slimfit S', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'gm',\n\t\t\t\t\t\t'label' => _x( 'Slimfit M', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'gl',\n\t\t\t\t\t\t'label' => _x( 'Slimfit L', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray (\n\t\t\t\t'label'\t=> _x( 'Could we give our partner Ortel Mobile your personal Information?', 'Team Profile Form', 'h3-mgmt' ),\n\t\t\t\t'id'\t=> 'public_mobile_inf',\n\t\t\t\t'type'\t=> 'select',\n\t\t\t\t'options' => array(\n\t\t\t\t\t0 => array(\n\t\t\t\t\t\t'value' => 0,\n\t\t\t\t\t\t'label' => _x( 'Please select if it is ok or not...', 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'yes',\n\t\t\t\t\t\t'label' => _x( \"YES, give them my personal information\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'value' => 'no',\n\t\t\t\t\t\t'label' => _x( \"Please not (So you do not get your sponsored sim-card\", 'Team Profile Form', 'h3-mgmt' )\n\t\t\t\t\t)\t\t\t\t\t\n\t\t\t\t)\n ),\n\t\t\tarray (\n\t\t\t\t'label'\t=> _x( 'Address for Ortel', 'Team Profile Form', 'h3-mgmt' ),\n 'id'\t=> 'addressMobile',\n\t\t\t\t'type'\t=> 'textarea'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'label' => _x( 'Avatar', 'User Profile', 'h3-mgmt' ),\n\t\t\t\t'type' => 'section',\n\t\t\t\t'admin_hide' => true\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'avatar',\n\t\t\t\t'id' => 'simple-local-avatar',\n\t\t\t\t'admin_hide' => true\n\t\t\t)\n\t\t);\n\t\treturn $fields;\n\t}", "function is_user_opted_in( ?WP_User $user = null ) : ?bool {\n\tif ( ! $user ) {\n\t\t$user = wp_get_current_user();\n\t}\n\tif ( ! $user->exists() ) {\n\t\treturn null;\n\t}\n\n\t$did_opt_in = get_user_meta( $user->ID, META_OPT_IN, true );\n\n\tif ( $did_opt_in === '' ) {\n\t\treturn null;\n\t}\n\n\treturn intval( $did_opt_in ) === 1;\n}", "function cjpopups_user_info($input, $var = null){\n\tglobal $wpdb;\n\t$user = $wpdb->get_row(\"SELECT * FROM $wpdb->users WHERE user_login = '{$input}' OR user_email = '{$input}' OR ID = '{$input}'\");\n\t$user_data_keys = array( 'user_login', 'user_pass', 'user_nicename', 'user_email', 'user_url', 'display_name' );\n\tif(!empty($user)){\n\t\tforeach ($user as $key => $value) {\n\t\t\t$users_data[$key] = $value;\n\t\t}\n\t\t$usermeta = $wpdb->get_results(\"SELECT * FROM $wpdb->usermeta WHERE user_id = '{$user->ID}'\");\n\t\tforeach ($usermeta as $key => $value) {\n\t\t\tif(!in_array($value->meta_key, $user_data_keys)){\n\t\t\t\t$users_data[$value->meta_key] = $value->meta_value;\n\t\t\t}\n\t\t}\n\t\tif(!is_null($var)){\n\t\t\t$return_user_data = (isset($users_data[$var])) ? $users_data[$var] : null;\n\t\t\treturn $return_user_data;\n\t\t}else{\n\t\t\t$return_user_data = @$users_data;\n\t\t\tforeach ($return_user_data as $ukey => $uvalue) {\n\t\t\t\tif(is_serialized($uvalue)){\n\t\t\t\t\t$return_user_data[$ukey] = unserialize($uvalue);\n\t\t\t\t}else{\n\t\t\t\t\t$return_user_data[$ukey] = $uvalue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$return_user_data['user_role'] = cjpopups_user_role($return_user_data['ID']);\n\t\t\treturn $return_user_data;\n\t\t}\n\n\t}else{\n\t\treturn null;\n\t}\n}", "function update_user_option($user_id, $option_name, $newvalue, $is_global = \\false)\n {\n }", "function hook_openid_connect_userinfo_save(UserInterface $account, array $context) {\n // Update only when the required information is available.\n if (\n $context['plugin_id'] != 'generic'\n || empty($context['userinfo']['my_info'])\n ) {\n return;\n }\n\n // Note: For brevity, this example does not validate field\n // types, nor does it implement error handling.\n $my_info = $context['userinfo']['my_info'];\n foreach ($my_info as $key => $value) {\n $account->set('field_' . $key, $value);\n }\n}", "public function profile() {\n if ($this->input->post() && $this->session->has_userdata('curr_user_id_edit')) {\n $this->_edit_profile();\n return;\n }\n\n // else, continue here\n\n $user_id = $this->session->userdata('user')['id'];\n // if third segment is not specified\n if (!$this->uri->segment(3)) {\n $this->_redirect('dashboard/profile/' . $user_id);\n return;\n }\n\n $id_segment = $this->uri->segment(3);\n // user should be active!\n $user = $this->_fetch_user($id_segment);\n\n // if user does not exist\n // or user status is 0\n if (!$user || $user['status'] == 0) {\n $this->session->set_flashdata('msg', 'An error occurred. User does not exist.');\n $this->_redirect('dashboard');\n return;\n }\n\n // allow edit if curr id == segment\n $allow_edit = $id_segment === $user_id;\n\n if ($allow_edit && $this->uri->segment(4) === 'edit') {\n $edit = true;\n }\n // if not edit, redirect to no /edit\n else if ($this->uri->segment(4) === 'edit') {\n $this->_redirect('dashboard/profile/' . $id_segment);\n return;\n }\n // else if any segment\n // go back to profile\n else if ($this->uri->segment(4)) {\n $this->_redirect('dashboard/profile/' . $id_segment);\n return;\n }\n\n // if just view\n if (!(isset($edit) && $edit)) {\n // unset user id edit here\n $this->session->unset_userdata('curr_user_id_edit');\n // display profile view\n $data = array(\n 'title' => 'My Profile',\n 'msg' => $this->session->flashdata('msg'),\n 'user' => $user,\n 'allow_edit' => $allow_edit\n );\n $this->_view(\n array('templates/nav', 'pages/dashboard/profile', 'alerts/msg'),\n array_merge($this->_nav_items, $data)\n );\n return;\n }\n\n // proceed here if edit\n $this->load->library('form_validation');\n\n // set session of currently editing\n // unset if not editing above\n $this->session->set_userdata('curr_user_id_edit', $user['id']);\n // display edit profile view\n $this->_show_edit_profile($user);\n }", "public function get_profile($usr = null, $how = 'username'){\n\t\t## Check if a username or id has been supplied when calling the function.\n\t\t## If so, we simply sanitize this value, based on the $how value.\t\t\n\t\tif(!empty($usr)){\n\t\t\tif($how == 'username'){\n\t\t\t\t$usr = $this->sanitize($usr, 'string');\n\t\t\t\t$qury = 'u.username=?';\n\t\t\t}else{\n\t\t\t\t$usr = $this->sanitize($usr, 'integer');\n\t\t\t\t$qury = 'u.id=?';\n\t\t\t}\n\t\t}else{\n\t\t\t## If no value is submitted via the $_GET variable, we just retrive the profile data of the user who is viewing the page ##\n\t\t\tif($how == 'username'){\n\t\t\t\t$usr = (!empty($_GET['user']) ? $this->sanitize($_GET['user'], 'string') : $this->sanitize($this->username, 'string'));\n\t\t\t\t$qury = 'u.username=?';\n\t\t\t}else{\n\t\t\t\t$usr = (!empty($_GET['user']) ? $this->sanitize($_GET['user'], 'integer') : $this->sanitize($this->uid, 'integer'));\n\t\t\t\t$qury = 'u.id=?';\n\t\t\t}\n\t\t}\n\t\t\n\t\t$conditions = array($this->uid, $usr);\n\t\t\n\t\t$get_details = $this->sql->prepare('SELECT\n\t\t\t\t\t\t\t\t\t\t\t\tu.id,\n\t\t\t\t\t\t\t\t\t\t\t\tmg.name as usergroup,\n\t\t\t\t\t\t\t\t\t\t\t\tu.avatar, \n\t\t\t\t\t\t\t\t\t\t\t\tu.username,\n\t\t\t\t\t\t\t\t\t\t\t\tu.email,\n\t\t\t\t\t\t\t\t\t\t\t\tu.membergroup as primary_grp,\n\t\t\t\t\t\t\t\t\t\t\t\tu.other_membergroups as other_grps,\n\t\t\t\t\t\t\t\t\t\t\t\tf.status,\n\t\t\t\t\t\t\t\t\t\t\t\t(SELECT f_val FROM profiles WHERE u_id = u.id AND f_id = 1) nombre,\n\t\t\t\t\t\t\t\t\t\t\t\t(SELECT f_val FROM profiles WHERE u_id = u.id AND f_id = 2) pais\n\t\t\t\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t\t\t\t\tmembers as u\n\t\t\t\t\t\t\t\t\t\t\tINNER JOIN\n\t\t\t\t\t\t\t\t\t\t\t\tmember_groups mg\n\t\t\t\t\t\t\t\t\t\t\t\tON\n\t\t\t\t\t\t\t\t\t\t\t\t\tmg.id = u.membergroup\n\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t\t\t\t\t\tfriends as f\n\t\t\t\t\t\t\t\t\t\t\t\tON\n\t\t\t\t\t\t\t\t\t\t\t\t\tf.friend_id = u.id\n\t\t\t\t\t\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\t\t\t\t\t\t\tf.user_id = ?\n\t\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\t'.$qury);\n\t\t\n\t\t$get_details->execute($conditions);\n\t\t$this->queries++;\n\t\t\n\t\t$profile_data = array('user_found' \t=> false,\n\t\t\t\t\t\t\t 'user_id' \t=> '',\n\t\t\t\t\t\t\t 'user_email' \t=> '',\n\t\t\t\t\t\t\t 'user_username' \t=> $this->lang['cl_profiles_2'],\n\t\t\t\t\t\t\t 'user_usergroup' \t=> '',\n\t\t\t\t\t\t\t 'user_avatar' => $this->base_url.'/images/default_big.png',\n\t\t\t\t\t\t\t 'user_friend' => '',\n\t\t\t\t\t\t\t 'nombre' => '',\n\t\t\t\t\t\t\t 'pais' => ''\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\tif($get_details->rowCount() > 0){\n\t\t\t$profile_data['user_found'] = true;\n\t\t\twhile($row = $get_details->fetchAll(PDO::FETCH_ASSOC)){\n\t\t\t\t$profile_data = array('user_found' \t\t\t=> true,\n\t\t\t\t\t\t\t\t\t 'user_id' \t\t\t=> $row[0]['id'],\n\t\t\t\t\t\t\t\t\t 'user_email' \t\t\t=> $row[0]['email'],\n\t\t\t\t\t\t\t\t\t 'user_username' \t\t=> $row[0]['username'],\n\t\t\t\t\t\t\t\t\t 'user_usergroup' \t\t=> $row[0]['usergroup'],\n\t\t\t\t\t\t\t\t\t 'user_primarygroup' \t=> $row[0]['primary_grp'],\n\t\t\t\t\t\t\t\t\t 'user_othergroups' \t=> (!empty($row[0]['other_grps']) ? explode(',', $row[0]['other_grps']) : array()),\n\t\t\t\t\t\t\t\t\t 'user_avatar' => ($row[0]['avatar'] != null ? $row[0]['avatar'] : ''),\n\t\t\t\t\t\t\t\t\t 'user_friend' \t\t=> ($row[0]['status'] == null ? false : $row[0]['status']),\n 'nombre' => $row[0]['nombre'],\n 'pais' => $row[0]['pais']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t$get_details->closeCursor();\n\t\t\n\t\treturn $profile_data;\n\t}", "public function p_editProfile() {\n\t$_POST['modified'] = Time::now();\n \n $w = \"WHERE user_id = \".$this->user->user_id;\n\t\t\n\t# Insert\n\tDB::instance(DB_NAME)->update(\"users\", $_POST, $w);\n \n Router::redirect(\"/users/profile\");\n\n }", "function wck_get_entry_field_user_select($id){\r\n\t\tif( !empty ( $id ) && is_numeric( $id ) ){\t\t\t\t\r\n\t\t\t$user = get_user_by( 'id', $id );\r\n\t\t\tif ( $user ) \r\n\t\t\t\treturn '<pre>'.htmlspecialchars( $user->display_name );\r\n\t\t\telse\r\n\t\t\t\treturn 'Error - User ID not found in database';\r\n\t\t\t\t\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "function profileUrl()\r\n {\r\n return \"/user/show/{$this->id}\";\r\n }", "public function profile()\n {\n if (isset($_REQUEST['submit'])) {\n\n $fullname = $_POST['fullname'];\n\n $phone = $_POST['phone'];\n\n $username = $_POST['username'];\n\n $des = $_POST['des'];\n\n $user = $_POST['user'];\n\n\n //Checking for User login or not\n $change = $this->getChange($username, $fullname, $phone ,$des, $user);\n\n if ($change) {\n $success = 'Change profile successful!';\n echo \"<p><span class='error' style='color: green'>\" . $success . \"</span></p><br>\";\n } else {\n // Registration Failed\n $fail = 'Change profile failed. Account already not exits, please try again.';\n echo \"<p><span class='error' style='color: red;'>\" . $fail . \"</span></p><br>\";\n };\n }\n }", "function auth_saml2_profile_get_custom_fields($onlyinuserobject = false) {\n global $DB, $CFG;\n\n // Get all the fields.\n $fields = $DB->get_records('user_info_field', null, 'id ASC');\n\n // If only doing the user object ones, unset the rest.\n if ($onlyinuserobject) {\n foreach ($fields as $id => $field) {\n require_once($CFG->dirroot . '/user/profile/field/' .\n $field->datatype . '/field.class.php');\n $newfield = 'profile_field_' . $field->datatype;\n $formfield = new $newfield();\n if (!$formfield->is_user_object_data()) {\n unset($fields[$id]);\n }\n }\n }\n\n return $fields;\n}", "private function __setProfileFormData() {\n\t\t$adminUser = $this->Auth->user();\n\n\t\t$this->request->data['User'] = $adminUser;\n\t\t$this->request->data['User']['old_email'] = $adminUser['email'];\n\n\t\t$dob = $adminUser['date_of_birth'];\n\t\tif (!is_null($dob) && ($dob !== '')) {\n\t\t\tlist($dobYear, $dobMonth, $dobDay) = explode('-', $dob);\n\t\t\t$formattedDob = sprintf('%s-%s-%s', $dobMonth, $dobDay, $dobYear);\n\t\t\t$this->request->data['User']['date_of_birth'] = $formattedDob;\n\t\t}\n\n\t\t$gender = $adminUser['gender'];\n\n\t\t$profileImg = Common::getUserThumb($adminUser['id'], $adminUser['type'], 'medium', 'user_pic');\n\n\t\t$superAdminStatus = __('No');\n\t\tif (intval($adminUser['type']) === User::ROLE_SUPER_ADMIN) {\n\t\t\t$superAdminStatus = __('Yes');\n\t\t}\n\n\t\t$timezoneList = $this->Timezone->get_timezone_list();\n\n\t\t// form details\n\t\t$formId = 'AdminProfileEditForm';\n\t\t$changePasswordFormId = 'AdminChangePasswordForm';\n\t\t$changePasswordFields = $this->__listAdminUserChangePasswordFormFields();\n\t\t$inputDefaults = array(\n\t\t\t'label' => false,\n\t\t\t'div' => false\n\t\t);\n\n\t\t// validation\n\t\t$modelName = 'User';\n\t\t$this->JQValidator->addValidation($modelName, $this->AdminChangePasswordForm->validate, $changePasswordFormId);\n\t\t$this->JQValidator->addValidation($modelName, $this->AdminProfileForm->validate, $formId);\n\n\t\t$title_for_layout = 'Edit Profile';\n\n\t\t$this->set(compact('title_for_layout', 'modelName', 'changePasswordFields', 'formId', 'changePasswordFormId', 'timezoneList', 'inputDefaults', 'gender', 'profileImg', 'superAdminStatus'));\n\t}", "function theme_show_user_learner_data( $value, $column_name, $user_id ) {\n\n if( 'learner' == $column_name ) {\n\t return get_user_meta( $user_id, 'learner', true );\n } // end if\n\n}", "function action_profile_show() {\n // Process request with using of models\n $user = get_authorized_user();\n // Make Response Data\n if ($user !== NULL) {\n $data = [\n 'profile' => $user,\n ];\n return ['view' => 'user/show', 'data' => $data];\n } else {\n return error403();\n }\n}", "function set_editor_profile() {\n\tif (!current_user_can('manage_options')) { ?>\n \t<style type=\"text/css\">\n \t\t.user-rich-editing-wrap, .user-comment-shortcuts-wrap, .show-admin-bar, .user-admin-bar-front-wrap,\n \t\t.user-nickname-wrap, .user-display-name-wrap, .user-url-wrap, .user-description-wrap, #profile-page h2 {\n\t\t\t\tdisplay:none !important;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}\n}", "public function display_talent_info( $args ) {\n $user_login = isset( $args['user_login'] ) ? $args['user_login'] : '';\n $user_profile = 'redirect';\n\n if ( $user_login ) {\n\t $validator = new Zend_Validate_Regex('/^[aA-zZ]{1,8}$/');\n\t $is_valid = $validator->isValid( $user_login );\n\t if ( $is_valid ) {\n $user_profile = $this->get_user_relations( array( 'user_login' => $user_login ) );\n\t }\n }\n\n return $user_profile;\n }", "public function profile()\n {\n $id = $this->Auth->user('id');\n $user = $this->Users->get($id, [\n 'contain' => []\n ]);\n\n if ($this->request->is(['patch', 'post', 'put'])) {\n //avoid mass-assignment attack\n $options = [\n 'fieldList' => [\n 'email',\n 'username',\n 'password',\n 'first_name',\n 'last_name',\n 'address_1',\n 'address_2',\n 'suburb',\n 'state',\n 'post_code',\n 'mobile',\n 'phone',\n ]\n ];\n\n $user = $this->Users->patchEntity($user, $this->request->getData(), $options);\n if ($this->Users->save($user)) {\n\n $this->Flash->success(__('Your profile has been updated.'));\n return $this->redirect(\"/\");\n } else {\n $this->Flash->error(__('Your profile could not be updated. Please, try again.'));\n }\n }\n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n\n return null;\n }", "function _process_user_info()\n\t{\n\t\t$user_info = null;\n\t\t$code = $this->input->get('code');\n\n\t\t//Google redirects with code insead of post\n\t\tif( $code )\n\t\t{\n\t\t\t$user_info = get_user_info( $this->input->get('code') );\n\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$user_info['email'] = trim($this->input->post('email'));\n\t\t\t$user_info['username'] = trim($this->input->post('username'));\n\t\t}\n\n\t\treturn $user_info;\n\t}", "public function update_user_profile($typeOfUser)\n {\n // used for displaying feedback for profile update\n $isProfileUpdated = 'is_' . $typeOfUser . '_profile_updated';\n $_SESSION[$isProfileUpdated] = false;\n\n $email = trim($this->input->post('txtEmail'));\n $phone = trim($this->input->post('txtPhone'));\n\n if ($email != '') {\n $this->CustomModel->updateField($_SESSION['u_id'], 'email', $email);\n $_SESSION[$isProfileUpdated] = true;\n }\n if ($phone != '') {\n $this->CustomModel->updateField($_SESSION['u_id'], 'phone', $phone);\n $_SESSION[$isProfileUpdated] = true;\n }\n\n $filename = 'uploads/' . $this->setUpImageUploadConfig();\n if ($this->upload->do_upload('image')) {\n\n $this->CustomModel->updateUserImage($_SESSION['u_id'], $filename);\n $this->resizeImage($filename, 512, 512);\n $_SESSION[$isProfileUpdated] = true;\n }\n\n // load the corresponding user view\n $this->load_user_view($typeOfUser);\n }", "public function actionProfile()\r\n\t{\r\n\t\t//disable jquery autoload\r\n\t\tYii::app()->clientScript->scriptMap=array(\r\n\t\t\t'jquery.js'=>false,\r\n\t\t);\r\n\t\t$model = $this->loadUser();\r\n\t $this->render('profile',array(\r\n\t \t'model'=>$model,\r\n\t\t\t'profile'=>$model->profile,\r\n\t ));\r\n\t}", "public function saveProfile()\n\t{\n\t\tif (isset($_REQUEST['username'])) {\n\t\t\t$username = trim($_REQUEST['username']);\n\t\t\t$fbuid = $this->getFBUID();\n\t\t\tif (isset($_POST['sub_clear'])) { $username = ''; }\n\t\t\tif ($username) {\n\t\t\t\t$result = $this->db->exec(\"INSERT IGNORE INTO selective_status_users (fbuid, twitterid) VALUES (\" . $this->db->quote($fbuid) . \", \" . $this->db->quote($username) . \");\");\n\t\t\t}\n\t\t\t$result = $this->db->exec(\"UPDATE selective_status_users SET twitterid = \" . $this->db->quote($username) . \", is_page = 0 WHERE fbuid = \" . $this->db->quote($fbuid) . \" LIMIT 1\");\n\t\t\treturn true;\n\t\t}\n\t}", "function change_user_info( $user, $key, $config )\n {\n //Unimplemented\n }", "function kino_user_fields( $kino_userid, $kino_fields ) {\n\t\n\tif ( empty( $kino_userid ) ) {\n\t\t$kino_userid = bp_loggedin_user_id();\n\t}\n\t\n\tif ( empty( $kino_fields ) ) {\n\t\t$kino_fields = kino_test_fields();\n\t}\n\t\n\t$kino_userdata = array();\n\t\n\t$kino_userdata['participation'] = kino_user_participation( \n\t\t$kino_userid, \n\t\t$kino_fields\n\t);\n\t\n\t// Define our fields\n\t// Ville, Pays\n\t\n\t$kino_userdata[\"ville\"] = bp_get_profile_field_data( array(\n\t\t\t'field' => $kino_fields[\"ville\"],\n\t\t\t'user_id' => $kino_userid\n\t) );\n\t$kino_userdata[\"pays\"] = bp_get_profile_field_data( array(\n\t\t\t'field' => $kino_fields[\"pays\"],\n\t\t\t'user_id' => $kino_userid\n\t) );\n\t$kino_userdata[\"birthday\"] = bp_get_profile_field_data( array(\n\t\t\t'field' => $kino_fields[\"birthday\"],\n\t\t\t'user_id' => $kino_userid\n\t) );\n\t$kino_userdata[\"tel\"] = bp_get_profile_field_data( array(\n\t\t\t'field' => $kino_fields[\"tel\"],\n\t\t\t'user_id' => $kino_userid\n\t) );\n\t\n\t// Method to find age in years...\n\t // Simple method:\n\t $kino_birthyear = substr($kino_userdata[\"birthday\"], -4);\n\t $kino_userdata[\"userage\"] = 2015 - $kino_birthyear;\n\t\n\t// Sessions\n\t\n\t$kino_userdata[\"sessions\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['session-attribuee'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Disponibilité\n\t \n\t $kino_userdata[\"dispo\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['dispo'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t $kino_userdata[\"dispo-partiel\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['dispo-partiel'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Présentation\n\t \n\t $kino_userdata[\"presentation\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['id-presentation'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t $kino_userdata[\"photo\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['id-photo'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Role Technicien ??\n\t if ( in_array( \"technicien-kab\", $kino_userdata[\"participation\"] )) {\n\t \n\t\t\t\t\t\t $kino_userdata[\"role-tech\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['role-kabaret-tech'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t \n\t\t\t\t\t\t $kino_userdata[\"comp-production\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-production'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-scenario\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-scenario'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-realisation\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-realisation'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-image\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-image'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-postprod-image\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-postprod-image'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-son\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-son'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-postprod-son\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-postprod-son'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-direction-artistique\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-direction-artistique'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-hmc\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-hmc'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-autres-liste\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-autres-liste'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"comp-autres-champ\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['comp-autres-champ'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"equipement\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['equipement'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t\t\t\t\t\t $kino_userdata[\"equipement-spec\"] = bp_get_profile_field_data( array(\n\t\t\t\t\t\t \t\t'field' => $kino_fields['equipement-spec'],\n\t\t\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t\t\t ) );\n\t }\n\t \n\t // Role Comédien ??\n\t if ( in_array( \"comedien-kab\", $kino_userdata[\"participation\"] )) {\n\t \n\t\t\t\t $kino_userdata[\"role-comed\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['role-kabaret-comed'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"age-camera-min\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['age-camera-min'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"age-camera-max\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['age-camera-max'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langue-mat\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langue-mat'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langue-mat-autre\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langue-mat-autre'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langues-parlees\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langues-parlees'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langues-parlees-autre\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langues-parlees-autre'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langues-jouees\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langues-jouees'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"langues-jouees-autre\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['langues-jouees-autre'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"talents\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['talents'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t $kino_userdata[\"talents-autre\"] = bp_get_profile_field_data( array(\n\t\t\t\t \t\t'field' => $kino_fields['talents-autre'],\n\t\t\t\t \t\t'user_id' => $kino_userid\n\t\t\t\t ) );\n\t\t\t\t \n\t\t}\n\t \n\t // Role Réalisateur ??\n\t \n\t $kino_userdata[\"role-real\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['role-kabaret-real'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Is Staff ?? \n\t $kino_userdata[\"fonctions-staff\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['fonctions-staff'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\t // Véhicule\n\t \n\t $kino_userdata[\"vehicule\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['vehicule'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t $kino_userdata[\"vehicule-remarque\"] = bp_get_profile_field_data( array(\n\t \t\t'field' => $kino_fields['vehicule-remarque'],\n\t \t\t'user_id' => $kino_userid\n\t ) );\n\t \n\treturn $kino_userdata;\n\t\n}", "public function profile_complete() {\n $data = array();\n if (!$this->user->is_logged_in()) {\n redirect(\"/account/info\");\n }\n\n $this->user->get_user($this->user->getMyId());\n $data['user'] = $this->user;\n\n $this->load->view('account/profile_complete', $data);\n }" ]
[ "0.66059905", "0.65691125", "0.6521306", "0.6516343", "0.6394412", "0.6309663", "0.6266442", "0.61459637", "0.6057598", "0.6057521", "0.6040821", "0.60265225", "0.5935147", "0.59245217", "0.5901184", "0.5896457", "0.58850336", "0.587851", "0.586746", "0.58338934", "0.58022976", "0.5772961", "0.57637835", "0.57528", "0.5751843", "0.5730309", "0.5720124", "0.5706073", "0.5693438", "0.5674527", "0.56525326", "0.56446046", "0.5633257", "0.56181973", "0.56093764", "0.56043184", "0.55993915", "0.5575566", "0.5567021", "0.55586207", "0.55551237", "0.5550423", "0.5546422", "0.5540746", "0.5533538", "0.5528334", "0.55150455", "0.5503268", "0.5494029", "0.54898304", "0.5488697", "0.54854053", "0.5481258", "0.5473588", "0.5461785", "0.54389966", "0.54332936", "0.54222584", "0.5418167", "0.5408088", "0.54045755", "0.5395761", "0.53927773", "0.5384286", "0.53773457", "0.5376461", "0.53692687", "0.536568", "0.5352127", "0.5343837", "0.5340829", "0.5336972", "0.53362405", "0.53295475", "0.53160465", "0.5308069", "0.5305069", "0.5295747", "0.5294062", "0.52936405", "0.5286679", "0.52818674", "0.5281753", "0.5279481", "0.5269669", "0.5265139", "0.5264964", "0.5261595", "0.5259321", "0.52546865", "0.5231592", "0.5222943", "0.5222849", "0.5220476", "0.5219393", "0.52095985", "0.52090025", "0.52053666", "0.5203694", "0.5201073" ]
0.7018234
0
Register the welcome and tracking opt in API route.
function register_api_routes() { register_rest_route( Altis\API_NAMESPACE, '/telemetry', [ 'methods' => WP_REST_Server::EDITABLE, 'permission_callback' => function () { return is_user_logged_in(); }, 'callback' => __NAMESPACE__ . '\\handle_telemetry_endpoint', 'args' => [ 'opt_in' => [ 'type' => 'boolean', 'default' => false, ], ], ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_api_endpoints() {\n\n\t\tregister_rest_route( 'nock/v1', '/messages', array(\n\t\t\t'methods' => array( 'POST' ),\n\t\t\t'callback' => array( $this, 'send_message' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/accounts', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_accounts' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/groups', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_groups' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/sms', array(\n\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t'callback' => array( $this, 'capture_sms' ),\n\t\t) );\n\n\t}", "public function custom_api() {\n\t\t$this->register_new_route( 'cases-status', '', WP_REST_Server::CREATABLE, array( $this, 'toggle_status' ) );\n\t}", "public function custom_api() {\n\n\t\t$this->register_new_route( 'cases', '_user', WP_REST_Server::READABLE, array( $this, 'read' ) );\n\n\t\t$this->register_new_route( 'cases', '', WP_REST_Server::EDITABLE, array( $this, 'update' ) );\n\n\t\t$this->register_new_route( 'cases', '', WP_REST_Server::DELETABLE, array( $this, 'delete' ) );\n\n\t\t$this->register_new_route( 'cases', '_user', WP_REST_Server::CREATABLE, array( $this, 'create' ) );\n\t}", "function wp_oembed_register_route()\n {\n }", "function spf_register_route(){\n register_rest_route('wooapp/v1','/shop/products',Array(\n 'methods' => 'GET',\n 'callback' => 'spf_get_shop_products',\n ));\n\n register_rest_route('wooapp/v1', '/auth/register', [\n 'methods' => 'POST',\n 'callback' => 'spf_register_new_user',\n ]);\n\n register_rest_route('wooapp/v1', '/auth/login', [\n 'methods' => 'POST',\n 'callback' => 'spf_login_user',\n ]);\n}", "public function register_routes() {\n\n\t\t// Get current user per the JWT token. Depends on JWT plugin.\n\t\tregister_rest_route(\n\t\t\t'wpcampus',\n\t\t\t'/auth/user/',\n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => [ $this, 'get_current_user' ],\n\t\t\t]\n\t\t);\n\t}", "protected function registerRoutes() {\n\n $this->get('/crossword', 'getCrossword');\n $this->post('/crossword', 'saveUserState');\n //not used\n //$this->get('/crossword', 'getCrossword');\n //$this->get('/wordData', 'getWordData');\n //);\n }", "public function register_route() {\n register_rest_route( $this->namespace, $this->endpoint , array(\n 'methods' => 'POST',\n 'callback' => array($this, 'get_next_page'),\n 'args' => array(),\n ) );\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function register_routes()\n {\n }", "public function route() {\r\n register_rest_route( 'api/v1', '/web-data-endpoint', array(\r\n 'methods' => 'GET',\r\n 'callback' => array( $this, 'callback' )\r\n ) );\r\n }", "private function registerApiRoutes(): void\n {\n $detect = app(Detect::class);\n $monitor = app(Monitor::class);\n\n $type = Settings::TYPE__ROUTE_API_FILE;\n if (!$detect->resourceEnabled($type)) {\n return;\n }\n\n $monitor->startTimer('register ' . $type);\n\n foreach ($detect->getRouteApiFiles() as $path) {\n Route::middleware($detect->routeApiMiddleware())\n ->group($detect->basePath($path));\n }\n $monitor->incRegCount($type, count($detect->getRouteApiFiles()));\n\n $monitor->stopTimer('register ' . $type);\n }", "public function register_routes() {\n $namespace = 'junglehunter/v1';\n register_rest_route(\n $namespace,\n '/all',\n array(\n 'methods' => 'GET',\n 'callback' => array($this, 'junglehunter_get_all')\n )\n );\n }", "public static function register_endpoints() {\n // endpoints will be registered here\n register_rest_route( Liang_API_Endpoints::$base_url, '/index', array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( 'Liang_API_Endpoints', 'get_index' ),\n ) );\n }", "public function add_api_routes()\n {\n /*\n * Only Apikey validate urls\n *\n */ \n register_rest_route($this->namespace, 'login', [\n 'methods' => 'POST',\n 'callback' => array($this, 'get_login'), \n 'args' => array(\n 'deviceToken' => array(\n 'required' => false,\n ),\n 'deviceId' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceId',$this->plugin_name),\n ),\n 'deviceType' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceType',$this->plugin_name),\n 'type' => 'string',\n 'enum' => array('1','2','3',),\n ),\n 'username' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Username',$this->plugin_name),\n ),\n 'password' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n )\n ]);\n\n register_rest_route($this->namespace, 'logout', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'logout'),\n )); \n register_rest_route($this->namespace, 'register', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'register'),\n 'args' => array(\n 'deviceToken' => array(\n 'required' => false,\n ),\n 'deviceId' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceId',$this->plugin_name),\n ),\n 'deviceType' => array(\n 'required' => true,\n 'description' => __('Please Enter deviceType',$this->plugin_name),\n 'type' => 'string',\n 'enum' => array('1','2','3',),\n ),\n 'email' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => 'The user\\'s email address',\n 'format' => 'email'\n ),\n 'username' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Username',$this->plugin_name),\n ),\n 'password' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n 'fname' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n 'lname' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => __('Please Enter Password',$this->plugin_name),\n ),\n\n )\n ));\n\n register_rest_route($this->namespace, 'forgotpassword', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'forgotpassword'),\n 'args' => array(\n 'email' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => 'The user\\'s email address',\n 'format' => 'email'\n ),\n )\n ));\n\n register_rest_route($this->namespace, 'fblogin', array(\n 'methods' => 'POST',\n 'callback' => array($this, 'fblogin'),\n 'args' => array(\n 'email' => array(\n 'required' => true,\n 'type' => 'string',\n 'description' => 'The user\\'s email address',\n 'format' => 'email'\n ),\n )\n ));\n\n\n \n /*\n * Only Apikey and access token after login.\n *\n */ \n\n \n \n }", "public static function registerEndpoints() {\n $register = register_rest_route(\n\t\t\t'UKM', \n\t\t\t'/informasjon/', \n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'informasjonsMeny'],\n\t\t\t\t'args' => []\n\t\t\t]\n );\n\n /**\n * ENDPOINT 4: Innlegg i bloggen\n */\n $register = register_rest_route(\n\t\t\t'UKM', \n\t\t\t'/nyheter/', \n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'nyheter'],\n\t\t\t\t'args' => []\n\t\t\t]\n );\n\n\n /**\n * ENDPOINT 5: Innlegg fra kategori\n */\n $register = register_rest_route(\n\t\t\t'UKM', \n\t\t\t'/kategori/(?P<id>\\d+)', \n\t\t\t[\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'kategori'],\n\t\t\t\t'args' => []\n\t\t\t]\n );\n\n /**\n * ENDPOINT 1 Info om en gitt post\n */\n $register = register_rest_route(\n 'UKM',\n '/post/(?P<id>\\d+)',\n [\n 'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'post'],\n 'args' => ['id']\n ]\n );\n\n /**\n * ENDPOINT 2: Innholdet i en post\n */\n $register = register_rest_route(\n 'UKM',\n '/content/(?P<id>\\d+)',\n [\n 'methods' => 'GET',\n\t\t\t\t'callback' => ['UKMwpAPI', 'postContent'],\n 'args' => ['id']\n ]\n );\n }", "public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}", "function onibus_endpoint_init() {\n\n\t$namespace = API_VERSAO;\n\n register_rest_route( $namespace, '/onibus/get-info-geral/',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_informacoes_gerais_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/set-info-geral/',\n\n\t array(\n\t 'methods' \t=> 'POST',\n\t 'callback' \t=> 'set_informacoes_gerais_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_all_onibus',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/(?P<id>\\d+)',\n\n\t array(\n\t 'methods' \t=> 'GET',\n\t 'callback' \t=> 'get_onibus_by_id',\n\t 'permission_callback' => function () {\n\t \treturn is_user_logged_in();\n\t }\n\t )\n\n );\n register_rest_route( $namespace, '/onibus/create/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'adicionar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n register_rest_route( $namespace, '/onibus/update/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'editar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n register_rest_route( $namespace, '/onibus/delete/',\n\n\t array(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'deletar_onibus',\n\t\t\t'permission_callback' => function () {\n\t\t\t \treturn is_user_logged_in();\n\t\t\t}\n\t\t)\n\n );\n\n}", "public function register_api_routes( Config $config ) {\n\t\t\\AM\\Endpoint\\Example_Endpoint::init( $config );\n\t}", "function wpib_register_route() {\n\tregister_rest_route( 'wpib/1.0/', '/inbox', array(\n\t\tarray(\n\t\t\t'methods' => 'POST',\n\t\t\t'callback' => 'wpib_on_email_recived',\n\t\t\t'args' => array(\n\t\t\t\t'mandrill_events' => array(\n\t\t\t\t\t'required' => true\n\t\t\t\t),\n\t\t\t)\n\t\t),\n\t) );\n}", "public static function register_rest_routes() {\n\t\tforeach (static::$apis as $api) {\n\t\t\t$api->register_rest_route();\n\t\t}\n }", "public function routeStartup()\n {\n //...\n }", "function registerEndpoints()\n{\n $namespace = 'travel-review-app/v1';\n\n register_rest_route(\n $namespace,\n '/destinations-default-wordpress',\n [\n 'methods' => 'GET',\n 'callback' => 'listDestinationsDefaultWordPress',\n ]\n );\n}", "public function register() {\n\t\tadd_action(\n\t\t\t'rest_api_init',\n\t\t\tfunction() {\n\t\t\t\t$this->register_routes();\n\t\t\t}\n\t\t);\n\n\t\tadd_filter(\n\t\t\t'do_parse_request',\n\t\t\tfunction( $do_parse_request, $wp ) {\n\t\t\t\tadd_filter(\n\t\t\t\t\t'query_vars',\n\t\t\t\t\tfunction( $vars ) use ( $wp ) {\n\t\t\t\t\t\t// Unsets standard public query vars to escape conflicts between WordPress core\n\t\t\t\t\t\t// and Google Site Kit APIs which happen when WordPress incorrectly parses request\n\t\t\t\t\t\t// arguments.\n\n\t\t\t\t\t\t$unset_vars = ( $wp->request && stripos( $wp->request, trailingslashit( rest_get_url_prefix() ) . self::REST_ROOT ) !== false ) // Check regular permalinks.\n\t\t\t\t\t\t\t|| ( empty( $wp->request ) && stripos( $this->context->input()->filter( INPUT_GET, 'rest_route' ), self::REST_ROOT ) !== false ); // Check plain permalinks.\n\n\t\t\t\t\t\tif ( $unset_vars ) {\n\t\t\t\t\t\t\t// List of variable names to remove from public query variables list.\n\t\t\t\t\t\t\treturn array_values(\n\t\t\t\t\t\t\t\tarray_diff(\n\t\t\t\t\t\t\t\t\t$vars,\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'orderby',\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn $vars;\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn $do_parse_request;\n\t\t\t},\n\t\t\t10,\n\t\t\t2\n\t\t);\n\t}", "public function register_routes() {\n\t\t$version = '1';\n\t\t$namespace = 'askmedesk/v' . $version;\n register_rest_route( $namespace, '/tipi-richiesta', array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => [$this, 'get_tipi_richiesta'],\n 'permission_callback' => [$this, 'askmedesk_permission_check']\n\t\t));\n\t\tregister_rest_route($namespace, '/creazione-richiesta', array(\n\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t'callback' => [$this, 'crea_richiesta'],\n\t\t\t'permission_callback' => [$this, 'askmedesk_permission_check'],\n\t\t\t'args' => $this->get_endpoint_args_for_item_schema( false )\n\t\t));\n\t}", "public function register_routes() {\n\t\tregister_rest_route( $this->namespace, $this->route, [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_options']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_options'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_options'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\n\t\tregister_rest_route( $this->namespace, $this->route . '/(?P<slug>.+)', [\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => [$this, 'get_option']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => [$this, 'update_option'],\n\t\t\t\t'permission_callback' => [$this, 'update_option_permissions_check']\n\t\t\t],\n\t\t\t[\n\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t'callback' => [$this, 'delete_option'],\n\t\t\t\t'permission_callback' => [$this, 'delete_option_permissions_check']\n\t\t\t]\n\t\t] );\n\t}", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/location', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::CREATABLE,\n\t\t\t\t'callback' => array( $this, 'update_user_location' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/quiz-result', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'save_quiz_result' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/ranking/(?P<park>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_ranking' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/point/(?P<slug>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_point' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/point/(?P<id>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'set_point_location' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/option/(?P<key>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_option' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/user', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'update_user' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/photo', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'upload_photo' ),\n\t\t\t)\n\t\t) );\n\t}", "function routes_install()\r\n{\r\n\tregister_hook('init_1', 'addon/routes/routes.php', 'routes_init_1');\r\n\tregister_hook('post_local', 'addon/routes/routes.php', 'routes_post_local_end_hook');\r\n\tregister_hook('profile_tabs', 'addon/routes/routes.php', 'routes_profile_tabs_hook');\r\n}", "public function add_endpoint() {\r\n add_rewrite_rule('^api/films/?(\\w+)?/?','index.php?__api=1&films=$matches[1]','top');\r\n }", "public function rest_api_init_action() {\r\n \r\n register_rest_route('api-bearer-auth/v1', '/login', [\r\n 'methods' => 'POST',\r\n 'callback' => [$this, 'callback_login'],\r\n 'args' => [\r\n 'username' => [\r\n 'required' => true,\r\n ],\r\n 'password' => [\r\n 'required' => true,\r\n ],\r\n ]\r\n ]);\r\n \r\n register_rest_route('api-bearer-auth/v1', '/tokens/refresh', [\r\n 'methods' => 'POST',\r\n 'callback' => [$this, 'callback_refresh_token'],\r\n 'args' => [\r\n 'token' => [\r\n 'required' => true\r\n ]\r\n ]\r\n ]);\r\n \r\n }", "protected function registerRoutes()\n {\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n }", "public function register_routes(): void {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'methods' => WP_REST_Server::ALLMETHODS,\n\t\t\t\t\t'callback' => [ $this, 'status_check' ],\n\t\t\t\t\t'permission_callback' => [ $this, 'status_check_permissions_check' ],\n\t\t\t\t\t'args' => [\n\t\t\t\t\t\t'content' => [\n\t\t\t\t\t\t\t'description' => __( 'Test HTML content.', 'web-stories' ),\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'type' => 'string',\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}", "function optimatRegisterSearch() {\n\t// new api search url: 1. name 2. route\n\tregister_rest_route('optimat/v1', 'search', array(\n\t\t'methods' => WP_REST_SERVER::READABLE, // like 'GET'\n\t\t'callback' => 'optimatSearchResults'\n\t)); \n}", "protected function registerRouteBindings()\n {\n //\n }", "public function rest_api_init() {\n register_rest_route('h5p/v1', '/post/(?P<id>\\d+)', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_post'),\n 'args' => array(\n 'id' => array(\n 'validate_callback' => function ($param, $request, $key) {\n return $param == intval($param);\n }\n ),\n ),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n\n register_rest_route('h5p/v1', 'all', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_all'),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n }", "public function registerRoutes() {\n $this->addRoute('default');\n }", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shops' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>.+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_shop' ),\n\t\t\t)\n\t\t) );\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base . '/manager', array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t'callback' => array( $this, 'register_shop_manager' ),\n\t\t\t)\n\t\t) );\n\t}", "public function onRestAPIInit()\r\n\t{\r\n\t\t// NB: Permalink Manager Lite compatibility. This fix prevents the plugin from causing POST REST requests being redirected to GET\r\n\t\t// NB: We also check the plugin is active to mitigate any potential effects to other plugins. This could be removed, as an optimization\r\n\t\tglobal $wp_query;\r\n\t\t\r\n\t\t$active_plugins = get_option('active_plugins');\r\n\t\tif(!empty($wp_query->query_vars) && array_search('permalink-manager/permalink-manager.php', $active_plugins))\r\n\t\t\t$wp_query->query_vars['do_not_redirect'] = 1;\r\n\t\t\r\n\t\t$this->registerRoutes();\r\n\t}", "public function hookDefineRoutes($args) {\n\t\t$args['router']->addConfig(new Zend_Config_Ini(dirname(__FILE__) . '/routes.ini', 'routes'));\n\t}", "public static function register(): void\n {\n if (! Route::hasMacro('apiMediaResource')) {\n Route::macro('apiMediaResource', function ($name, $controller) {\n Route::get(\"$name\", \"$controller@index\")->name(\"$name.index\");\n Route::get(\"$name/{media}\", \"$controller@show\")->where('media', '.*')->name(\"$name.show\");\n Route::patch(\"$name/{media}/rename\", \"$controller@rename\")->where('media', '.*')->name(\"$name.rename\");\n Route::post(\"$name/{media}/copy\", \"$controller@copy\")->where('media', '.*')->name(\"$name.copy\");\n Route::patch(\"$name/{media}/move\", \"$controller@move\")->where('media', '.*')->name(\"$name.move\");\n Route::post(\"$name/{media}/download\", \"$controller@download\")->where('media', '.*')->name(\"$name.download\");\n Route::delete(\"$name/delete\", \"$controller@delete\")->name(\"$name.delete\");\n Route::post(\"$name/upload\", \"$controller@upload\")->name(\"$name.upload\");\n Route::post(\"$name/add\", \"$controller@add\")->name(\"$name.add\");\n Route::post(\"$name/zip\", \"$controller@zip\")->name(\"$name.zip\");\n });\n }\n }", "protected function registerApiRoutes()\n {\n if (config('firefly.api.enabled')) {\n Route::group(config('firefly.api'), function () {\n $this->loadRoutesFrom(__DIR__.'/../routes/api.php');\n });\n }\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "protected function routes()\n {\n Nova::routes()\n ->withAuthenticationRoutes()\n ->withPasswordResetRoutes()\n ->register();\n }", "public function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback' => array( $this, 'parse_url_details' ),\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'url' => array(\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'description' => __( 'The URL to process.' ),\n\t\t\t\t\t\t\t'validate_callback' => 'wp_http_validate_url',\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_url',\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'permission_callback' => array( $this, 'permissions_check' ),\n\t\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "function register_endpoints(){\n\t$route_base = 'wc/v1';\n\n\tregister_rest_route($route_base, '/posts', array(\n\t\t'methods' => 'GET',\n\t\t'callback' => 'api_get_posts',\n\t\t'permission_callback' => 'helper_authentication_check'\n\t));\n\n\tregister_rest_route($route_base, '/posts/(?P<post_id>\\d+)', array(\n\t\t'methods' => 'GET',\n\t\t'callback' => 'api_get_post',\n\t\t'permission_callback' => 'helper_authentication_check'\n\t));\n}", "function api_wines_routes_api(){\n register_rest_route( 'bestwines/v1', '/wines', array(\n 'methods' => 'GET',\n 'callback' => 'api_get_wines',\n ));\n}", "protected function registerMiddleware()\n {\n \\Route::middleware('hsign', ApiSign::class);\n }", "public function register(\\Box_App &$app)\n {\n $app->get('/autoticket', 'get_index', array(), get_class($this));\n\t\t$app->get('/autoticket/settings', 'get_settings', array(), get_class($this));\n }", "public function registerRouters () {\n\t\tif ( !current_user_can( 'manage_options' ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->classes as $class ) {\n\t\t\t\\Maven\\Core\\HookManager::instance()->addFilter( 'json_endpoints', array( $class, 'registerRoutes' ) );\n\t\t}\n\t}", "public static function register(): void\n {\n Route::resource('otp', OtpController::class, [\n 'only' => ['create', 'store'],\n 'prefix' => 'otp',\n ])->middleware(['web', 'auth']);\n }", "function add_menus_endpoint() {\n\n\t\tif ( $this->config[\"rest\"][\"menus\"] ) {\n\t\t\tregister_rest_route(\n\t\t\t\tWPN_REST_URL,\n\t\t\t\t'/menus',\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => 'GET',\n\t\t\t\t\t'callback' => array( $this, 'api_list_menus' )\n\t\t\t\t) );\n\n\n//\t\t\tregister_rest_route(\n//\t\t\t\tWPN_REST_URL,\n//\t\t\t\t'/menus/(?P<slug>[0-9a-zA-Z(-]+)',\n//\t\t\t\tarray(\n//\t\t\t\t\t'methods' => 'GET',\n//\t\t\t\t\t'callback' => array( $this, 'api_menu_by_id_slug' )\n//\t\t\t\t) );\n\n\t\t\tregister_rest_route(\n\t\t\t\tWPN_REST_URL,\n\t\t\t\t'/menus/(?P<id>\\d+)',\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => 'GET',\n\t\t\t\t\t'callback' => array( $this, 'api_menu_by_id_slug' )\n\t\t\t\t) );\n\t\t}\n\t}", "public function register_routes() {\n\n register_rest_route( $this->namespace, '/' . $this->base, array(\n array(\n 'methods' => WP_REST_Server::CREATABLE,\n 'callback' => array( $this->service, 'create' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( true ),\n 'accept_json' => true\n ),\n ) );\n\n register_rest_route( $this->namespace, '/' . $this->base . '/(?P<id>[\\d]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( $this->service, 'get' ),\n 'permission_callback' => array( $this, 'getAllUserCheck' ),\n 'args' => array(\n 'context' => array(\n 'default' => 'view',\n )\n ),\n ),\n\n array(\n 'methods' => WP_REST_Server::EDITABLE,\n 'callback' => array( $this->service, 'update' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => $this->get_endpoint_args_for_item_schema( false ),\n 'accept_json' => true\n ),\n\n array(\n 'methods' => WP_REST_Server::DELETABLE,\n 'callback' => array( $this->service, 'delete' ),\n 'permission_callback' => array( $this, 'getAdminUserCheck' ),\n 'args' => array(\n 'force' => array(\n 'default' => false,\n ),\n ),\n ),\n ) );\n }", "public function registerExternalEndpoints()\n {\n Route::post('encode/notify', [\n 'as' => 'decoy::encode@notify',\n 'uses' => '\\Bkwld\\Decoy\\Controllers\\Encoder@notify',\n ]);\n }", "public function register_routes() {\n\t\t$public_post_types = $this->post_type_helper->get_public_post_types();\n\n\t\tforeach ( $public_post_types as $post_type ) {\n\t\t\t\\register_rest_field( $post_type, self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_post' ] ] );\n\t\t}\n\n\t\t$public_taxonomies = $this->taxonomy_helper->get_public_taxonomies();\n\n\t\tforeach ( $public_taxonomies as $taxonomy ) {\n\t\t\tif ( $taxonomy === 'post_tag' ) {\n\t\t\t\t$taxonomy = 'tag';\n\t\t\t}\n\t\t\t\\register_rest_field( $taxonomy, self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_term' ] ] );\n\t\t}\n\n\t\t\\register_rest_field( 'user', self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_author' ] ] );\n\n\t\t\\register_rest_field( 'type', self::YOAST_HEAD_FIELD_NAME, [ 'get_callback' => [ $this, 'for_post_type_archive' ] ] );\n\t}", "private function register_routes() {\n\t\t$routes = $this->get_routes();\n\t\tforeach ( $routes as $route ) {\n\t\t\t$route->register();\n\t\t}\n\t}", "public function registerFormRoutes() {\n add_action('rest_api_init', function() {\n register_rest_route('forms/v1', '/submit', [\n 'methods' => 'POST',\n 'callback' => [$this, 'handleSubmission']\n ]);\n });\n }", "function rest_api_init() {\n\trest_api_register_rewrites();\n\n\tglobal $wp;\n\t$wp->add_query_var( 'rest_route' );\n}", "public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }", "function register_routes(){\n \tregister_rest_route( parent::get_api_base(), $this->controller . 'get' , array(\n \t\t'methods' => WP_REST_Server::READABLE,\n \t\t'callback' => array($this,'run_cron'),\n\n \t\t//'permission_callback' => array( $this, 'get_item_permissions_check' ),\n \t));\n\t}", "private function registerRoutes(){\n $appRouter = require_once __DIR__.'/../../routes/app.php';\n $this->registerApplicationRoutes($appRouter);\n $this->registerApplicationRoutes($appRouter, false);\n $this->registerAuthenticationRoutes();\n }", "public function setUpRoutes()\n {\n Route::group(['middleware' => AddCustomProvider::class], function () {\n Passport::routes(function ($router) {\n return $router->forAccessTokens();\n });\n });\n\n Route::middleware('auth:api')->get('/user', function (Request $request) {\n return $request->user();\n });\n\n Route::middleware('auth:company')->get('/company', function (Request $request) {\n return $request->user();\n });\n\n Route::middleware('auth:api,company')->get('/users', function (Request $request) {\n return [\n $request->user('api'),\n $request->user('company'),\n $request->user(),\n Auth::user(),\n Auth::guard('api')->user(),\n Auth::guard('company')->user(),\n Auth::check(),\n Auth::id(),\n ];\n });\n\n Route::middleware('auth:api')->get('/just_user', function (Request $request) {\n return [\n $request->user('api'),\n $request->user('company'),\n $request->user(),\n Auth::user(),\n Auth::guard('api')->user(),\n Auth::guard('company')->user(),\n Auth::check(),\n Auth::id(),\n ];\n });\n\n Route::middleware('auth:company')->get('/just_company', function (Request $request) {\n return [\n $request->user('api'),\n $request->user('company'),\n $request->user(),\n Auth::user(),\n Auth::guard('api')->user(),\n Auth::guard('company')->user(),\n Auth::check(),\n Auth::id(),\n ];\n });\n\n Route::middleware('auth')->get('/no_guards', function (Request $request) {\n return $request->user();\n });\n }", "function register_rest_routes() {\n\tif ( class_exists( '\\WP_REST_Controller' ) ) {\n\t\tinclude_once __DIR__ . '/wprest-shortcodes-controller.php';\n\t\t$controller = new rest\\WPREST_Shortcodes_Controller();\n\t\t$controller->register_routes();\n\t}\n}", "public function get(...$args) {\n $this->registerRouteHandler('GET', ...$args);\n }", "function create_initial_rest_routes()\n {\n }", "public static function register_endpoints() {\n\t\t\n $namespace = sprintf( 'wp/%s', API_VERSION );\n \n // Create a new blank package\n register_rest_route( $namespace, API_PREFIX . 'package/add', array(\n 'methods' => 'GET',\n 'callback' => array( 'Doolittle_Package_REST_API_Endpoints', 'add' ),\n ) );\n \n // Delete a package\n register_rest_route( $namespace, API_PREFIX . 'package/delete', array(\n 'methods' => 'POST',\n 'callback' => array( 'Doolittle_Package_REST_API_Endpoints', 'delete' ),\n 'args' => array(\n 'post_ids' => array(\n 'required' => true,\n 'type' => 'object',\n 'description' => 'Package post_ids',\n ) \n )\n ) );\n \n \n // Delete a package\n register_rest_route( $namespace, API_PREFIX . 'package/update', array(\n 'methods' => 'POST',\n 'callback' => array( 'Doolittle_Package_REST_API_Endpoints', 'update' ),\n 'args' => array(\n 'data' => array(\n 'required' => true,\n 'type' => 'object',\n 'description' => 'Package form',\n ) \n )\n ) );\n\t}", "public function register_routes() {\n # GET/POST /products\n $routes[$this->base] = array(\n array( array( $this, 'get_products' ), WC_API_Server::READABLE ),\n array( array( $this, 'create_product' ), WC_API_SERVER::CREATABLE | WC_API_Server::ACCEPT_DATA ),\n );\n }", "public function register_routes() {\n\n\t\tregister_rest_route( $this->namespace, '/' . $this->rest_base, array(\n\t\t\tarray(\n\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t'callback' => array( $this, 'get_items' ),\n\t\t\t\t'permission_callback' => array( $this, 'get_items_permissions_check' ),\n\t\t\t\t'args' => array(),\n\t\t\t)\n\t\t) );\n }", "public function add_endpoints() {\n\t\tadd_rewrite_endpoint( self::$endpoint, EP_ROOT | EP_PAGES );\n\t\t//flush_rewrite_rules();\n\t}", "public function register_rest_routes() {\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast',\n\t\t\tarray(\n\t\t\t\t'methods' => 'GET',\n\t\t\t\t'callback' => array( $this, 'get_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for podcast\n\t\t */\n\t\tregister_rest_route(\n\t\t\t'ssp/v1',\n\t\t\t'/podcast_update',\n\t\t\tarray(\n\t\t\t\t'methods' => 'POST',\n\t\t\t\t'callback' => array( $this, 'update_rest_podcast' ),\n\t\t\t)\n\t\t);\n\n\t\t/**\n\t\t * Setting up custom route for episodes\n\t\t */\n\t\t$controller = new Episodes_Controller();\n\t\t$controller->register_routes();\n\n\t}" ]
[ "0.6447058", "0.63742703", "0.63714004", "0.6355609", "0.6292687", "0.6291114", "0.6284822", "0.6265994", "0.62515867", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.62511176", "0.6235532", "0.6192157", "0.6189346", "0.61852837", "0.61802137", "0.6161462", "0.6152602", "0.6113186", "0.60655564", "0.6058926", "0.60210496", "0.60199785", "0.6009638", "0.6002239", "0.5988669", "0.596926", "0.5949504", "0.5940765", "0.59201294", "0.5909147", "0.58917713", "0.58851486", "0.5872672", "0.5868485", "0.5861399", "0.5858933", "0.5846585", "0.58233654", "0.58217317", "0.5814712", "0.5786093", "0.57696575", "0.57696575", "0.5750357", "0.57482386", "0.5744626", "0.5735446", "0.5727228", "0.5717105", "0.5707362", "0.5706389", "0.5686226", "0.56602675", "0.5636639", "0.56252736", "0.55988216", "0.5598432", "0.5597777", "0.5579663", "0.5562839", "0.55309653", "0.55289453", "0.5527176", "0.5499287", "0.5496364", "0.54910886", "0.5488224", "0.5481739", "0.548114" ]
0.67236173
0
Handle telemetry API request.
function handle_telemetry_endpoint( WP_REST_Request $request ) { $current_user = wp_get_current_user(); $did_opt_in = $request['opt_in']; opt_in( $did_opt_in ); $data = [ 'id' => $current_user->ID, 'tracking' => [ 'opt_in' => $did_opt_in, ], ]; if ( $did_opt_in ) { $data['tracking_data'] = get_segmentio_user_details(); } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function handleDiagnosticsRequest()\n {\n $statusApiConfigurator = new Webinterpret_Connector_StatusApi_StatusApiConfigurator(Mage::app(), Mage::getConfig());\n\n $statusApi = $statusApiConfigurator->getExtendedStatusApi();\n\n $json = $statusApi->getJsonTestResults();\n header('Content-Type: application/json');\n header('Content-Length: '.strlen($json));\n echo $json;\n }", "public function handleRequest() {}", "public function doRequest()\n {\n $this->post('/api_v1/webhook/log/1',\n json_decode('{\n \"transaction_time\": \"1603711958\",\n \"id\": \"e0c523cd-3dfd-4206-83b4-9c0dc32dd77e\",\n \"event\": \"in-store-txn\",\n \"value\": 13.98,\n \"status\": \"complete\",\n \"customer_id\": \"e0c523cd-3dfd-4206-83b4-9c0dc32dd77e\"\n }'),\n [\n \"Accept\" => \"application/json\"\n ]\n );\n\n $this->assertEquals(\n 200, $this->response->getStatusCode()\n );\n }", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "public function hookServer($request)\n {\n //SAmple call\n //http://localhost:8000/hookServer?server=1&disk=25&mem=822/992|82.86|&cpu=90&con=1&ip=1&memc=50&token=pTX7s2h9FlmVB7lWDmAucUaN2A85NHO9JyZcvL2T\n // \n $token = isset($request['token']) ?: \"\";\n if($token == \"pTX7s2h9FlmVB7lWDmAucUaN2A85NHO9JyZcvL2T\"){\n //Get disk information\n $disk = $this->parseServerDisk($request['disk']);\n\n //869/992|87.60|\n $mem = $this->parseServerMemory($request['mem']);\n $memTotal = $this->parseServerMemoryTotal($request['mem']);\n $memc = isset($request['memc']) ?: 0 ;\n $memCache = $this->parseServerMemoryCache( $memc, $memTotal);\n\n $cpu = isset($request['cpu']) ? $request['cpu']: 0;\n $server = isset($request['server']) ? $request['server']: 0 ; \n $connections = isset($request['con']) ? $request['con']: 0;\n $ip = isset($request['ip']) ? $request['ip']: 0;\n\n //Save data on metrics\n $actualServer = $this->find($server);\n $metric = new Metric;\n $metric->cpu = $cpu;\n $metric->memory = $mem;\n $metric->memory_cache = $memCache;\n $metric->disk = $disk;\n $metric->connections = $connections; \n $metric->ips = $ip;\n\n return $actualServer->metrics()->save($metric);\n }\n\n return \"error\";\n\n }", "public function execute()\n {\n /** @var \\Magento\\Framework\\App\\Request\\Http $request */\n $request = $this->getRequest();\n\n /** @var \\Zend\\Http\\Headers $header */\n $header = $request->getHeaders();\n\n /** @var bool $result */\n $result = false;\n $msg = \"\";\n\n if ($this->authenticate($header)) {\n $content = $request->getContent();\n\n $data = $this->logitrail->getApi()->processWebhookData($content);\n\n $this->logger->debug(json_encode($data, JSON_UNESCAPED_UNICODE));\n\n switch ($data[\"event_type\"]) {\n case \"product.inventory.change\":\n $result = $this->handleInventoryChange($data);\n $msg = \"success\";\n break;\n case \"order.shipped\":\n $result = $this->handleOrderShipped($data);\n $msg = \"success\";\n break;\n default:\n $result = true;\n $msg = \"Handling for event type {$data[\"event_type\"]} not implemented\";\n break;\n }\n }\n\n if ($result) {\n header('HTTP/1.1 200 OK');\n echo($msg);\n } else {\n header('HTTP/1.0 400 Bad Request');\n echo('fail');\n }\n exit;\n }", "protected abstract function handleRequest();", "public static function process_http_request()\n {\n }", "abstract function do_api_request();", "public function processApi();", "abstract public function handle_request();", "public function sniff_requests() {\r\n global $wp;\r\n\r\n if(isset($wp->query_vars['__api'])){\r\n $this->handle_request();\r\n exit;\r\n }\r\n }", "function handleRequest() ;", "public function otherMCFunctions(Request $request)\n {\n $message = array(\n 'content' => $request->MESSAGE,\n 'iv' => $request->IV\n );\n\n $decrypted = $this->decryptMessage($message);\n $decryptedArray = json_decode($decrypted,true);\n\n $processedData = new ProcessedData;\n $processedData->DEVICE_ID = 999999;\n $processedData->DATA = array_merge(\n json_decode('{\"URL\":\"'.$request->URL.'\"}',true),$decryptedArray);\n $processedData->SEND_FLAG = 0;\n $processedData->save();\n $decryptedArrayString = implode(\",\",$decryptedArray);\n $device = Device::where('DEVICE_SERIAL_NO',\n $decryptedArrayString)->first();\n\n //If device is Low Battery\n if ($request->URL == 'alarmDevice') {\n $this->storeLogs(0, 'Automatic',\n \"Battery of device is low: \".$device['DEVICE_NAME'].' - '.\n $decryptedArrayString, '', '');\n event(new LowBatteryDevice($processedData));\n }\n return response(204);\n }", "public function handle($request, Closure $next)\n {\n //before handling the API request\n $ApiLog = new ApiLog();\n $Payload = array_filter($request->input());\n if (isset($Payload['password'])) {\n //if the payload contains a password redact it\n $Payload['password'] = '**redacted**';\n }\n $ApiLog->json_parameters = json_encode($Payload);\n $ApiLog->requester_ip = $request->ip();\n $ApiLog->method = $request->method();\n $ApiLog->path = $request->path();\n try {\n //get the id of the user if they are authorized\n $ApiLog->user_id = $request->user()['user_id'];\n } catch (NoActiveAccessTokenException $e) {\n // no logged in user\n $ApiLog->user_id = null;\n }\n\n try {\n $ApiLog->save();\n } catch (QueryException $e) {\n //There is a good chance the URL was to long for the path column, try truncating it as a last effort\n $ApiLog->path = substr($ApiLog->path, 0, 254);\n try {\n $ApiLog->save();\n } catch (QueryException $e) {\n if (\n // these are all exceptions that generally mean the api\n // couldn't contact mysql. During dev this likely mans\n // the api machine went to sleep. In production... we\n // haven't seen it, but returning 503 (service unavailable)\n // is a reasonable thing to do.\n preg_match('/PDOException: SQLSTATE\\[HY000\\] \\[2002\\] Network is down/', $e) ||\n preg_match('/PDOException: SQLSTATE\\[HY000\\] \\[2002\\] Host is down/', $e) ||\n preg_match('/SQLSTATE\\[HY000\\] \\[2002\\] Network is unreachable/', $e) ||\n preg_match('/PDOException: SQLSTATE\\[HY000\\] \\[2002\\] Operation timed out/', $e)\n ) {\n \\Log::info('Api logger middleware unable to contact database');\n return response()->json('API unable to contact database.', 503);\n }\n //it still failed so handle it without crashing.\n Log::info('ApiLogger middleware exception:');\n Log::info($e);\n return $next($request);\n }\n }\n\n //handle the API request\n $response = $next($request);\n\n\n try {\n //After handling the API request, update the response code\n $ApiLog->response_code = $response->status();\n $ApiLog->save();\n } finally {\n return $response;\n }\n }", "public function logData($request,$response){\n\n // Symfony\\Component\\HttpFoundation\\BinaryFileResponse (downloading file) doesn't have method status\n $responseStatus = method_exists($response, 'status') ? $response->status() : '';\n $codeFirstNumber = $this->checkCode($responseStatus);\n\n if($codeFirstNumber === '') {\n return null;\n }\n\n $currentRouteAction = Route::currentRouteAction();\n\n // Initialiaze controller and action variable before use them\n $controller = \"\";\n $action = \"\";\n\n /*\n * Some routes will not contain the `@` symbole (e.g. closures, or routes using a single action controller).\n */\n if ($currentRouteAction) {\n if (strpos($currentRouteAction, '@') !== false) {\n list($controller, $action) = explode('@', $currentRouteAction);\n } else {\n // If we get a string, just use that.\n if (is_string($currentRouteAction)) {\n list ($controller, $action) = [\"\", $currentRouteAction];\n } else {\n // Otherwise force it to be some type of string using `json_encode`.\n list ($controller, $action) = [\"\", (string)json_encode($currentRouteAction)];\n }\n }\n }\n\n $endTime = microtime(true);\n\n $implode_models = $this->models;\n\n array_walk($implode_models, function(&$value, $key) {\n $value = \"{$key} ({$value})\";\n });\n\n $models = implode(', ',$implode_models);\n $this->logs['created_at'] = Carbon::now();\n $this->logs['method'] = $request->method();\n $this->logs['url'] = $request->path();\n $this->logs['payload'] = $this->payload($request);\n $this->logs['response'] = $response->status();\n $this->logs['duration'] = number_format($endTime - LARAVEL_START, 3);\n $this->logs['controller'] = $controller;\n $this->logs['action'] = $action;\n $this->logs['models'] = $models;\n $this->logs['ip'] = $request->ip();\n\n if (config('http-query-logger.email_notification')) {\n $this->sendEmailNotification($codeFirstNumber, $this->logs);\n }\n\n return $this->logs;\n }", "function hook_restapi_request($path, ResourceConfiguration $resource, JsonRequest $request) {\n\n // Logs statsd data on our endpoints. Note that the $path represents the\n // actual path being called, while the ResourceConfiguration::getPath() is the\n // configured path (which may contain wildcards). The latter may also differ\n // from the former in cases where internal calls are made.\n if (module_exists('statsd')) {\n statsd_call('restapi.' . $resource->getPath());\n }\n\n}", "public function processRequest();", "public function captureIncomingRequest()\n {\n try {\n $this->request = new Request;\n } catch (\\Throwable $th) {\n exit(json_encode([\n 'error' => $th->getMessage(),\n 'SUCCESS' => false,\n ]));\n }\n\n $this->payload = $this->request->data();\n $this->endpoint = urldecode($this->payload['endpoint']);\n unset($this->payload['endpoint']);\n }", "function process_request() {\n\t\tglobal $publishthis;\n\n\t\ttry{\n\n\t\t\t$bodyContent = '';\n\n\t\t\tif ( function_exists( 'wpcom_vip_file_get_contents' ) ) {\n\t\t\t\t$bodyContent = wpcom_vip_file_get_contents( 'php://input', 10, 60 );\n\t\t\t} else {\n\t\t\t\t$bodyContent = file_get_contents( 'php://input' );\n\t\t\t}\n\n\t\t\t$publishthis->log->addWithLevel( array( 'message' => 'Endpoint Request', 'status' => 'info', 'details' => $bodyContent ), \"2\" );\n\n\t\t\t$arrEndPoint = json_decode( $bodyContent, true );\n\n\t\t\t$action = $arrEndPoint[\"action\"];\n\n\t\t\t$pt_settings = $publishthis->get_options();\n\n\t\t\tif( !in_array( $action, array('resetState', 'stopEndpoint', 'resumeEndpoint') ) ) {\n\t\t\t\t$manually_stopped = get_option( 'pt_import_manually_stopped' );\n\t\t\t\tif ( $manually_stopped == 1 ) {\n\t\t\t\t\t$this->sendFailure('Import manually stopped');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch( $action ) {\n\t\t\t\tcase \"verify\":\n\t\t\t\t\t$this->actionVerify();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"publish\":\n\t\t\t\t\tif( $publishthis->get_option( 'curated_publish' ) != 'import_from_manager' ) {\n\t\t\t\t\t\t$this->sendFailure( \"Publishing through CMS is disabled\" );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$feedId = intval( $arrEndPoint[\"feedId\"], 10 );\n\t\t\t\t\t$pageNum = intval( $arrEndPoint[\"pageNum\"], 10 );\n\t\t\t\t\t$importId = $arrEndPoint[\"importId\"];\n\n\t\t\t\t\t$this->actionPublish2( $feedId, $pageNum, $importId );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getAuthors\":\n\t\t\t\t\t$this->actionGetAuthors();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"getCategories\":\n\t\t\t\t\t$this->actionGetCategories();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resetState\":\n\t\t\t\t\t$this->resetState();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"stopEndpoint\":\n\t\t\t\t\t$this->stopEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"resumeEndpoint\":\n\t\t\t\t\t$this->resumeEndpoint();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$this->sendFailure( \"Empty or bad request made to endpoint\" );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch( Exception $ex ) {\n\t\t\t//we will log this to the pt logger, but we always need to send back a failure if this occurs\n\n\t\t\t$this->sendFailure( $ex->getMessage() );\n\t\t}\n\n\t\treturn;\n\t}", "public function handleWebhookRequest(Request $httpRequest)\n {\n dd(\"@todo handle the webhook request of Mailjet\");\n }", "public function requestFromApi() \n {\n $clientApi = new \\GuzzleHttp\\Client([\n \"base_uri\" => \"https://services.mysublime.net/st4ts/data/get/type/\",\n \"timeout\" => 4.0]);\n \n try { \n $response = $clientApi->request(\"GET\", $this->_urlEndPoint);\n if ($response->getStatusCode() == \"200\") {\n $body = $response->getBody();\n $this->_jsonRequestedArr = json_decode($body); \n }\n else { \n $this->_error .= \"Bad status code: . \" . $response->getStatusCode(); \n }\n }\n catch (Exception $exc) {\n $this->_error .= $exc->getMessage();\n }\n\n }", "public function handle($request, Closure $next)\n {\n $response = $next($request);\n\n $ip = $request->ip();\n $method = $request->method();\n $url = $request->fullUrl();\n $userAgent = $request->userAgent();\n $message = '';\n $time = Carbon::now()->toDateTimeString();\n $path = $request->path();\n\n if (Auth::guard('api')->check()) {\n $user = Auth::guard('api')->user();\n\n $userId = $user->id;\n\n \\DB::table('access_audits')->insert([\n 'ip' => $ip,\n 'method' => $method,\n 'url' => $url,\n 'user_agent' => $userAgent,\n 'created_at' => $time,\n 'updated_at' => $time,\n 'user_id' => $userId,\n 'path' => $path,\n ]);\n\n $message = 'API Request - ' . $user->email . ' at IP - ' . $ip . ' via ' . $method . ' to ' . $url . ' using ' . $userAgent . ' from ' . $path;\n } elseif (Auth::guard('web')->check()) {\n $webUser = Auth::guard('web')->user();\n\n $userId = $webUser->id;\n\n \\DB::table('access_audits')->insert([\n 'ip' => $ip,\n 'method' => $method,\n 'url' => $url,\n 'user_agent' => $userAgent,\n 'created_at' => $time,\n 'updated_at' => $time,\n 'user_id' => $userId,\n 'path' => $path,\n ]);\n\n $message = 'WEB Request - ' . $webUser->email . ' at IP - ' . $ip . ' via ' . $method . ' to ' . $url . ' using ' . $userAgent . ' from ' . $path;\n } else {\n $message = 'WEB Request - at IP - ' . $ip . ' via ' . $method . ' to ' . $url . ' using ' . $userAgent . ' from ' . $path;\n }\n\n \\Log::useFiles(storage_path('logs/access.log'));\n \\Log::info('');\n \\Log::info($message);\n\n return $response;\n }", "protected function processGetRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'get'\n ]));\n }", "public function processApi()\n {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n }\n else {\n $this->response('', 404);\n }\n }", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "abstract public function handleRequest($request);", "public function run_request() {\r\n\t\t// Do nothing if we don't\r\n\t\tif ( empty( $_GET['wpmudev-hub'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\r\n\t\t$this->register_internal_actions();\r\n\t\t$this->register_plugin_actions();\r\n\r\n\t\t//get the json\r\n\t\t$raw_json = file_get_contents( 'php://input' );\r\n\r\n\t\t$this->validate_hash( $_GET['wpmudev-hub'], $raw_json );\r\n\r\n\t\t$body = json_decode( $raw_json );\r\n\t\tif ( ! isset( $body->action ) ) {\r\n\t\t\twp_send_json_error( array( 'code' => 'invalid_params', 'message' => 'The \"action\" parameter is missing' ) );\r\n\t\t}\r\n\t\tif ( ! isset( $body->params ) ) {\r\n\t\t\twp_send_json_error( array( 'code' => 'invalid_params', 'message' => 'The \"params\" object is missing' ) );\r\n\t\t}\r\n\r\n\t\tif ( isset( $this->actions[ $body->action ] ) ) {\r\n\t\t\t$this->current_action = $body->action;\r\n\r\n\t\t\t//log it if turned on\r\n\t\t\tif ( WPMUDEV_API_DEBUG ) {\r\n\t\t\t\t$this->timer = microtime( true ); //start the timer\r\n\t\t\t\t$log = '[Hub API call] %s %s';\r\n\t\t\t\t$log .= \"\\n Request params: %s\\n\";\r\n\r\n\t\t\t\t$msg = sprintf(\r\n\t\t\t\t\t$log,\r\n\t\t\t\t\t$_GET['wpmudev-hub'],\r\n\t\t\t\t\t$body->action,\r\n\t\t\t\t\tjson_encode( $body->params, JSON_PRETTY_PRINT )\r\n\t\t\t\t);\r\n\t\t\t\terror_log( $msg );\r\n\t\t\t}\r\n\r\n\t\t\tcall_user_func( $this->actions[ $body->action ], $body->params, $body->action, $this );\r\n\r\n\t\t\t$this->send_json_success(); //send success in case the callback didn't respond\r\n\t\t}\r\n\r\n\t\t// When the callback function did not send a response assume error.\r\n\t\twp_send_json_error( array(\r\n\t\t\t'code' => 'unregistered_action', 'message' => 'This action is not registered. The required plugin is not installed, updated, or configured properly.'\r\n\t\t) );\r\n\t}", "function send_data_to_impact_api($campaign_id , $action_tracker_id , $click_id , $date , $order_id , $contact_id , $email){\n //get the Impact API endpoint and authentication details (for basic auth) from the database\n $impact_api_endpoint = sanitize_text_field(get_option('impact_api_endpoint'));\n $impact_api_account_sid = sanitize_text_field(get_option('impact_api_account_sid'));\n $impact_api_auth_token = sanitize_text_field(get_option('impact_api_auth_token'));\n //create the body of the post request\n $body = array(\n 'CampaignId' => $campaign_id,\n 'ActionTrackerId' => $action_tracker_id,\n 'ClickId' => $click_id,\n 'EventDate' => $date,\n 'OrderId' => $order_id,\n 'CustomerId' => $contact_id,\n 'CustomerEmail' => sha1($email),\n );\n //convert the body to JSON\n $body_json = wp_json_encode($body);\n //set the args - check these later\n $args = array(\n 'body' => $body_json,\n 'timeout' => '5',\n 'redirection' => '5',\n 'httpversion' => '1.0',\n 'blocking' => true,\n 'headers' => [ \n 'Content-Type' => 'application/json',\n 'Authorization' => 'Basic ' . base64_encode( $impact_api_account_sid . ':' . $impact_api_auth_token ),\n ],\n 'cookies' => array(),\n );\n \n //send the post request here\n $response_from_impact = wp_remote_post( $impact_api_endpoint, $args );\n //get the response code\n $http_code = wp_remote_retrieve_response_code( $response_from_impact );\n if ($http_code == 200){\n return 'data sent to impact successfully';\n }else{\n return 'problem in sending data to impact. Code: '. $http_code;\n }\n}", "public function handleWebHook(Request $request)\n {\n foreach ($request->all() as $request) {\n if (empty($request['msys'])) {\n $this->callEventMethod('ping', []);\n } else {\n $event = $request['msys'];\n foreach ($event as $eventType=>$event) {\n $eventName = $eventType . '_' . $event['type'];\n $this->callEventMethod($eventName, $event);\n }\n }\n }\n return response(null, 204);\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function getWebhookInfo(){\n return $this->make_http_request(__FUNCTION__);\n }", "public function runRequest() {\n }", "public function processApi() {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n if((int)method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('',404);\n }", "public function process(array $event)\n {\n $uri = '';\n if ($this->request instanceof HttpRequest) {\n $uri = $this->request->getUriString();\n }\n $token = $this->tokenService->getToken();\n\n // get request uri and IP address and add it to the extras of the logger\n $remoteAddress = new RemoteAddress();\n $parameters = [];\n $parameters['get_vars'] = $this->request->getQuery()->toArray();\n $parameters['post_vars'] = $this->request->getContent();\n $route = '';\n $request_method = $this->request->getMethod();\n $username = '';\n if ($this->identity->getIdentity()) {\n $username = $this->identity->getIdentity()->getUsername();\n }\n $userAgent = '';\n $header = $this->request->getHeader('UserAgent');\n if ($header instanceof UserAgent) {\n $userAgent = $header->getFieldValue();\n }\n $extras = array(\n 'uri' => substr($uri, 0, self::URI_MAX_LENGTH),\n 'parameters' => json_encode($parameters),\n 'request_method' => $request_method,\n 'ip_address' => $remoteAddress->getIpAddress(),\n 'php_session_id' => session_id(),\n 'username' => $username,\n 'route' => $route,\n 'request_uuid' => $this->requestUuid,\n 'token' => $token,\n 'user_agent' => substr($userAgent, 0, self::USER_AGENT_MAX_LENGTH),\n 'memory_usage' => memory_get_usage(true),\n );\n if (isset($event['extra']) && is_array($event['extra'])) {\n $extras = array_merge($event['extra'], $extras);\n }\n $event['extra'] = $extras;\n // check if we have trace, else get it explicitly\n return $event;\n }", "public function processApi() {\n $request = $this->_request['request'];\n $values = $this->_request;\n\n // WARNING: This method needs to add some ways to authenticate the user\n // and should also filter out any dangerous or magic methods before it\n // would be safe. This code is for demonstration purposes only!\n\n if (method_exists($this->database, $request)) {\n if (!empty($_REQUEST['request'])) {\n unset($values['request']);\n $result = $this->database->processRequest($request, $values);\n if (!empty($result)) {\n $this->response($this->json($result), 200);\n }\n else {\n // If no records \"No Content\" status\n $this->response('',204);\n }\n }\n else {\n // If the method not exist with in this class, response would be \"Page not found\".\n $this->response('',404);\n }\n }\n }", "protected function _logTraffic() {\n if ('testing' !== APPLICATION_ENV) {\n $lastRequest = $this->_client->getLastRequest();\n $lastResponse = $this->_client->getLastResponse();\n $filename = date('Y-m-d') . '-gofilex.log';\n $logMessage = \"\\n\";\n $logMessage .= '[REQUEST]' . \"\\n\";\n $logMessage .= $lastRequest . \"\\n\\n\";\n $logMessage .= '[RESPONSE]' . \"\\n\";\n $logMessage .= $lastResponse . \"\\n\\n\";\n\n $logger = Garp_Log::factory($filename);\n $logger->log($logMessage, Garp_Log::INFO);\n }\n }", "public function calculateStatisticsForRequest() : void {\n foreach ($this->timeSegments as $timeSegment) {\n if ($timeSegment instanceof LoopedTimeSegment) {\n $timeSegmentStatistic = $this->calculateStatisticForLoopedTimeSegment($timeSegment);\n } else if ($timeSegment instanceof SingleTimeSegment) {\n $timeSegmentStatistic = $this->calculateStatisticForSingleTimeSegment($timeSegment);\n }\n\n $this->statisticDataForRequest[$timeSegment->getLabel()][] = $timeSegmentStatistic;\n }\n }", "public function onEndpointRequest( $info, $ftnreq, $send_executor_rsp );", "public function call()\n {\n $this->dispatchRequest($this['request'], $this['response']);\n }", "private function requestProcessor() {\n try {\n\n if (empty($this->uri))\n throw new \\Exception(\"Undefined url\");\n\n $ReqHandle = curl_init($this->uri);\n\n $body = json_encode([]);\n if( sizeof($this->data) > 0 )\n $body = json_encode($this->data);\n\n $returnTransfer = 0;\n if( $this->hasResponseToReturn )\n $returnTransfer = 1;\n\n $isPost = 0;\n if( $this->method != 'GET')\n $isPost = 1;\n\n\n if($isPost == 1){\n curl_setopt($ReqHandle,CURLOPT_POST, $isPost);\n curl_setopt($ReqHandle, CURLOPT_POSTFIELDS, $body);\n }\n \n curl_setopt_array($ReqHandle, [\n CURLOPT_RETURNTRANSFER => $returnTransfer,\n CURLOPT_HTTPHEADER => $this->headersToBeUsed\n ]);\n\n\n $result = curl_exec($ReqHandle);\n\n if(curl_errno($ReqHandle)){\n\n return curl_error($ReqHandle);\n }\n\n if($returnTransfer == 1)\n return json_decode($result);\n\n\n\n } catch (\\Throwable $t) {\n new ErrorTracer($t);\n }\n }", "public function __construct()\n {\n $this->middleware('throttle:20,1');\n \n event(new ApiRequest());\n }", "public function hookHandler(Request $request)\n {\n $clientIp = !empty($request->header('X-Forwarded-For')) ?: $request->ip();\n Log::debug('hook received from ' . $clientIp);\n\n if ($this->isVerbose()) {\n dump($request);\n }\n\n $eventType = $request->headers->get('X-Gitlab-Event') ;\n if (is_null($eventType))\n $eventType = 'Push Hook';\n\n // for debugging purpose.\n \\Storage::put(str_replace(' ', '-', $eventType) . \".json\",\n json_encode($request->json()->all(), JSON_PRETTY_PRINT));\n\n Log::info('eventType : ' . $eventType);\n\n if ($eventType == 'Push Hook')\n {\n return $this->pushHook($request);\n }\n elseif ($eventType == 'Merge Request Hook'){\n return $this->mergeRequestHook($request);\n }\n\n abort(500, 'Unknown Hook type : ' . $eventType);\n }", "abstract public function handleRequest(Request $request);", "function run($request) {\n\n\t\t$ef = new EventApi;\n\n\t\t$query_attributes = array(\n\t\t\t'category' => 6, \n\t\t\t'location' => 363,\n\t\t\t'modified_since' => date('Y-m-d h:i:s', strtotime('-30 days')),\n\t\t\t'created_since' => date('Y-m-d h:i:s', strtotime('-30 days'))\n\t\t\t); \n\n\t\t$results = $ef->get_dataset($query_attributes); \n\n\t\techo count($results) . ' results returned'; \n\n\t\tforeach ($results as $result) {\n\t\t\techo '<p>' . $result['name'] . ' / ' . $result['location_summary'] . '</p>';\n\t\t}\n\n\t}", "public function handle_webhook() {\n\t\t$payload = file_get_contents( 'php://input' );\n\t\tif ( ! empty( $payload ) && $this->validate_webhook( $payload ) ) {\n\t\t\t$data = json_decode( $payload, true );\n\t\t\t$event_data = $data['event']['data'];\n\n\t\t\tself::log( 'Webhook received event: ' . print_r( $data, true ) );\n\n\t\t\tif ( ! isset( $event_data['metadata']['order_id'] ) ) {\n\t\t\t\t// Probably a charge not created by us.\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$order_id = $event_data['metadata']['order_id'];\n\n\t\t\t$this->_update_order_status( wc_get_order( $order_id ), $event_data['timeline'] );\n\n\t\t\texit; // 200 response for acknowledgement.\n\t\t}\n\n\t\twp_die( 'Coinbase Webhook Request Failure', 'Coinbase Webhook', array( 'response' => 500 ) );\n\t}", "public abstract function processRequest();", "public function handle($request, Closure $next)\n {\n $response = $next($request);\n $request->endTime = microtime();\n $starttime = explode(' ',$request->startTime);\n $endtime = explode(' ',$request->endTime);\n $rumTime = round( ( ($endtime[0]+$endtime[1])-($starttime[0]+$starttime[1]) ) ,5);\n\n $logData = [];\n $logData['startTime'] = $request->startTime;\n $logData['endTime'] = $request->endTime;\n $logData['rumTime'] = $rumTime;\n $logData['url'] = $request->fullUrl();\n Log::info(json_encode($logData));\n\n return $response;\n\n }", "public function handle($request, Closure $next)\n {\n // ------------------------------------------------------------------------\n // Log Before call\n\n $begin_log_vars = [\n 'method' => '',\n 'route' => '',\n 'uri' => '',\n 'parameters' => '',\n 'inputBodySize' => '',\n ];\n\n // get the request details\n $method = $request->method();\n $begin_log_vars['method'] = $method;\n\n $route = $request->route();\n if ($route) {\n $route_uri = $route->uri();\n $route_name = $route->getName();\n $route_params = $route->parameters();\n } else {\n $route_name = '[unknown]';\n $route_uri = '[unknown]';\n $route_params = [];\n }\n $begin_log_vars['route'] = $route_name;\n $begin_log_vars['uri'] = $route_uri;\n $begin_log_vars['parameters'] = $route_params;\n\n $body_size = $request->header('Content-Length');\n if (!$body_size) { $body_size = 0; }\n $begin_log_vars['inputBodySize'] = $body_size;\n EventLog::debug('apiCall.begin', $begin_log_vars);\n\n // ------------------------------------------------------------------------\n // Execute the next closure\n\n $status_code = null;\n $caught_exception = null;\n try {\n $response = $next($request);\n $status_code = $response->getStatusCode();\n } catch (Exception $e) {\n $caught_exception = $e;\n\n $status_code = 500;\n if ($e instanceof HttpException) { $status_code = $e->getStatusCode(); }\n }\n\n // ------------------------------------------------------------------------\n // Log after call\n\n $end_log_vars = [\n 'method' => $begin_log_vars['method'],\n 'route' => $begin_log_vars['route'],\n 'uri' => $begin_log_vars['uri'],\n 'parameters' => $begin_log_vars['parameters'],\n 'status' => $status_code,\n ];\n\n if ($caught_exception !== null) {\n // log the exception and then throw the error again\n EventLog::logError('apiCall.end', $caught_exception, $end_log_vars);\n throw $caught_exception; \n } else if ($response->isServerError() OR $response->isClientError()) {\n EventLog::warning('apiCall.end', $end_log_vars);\n } else {\n EventLog::debug('apiCall.end', $end_log_vars);\n }\n\n return $response;\n }", "public function webhookAction()\n {\n $modelWebhook = Mage::getModel('chargepayment/webhook');\n\n $isDebugCard = Mage::getModel('chargepayment/creditCard')->isDebug();\n $isDebugJs = Mage::getModel('chargepayment/creditCardJs')->isDebug();\n $isDebugKit = Mage::getModel('chargepayment/creditCardKit')->isDebug();\n $isDebugHosted = Mage::getModel('chargepayment/hosted')->isDebug();\n\n $isDebug = $isDebugCard || $isDebugJs || $isDebugKit || $isDebugHosted ? true : false;\n\n if ($isDebug) {\n Mage::log(file_get_contents('php://input'), null, CheckoutApi_ChargePayment_Model_Webhook::LOG_FILE);\n Mage::log(json_decode(file_get_contents('php://input')), null, CheckoutApi_ChargePayment_Model_Webhook::LOG_FILE);\n }\n\n if (!$this->getRequest()->isPost()) {\n $this->getResponse()->setHttpResponseCode(400);\n return;\n }\n\n $request = new Zend_Controller_Request_Http();\n $key = $request->getHeader('Authorization');\n\n if (!$modelWebhook->isValidPublicKey($key)) {\n $this->getResponse()->setHttpResponseCode(401);\n return;\n }\n\n $data = json_decode(file_get_contents('php://input'));\n\n if (empty($data)) {\n $this->getResponse()->setHttpResponseCode(400);\n return;\n }\n\n $eventType = $data->eventType;\n\n if (!$modelWebhook->isValidResponse($data)) {\n $this->getResponse()->setHttpResponseCode(400);\n return;\n }\n\n switch ($eventType) {\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_CHARGE_CAPTURED:\n $result = $modelWebhook->captureOrder($data);\n break;\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_CHARGE_REFUNDED:\n $result = $modelWebhook->refundOrder($data);\n break;\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_CHARGE_VOIDED:\n $result = $modelWebhook->voidOrder($data);\n break;\n case CheckoutApi_ChargePayment_Model_Webhook::EVENT_TYPE_INVOICE_CANCELLED:\n $result = $modelWebhook->voidOrder($data);\n break;\n default:\n $this->getResponse()->setHttpResponseCode(500);\n return;\n }\n\n $httpCode = $result ? 200 : 400;\n\n $this->getResponse()->setHttpResponseCode($httpCode);\n }", "public function __invoke(Request $request)\n {\n $event = $request->get('type');\n $fired_at = $request->get('fired_at'); // UTC timestamp string eg: \"2009-03-26 21:35:57\",\n $data = $request->get('data');\n\n switch ($event) {\n case 'subscribe':\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['ip_signup'] = \"10.20.10.30\"\n break;\n\n case 'unsub':\n case 'delete':\n //An unsubscribe event's action is either unsub or delete. The reason will be manual unless caused by a spam complaint, then it will be abuse.\n //$data['reason'] = \"manual\", // \"abuse\"\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['campaign_id'] = \"cb398d21d2\",\n break;\n\n\n case 'profile':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"[email protected]\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"[email protected]\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\"\n break;\n\n case 'upemail':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['new_id'] = \"51da8c3259\",\n //$data['new_email'] = \"[email protected]\",\n //$data['old_email'] = \"[email protected]\"\n break;\n\n case 'cleaned':\n //For cleaned emails, the reason will be hard (for hard bounces) or abuse.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['campaign_id'] = \"4fjk2ma9xd\",\n //$data['reason'] = \"hard\", // \"abuse\"\n //$data['email'] = \"[email protected]\"\n break;\n\n case 'campaign':\n // Campaign-Sent Emails\n //$data['id'] = \"5aa2102003\",\n //$data['subject'] = \"Test Campaign Subject\",\n //$data['status'] = \"sent\",\n //$data['reason'] = \"\",\n //$data['list_id'] = \"a6b5da1054\"\n break;\n }\n\n\n // Send a response, to acknowledge receipt, so it doesn't keep re-sending.\n return response('Success', 200);\n }", "public function webhook(Request $request): void\n {\n if (! $request->has('id')) {\n return;\n }\n\n $payment = Mollie::api()->orders()->get($request->id);\n\n $order = $this->findOrder($payment->id);\n\n switch ($payment->status) {\n case 'paid':\n $this->isPaid($order, Carbon::parse($payment->paidAt), $payment->method);\n break;\n case 'authorized':\n $this->isAuthorized($order, Carbon::parse($payment->authorizedAt), $payment->method);\n break;\n case 'completed':\n $this->isCompleted($order, Carbon::parse($payment->completedAt), $payment->method);\n break;\n case 'expired':\n $this->isExpired($order, Carbon::parse($payment->expiredAt));\n break;\n case 'canceled':\n $this->isCanceled($order, Carbon::parse($payment->canceledAt));\n break;\n }\n }", "public function webhook_request(Request $request)\n {\n\n Log::debug('WebhookController webhook_request');\n\n $input = $request->all();\n Log::debug(print_r($input, true));\n $data = $input['obj'];\n\n Log::debug($data);\n Log::debug('message');\n Log::debug($data['message']);\n\n Log::debug($data);\n\n if ($data['message'] === 'ta-set-unique-address') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-get-unique-address') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-set-key-value-pair') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'tas-event') {\n $event = new SmartContractEvent();\n $event->event_type = 'tas-event';\n $event->payload = json_encode($data);\n $_data = $data['data'];\n $event->transaction_hash = $_data['transactionHash'];\n // $event->attestation_hash = $_data['returnValues']['attestationKeccak'];\n // $event->user_address = $_data['returnValues']['_identifiedAddress'];\n // $event->ta_address = $_data['returnValues']['msg_sender'];\n $event->event = $_data['event'];\n $event->save();\n\n $data_local = $data['data'];\n if($data_local['event'] === 'EVT_setAttestation') {\n $returnValues = $data_local['returnValues'];\n $msg_sender_address = $returnValues['msg_sender'];\n $attestation_hash = $returnValues['attestationKeccak'];\n $identified_address = $returnValues['_identifiedAddress'];\n $public_data = $returnValues['_publicData_0'];\n $documents_matrix_encrypted = $returnValues['_documentsMatrixEncrypted_0'];\n $document_decrypt = $data_local['document_decrypt'];\n $availability_address_encrypted = $returnValues['_availabilityAddressEncrypted'];\n $jurisdiction = $returnValues['_jurisdiction'];\n\n $type = $data_local['type'];\n\n $attestation = new SmartContractAttestation();\n $attestation->ta_account = $msg_sender_address;\n $attestation->jurisdiction = $jurisdiction;\n $attestation->effective_time = $_data['returnValues']['_effectiveTime'];\n $attestation->expiry_time = $_data['returnValues']['_expiryTime'];\n $attestation->public_data = $public_data;\n $attestation->documents_matrix_encrypted = $documents_matrix_encrypted;\n $attestation->availability_address_encrypted = $availability_address_encrypted;\n $attestation->is_managed = $_data['returnValues']['_isManaged'];\n $attestation->attestation_hash = $attestation_hash;\n $attestation->transaction_hash = $_data['transactionHash'];\n $attestation->user_account = $identified_address;\n\n $attestation->save();\n\n $url = $this->helper_url.'/ta-get-attestation-components?attestation_hash='.$attestation_hash;\n Log::debug('WebhookController EVT_setAttestation url');\n Log::debug($url);\n\n $client = new Client();\n $res = $client->request('GET', $url);\n if($res->getStatusCode() == 200) {\n\n $response = json_decode($res->getBody());\n Log::debug('WebhookController EVT_setAttestation ta-get-attestation-components');\n Log::debug($response);\n\n\n } else {\n Log::error('WebhookController EVT_setAttestation ta-get-attestation-components: ' . $res->getStatusCode());\n }\n }\n\n broadcast(new ShyftSmartContractEvent($data));\n }\n\n if ($data['message'] === 'tam-event') {\n $event = new SmartContractEvent();\n $event->event_type = 'tam-event';\n $event->payload = json_encode($data);\n $_data = $data['data'];\n $event->transaction_hash = $_data['transactionHash'];\n $event->event = $_data['event'];\n $event->save();\n\n $data_local = $data['data'];\n if($data_local['event'] === 'EVT_verifyTrustAnchor') {\n $returnValues = $data_local['returnValues'];\n $account_address = $returnValues['trustAnchorAddress'];\n \n $ta = VerifiedTrustAnchor::firstOrCreate(['account_address' => $account_address]);\n $ta->save();\n }\n\n broadcast(new ShyftSmartContractEvent($data));\n }\n\n if ($data['message'] === 'create-new-user-account') {\n\n // var obj = { user_id: user_id, message: \"create-new-user-account\", data: data };\n $input['user_id'] = $data['user_id'];\n\n $ta = TrustAnchor::firstOrCreate(['user_id' => $input['user_id']]);\n\n // var account = {prefname:prefname, address:address, private_key:privateKey};\n $account = $data['data']['account'];\n $ta->ta_prefname = $account['prefname'];\n $ta->account_address = $account['address'];\n $ta->private_key = $account['private_key'];\n $ta->save();\n\n $user = User::findOrFail($input['user_id']);\n $user->trustAnchor()->save($ta);\n\n $data['data'] = $ta;\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-is-verified') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-reload-account') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-event') {\n $event = new SmartContractEvent();\n $event->event_type = 'ta-event';\n $event->payload = json_encode($data);\n $event->save();\n broadcast(new ShyftSmartContractEvent($data));\n }\n if ($data['message'] === 'taed-event') {\n Log::debug('taed-event');\n $event = new SmartContractEvent();\n $event->event_type = 'taed-event';\n $event->payload = json_encode($data);\n $event->save();\n $data_local = $data['data'];\n\n if ($data_local['event'] === \"EVT_setDataRetrievalParametersCreated\") {\n $extra_data = new TrustAnchorExtraData();\n\n $extra_data->transaction_hash = $data_local['transactionHash'];\n $extra_data->trust_anchor_address = $data_local['returnValues']['_trustAnchorAddress'];\n $extra_data->endpoint_name = $data_local['returnValues']['_endpointName'];\n $extra_data->ipv4_address = $data_local['ipv4_address'];\n $extra_data->save();\n }\n // $account = $data_local['returnValues']['_trustAnchorAddress'];\n // $endpoint_hash = $data_local['returnValues']['_endpointName'];\n // $id = 1;\n // $url = $this->helper_url.'/ta-get-endpoint-name?user_id='.$id.'&account='.$account.'&endpoint_hash='.$endpoint_hash;\n // $client = new Client();\n // $res = $client->request('GET', $url);\n // if($res->getStatusCode() == 200) {\n\n // $response = json_decode($res->getBody());\n // Log::debug('ContractsController ta_get_endpoint_name');\n // Log::debug($response);\n\n\n // } else {\n // Log::error('ContractsController ta_get_endpoint_name: ' . $res->getStatusCode());\n // }\n\n broadcast(new ShyftSmartContractEvent($data));\n }\n if ($data['message'] === 'taedu-event') {\n Log::debug('taedu-event');\n $event = new SmartContractEvent();\n $event->event_type = 'taedu-event';\n $event->payload = json_encode($data);\n $event->save();\n $data_local = $data['data'];\n\n if ($data_local['event'] === \"EVT_setTrustAnchorKeyValuePairCreated\") {\n $extra_data = new TrustAnchorExtraDataUnique();\n\n $extra_data->transaction_hash = $data_local['transactionHash'];\n $extra_data->trust_anchor_address = $data_local['returnValues']['_trustAnchorAddress'];\n $extra_data->key_value_pair_name = $data_local['returnValues']['_keyValuePairName'];\n $extra_data->key_value_pair_value = $data_local['returnValues']['_keyValuePairValue'];\n $extra_data->save();\n }\n\n if ($data_local['event'] === \"EVT_setTrustAnchorKeyValuePairUpdated\") {\n\n $extra_data = TrustAnchorExtraDataUnique::firstOrNew(['key_value_pair_name' => $data_local['returnValues']['_keyValuePairName'], 'trust_anchor_address' => $data_local['returnValues']['_trustAnchorAddress']]);\n\n $extra_data->transaction_hash = $data_local['transactionHash'];\n $extra_data->trust_anchor_address = $data_local['returnValues']['_trustAnchorAddress'];\n $extra_data->key_value_pair_name = $data_local['returnValues']['_keyValuePairName'];\n $extra_data->key_value_pair_value = $data_local['returnValues']['_keyValuePairValue'];\n $extra_data->save();\n }\n\n broadcast(new ShyftSmartContractEvent($data));\n }\n if ($data['message'] === 'ta-set-jurisdiction') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-create-user') {\n\n $trust_anchor_user_id = $data['ta_user_id'];\n $tau = TrustAnchorUser::findOrFail($trust_anchor_user_id);\n $tau->account_address = $data['data']['account']['address'];\n $tau->private_key = $data['data'] ['account']['private_key'];\n $tau->save();\n\n #save btc and eth to user account\n # {\"address\":address, \"public_key\": publicKey, \"private_key\": privateKey};\n $bitcoinAccount = $data['data']['bitcoinAccount'];\n $cwa = new CryptoWalletAddress();\n $cwa->address = $bitcoinAccount['address'];\n $cwa->public_key = $bitcoinAccount['public_key'];\n $cwa->private_key = $bitcoinAccount['private_key'];\n $cwa->trust_anchor_user_id = $tau->id;\n $cwa->trust_anchor_id = $tau->trust_anchor_id;\n $cwa->crypto_wallet_type_id = CryptoWalletType::where('wallet_type', 'BTC')->first()->id;\n $cwa->save();\n\n $ethereumAccount = $data['data']['ethereumAccount'];\n $cwa = new CryptoWalletAddress();\n $cwa->address = $ethereumAccount['address'];\n $cwa->public_key = $ethereumAccount['public_key'];\n $cwa->private_key = $ethereumAccount['private_key'];\n $cwa->trust_anchor_user_id = $tau->id;\n $cwa->trust_anchor_id = $tau->trust_anchor_id;\n $cwa->crypto_wallet_type_id = CryptoWalletType::where('wallet_type', 'ETH')->first()->id;\n $cwa->save();\n\n $data['data']['account'] = $tau->account_address;\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-set-attestation') {\n\n $result = $data['data'];\n\n $ta = TrustAnchor::where('account_address', $result['ta_address'])->first();\n $tau = TrustAnchorUser::where('account_address', $result['user_address'])->first();\n\n $taua = new TrustAnchorUserAttestation();\n $taua->trust_anchor_id = $ta->id;\n $taua->trust_anchor_user_id = $tau->id;\n $taua->attestation_hash = $result['resultAttestationKeccak'];\n $taua->save();\n\n\n $ta->trustAnchorUserAttestation()->save($taua);\n $tau->trustAnchorUserAttestation()->save($taua);\n\n broadcast(new ContractsInstantiate($data));\n\n }\n\n if ($data['message'] === 'ta-set-attestation-error') {\n broadcast(new ContractsInstantiate($data));\n }\n\n if ($data['message'] === 'ta-register-jurisdiction') {\n broadcast(new ContractsInstantiate($data));\n }\n\n if ($data['message'] === 'ta-register-jurisdiction-error') {\n broadcast(new ContractsInstantiate($data));\n }\n\n if ($data['message'] === 'ta-get-balance') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-request-tokens') {\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-get-user-attestations') {\n\n broadcast(new ContractsInstantiate($data));\n }\n if ($data['message'] === 'ta-get-attestation-components-in-array') {\n Log::debug('ta-get-attestation-components-in-array');\n Log::debug(print_r($data, true));\n $result = $data['data'][0];\n $country = Country::where('id', hexdec($result['jurisdiction']))->first();\n $list = [['field' => 'TA Address', 'data' => $result['trustAnchorAddress']],\n ['field' => 'User Address', 'data' => $result['user_address']],\n ['field' => 'Jurisdiction', 'data' => $country->name],\n\n ['field' => 'Type Hash', 'data' => $result['publicData']],\n ['field' => 'Memo Hash', 'data' => $result['availabilityAddressEncrypted']],\n ['field' => 'Document Hash', 'data' => $result['documentsMatrixEncrypted']],\n ['field' => 'Type Decoded', 'data' => $result['type']],\n\n\n ['field' => 'Document Encode', 'data' => $result['document_encode']],\n ['field' => 'Document Decoded', 'data' => $result['document']],\n ['field' => 'Memo Decoded', 'data' => $result['memo']]];\n\n\n $data['data'] = $list;\n broadcast(new ContractsInstantiate($data));\n }\n\n if ($data['message'] === 'ta-get-attestation-components') {\n Log::debug('ta-get-attestation-components');\n Log::debug(print_r($data, true));\n\n $data_local = $data['data'];\n Log::debug(print_r($data_local, true));\n\n if ($data_local['type'] == 'WALLET') {\n\n $crypto_address = $data_local['document'];\n Log::debug('crypto_address');\n Log::debug($crypto_address);\n\n $sca = SmartContractAttestation::where('attestation_hash', $data_local['attestation_hash'])->first();\n $sca->public_data_decoded = $data_local['type'];\n $sca->documents_matrix_encrypted_decoded = $data_local['document'];\n $sca->availability_address_encrypted_decoded = $data_local['memo'];\n\n $sca->save();\n\n $sender = TrustAnchorUser::where('account_address', $sca->user_account)->first();\n $sender_ta = TrustAnchor::where('account_address', $data_local['trustAnchorAddress'])->first();\n\n $crypto_wallet_address = CryptoWalletAddress::where('address', $crypto_address)->first();\n\n if ($crypto_wallet_address && $sender && $sender_ta) {\n\n Log::debug('crypto_wallet_address');\n Log::debug($crypto_wallet_address);\n\n $receiver_id = $crypto_wallet_address->trust_anchor_user_id;\n\n $receiver = TrustAnchorUser::where('id', $crypto_wallet_address->trust_anchor_user_id)->first();\n $receiver_ta_id = $crypto_wallet_address->trust_anchor_id;\n $receiver_ta = TrustAnchor::where('id', $receiver_ta_id)->first();\n $crypto_assoc = new TrustAnchorAssociationCrypto();\n $crypto_assoc->crypto_address = $crypto_address;\n\n if($sender) {\n $crypto_assoc->sender_account_address = $sender->account_address;\n $crypto_assoc->sender_account_prefname = $sender->prefname;\n $crypto_assoc->sender_dob = $sender->dob;\n $crypto_assoc->sender_gender = $sender->gender;\n $crypto_assoc->sender_jurisdiction = $sender->jurisdiction;\n }\n if($receiver) {\n $crypto_assoc->receiver_account_address = $receiver->account_address;\n $crypto_assoc->receiver_account_prefname = $receiver->prefname;\n $crypto_assoc->receiver_dob = $receiver->dob;\n $crypto_assoc->receiver_gender = $receiver->gender;\n $crypto_assoc->receiver_jurisdiction = $receiver->jurisdiction;\n }\n\n if($sender_ta) {\n $crypto_assoc->sender_ta_account_address = $sender_ta->account_address;\n $crypto_assoc->sender_ta_assoc_prefname = $sender_ta->ta_prefname;\n }\n\n if($receiver_ta) {\n $crypto_assoc->receiver_ta_account_address = $receiver_ta->account_address;\n $crypto_assoc->receiver_ta_assoc_prefname = $receiver_ta->ta_prefname;\n }\n\n $crypto_assoc->save();\n }\n #trigger Kyc Template\n app('App\\Http\\Controllers\\KycTemplateController')->attestation($data_local['attestation_hash']);\n }\n }\n\n\n if ($data['message'] === 'smart-contract-transaction') {\n\n\n Log::debug(print_r($data, true));\n\n $result = $data['data'];\n\n $transaction = SmartContractTransaction::firstOrNew(['transaction_hash' => $result['transaction']]);\n $transaction->save();\n\n }\n\n if ($data['message'] === 'get-smart-contract-transaction') {\n\n Log::debug('get-smart-contract-transaction');\n Log::debug(print_r($data, true));\n $result = $data['data'];\n $transaction = SmartContractTransaction::where('transaction_hash', $result['hash'])->first();\n if ($transaction) {\n $transaction->nonce = $result['nonce'];\n $transaction->block_hash = $result['blockHash'];\n $transaction->block_number = $result['blockNumber'];\n $transaction->transaction_index = $result['transactionIndex'];\n $transaction->from_address = $result['from'];\n $transaction->to_address = $result['to'];\n $transaction->value = $result['value'] / 1000000000000000000;\n $transaction->gas = $result['gas'];\n $transaction->gas_price = $result['gasPrice'];\n $transaction->payload = json_encode($result);\n\n $transaction->save();\n }\n\n\n }\n\n return response()->json(['message' => 'success'], 200);\n }", "public function api_call() {\n\n }", "public function handle($request, Closure $next)\n {\n $response = $next($request);\n\n app('api.log.receiver')->log($request, $response);\n\n return $response;\n }", "public function handleGetRequest($id);", "public function handle($request);", "public function api()\n {\n $function = $this->getParameter('function',$this->api_functions);\n\n $this->fetchOrder();\n\n $actualFunc = $this->oOrder->getData('micropayment_last_function');\n $this->oOrder->setData('micropayment_last_function',$function)->save();\n\n $this->checkEventWorkFlow($actualFunc,$function);\n $this->fetchOrder();\n switch ($function) {\n case self::FUNCTION_INIT:\n if($actualFunc)\n $this->handleInit();\n break;\n case self::FUNCTION_PAYIN:\n \t $this->handlePayin();\n\t break;\n case self::FUNCTION_BILLING:\n $this->handleBilling();\n break;\n case self::FUNCTION_STORNO:\n $this->handleStorno();\n break;\n case self::FUNCTION_BACKPAY:\n $this->handleBackpay();\n break;\n case self::FUNCTION_REFUND:\n $this->handleRefund();\n break;\n case self::FUNCTION_EXPIRE:\n $this->handleExpire();\n break;\n case self::FUNCTION_CHANGE:\n $this->handleChange();\n break;\n case self::FUNCTION_TEST:\n $this->handleTest();\n break;\n case self::FUNCTION_ERROR:\n $this->handleError();\n break;\n }\n $this->sendStatus();\n }", "public function handleWebhook()\n {\n $payload = (array) json_decode(Request::getContent(), true);\n \n $method = 'handle'.studly_case(str_replace('.', '_', $payload['type']));\n \n if (method_exists($this, $method)) {\n return $this->{$method}($payload);\n }\n else {\n return $this->missingMethod();\n }\n }", "public function webhook(Request $request)\n {\n $verified = Flutterwave::verifyWebhook();\n \n // if it is a charge event, verify and confirm it is a successful transaction\n if ($verified && $request->event == 'charge.completed' && $request->data->status == 'successful') {\n $verificationData = Flutterwave::verifyPayment($request->data['id']);\n if ($verificationData['status'] === 'success') {\n // process for successful charge\n \n }\n \n }\n \n // if it is a transfer event, verify and confirm it is a successful transfer\n if ($verified && $request->event == 'transfer.completed') {\n \n $transfer = Flutterwave::transfers()->fetch($request->data['id']);\n \n if($transfer['data']['status'] === 'SUCCESSFUL') {\n // update transfer status to successful in your db\n } else if ($transfer['data']['status'] === 'FAILED') {\n // update transfer status to failed in your db\n // revert customer balance back\n } else if ($transfer['data']['status'] === 'PENDING') {\n // update transfer status to pending in your db\n }\n \n }\n }", "public function handleWebhook(Request $request)\n {\n $this->request = $request;\n\n //\n $payload = $request->getContent();\n $data = \\json_decode($payload, true);\n $jsonError = \\json_last_error();\n if (null === $data && \\JSON_ERROR_NONE !== $jsonError) {\n\n Log::error('Error decoding Stripe webhook', ['payload' => $payload, 'json_last_error' => $jsonError]);\n return new Response('Invalid input', 400);\n }\n\n $event = \\Stripe\\Event::constructFrom($data);\n\n\n $method = 'handle' . Str::studly(str_replace('.', '_', $event->type));\n\n StripeIntentWebhookReceived::dispatch($data);\n\n if (method_exists($this, $method)) {\n $response = $this->{$method}($event);\n\n StripeIntentWebhookHandled::dispatch($data);\n\n return $response;\n }\n\n return $this->missingMethod($data);\n }", "public function processApi()\n\t\t{\n\t\t\t$this->createEntry();\n\t\t}", "public function handle($request, Closure $next)\n {\n $requestId = $this->requestContext->getId();\n $userId = Auth::user() ? Auth::user()->id : 'n/a';\n\n $monolog = Log::getMonolog();\n $monolog->pushProcessor(function ($record) use ($userId, $requestId) {\n $record['extra']['user'] = $userId;\n $record['extra']['request_id'] = $requestId;\n\n return $record;\n });\n\n $response = $next($request);\n \n if (!$this->shouldSample()){\n return $response;\n }\n\n $responseContent = $response->getContent();\n\n $headers = collect($request->headers)\n ->keys()\n ->flip()\n ->map(function ($i, $header) use ($request) {\n return $request->header($header);\n })\n ->all();\n\n $requestResponseData = new RequestResponseData(\n $this->requestContext->getId(),\n Auth::id(),\n json_encode($request->all()), // This should not be all should be getContent()\n $request->method(),\n $request->fullUrl(),\n $request->ip(),\n $response->status(),\n $responseContent,\n $this->getResponseTimeInMs(),\n $headers,\n $this->requestContext->getStartedAt()\n );\n\n\n try {\n $this->dispatch(new StoreRequestData($requestResponseData));\n } catch (Exception $e) {\n // An exception in logging shouldn't terminate\n // the session and cause a 500 response!\n // Move on -->\n Log::error($e);\n }\n\n try {\n $this->dispatch(new StoreQueries($this->requestContext));\n } catch (Exception $e) {\n // An exception in logging shouldn't terminate\n // the session and cause a 500 response!\n // Move on -->\n Log::error($e);\n }\n\n return $response;\n }", "protected function handle(Request $request) {}", "public function handleRequest(Request $request, Response $response);", "public function webhook_action ()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$id = isset($_GET['order_id']) ? $_GET['order_id'] : 0;\n\n\t\t\tif (empty($id))\n\t\t\t{\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\tdie(\"No order ID received\");\n\t\t\t}\n\n\t\t\t$transaction_id = $this->get_transaction_id_from_order_id($id);\n\t\t\t$payment = self::get_api()->payments->get($transaction_id);\n\n\t\t\t$this->update_status($id, $payment->status);\n\t\t\t$this->log($transaction_id, $payment->status, $id);\n\t\t}\n\t\tcatch (Mollie_API_Exception $e)\n\t\t{\n\t\t\techo \"API call failed: \" . htmlspecialchars($e->getMessage());\n\t\t}\n\n\t\tdie(\"OK\");\n\t}", "abstract public function processRequest();", "public function calllog(Request $request) {\n\n $requestData = $request->all();\n $this->respon['error_type'] = 0;\n //\n $message = array(\n 'token.required' => __('api.token_required'),\n 'call_id.required' => __('api.call_id_required'),\n 'ip.required' => __('api.ip_required'),\n 'location.required' => __('api.location_required'),\n );\n $rule = [\n 'token' => 'required',\n 'call_id' => 'required',\n 'ip' => 'required',\n 'location' => 'required',\n ];\n $validator = Validator::make($requestData, $rule,$message);\n //\n if ($validator->fails()) {\n $this->respon['message'] = $validator->errors()->first();\n return response()->json($this->respon,400);\n }else {\n //\n $user = Users::where('token', $request->input('token'))->first();\n //\n if ($user) {\n $data = [\n 'user_id' => $user->id,\n 'call_id' => $request->input('call_id'),\n 'ip' => $request->input('ip'),\n 'location' => $request->input('location')\n ];\n //\n $check_call_id = Call::where('id',$data['call_id'])->where(\"status\",0)->first();\n if($check_call_id){\n $call = Calllog::create($data);\n if($call){\n $this->respon['status'] = true;\n $this->respon['message'] = __('api.success');\n $this->respon['data'] = $call;\n $this->respon['error_type'] = 1;\n } else {\n $this->respon['message'] = __('api.error');\n }\n }else{\n return response()->json([\n 'status'=>'false',\n 'message'=>'this call id is not correct',\n 'data'=>(object)[],\n 'error_type'=>0\n ],400);\n }\n } else {\n return response()->json(\n [\n 'status' => 'false',\n 'message' => 'this token is not correct!!',\n 'data'=>(object)[],\n 'error_type'=>0\n ], 400);\n }\n }\n return response()->json($this->respon);\n }", "function veritrans_vtweb_response() {\n global $woocommerce;\n\t\t@ob_clean();\n\n $params = json_decode( file_get_contents('php://input'), true );\n\n if (2 == $this->api_version)\n {\n\n $veritrans_notification = new VeritransNotification();\n\n if (in_array($veritrans_notification->status_code, array(200, 201, 202)))\n {\n\n $veritrans = new Veritrans();\n if ($this->environment == 'production')\n {\n $veritrans->server_key = $this->server_key_v2_production;\n } else\n {\n $veritrans->server_key = $this->server_key_v2_sandbox;\n }\n \n $veritrans_confirmation = $veritrans->confirm($veritrans_notification->order_id);\n\n if ($veritrans_confirmation)\n {\n $order = new WC_Order( $veritrans_confirmation['order_id'] );\n if ($veritrans_confirmation['transaction_status'] == 'capture')\n {\n $order->payment_complete();\n $order->reduce_order_stock();\n } else if ($veritrans_confirmation['transaction_status'] == 'challenge') \n {\n $order->update_status('on-hold');\n } else if ($veritrans_confirmation['transaction_status'] == 'deny')\n {\n $order->update_status('failed');\n }\n $woocommerce->cart->empty_cart();\n }\n \n }\n\n } else\n {\n if( $params ) {\n\n if( ('' != $params['orderId']) && ('success' == $params['mStatus']) ){\n $token_merchant = get_post_meta( $params['orderId'], '_token_merchant', true );\n \n $this->log->add('veritrans', 'Receiving notif for order with ID: ' . $params['orderId']);\n $this->log->add('veritrans', 'Matching token merchant: ' . $token_merchant . ' = ' . $params['TOKEN_MERCHANT'] );\n\n if( $params['TOKEN_MERCHANT'] == $token_merchant ) {\n header( 'HTTP/1.1 200 OK' );\n $this->log->add( 'veritrans', 'Token Merchant match' );\n do_action( \"valid-veritrans-web-request\", $params );\n }\n }\n\n elseif( 'failure' == $params['mStatus'] ) {\n global $woocommerce;\n // Remove cart\n $woocommerce->cart->empty_cart();\n }\n\n else {\n wp_die( \"Veritrans Request Failure\" );\n }\n }\n }\n\t}", "public function request()\n {\n }", "public function request()\n {\n }", "public function webhook(Request $request): Response\n {\n return call_user_func($this->webHookController, $request);\n }", "public function webhook()\n {\n $this->paymentSettings = $this->getPaymentSettings();\n $payload = file_get_contents(\"php://input\");\n $signature = (isset($_SERVER['HTTP_X_PAYSTACK_SIGNATURE']) ? $_SERVER['HTTP_X_PAYSTACK_SIGNATURE'] : '');\n /* It is a good idea to log all events received. Add code *\n * here to log the signature and body to db or file */\n if (!$signature) {\n // only a post with paystack signature header gets our attention\n exit();\n }\n // confirm the event's signature\n if ($signature !== hash_hmac('sha512', $payload, $this->paymentSettings['secret_key'])) {\n // silently forget this ever happened\n exit();\n }\n $webhook_response = json_decode($payload, true);\n if ('charge.success' != $webhook_response['event']) {\n exit;\n }\n try {\n $orderId = $this->updatePaymentStatus($webhook_response['data']['reference']);\n } catch (Exception $e) {\n // Invalid payload\n http_response_code(400);\n exit();\n }\n http_response_code(200);\n exit();\n }", "public function request1(): void\n {\n $this->etat->handle1();\n }", "public function handle($request, Closure $next) {\n //add in api log\n Api::addApilogs($request);\n $post_data = $request->all();\n $userid = isset($post_data['userid']) ? $post_data['userid'] : 0;\n $api_token = isset($post_data['api_token']) ? $post_data['api_token'] : '';\n\n if ($api_token != '') {\n $checkApiToken = Users::where(array('api_token' => $api_token, 'record_status' => 1))->first();\n if (!EMPTY($checkApiToken) && count($checkApiToken) > 0) {\n $acckey = Crypt::decrypt($api_token);\n $accessArr = explode('@#@', $acckey);\n $userid = isset($accessArr[0]) ? $accessArr[0] : 0;\n $users = Users::where(array('id' => $userid, 'api_token' => $api_token, 'record_status' => 1))->first();\n\n if (!EMPTY($users) && count($users) > 0) {\n $status = isset($users['attributes']['status']) ? $users['attributes']['status'] : 0;\n if ($status == 1) {\n $userid = isset($users['attributes']['id']) ? $users['attributes']['id'] : 0;\n $username = isset($users['attributes']['name']) ? $users['attributes']['name'] : '';\n $username .= isset($users['attributes']['last_name']) ? ' ' . $users['attributes']['last_name'] : '';\n $useremail = isset($users['attributes']['email']) ? $users['attributes']['email'] : '';\n $usertitle = isset($users['attributes']['title']) ? $users['attributes']['title'] : '';\n $created_by = isset($users['attributes']['created_by']) ? $users['attributes']['created_by'] : 0;\n $userInfo = array('name' => $username, 'id' => $userid, 'email' => $useremail, 'title' => $usertitle,'created_by'=>$created_by);\n if (Session::has('user')) {\n $request->session()->forget('user');\n }\n Session::push('user', $userInfo);\n\n return $next($request);\n } else {\n $result = array('error' => true, 'message' => \"User is in in-active state.\");\n }\n } else {\n $result = array('error' => true, 'message' => \"User doesn't exist.\");\n }\n } else {\n $result = array('error' => true, 'message' => \"Api Key doesn't exist.\");\n }\n } else {\n $result = array('error' => true, 'message' => \"Api Key doesn't exist.\");\n }\n return Response::json($result, 200);\n }", "protected function restSystemCloudMetricsGetRequest()\n {\n\n $resourcePath = '/rest/system/cloud/metrics';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "protected function send_request(array $event_info)\n {\n }", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "function humcore_http_api_debug_action() {\n\n\tif ( defined( 'CORE_HTTP_DEBUG' ) && 'true' === CORE_HTTP_DEBUG && defined( 'CORE_ERROR_LOG' ) && '' != CORE_ERROR_LOG ) {\n\t\t// Hook into the http_api_debug action and call humcore_http_api_debug when http_api_debug fires.\n\t\tadd_action( 'http_api_debug', 'humcore_http_api_debug', 1000, 5 );\n\t}\n}", "public function send(): void\n {\n $requiredParams = [\n 'v' => $this->client->getVersion(),\n 'tid' => $this->client->getTrackingId(),\n 'cid' => $this->client->getClientId(),\n 't' => $this->getHitType(),\n ];\n $paramValues = array_merge(\n $requiredParams,\n $this->parameters\n );\n \n $url = $this->getBaseUrl();\n\n $guzzle = new \\GuzzleHttp\\Client();\n $result = $guzzle->request('POST', $url, ['form_params' => $paramValues]);\n\n if ($this->client->isDebug()) {\n var_dump((string) $result->getBody());\n }\n }", "public function processAPI() {\n $file = __dir__ . \"/../Controllers/\" . $this->endpoint . \"Controller.php\";\n\n if (file_exists($file)) {\n require $file;\n $class = \"\\\\Controllers\\\\\" .$this->endpoint . \"Controller\";\n\n } else {\n throw new \\Exception($file . \" does not exist.\");\n }\n\n $response = [];\n switch($this->method) {\n case HttpMethod::DELETE:\n case HttpMethod::POST:\n case HttpMethod::PUT:\n case HttpMethod::PATCH:\n $data = file_get_contents(\"php://input\");\n $this->data = json_decode($data,true);\n break;\n case HttpMethod::GET:\n break;\n default:\n $response = [\n \"Error\" => true,\n \"ErrorMessage\" => \"Unsupported Method: \".$this->method\n ]; \n $status = 405; \n return $this->_response($response,$status);\n break;\n }\n\n $worker = new $class($this->method,$this->data);\n $response = $worker->actionJson();\n\n return $this->_response($response);\n\n }", "public function onKernelRequest(GetResponseEvent $event) : void\n {\n // don't do anything if it's not the master request\n if (! $event->isMasterRequest()) {\n return;\n }\n \n // get Request from Event\n $request = $event->getRequest();\n \n // log Request via RequestLogger\n $this->requestLogger->logRequest($request);\n \n }", "public function handle()\n {\n $vkRequestsParams = RequestController::vkRequestsParams();\n $started_at = Carbon::now();\n $methods = [\n 'qwerty',\n ];\n $items = VkQueue::whereIn('method', $methods)->take($vkRequestsParams->records)->get();\n\n $this->log(0, 'RequestVk started at ' . Carbon::now()->format('Y-m-d, H:i:s'));\n $this->log(0, 'Available records: ' . $items->count());\n $this->log(0, 'Acceptable Records Count per Minute: ' . $vkRequestsParams->records);\n\n foreach ($items as $item) {\n if ($this->isBreakTimeRequest($started_at)) {\n $this->log($item->id, 'isBreakTimeRequest');\n continue;\n }\n\n if (Carbon::parse($item->user->expired_at) <= Carbon::now()) {\n $this->log($item->id, 'storeError :: Token expired');\n $this->storeError($item->user_id, $item->method, $item->access_token, trans('api.31'));\n $item->delete();\n continue;\n }\n\n $url = config('vk.request_url', 'http://localhost');\n\n $response = RequestController::send('POST', str_finish($url, '/') . $item->method, json_decode($item->context));\n\n if (!empty($response->error_description)) {\n $this->log($item->id, 'storeError :: ' . $response->error_description);\n $this->storeError($item->user_id, $item->method, $item->access_token, $response->error_description);\n } else {\n $this->log($item->id, 'storeSuccess :: ' . gettype($response));\n $this->storeSuccess($item->user_id, $item->method, $item->access_token, $response);\n }\n\n $item->delete();\n }\n\n $this->log(0, 'Requesting time: ' . Carbon::now()->diff($started_at)->s . 's');\n $this->log(0, 'RequestVk exiting at ' . Carbon::now()->format('Y-m-d, H:i:s'));\n }", "public function index(Request $request, $tag = null)\n {\n $method = $request->method();\n //$expectedContentTypes = $request->getAcceptableContentTypes();\n// $clientIPs = $request->getClientIps();\n $defaultLocale = $request->getDefaultLocale();\n $scheme = $request->getScheme();\n $postData = $request->post();\n $getData = $request->query();\n $requestHeaders = $request->header();\n\n //$request = Request::instance() ;\n $rawData = $request->getContent();\n\n// Log::info('Tag: ' . $tag);\n// Log::info('Scheme: ' . $scheme);\n// Log::info('Method: ' . $method);\n// Log::info('User Agent: ' . $request->userAgent());\n// Log::info('Expected Content Types: ' . json_encode($expectedContentTypes));\n// Log::info('Client IPs: ' . json_encode($clientIPs));\n// Log::info('Default Locale: ' . $defaultLocale);\n// Log::info('POST Data: ' . json_encode($postData));\n// Log::info('GET Data: ' . json_encode($getData));\n// Log::info('Headers: ');\n// foreach ($requestHeaders as $k => $v)\n// if (count($v) > 1)\n// Log::info($k . ' = ' . json_encode($v));\n// else\n// Log::info($k . ' = ' . $v[0]);\n//\n// Log::info('creating hit');\n\n $hit = Hit::create(['tag' => $tag ?? null,\n 'scheme' => $scheme,\n 'method' => $method,\n 'remote_address'=> $request->ip(),\n 'remote_host' => gethostbyaddr($request->ip()),\n // 'expected_content_types' => json_encode($expectedContentTypes),\n // 'client_ips' => json_encode($clientIPs),\n 'default_locale' => $defaultLocale,\n 'user_agent' => $request->userAgent(),\n // 'post_data' => json_encode($postData),\n // 'get_data' => json_encode($getData),\n 'raw_data' => $rawData,]\n // 'headers' => json_encode($requestHeaders)]\n );\n //Log::info('hit created');\n\n if ($hit)\n {\n //Write POST\n foreach ($postData as $k => $v)\n {\n Metadata::create(['fk_hit_id' => $hit->id,\n 'metadata_key' => $k,\n 'metadata_value' => $v,\n 'metadata_type' => 'POST']);\n }\n //Write GET\n foreach ($getData as $k => $v)\n {\n Metadata::create(['fk_hit_id' => $hit->id,\n 'metadata_key' => $k,\n 'metadata_value' => $v,\n 'metadata_type' => 'GET']);\n }\n //Write Headers\n foreach ($requestHeaders as $k => $v)\n {\n if (is_array($v))\n {\n foreach ($v as $v1)\n {\n Metadata::create(['fk_hit_id' => $hit->id,\n 'metadata_key' => $k,\n 'metadata_value' => $v1,\n 'metadata_type' => 'HEADER']);\n }\n }\n else\n {\n Metadata::create(['fk_hit_id' => $hit->id,\n 'metadata_key' => $k,\n 'metadata_value' => $v,\n 'metadata_type' => 'HEADER']);\n }\n }\n\n //If we are doing a passthrough, make the request here (refactor to helper function)\n return Response::HTTP_OK;\n }\n\n return Response::HTTP_INTERNAL_SERVER_ERROR;\n }", "public function handleHttpRequest() {\r\n\t\t\r\n\t\t// starttime\r\n\t\t$time_start = microtime(true);\r\n\t\t\r\n\t\t// create new Session if the client doesn't have one\r\n\t\tif( session_id() == null ) session_start();\r\n\r\n\t\t$result = array();\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// get version on empty request \r\n\t\t\tif( ( $_GET == null && $_POST == null ) /* || ( $_POST == null && $_POST == null ) */ ) {\r\n\r\n\t\t\t\t// no parameters given, just return the version number\r\n $initial = 'BiotoPi API ' . 'v1 '; // Helper::getVersion();\r\n\t\t\t\t$result['data'] = $initial;\r\n\t\t\t\t$result['state'] = true;\r\n\r\n\t\t\t\t// TODO, $_REQUEST is never empty, use $_POST & $_GET instead!!\r\n\t\t\t} else if( isset( $_GET ) || isset( $_POST ) /* && $_REQUEST != \"\" */ ) {\r\n\r\n\t\t\t\tif( ENV == 'prod' && isset( $_REQUEST['tk'] ) && $_REQUEST['tk'] !== null ) {\r\n\r\n\t\t\t\t\t// only allowed requests in productive enviroments with right token\r\n\t\t\t\t\t$tk = base64_decode( urldecode( $_REQUEST['tk'] ) );\r\n\t\t\t\t\t$sitetk = Config::get( 'token' );\r\n\t\t\t\t\t$unpack = unpack( 'H*', $sitetk );\r\n\t\t\t\t\tif( $tk != strtotime( date( 'd.m.Y H:i:00' ) ) . array_shift( $unpack ) ) throw new Exception( \"Wrong token! \" );\r\n\t\t\t\t\t//\t\t\t\t\t\t$tk = base64_decode( urldecode( $_REQUEST['tk'] ) );\r\n\t\t\t\t\t//\t\t\t\t\t\tif( $tk != Config::get( 'token' ) ) throw new Exception( \"Wrong token!\" ); // , $_SESSION['site'] \r\n\r\n\t\t\t\t} else if( ENV == 'prod' && ( ! isset( $_SESSION['eingeloggt'] ) || $_SESSION['eingeloggt'] != 1 ) ) {\r\n\r\n // we need a Users Backend and Frontend\r\n // Login, Register (contains send E-Mail with tokenized Link)\r\n // Overview for Admins (we need also Groups for this: Admin and User should be enough) \r\n\r\n\t\t\t\t\t// unauthorized requests redirect or notify?\r\n // if( Config::get( 'apiredirect' ) ) {\r\n // // Redirect to loginpage\r\n // header ( \"Location: ./mgmt\" );\r\n // } else {\r\n\t\t\t\t\t\t// Returns a Message\r\n throw new Exception( 'Please login to use this service!' );\r\n // }\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// get our controller and action names \r\n\t\t\t\t$controllerName = isset( $_REQUEST['controller'] ) ? $_REQUEST['controller'] : null;\r\n\t\t\t\t$actionName = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;\r\n\r\n\t\t\t\tif( $controllerName === null ) throw new Exception( 'No Controller given, aborted!' );\r\n\t\t\t\tif( $actionName === null ) throw new Exception( 'No Action given, aborted!' );\r\n\r\n\t\t\t\t// Controller allways are lowercase only the first Character is Uppercase\r\n\t\t\t\t// $controllerName = ucfirst( strtolower( $controllerName ) );\r\n $controllerName = ucfirst( $controllerName );\r\n\r\n\t\t\t\t// use PHP reflectionAPI to get result\r\n\t\t\t\t$controller = self::createController( $controllerName );\r\n\t\t\t\t$response = self::callMethod( $controller, $actionName );\r\n\r\n\t\t\t\t// return result into data and set succes true\r\n\t\t\t\t$result['state'] = true;\r\n\t\t\t\t$result['data'] = $response;\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch( Exception $e ) {\r\n\t\t\t// catch any exceptions, set success false and report the problem\r\n\t\t\t$result['state'] = false;\r\n\t\t\t$result['errormsg'] = $e->getMessage();\r\n\t\t}\r\n\r\n\t\tif( isset($_GET['debug']) && $_GET['debug'] === \"1\" ) {\r\n\t\t\t$result['time'] = round( ( microtime(true) - $time_start ), 3 );\r\n\t\t\techo \"<pre>\";\r\n\t\t\tprint_r( $result );\r\n\t\t\t//var_dump( $result );\r\n\t\t\techo \"</pre>\";\r\n\t\t} else if ( $result ) {\r\n // if( $result['data'] === $initial ) {\r\n // // we are on an initial request\r\n // }\r\n // return our json encoded result to the requester\r\n header( 'Cache-Control: no-cache, must-revalidate' );\r\n\t\t\theader( \"Access-Control-Allow-Origin: *\" );\r\n\t\t\theader( \"Content-Type: application/json charset=UTF-8\" );\r\n\t\t\tprint_r( json_encode( $result ) );\r\n\t\t} else {\r\n\t\t\techo \"<pre>\";\r\n\t\t\tvar_dump( $result );\r\n\t\t\techo \"</pre>\";\r\n\t\t}\r\n\r\n\t\tsession_write_close();\r\n\r\n\t\t// // redirect to last destination as form fallback on no js.\r\n\t\t// if( isset( $_REQUEST['redirect'] ) ) {\r\n\t\t// \theader ( \"Location: \" . $_REQUEST['redirect'] );\r\n\t\t// }\r\n\r\n\t}", "public function processRequest() {\n $serviceType = $this->getServiceType();\n if(!$serviceType){return \"Invalid Call ! \\n\";}\n $repoPath = $this->getRepoName();\n if(!defined(\"__APIURL__\" . $serviceType)){\n return \"API URL not found for $serviceType\\n\";\n }\n $apiUrl = sprintf(constant(\"__APIURL__\" . $serviceType), $repoPath);\n $response = $this->makeCurlRequest($apiUrl, 'get');\n switch ($serviceType) {\n case 'github.com':\n return $this->getCountForGit($response);\n break;\n case 'bitbucket.org':\n return $this->getCountForBit($response);\n break;\n default :\n return $response;\n break;\n }\n }", "public function getAPI(Request $request)\n {\n }", "private function dispatch(): void {\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"{$this->apiUrl}/{$this->endpoint}\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => \"CURL_HTTP_VERSION_1_1\",\n CURLOPT_CUSTOMREQUEST => $this->method\n ));\n\n $this->response = curl_exec($curl); \n curl_close($curl);\n }", "public function handleWebhook(Request $request)\n {\n $payload = $request->all();\n\n $method = 'handle'.studly_case(str_replace('.', '_', $payload['event']));\n\n if (method_exists($this, $method)) {\n return $this->{$method}($payload);\n } else {\n return $this->missingMethod();\n }\n }", "public function process() {\n\t\t$service = $this->getService();\n\t\t$service->hsts = HTTP_Helper::retrievePost( 'hsts_preload' );\n\t\t$service->include_subdomain = HTTP_Helper::retrievePost( 'include_subdomain' );\n\t\t$service->hsts_cache_duration = HTTP_Helper::retrievePost( 'hsts_cache_duration' );\n\t\t$service->scenario = HTTP_Helper::retrievePost( 'scenario' );\n\t\t$ret = $service->process();\n\t\tif ( is_wp_error( $ret ) ) {\n\t\t\twp_send_json_error( [\n\t\t\t\t'message' => $ret->get_error_message()\n\t\t\t] );\n\t\t} else {\n\t\t\tSettings::instance()->addToResolved( Sh_Strict_Transport::$slug );\n\t\t}\n\t}", "public function monitorApiService()\n {\n $this->monitorLastPage();\n $this->monitorOrderList();\n $this->monitorOrderDetails();\n $this->monitorChangeStatus();\n }", "public function processApi(){\n\t\t$words = explode(\"/\",$_REQUEST['rquest']);\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$words[0])));\n\t\t\n \t\tif(strcmp(\"services\",$func) == 0)\n\t\t\t$this->$func($words[1],$words[2]);\t// you can set as many levels as you want\n\t\telse\n\t\t\t$this->response('',404);\t// response would be \"Page not found\"\n\t}", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "public function handleData();", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);" ]
[ "0.62899756", "0.6232049", "0.59823304", "0.5879962", "0.5879962", "0.5879962", "0.5814393", "0.576273", "0.56408036", "0.56368893", "0.56304526", "0.556917", "0.5565125", "0.5479541", "0.5459264", "0.545608", "0.54184735", "0.5416163", "0.54149014", "0.540092", "0.5338434", "0.53265315", "0.53153205", "0.5311289", "0.52958274", "0.52922875", "0.52247655", "0.52239615", "0.521376", "0.51999754", "0.5193585", "0.5187508", "0.51787037", "0.5173258", "0.5171266", "0.5161801", "0.5160207", "0.5153952", "0.5150683", "0.5146399", "0.514525", "0.5140464", "0.5137428", "0.5106944", "0.5102149", "0.50942403", "0.50887567", "0.50809073", "0.50683326", "0.5055223", "0.5051785", "0.50515693", "0.5050617", "0.50453144", "0.50376093", "0.50198704", "0.5015607", "0.50105494", "0.49945232", "0.49936548", "0.49862522", "0.49827775", "0.4977248", "0.49768195", "0.497663", "0.4976492", "0.49643096", "0.49598074", "0.49521315", "0.49514028", "0.4951151", "0.49446306", "0.49428552", "0.49404067", "0.49404067", "0.49356627", "0.49304143", "0.49271244", "0.49245825", "0.49177456", "0.4914701", "0.49118268", "0.49110436", "0.4909904", "0.48966765", "0.48849213", "0.4882688", "0.48759398", "0.48729435", "0.485957", "0.48578614", "0.4853347", "0.4849757", "0.4848027", "0.4845658", "0.48328194", "0.48286945", "0.48209006", "0.48204586", "0.48192355" ]
0.68948895
0
Push post save event to Segment.io.
function track_new_or_updated_content( $post_id, $post, $update ) { // Bail on auto-save. if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } if ( $update ) { $action = 'update'; } else { $action = 'create'; } track( [ 'event' => 'Content', 'properties' => [ 'content_type' => $post->post_type, 'content_action' => $action, ], ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function postSave() {}", "public function save(Post $post): void;", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "public function postSaveCallback()\n {\n $this->performPostSaveCallback();\n }", "public function postSave(EntityEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n }", "function _save_post_hook()\n {\n }", "public function onAfterSave();", "protected function _postSave()\r\n\t{\r\n\t}", "public function save() {\n\t\tglobal $wpdb;\n\n\t\t$defaults = array(\n\t\t\t\t'id' => null,\n\t\t\t\t'slug' => null,\n\t\t\t\t'payload' => null,\n\t\t\t\t'remote_host' => null,\n\t\t\t\t'remote_ip' => null,\n\t\t\t\t'timestamp' => date( \"Y-m-d H:i:s\" ),\n\t\t\t);\n\t\t$data = array_merge( $defaults, (array)$this->data );\n\n\t\tif ( empty( $data['slug'] ) )\n\t\t\treturn new WP_Error( 'invalid-arguments', \"'slug' is a required argument.\" );\n\n\t\tif ( ! empty( $data['remote_ip'] ) )\n\t\t\t$data['remote_ip'] = ip2long( $data['remote_ip'] );\n\n\t\tif ( empty( $data['id'] ) ) {\n\t\t\tunset( $data['id'] );\n\t\t\t$ret = $wpdb->insert( $wpdb->notify_events, $data );\n\t\t\t$data['id'] = (int) $wpdb->insert_id;\n\t\t} else {\n\t\t\t$ret = $wpdb->update( $wpdb->notify_events, $data, array( 'id' => $data['id'] ) );\n\t\t}\n\n\t\tif ( ! empty( $data['remote_ip'] ) )\n\t\t\t$data['remote_ip'] = long2ip( $data['remote_ip'] );\n\n\t\tif ( $ret ) {\n\t\t\t$this->data = (object)$data;\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn new WP_Error( 'mysql-failure', \"Couldn't insert/update event into database.\" );\n\t\t}\n\t}", "private function PostSaver(){\n if ($this->updateMode){\n $post = Post::find($this->postId);\n } else {\n $post = new Post();\n }\n $post->user_id = Auth::user()->id;\n $post->title = $this->title;\n $post->category_id = (int)$this->categories;\n $post->caption = $this->caption;\n $post->url = $this->imagePath;\n $post->save();\n $post->Tag()->sync($this->tags);\n }", "public function post_save(){\n\n }", "public function saveAction()\r\n\t{\r\n\t\t$eventId = $this->getRequest()->getParam('event_id');\r\n\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\r\n\t\tif($data = $this->getRequest()->getPost()){\r\n\t\t\ttry{\r\n\t\t\t\t$eventModel->addData($data)\r\n\t\t\t\t\t->save();\r\n\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your event has been saved\"));\r\n\t\t\t} catch (Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setEventFormData($data); // persist the values\r\n\t\t\t\t$this->_redirect('*/*/edit', array('_current' => true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_redirect('*/*/index');\t\r\n\t}", "public function save()\n {\n $now = new DateTime();\n $this->timestamp = $now->getTimestamp();\n self::setClassAndTable();\n parent::saveModel();\n\n $this->id = parent::getLastID();\n\n // Send notification to watchers\n $post = Post::find([\"id\" => $this->post_id]);\n $owner = $post->user();\n $watchers = $post->watchers();\n foreach ($watchers as $user) {\n $notif = new Notification();\n $notif->user_id_from = $owner->id;\n $notif->user_id_to = $user->id;\n $notif->type = Notification::WATCHLIST_UPDATE;\n $notif->link = \"/posts/view.php?post_id=$post->id\";\n $notif->save();\n }\n }", "public function postSegment()\n\t{\n\t\tif (count($this->_segmentQueue) > 0) {\n\t\t\t$payload = $this->getApi()->wrap($this->getApiModel(), $this->_segmentQueue);\n\t\t\t$this->getApi()->reinit()->call($this->getApiController(), $payload);\n\t\t\t$this->_segmentQueue = array();\n\t\t}\n\t}", "protected function save(){\n $this->getTags();\n foreach ($this->posts as $post){\n $createdPost = Post::create(['habr_id' => $post['postId'],\n 'post' => $post['full'],\n 'unix_time' => $post['time']]);\n $this->attachPostTags($createdPost,$post['tags']);\n }\n }", "private function handlePostRequest() {\n $this->store();\n }", "public function save() {}", "public function save() {}", "public function save() {}", "public function save()\n {\n $postMapper = new Application_Model_PostsMapper();\n $postMapper->save($this);\n }", "public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }", "public function publish(Post $post){\n $this->posts()->save($post);\n }", "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }", "public function onSaveEntry(SproutForms_OnSaveEntryEvent $event)\n\t{\n\t\t$this->raiseEvent('onSaveEntry', $event);\n\t}", "public function save($post_id);", "public function onSave()\n {\n try\n {\n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // get the form data into an active record Entry\n $object = $this->form->getData('AgendaEntry');\n \n $this->form->validate(); // form validation\n $object->store(); // stores the object\n $this->form->setData($object); // keep form data\n \n TTransaction::close(); // close the transaction\n $posAction = new TAction(array('AgendaView', 'reload'));\n // shows the success message\n new TMessage('info', TAdiantiCoreTranslator::translate('Record saved'), $posAction);\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n $this->form->setData( $this->form->getData() ); // keep form data\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }", "public function onSaveEvent(Event $event)\n {\n $this->raiseEvent('onSaveEvent', $event);\n }", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "public function save()\n {\n $data = $this->input->post(null, true);\n $result = TagService::getInstance()->save($data);\n $this->_success($result);\n }", "public function persist()\n {\n\n $this->persistor->persist(\n $this->event,\n $this->relatedEntities,\n $this->eventRequest->getApplication(),\n $this->eventRequest->getAccount(),\n $this->eventRequest->getProduct(),\n $this->eventRequest->appendCustomer\n );\n\n }", "private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }", "protected function hook_afterSave(){}", "public function saveAction()\n {\n //the data for the thing\n $_consumerId = $this->getRequest()->getParam('consumer_id');\n \n //the post data\n $_data = $this->getRequest()->getPost();\n if ($_data) {\n $_artist = $this->_initConsumerSave();\n \n try {\n $_artist->save();\n \n $_redirectBack = false;\n $this->_getSession()->addSuccess($this->__('The consumer has been saved.'));\n } catch (Mage_Core_Exception $e) {\n $this->_getSession()->addError($e->getMessage())\n ->setArtistData($_data);\n $_redirectBack = true;\n } catch (Exception $e) {\n Mage::logException($e);\n $this->_getSession()->addError($e->getMessage());\n $_redirectBack = true;\n }\n }\n \n if ($_redirectBack) {\n $this->_redirect(\n '*/*/edit', array(\n 'id' => $_consumerId,\n '_current' => true\n )\n );\n } else {\n $this->_redirect('*/*/');\n }\n }", "public function save()\n {\n // For V2.0\n }", "public function save() {\n }", "public function save() {\n }", "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'event_type_id' => $this->event_type_id,\n 'user_1_id' => $this->user_1_id,\n 'user_2_id' => $this->user_2_id,\n 'user_1_name' => $this->user_1_name,\n 'user_2_name' => $this->user_2_name,\n 'product_1_name' => $this->product_1_name,\n 'product_2_name' => $this->product_2_name,\n 'data_1' => $this->data_1,\n 'data_2' => $this->data_2\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "public function store()\r\n\t{\r\n\t\t$jsonData = $this->getAll();\r\n\r\n\t $data = array(\r\n\t\t\t'username'=> $this->user->username,\r\n\t\t\t'post'=> $this->post,\r\n\t\t\t'date'=> $this->date,\r\n\t );\r\n\r\n\t\tarray_unshift($jsonData, $data);\r\n\r\n\t\t$this->save($jsonData);\r\n\t}", "public function sendPost(){\n\t\t\t// record the post in the database\n\t\t\t\n\t\t}", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function onSaving(Step $step): void\n {\n }", "public function afterSave(){\n\t}", "public function store()\n {\n /*$this->validate([\n 'title' => 'required',\n 'body' => 'required',\n ]);*/\n agenc::updateOrCreate([\n 'name' => $this->name,\n 'code' => $this->code,\n 'phone' => $this->phone,\n 'fax' => $this->fax,\n 'email' => $this->email,\n 'address' => $this->address,\n 'country' => $this->country,\n 'status' => 1,\n ]);\n\n session()->flash('message',\n $this->agency_id ? 'Post Updated Successfully.' : 'Post Created Successfully.');\n\n $this->resetInputFields();\n\n $this->emit('userStore');\n }", "public function store(StorePost $request)\n {\n $data = [\n 'title' => $request->title,\n 'body' => nl2br($request->body),\n 'description' => $request->description,\n 'image' => $request->image,\n 'is_anon' => $request->is_anon,\n 'category_id' => $request->category_id,\n\n ];\n $post = Post::create($data);\n event(new increaseScoreEvent(50));\n return redirect()->route('post.show',$post);\n }", "public final function save() {\n }", "public function afterSave()\n {\n\n }", "public function save() {\n }", "public function onBeforeSave($event);", "public function save_post( $post_id, $post ) {\n\t\tif ( self::POST_TYPE != $post->post_type || ( defined('DOING_AJAX') && DOING_AJAX ) || wp_is_post_autosave($post) || wp_is_post_revision($post) || 'auto-draft' == $post->post_status )\n\t\t\treturn;\n\t\t\n\t\tif ( isset($_POST[self::NOTIFY_META]) ) {\n\t\t\tupdate_post_meta( $post_id, self::NOTIFY_META, $_POST[self::NOTIFY_META] );\n\t\t}\n\n\t\t$this->send_notification( $post_id );\n\t}", "public function save(NewsPost $NewsPost);", "function after_save() {}", "protected function _postSave($success, $exists) {}", "function save_QRCode_Event_BA_DM_Plugin(){\n\t\tglobal $post;\n\t\t# prüft zerst $post, ist er nicht vorhanden dann lohnen sich die unteren Abfragen nicht, da es ja noch keine Posts dazu gibt und es zu lauter Fehlermeldungen führen würde (wegen nicht vorhandener Post-Einträge)\n\t\tif (!empty($post)) {\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_name\", $_POST['qrCode_event_name']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_start\", $_POST['qrCode_event_start']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_end\", $_POST['qrCode_event_end']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_location\", $_POST['qrCode_event_location']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_description\", $_POST['qrCode_event_description']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_size\", $_POST['qrCode_event_size']);\n\t\t\tupdate_post_meta($post->ID, \"qrCode_event_ecc_level\", $_POST['qrCode_event_ecc_level']);\n\t\t}\n\n\t}", "public function save()\n {\n $data = [\n 'eventKey' => $this->eventKey,\n 'eventType' => $this->getEventType(),\n 'eventAction' => $this->getEventAction(),\n 'eventSubjectID' => $this->getSubjectID(),\n 'eventSubjectData' => trim($this->getSubjectData()),\n 'eventUserID' => ($this->user) ? $this->user->id() : 0,\n 'eventTriggered' => date('Y-m-d H:i:s')\n ];\n\n $PerchAPI = new PerchAPI(1.0, 'redfinch_logger');\n $Events = new RedFinchLogger_Events($PerchAPI);\n\n return $Events->create($data);\n }", "public function store(Request $request)\n {\n Validator::make($request->all(), [\n 'name' => ['required','max:255'],\n 'description' => ['required'],\n 'deadline' => ['date'],\n 'qr' => [],\n 'answers' => ['present', 'array', 'required']\n ])->validateWithBag('createNewEvent');\n\n //Post::create($request->all());\n $event = new \\App\\Models\\Event;\n $event->name = $request->name;\n $event->description = $request->description;\n $event->answers = json_encode(array_filter($request->answers, 'strlen'));\n $event->deadline = Carbon::parse($request->deadline);\n $event->qr = $request->qr ? 1:0;\n $event->user_id = Auth::id();\n $event->save();\n\n $hashids = new Hashids(env('APP_KEY'));\n $event->external_id = $hashids->encode($event->id, $event->user_id);\n $event->save();\n\n return redirect()->back()->with('message', 'Post Created Successfully.');\n }", "public function onPostDispatch()\n {\n /** @var Shipperhq_Shipper_Model_Storage[] $storageList */\n $storageList = Mage::helper('shipperhq_shipper')->storageManager()->getStorageObjects();\n foreach ($storageList as $storage) {\n if ($storage->hasDataChanges() && $storage->getId()) {\n $this->_saveStorageInstance($storage);\n }\n }\n }", "public function post_publish()\n\t{\n\t\t$this->get_publish();\n\t}", "public function save()\n {\n }", "public function postPersist($entity);", "public function save() {\n\t\tif ($this->data) {\n\t\t\treturn $this->repo->addPost($this->data);\n\t\t}\n\t\treturn false;\n\t}", "public function save()\r\n {\r\n \r\n }", "public function save()\n\t{\n\t\tvalidateToken('admin-ssc');\n\n\t\t$this->adapter->save();\n\t}", "public function save() {\n\t\t\t\n\t\t}", "public function onSave()\n {\n // first, use the default onSave()\n $object = parent::onSave();\n \n // if the object has been saved\n// if ($object instanceof Voo)\n// {\n// // $source_file = 'tmp/'.$object->photo_path;\n// // $target_file = 'images/' . $object->photo_path;\n// // $finfo = new finfo(FILEINFO_MIME_TYPE);\n// \n// // if the user uploaded a source file\n// if (file_exists($source_file) AND $finfo->file($source_file) == 'image/png')\n// {\n// // move to the target directory\n// // rename($source_file, $target_file);\n// \n// try\n// {\n// TTransaction::open($this->database);\n// // update the photo_path\n// // $object->photo_path = 'images/'.$object->photo_path;\n// $object->store();\n// TTransaction::close();\n// }\n// catch (Exception $e) // in case of exception\n// {\n// new TMessage('error', '<b>Error</b> ' . $e->getMessage());\n// TTransaction::rollback();\n// }\n// }\n// }\n }", "public function afterVersionedSave()\n {\n if ($this->wasDirty && static::$createRevisionOnSave) {\n // save a copy to history table\n $recordValues = $this->_prepareRecordValues();\n $set = static::_mapValuesToSet($recordValues);\n DB::nonQuery((new Insert())->setTable(static::getHistoryTable())->set($set), null, [static::class,'handleError']);\n }\n }", "public\tfunction\tsave()\n\t\t{\n\t\t}", "public function save()\r\n {\r\n //\r\n }", "public static function postUpdate(Event $event){\n $io = $event->getIO();\n $io->write(\"postUpdate event triggered.\");\n }", "public function saveEvent($post){\n\n\t\tif (! $ctime = strtotime($post['datetime']) ){\n\t\t\techo \"<script>\n\t\t\t\talert('Date ${post['datetime']} not recognized');\n\t\t\t\thistory.back();\n\t\t\t\t</script>\n\t\t\t\";\n\t\t}\n\t\tif ($ctime < time()){\n\t\t\techo \"<script>\n\t\t\t\talert('You cannot enter an event for a past date');\n\t\t\t\thistory.back();\n\t\t\t\t</script>\n\t\t\t\";\n\t\t}\n\t\t$post['datetime'] = date('Y-m-d g:i a', $ctime);\n\n\t\t$id = $post['id'];\n\t\tforeach ($post as $var => $val) {\n\t\t\t$despec[$var] = $val;\n\t\t}\n\n\t\t$prep = u\\prepPDO($despec,array_keys(self::$empty_item),'id');\n\t\t if ($despec['id'] == 0){ #new entry\n\n\t\t\t$sql = \"INSERT into `events` ( ${prep['ifields']} ) VALUES ( ${prep['ivalues']} );\";\n\t\t\t//u\\echor($prep,$sql);\n\t\t\t $stmt = $this->pdo->prepare($sql);\n\n\t\t\t $stmt->execute($prep['idata']);\n\t\t\t $new_id = $this->pdo->lastInsertId();\n\n\t\t} else { #update\n\t\t\t$prep = u\\prepPDO($despec,array_keys(self::$empty_item),'id');\n\t\t\t$sql = \"UPDATE `events` SET ${prep['uset']} WHERE id = ${prep['ukey']};\";\n\t\t\t//\tu\\echor($prep,$sql);\n\t\t\t $stmt = $this->pdo->prepare($sql);\n\n\t\t\t $stmt->execute($prep['udata']);\n\t\t\t$new_id = $id;\n\t\t}\n\t\treturn $new_id;\n}", "protected function afterSave() {\n\n }", "function dp_save_event_info($post_id) {\n // if not, then return\n if ('event' != $_POST['post_type']) {\n return;\n }\n\n // checking for the 'save' status\n $is_autosave = wp_is_post_autosave($post_id);\n $is_revision = wp_is_post_revision($post_id);\n $is_valid_nonce = (isset($_POST['dp-event-info-nonce']) && (wp_verify_nonce($_POST['dp-event-info-nonce'], basename(__FILE__)))) ? true : false;\n\n // exit depending on the save status or if the nonce is not valid\n if ($is_autosave || $is_revision || !$is_valid_nonce) {\n return;\n }\n\n // checking for the values and performing necessary actions\n if (isset($_POST['dp-event-date'])) {\n update_post_meta($post_id, 'event-date', strtotime($_POST['dp-event-date']));\n }\n\n if (isset($_POST['dp-event-glat'])) {\n update_post_meta($post_id, 'event-glat', sanitize_text_field($_POST['dp-event-glat']));\n }\n\n if (isset($_POST['dp-event-glng'])) {\n update_post_meta($post_id, 'event-glng', sanitize_text_field($_POST['dp-event-glng']));\n }\n\n if (isset($_POST['dp-event-url'])) {\n update_post_meta($post_id, 'event-url', sanitize_text_field($_POST['dp-event-url']));\n }\n}", "public function postEventadd();", "public final function save()\n {\n }", "public function afterSaveCommit(): void\n {\n }", "public static function saved($event) {\n\n\t\t$account = $event->getSubject();\n\t\t$new = $event['new'];\n\n\t}", "public static function saving($callback)\n {\n self::listenEvent('saving', $callback);\n }", "public function preSave() {}", "public function save()\n {\n remove_action('save_post', array($this, 'save'), 999);\n add_filter('wp_save_post_revision_post_has_changed', function () {\n return false;\n }, 99999);\n global $post;\n if (is_a($post, '\\WP_Post')) {\n $postArgs = array(\n 'ID' => $post->ID,\n 'post_content' => $this->content\n );\n wp_update_post($postArgs);\n\n $rev = wp_get_post_revisions($post);\n if (!empty($rev)) {\n $last = current($rev);\n $postArgs = array(\n 'ID' => $last->ID,\n 'post_content' => $this->content\n );\n wp_update_post($postArgs);\n }\n\n do_action('kb.concat.save', $postArgs);\n }\n\n }", "public function _postInsert()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function save() {\n\n }", "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "public function onBeforeSave();", "public function pushRecord()\r\n {\r\n\r\n }" ]
[ "0.6973555", "0.6441275", "0.6439647", "0.6439647", "0.6361393", "0.633063", "0.6325109", "0.62515664", "0.62338334", "0.61972123", "0.61840725", "0.60977197", "0.6078189", "0.6038672", "0.60357434", "0.60225534", "0.60147965", "0.60147965", "0.60143113", "0.6001135", "0.598805", "0.59823054", "0.59761024", "0.59761024", "0.5957595", "0.59393495", "0.5925291", "0.58966935", "0.5885586", "0.5883003", "0.58787966", "0.5872112", "0.5863217", "0.5855358", "0.58387476", "0.58336043", "0.58336043", "0.58307296", "0.5828619", "0.58040273", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5800944", "0.5768606", "0.575502", "0.573861", "0.5738197", "0.5736518", "0.5725532", "0.5717007", "0.57123774", "0.5709805", "0.5708807", "0.57044244", "0.57027817", "0.57005847", "0.56972957", "0.5694536", "0.5690011", "0.5684683", "0.56695265", "0.5669275", "0.5666443", "0.5657211", "0.56533766", "0.56444323", "0.5639081", "0.563763", "0.56269145", "0.5615631", "0.5613694", "0.561108", "0.5599855", "0.5597426", "0.5587771", "0.55834246", "0.55742896", "0.55719674", "0.55671054", "0.55651885", "0.5556807", "0.5549234", "0.5549138", "0.55484277", "0.5545957", "0.5542781" ]
0.0
-1
private $url =" ;
public function __CONSTRUCT($db) { $this->db = $db; $this->response = new Response(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUrl(){\n return $this->url;\n }", "public function __construct($url){\n $this->url = $url;\n }", "public function url(){\r\n\t\treturn $this->_url;\r\n\t}", "function __construct($url)\n {\n $this->url = $url;\n }", "public function getURL() { return $this->url; }", "public function __construct(protected string $url)\n {\n //\n }", "public function __construct()\r\n {\r\n $this->geturl();\r\n }", "public function getUrl() {\r\n\t}", "public function getUrl()\n {\n return $this->_url;\n }", "public function setUrl( $url );", "function getUrl() {\n\t\treturn $this->_url;\n\t}", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl() {\n return $this->url;\n }", "public function getUrl() {\n return $this->url;\n }", "public function getUrl(): string {\n return $this->url;\n }", "public function __construct($url)\n {\n $this->url = $url;\n }", "public function __construct($url)\n {\n $this->url = $url;\n }", "public function __construct($url)\n {\n $this->url = $url;\n }", "public function get_url()\n {\n return $this->_url;\n }", "public function get_url()\n {\n return $this->_url;\n }", "public function url()\n {\n return $this->url;\n }", "public function get_url()\n {\n return $this->url;\n }", "public function setUrl($url){\n $this->url = $url;\n }", "public function __construct($url) {\n\t\t$this->url = $url;\n\t}", "public function getUrl()\n {\n return self::$url;\n }", "public function __construct(){\n\t\t$this->url = YaffmapConfig::get('url').$this->path;\n\t}", "public function url()\n {\n return $this->data['url'];\n }", "public function get_url () {\r\n\t\treturn $this->url;\r\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function url()\n\t{\n\t\treturn $this->url;\n\t}", "public function get_url()\n {\n }", "public function setURL($url)\n {\n $this->url = $url;\n }", "public function url(): string;", "public function setUrl($url) {}", "static public function getURL() {\n\t\treturn self::$url;\n\t}", "public function setURL($url);", "public function setURL($url);", "public function getURL()\n {\n return $this->_url;\n }", "public function getUrl()\r\n {\r\n return $this->url;\r\n }", "public function getUrl()\r\n {\r\n return $this->url;\r\n }", "public function getUrl()\r\n {\r\n return $this->url;\r\n }", "public function __toString()\n {\n return $this->url;\n }", "public function getURL() {\n\t\treturn $this->_url;\n\t}", "public function url(): string\n {\n return $this->url;\n }", "public function url(): string\n {\n return $this->url;\n }", "function setUrl($url) {\n\t\t$this->_url = $url;\n\t}", "function setUrl($url) {\n\t\t$this->_url = $url;\n\t}", "public function __construct()\n {\n $this->buildUrl();\n }", "public function getURL() {\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->_url;\n\t}", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "public function setUrl($url);", "public function getUrl(): string\n {\n return self::URL;\n }", "public function __construct($data)\n {\n $this->url = $data;\n }", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "public function url();", "public function url();", "public function url();", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl(): string;", "public function getUrl(): string;", "public function getUrl(): string;", "public function setUrl($url) {\n $this->url = $url;\n }", "public function __construct()\n {\n $this->base_url = url('/').'/';\n }", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}" ]
[ "0.7639105", "0.74509156", "0.7385742", "0.7197455", "0.71653765", "0.71431744", "0.7049146", "0.6993383", "0.6992549", "0.69677305", "0.69405067", "0.6939149", "0.69346946", "0.69346946", "0.6918815", "0.68952006", "0.68952006", "0.68952006", "0.6893935", "0.6893935", "0.6892713", "0.6852332", "0.6851542", "0.68400186", "0.68154395", "0.6805818", "0.67629766", "0.6736021", "0.6726024", "0.6726024", "0.67193705", "0.6709548", "0.67040056", "0.66968095", "0.66756064", "0.66522896", "0.6640533", "0.6640533", "0.6639724", "0.66322213", "0.66322213", "0.66322213", "0.66293937", "0.6609373", "0.6607142", "0.6607142", "0.6603273", "0.6603273", "0.6566363", "0.65563565", "0.6541972", "0.65212995", "0.65212995", "0.65212995", "0.65212995", "0.6517438", "0.6498493", "0.64973795", "0.6495751", "0.6495751", "0.6495751", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6487782", "0.6473418", "0.6473418", "0.6473418", "0.64461356", "0.64365435", "0.64354926", "0.64354926", "0.64354926" ]
0.0
-1
Run the database seeds.
public function run() { $site = factory(Site::class)->create([ 'user_id' => User::first()->id, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
VIEW FUNCTIONS Robert / 120218 RECIPE FUNCTIONS
public function view_recipe($id){ $query = $this->db->query(" SELECT re.id re_id, re.name re_nm, re.price re_prc, re.instructions re_ins, re.cooking_time re_ct, re.servings re_se, re.image re_im, re.status re_st, re.created_date re_cd, re.updated_date re_ud, rg.name rg_nm, rg.id rid, co.name co_nm, co.id cid, ing.name in_nm, ring.ingredient_amount in_am FROM recipe_ingredients ring INNER JOIN ingredients ing ON ring.ingredient_id = ing.id RIGHT JOIN recipe re ON ring.recipe_id = re.id INNER JOIN country co ON re.country_id = co.id INNER JOIN region rg ON co.region_id = rg.id WHERE md5(re.id) = '$id' "); if ($query->num_rows() > 0){ return $query->result(); }else{ return NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "public function view() {\r\n\r\n\t}", "public function view()\n {\n //\n }", "public function singleView();", "public function view() {\n }", "public function views()\n {\n }", "public function views()\n {\n }", "public function views()\n {\n }", "function career_view()\n {\n $ob = new model();\n $show_career=$ob->career_view_sql();\n return $show_career;\n }", "function view() {\n\t\treturn '';\n\t}", "function cplanilla_view() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"planilla\"] = new cplanilla();\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\", 'view', 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\", 'planilla', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}", "protected function get_views()\n {\n }", "protected function get_views()\n {\n }", "protected function get_views()\n {\n }", "protected function get_views()\n {\n }", "public function view(): mixed;", "function index()\n {\n $this->_view_edit('view');\n }", "public function profileViews();", "public function view() {\n\n $this->db->where('VCIF', 'XYZ');\n $q = $this->db->get('STRUCTURE')->result();\n }", "public function actionView()\n {\n \n }", "public function actionView() {}", "public function actionView() {}", "private function _View() {\n\t \n // $this->_View;\n\t\t\t//$View = ClassRegistry::getObject('');\n\t\treturn $this->_View;\n\t}", "function portfolio_view()\n {\n $ob = new model();\n $show_port=$ob->portfolio_view_sql();\n return $show_port;\n }", "function get_html()\n\t{\n\n\t// incrase views\n\n\t}", "function enquery_view()\n {\n $ob = new model();\n $show_enquery=$ob->enquery_view_sql();\n return $show_enquery;\n }", "function readSearchView(){\n\t\t// fe_user access management can read \n\t\t$rec = $this->model->get_fecruserid($this->rec_id); \n\t\t$access = $this->accessObj->checkAccess($rec,'pageSearch','read');\n\t\tif(!(bindec($access) & bindec('0100'))){\n\t\t\t$this->cmd = 'canNotRead';\n\t\t\t// Get the FORM\n\t\t\t$content = $this->get_include_contents('view_canNotAccess.php');\n\t\t\treturn $content; \n\t\t}\n\t\t$queryConf['startingPoint'] = $this->startingPoint;\t\n\t\t// template for the view\n\t\t$lot = $this->model->select($this->rec_id,$queryConf);\n\t\tif($lot){ \n\t\t\t// fe_user access management\n\t\t\t$access = $this->accessObj->checkAccess($lot[$this->rec_id],'pageSearch','read');\n\t\t\tif(!(bindec($access) & bindec('0100'))){\n\t\t\t\t$this->cmd = 'readForbidden';\n\t\t\t\t$this->data = '';\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->cmd = 'read';\n\t\t\t\t$this->data = $lot[$this->rec_id];\n\t\t\t}\n\t\t}\n\t\t$content = $this->get_include_contents('view_searchDetails.php');\n\t\t\n\t\treturn $content;\n\t}", "public function access();", "public function view() {\n\t\treturn;\n\t}", "function contact_view()\n {\n $ob = new model();\n $show_contact=$ob->contact_view_sql();\n return $show_contact;\n }", "function viewAction(){\r\n\t\t//$iUnitId = Sys_Publib_Library::_getItemAttrById($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'unit_id');\r\n\t\t//Lay ID phong ban cua NSD dang nhap hien thoi\r\n\t\t$pUrl = $_SERVER['REQUEST_URI'];\r\n\t\t$objFunction =\tnew\tSys_Function_DocFunctions()\t;\r\n\t\t$objFilter = new Zend_Filter();\t\t\t\r\n\t\t// Tieu de man hinh danh sach\r\n\t\t$this->view->docInfo \t\t= \"THÔNG TIN VĂN BẢN\";\r\n\t\t$sDocumentId = $this->_request->getParam('hdn_object_id','');\r\n\t\t$sType\t\t = $this->_request->getParam('hdn_type','');\r\n\t\t//Lay cac hang so dung chung\r\n\t\t$arrConst = Sys_Init_Config::_setProjectPublicConst();\r\n\t\t$this->view->arrConst = $arrConst;\r\n\t\t// Tao doi tuong Zend_Filter\r\n\t\t$objFilter = new Zend_Filter();\r\n\t\t$ojbSysLib = new Sys_Library();\r\n\t\t$objFullTextSearch = new fulltextsearch_modFulltextsearch();\r\n\t\t//Lay thong tin trong danh muc\r\n\t\t$arrDocSingle = $objFullTextSearch->DocFullTextSearchDocGetSingle($sDocumentId, $sType);\t\t\t\r\n\t\t$this->view->arrDocSingle = $arrDocSingle;\r\n\t\t//Lay gia tri tim kiem tren form\r\n\t\t\t$sfullTextSearch \t= $this->_request->getParam('txtfullTextSearch','');\r\n\t\t\t$iYear\t \t\t\t= $this->_request->getParam('year','');\r\n\t\t\t$iCurrentPage\t\t= $this->_request->getParam('hdn_current_page',0);\t\r\n\t\t\tif ($iCurrentPage <= 1){\r\n\t\t\t\t$iCurrentPage = 1;\r\n\t\t\t}\r\n\t\t\t$iNumRowOnPage = $this->_request->getParam('cbo_nuber_record_page',0);\r\n\t\t\tif ($iNumRowOnPage == 0)\r\n\t\t\t\t$iNumRowOnPage = 15;\r\n\t\t\t$arrParaSet = array(\"trangHienThoi\"=>$iCurrentPage, \"soBanGhiTrenTrang\"=>$iNumRowOnPage,\"chuoiTimKiem\"=>$sfullTextSearch,\"Nam\"=>$iYear);\r\n\t\t\t$_SESSION['seArrParameter'] = $arrParaSet;\t\r\n\t\t\r\n\t}", "public function view(){\n\t\t$this->buildListing();\n\t}", "abstract protected function getView();", "function getOverview() ;", "function gallery_view()\n {\n $ob = new model();\n $show_gallery=$ob->gallery_view_sql();\n return $show_gallery;\n }", "protected function viewAction()\n {\n }", "function dsp_single_office_info()\n {\n $VIEW_DATA['arr_single_office_info'] = $this->model->qry_single_office_info();\n $this->view->render('dsp_single_office_info',$VIEW_DATA);\n }", "public function getView(){ }", "public function view(int $id)\r\n {\r\n }", "function client_view($id = null) {\n\t\t$this->admin_view($id);\n\t}", "public function view($name,$key,$database,$opt);", "function view(){\n\n $course_id = $this->params[0];\n $this->course = get_first(\"SELECT * FROM course WHERE course_id = '{$course_id}'\");\n $this->lessons = get_all(\"SELECT * FROM lesson WHERE course_id = '{$course_id}'\");\n }", "public function index()\n {\n\t\t// $offers = listing::where('id', '=', '4')->take(1)->get();\n\t\t//les 4 derniers\n\t\t// $recents= listing::take(4)->orderBy('id','asc')->get();\n\t\t// return view('offre', compact('recents', 'offers'));\n \n }", "function career_applied_view()\n {\n $career_id=$_REQUEST['career_id'];\n $ob = new model();\n $show_career_applied=$ob->career_applied_view_sql($career_id);\n return $show_career_applied;\n }", "public function ViewAction()\r\n\t{\r\n\t\t$this->View->author = $this->Author->select();\r\n\t}", "public function view(){\n return $this->db->get('articles')->result();\n }", "public function index()\n {\n\t\t//return $view->fetch();\n }", "public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }", "function showView()\n\t{\n\t\ttrigger_error(\"showView() is not implemented\");\n\t}", "public function getView();", "public function view($id)\n {\n }", "public function view($id) {\n }", "public function index()\n {\n /*\t\n $products = Product::where('sell_yn',1)->where('ca_id',$ca_id)->with('user')->with('reviews')->get();\n\t\t\n\t\t$categorys = Category::where('ca_use',1)->get();\n\t\t\n\t\t$views = view('product.product_list');\n\t\t\n\t\t$views->products = $products;\n\t\t\n\t\t$views->categorys = $categorys;\n\t\t$views->ca_id = $ca_id;\n \n\t\treturn $views;\n\t\t * */\n }", "function vcn_cma_documents_view() {\n$get_userid = explode('-',$_GET['userid']);\n$vars['user_id']=$get_userid[0];\n$valid['user_id']='valid';\n$documentinfo = vcn_get_data ($errors, $vars, $valid, 'cmasvc', 'cmauserdocument', 'list', $limit=false, $offset=false, $order='document_id', $direction='desc');\n\nforeach ($documentinfo->cma as $document) {\n\t//$shareynarray = array();\n\tif($document->shareyn == 'y' || $document->shareyn == 'Y'){\n\t\t$shareynarray = $document->shareyn;\n\t}\n}\n\n\tif (isset($shareynarray)) {\n\t\n\t\t$base_path = base_path();\n\t\t$o .= '<br />The following is a list of available documents:<br /><br />';\n/* \t\t$o .= '<div style=\"margin-left: 0px; margin-bottom: 3px;\">'.'<b>Document Title</b>'.'</div>';\n\t\t$o .= '<hr class=\"clear-both\">' . PHP_EOL; */\n foreach ($documentinfo->cma as $document) {\n\t\t\tif($document->shareyn == 'y' || $document->shareyn == 'Y'){\n\t\t\t\t$imagepath = $base_path . drupal_get_path('module', 'vcn_cma') . '/images';\n\t\t\t\tif($document->documenttypeid == 2) {$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/word.png'. '\" title=\"Word Document\" alt=\"Word Document\" />';}\n\t\t\t\telseif($document->documenttypeid == 3){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/ppt.png'. '\" title=\"PowerPoint Document\" alt=\"PowerPoint Document\" />';}\n\t\t\t\telseif($document->documenttypeid == 4){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/exel.png'. '\" title=\"Excel Document\" alt=\"Excel Document\" />';}\n\t\t\t\telseif($document->documenttypeid == 5){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/img.png'. '\" title=\"Image File\" alt=\"Image File\" />';}\n\t\t\t\telseif($document->documenttypeid == 6){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/txt.png'. '\" title=\"Text File\" alt=\"Text File\" />';}\n\t\t\t\telseif($document->documenttypeid == 7){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/zip.png'. '\" title=\"Zip File\" alt=\"Zip File\" />';} \n\t\t\t\telseif($document->documenttypeid == 8){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/pdf.png'. '\" title=\"PDF File\" alt=\"PDF File\" />';}\n\t\t\t\telse{$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/blank.png'. '\" title=\"Other\" alt=\"Other\" />';}\n\n\t\t\t\t$onlydate = explode(' ', $document->documentuploaddate);\n\t\t\t\t$datediv = '<div style=\"margin-left: 747px; margin-top: -12px;\">'.$onlydate[0].'</div>';\n\t\t\t\t$o .= '\t<div id=\"documentid-' . $document->documentid . '\" class=\"cma-documents\">' . PHP_EOL;\n\t\t\t\t$o .= '\t\t<div class=\"cma-documents-inner\">' . PHP_EOL;\n\t\t\t\t$o .= '\t\t\t<div class=\"cma-documents-body\">' . PHP_EOL;\n\n\t\t\t\t$docidforcheck = $document->documentid;\n\t\t\t\t$docidforshareyn = \"'\".$document->shareyn.\"'\";\n\n\t\t\t\t$o .= ' <a style=\"text-decoration: none; margin-top:1px;\" href=\"/careerladder/getfile.php?docid='.$document->documentid.'\"> '.$img.'&nbsp;&nbsp;'.$document->documenttitle.' </a>'.PHP_EOL; //with image \n\n\t\t\t\t$o .= '\t\t\t</div><!-- /cma-notebook-documents-body -->' . PHP_EOL;\n\t\t\t\t//$o .= ' <hr class=\"clear-both\">' . PHP_EOL;\n\t\t\t\t$o .= '\t\t</div><!-- /cma-notebook-certificate-inner -->' . PHP_EOL;\n\t\t\t\t$o .= '\t</div><!-- /cma-notebook-program -->' . PHP_EOL;\n\t\t\t}\n }\n\n\t\t$datein = '<div style=\\\"margin-left: 746px; margin-top: -8px;\\\">'.date(\"Y-m-d\").'</div>';\n }else{\n \t$o .='<br /><br />';\n \t$o .='<div><b>The user do not have any Documents to share</b></div>'; \n }\n return $o; \n}", "protected function getViewData() {\n\n }", "public function getView()\n {\n }", "function yy_r112(){\n $this->_retvalue = new SQL\\View($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor);\n }", "public function getView() {}", "public function getView() {}", "function viewInfo() {\n\t$view = new viewModel();\n\t$view->showInfo();\t\n}", "function getviewdisplay($tid)\n\t{\n\tswitch ($tid) {\n \n\t\n\tcase 353:\n return 'page' ;\n break;\n\t \n\t case 357:\n return 'page_2' ;\n break;\n\t \n\t case 359:\n return 'page_3';\n break;\n\t \n\t/* case 360:\n return 361;\n break;*/\n\t \n\t case 364:\n return 'page_5' ;\n break;\n\t \n\t case 365:\n return 'page_4' ;\n break;\n\t \n\t case 368:\n return 'page_7' ;\n break;\n\t \n\t case 370:\n return 'page_6' ;\n break;\n\t \n\t case 372:\n return 'page_9';\n break;\n\t \n\t case 374:\n return 'page_8' ;\n break;\n\t \n\t case 380:\n return 'page_10';\n break;\n\t \n\t case 382:\n return 'page_11';\n break;\n\t \n\t case 384:\n return 'page_12' ;\n break;\n\t \n\t case 387:\n return 'page_13';\n break;\n\t \n\t case 388:\n return 'page_14';\n break;\n\t \n\t case 391:\n return 'page_15';\n break;\n\t \n\t/* case 392:\n return 393;\n break;*/\n\t \n\t case 394:\n return 'page_17';\n break;\n\t \n\t case 401:\n return 'page_18' ;\n break;\n\t \n\t/* case 498:\n return ;\n break;*/\n\t \n\t }\n\t}", "function feedback_view()\n {\n $ob = new model();\n $show_feedback=$ob->feedback_view_sql();\n return $show_feedback;\n }", "public function GetViewAllURL();", "public function viewAny()\n {\n //\n }", "function escape_get_view_actions() {\n return array('view','view all');\n}", "abstract protected function show();", "public function getViews();", "function dsp_all_office_info()\n {\n $VIEW_DATA['arr_all_office_info'] = $this->model->qry_all_office_info();\n $this->view->render('dsp_all_office_info',$VIEW_DATA);\n }", "public function view($rfp_id){\n\n $data['title'] = 'Admin View Request';\n $data['heading'] = 'View Request Page'; \n $data['rfp_id'] = decode($rfp_id);\n\n $data['record']=$this->Rfp_model->get_result('rfp',['id' => decode($rfp_id)],'1');\n // pr($data['record'],1);\n $data['subview'] = 'admin/rfp/view';\n $this->load->view('admin/layouts/layout_main', $data);\n }", "public function showIndex()\n\t{\n\n\t\t//var_dump(Parser::GetRazdely());\n\n\t\t//var_dump(Parser::getCarPost('prodam-mikroavtobus-26483298'));\n\n\t\t//var_dump(Parser::getPosts('realty/sell_flats', 5));\n\n\t\t//var_dump(Parser::getPosts('auto/sale', 5, 5));\n\n\t\tvar_dump(Parser::getPosts('free', 4, 1, 10));\n\t}", "function getViewFilePath();", "public function view(){\n return 123;\n }", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "public function views() {\n\t\t$views = $this->get_views();\n\n\t\t/** This filter is documented in wp-admin/inclues/class-wp-list-table.php */\n\t\t$views = apply_filters( \"views_{$this->screen->id}\", $views );\n\n\t\t$this->screen->render_screen_reader_content( 'heading_views' );\n?>\n<div class=\"wp-filter\">\n\t<ul class=\"filter-links\">\n\t\t<?php\n\t\tif ( ! empty( $views ) ) {\n\t\t\tforeach ( $views as $class => $view ) {\n\t\t\t\t$views[ $class ] = \"\\t<li class='$class'>$view\";\n\t\t\t}\n\t\t\techo implode( \" </li>\\n\", $views ) . \"</li>\\n\";\n\t\t}\n\t\t?>\n\t</ul>\n\n\t<?php install_search_form(); ?>\n</div>\n<?php\n\t}", "public function getParamsToView();", "public function viewAction()//23:15\n {\n\n }", "function action_view()\n {\n $this->addStatusFields();\n return parent::action_view();\n }", "function showForm() {\n\t//$f = \"<h1>Chicago Socrata Capture</h1><h2>Copy \\\"views\\\" from the City of Chicago data portal to PostgreSQL</h2>\";\n\t$f = \"<form name='views' method='get'><input type='text' name='view' id='view' size='30' placeholder='Input an 9-digit view ID'><input type='submit' value='Get this view'></form>\";\n\t\n\tif(!empty($_GET['view'])) {\n\t\tcreateInfoTable();\n\t\tcheckViewExistence($_GET['view']);\n\t}\n\t\t\n\treturn $f;\n}", "function newskomentar_viewdetail($tbl_newskomentar){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_newskomentar WHERE id='$id'\");\n\t\treturn $sql;\n}", "public function showEdit()\n {\n\n }", "public function view2(){\n return $this->db->get('tbl_admin_kelas')->result();\n }", "function field_view($name)\r\n {\r\n if (right::superuser()) return (true);\r\n \r\n $fieldRight = right::get_field($name);\r\n $view = $fieldRight[view];\r\n\r\n $userRight = right::get(\"rights\");\r\n\r\n if ($view != 0) return($userRight & $view);\r\n else return(false); // default no display\r\n }", "function aspirelists_get_view_actions() {\n return array('view', 'view all');\n}", "public function view (){\n $query = $this->db->get('artist_details');\n return $query->result();\n }", "public function show()\n\t{\n\t\t\n\t}", "public function index()\n {\n return view('result', ['adverts'=>Advert::with('modification.model.mark')\n ->orderBy('created_at', 'DESC')\n ->simplePaginate(5)]);\n }", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "private function renderView()\n\t{\n\t\tff_renderView(substr(__CLASS__, 7));\n\t}", "function view()\n\t{\n\t\tglobal $tree, $ilUser, $ilCtrl, $lng;\n\n\t\t$this->showHierarchy();\n\t}", "public function get_product_view() {\n parent::select_lang('name');\n $res = $this->db->select('id, link, view, position')->from('site_catalog_view')->where('visible', 1)->order_by('position', 'ASC')->get();\n if ($res->num_rows() <= 0) return array();\n $res = $res->result_array();\n return $res;\n }", "function viewrec($recid)\r\n{\r\n\t$res = sql_select();\r\n \t$count = sql_getrecordcount();\r\n \tmysqli_data_seek($res, $recid);\r\n \t$row = mysqli_fetch_assoc($res);\r\n\t$prodcode = $row[\"prod_code\"];\r\n\t$field=\"prod_code\";\r\n\t//echo \"ViewRec : Rec ID :\".$recid.\" Count=\".$count.\"<br>\";\r\n \tshowrecnav(\"view\", $recid, $count);\r\n?>\r\n\t<br>\r\n<?php\r\n\tshowrow($row, $recid); \r\n\t\r\n\t\r\n?>\r\n\t<br>\r\n\r\n\t<?php\r\n \t\tmysqli_free_result($res);\r\n\t}", "public function view_user($id)\n {\n\n\n }", "function viewrec($recid)\r\n{\r\n\t$res = sql_select();\r\n \t$count = sql_getrecordcount();\r\n \tmysqli_data_seek($res, $recid);\r\n \t$row = mysqli_fetch_assoc($res);\r\n\t$customercode = $row[\"comp_id\"];\r\n\t$field=\"comp_id\";\r\n\t//echo \"View : OutletCode :\".$customercode;\r\n \tshowrecnav(\"view\", $recid, $count);\r\n?>\r\n\t<br>\r\n<?php\r\n\tshowrow($row, $recid); \r\n\t\r\n\t\r\n?>\r\n\t<br>\r\n\r\n\t<hr size=\"1\" noshade>\r\n\t<table class=\"bd\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">\r\n\t\t<tr>\r\n\t\t\t<td><input type=\"button\" name=\"btnEdit\" value=\"Edit Record\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','company/company.php?status=true&a=edit&filter=<?php echo $customercode ?>&filter_field=<?php echo $field ?>')\"></td>\r\n\t\t</tr>\r\n\t</table>\r\n\t<?php\r\n \t\tmysqli_free_result($res);\r\n\t}", "function get_views()\n\t{\n\t\treturn $this->views;\n\t\t//return get_views($this->id);\n\t}", "function views() {\n\t\t$this->view_rename(APP . 'views');\n\t\tprint_r($this->view_rename);\n\t}", "public function getViews()\n {\n global $adminer;\n\n $main_actions = [\n 'add-view' => \\adminer\\lang('Create view'),\n ];\n\n $headers = [\n \\adminer\\lang('View'),\n \\adminer\\lang('Engine'),\n // \\adminer\\lang('Data Length'),\n // \\adminer\\lang('Index Length'),\n // \\adminer\\lang('Data Free'),\n // \\adminer\\lang('Auto Increment'),\n // \\adminer\\lang('Rows'),\n \\adminer\\lang('Comment'),\n ];\n\n // From db.inc.php\n // $table_status = \\adminer\\table_status('', true); // Tables details\n $table_status = \\adminer\\table_status(); // Tables details\n\n $details = [];\n foreach($table_status as $table => $status)\n {\n if(\\adminer\\is_view($status))\n {\n $details[] = [\n 'name' => $adminer->tableName($status),\n 'engine' => \\array_key_exists('Engine', $status) ? $status['Engine'] : '',\n 'comment' => \\array_key_exists('Comment', $status) ? $status['Comment'] : '',\n ];\n }\n }\n\n return \\compact('main_actions', 'headers', 'details');\n }", "private function view_list($status = 'ready', $maxAge = 0)\n {\n global $Administrator, $Database;\n\n $maxAge = (int)($maxAge * 86400); //convert to seconds\n $portals = implode(',', $Administrator->portals('formitive', 'view'));\n $returnView = new View;\n \n $viewUnreadOnly = ($status == 'unread')? true: false;\n $validStatuses = array('archived', 'ready');\n if (!-in_array($status, $validStatuses)) $status = 'ready';\n \n $sql = \"SELECT * FROM `apps_formitive_index` WHERE `portal` IN ($portals) AND `status` = '$status' ORDER BY `activity` DESC LIMIT 101;\";\n try\n { \n $result = $Database->fetchAssoc($sql);\n unset($sql);\n }\n catch (Exception $e)\n {\n $msg = '<h3>Could not query database!</h3>';\n if (DEBUG_MODE) $msg = $msg . \"<br>Exception thrown: $e<br><br>\";\n if (DEBUG_MODE) $msg = $msg . $sql;\n $returnView->set_content($msg);\n return $returnView;\n }\n \n $statUnread = 0;\n $stat24Hours = 0;\n $stat48Hours = 0;\n $stat7Days = 0;\n $stat30Days = 0;\n \n foreach($result as $id => $row)\n {\n if ((time() - $row['activity']) < 86400) $stat24Hours++;\n if ((time() - $row['activity']) < 172800) $stat48Hours++;\n if ((time() - $row['activity']) < 604800) $stat7Days++;\n if ((time() - $row['activity']) < 2592000) $stat30Days++;\n if ($row['accessed'] == 0) $statUnread++;\n }\n \n //determine table's title\n $mark = ($viewUnreadOnly)? 'unread': $status;\n $from = ($maxAge > 0)? 'From last '. (int)($maxAge / 86400) .' Days': '';\n $tableTitle = \"View Patient Forms Marked \\\"$mark\\\" $from\";\n \n \n $t = '\n <div class=\"portlet x3\">\n\t\t\t\n <div class=\"portlet-header\">\n <h4>Quick Links</h4>\n </div> <!-- .portlet-header -->\n\t\t\t\n <div class=\"portlet-content\">\n <table cellspacing=\"0\" class=\"info_table\">\n <tbody>\n <tr>\n <td class=\"value\">--</td>\n <td><a href=\"/apps/Formitive/view-ready\">View Forms</a></td>\n </tr>\n <tr>\n <td class=\"value\">'. $statUnread .'</td>\n <td class=\"full\"><a href=\"/apps/Formitive/view-unread\">Unread</a></td>\n </tr>\n <tr>\n <td class=\"value\">'. $stat24Hours .'</td>\n <td class=\"full\"><a href=\"/apps/Formitive/view-1day\">Last 24 hours</a></td>\n </tr>\n <tr>\n <td class=\"value\">'. $stat48Hours .'</td>\n <td class=\"full\"><a href=\"/apps/Formitive/view-2days\">Last 48 hours</a></td>\n </tr>\n <tr>\n <td class=\"value\">'. $stat7Days .'</td>\n <td class=\"full\"><a href=\"/apps/Formitive/view-7days\">Last 7 days</a></td>\n </tr>\n <tr>\n <td class=\"value\">'. $stat30Days .'</td>\n <td class=\"full\"><a href=\"/apps/Formitive/view-30days\">Last 30 days</a></td>\n </tr>\n <tr>\n <td class=\"value\">--</td>\n <td class=\"full\"><a href=\"/apps/Formitive/view-archived\">View Archived Forms</a></td>\n </tr> \n\n </tbody>\n </table>\n </div> <!-- .portlet-content -->\t\t\t\n </div> <!-- .portlet -->\n \n <div id=\"dash_chart\" class=\"portlet x9\">\n \n <div class=\"portlet-header\">\n <h4>'. $tableTitle .'</h4>\n </div> <!-- .portlet-header -->\n\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"display\">\n <thead>\n <tr>\n <th>PDF</th>\n <th>Name</th>\n <th>E-mail</th>\n <th colspan=\"2\">Primary Phone</th>\n <th>Action</th>\n </tr>\n </thead>\n <tbody>';\n \n \n foreach ($result as $row)\n {\n if ($maxAge == 0 OR ((time() - $row['activity'] + 3601) <= $maxAge))\n {\n $linkPDF = 'http://'. URL_FRONTEND .'apps/Formitive/get-pdf/'. $row['id'];\n $name = ucwords(trim($row['last']). ', '. trim($row['first']));\n $iconPDF = '/formitive/icons/pdf.png';\n\n $phone = trim(strtolower($row['phone1']));\n\n if (strstr($phone, 'work'))\n {\n $iconPhone = '/formitive/icons/workphone.png'; \n $phone = str_replace('(work)', null, $phone);\n }\n elseif (strstr($phone, 'cell'))\n {\n $iconPhone = '/formitive/icons/cellphone.png'; \n $phone = str_replace('(cell)', null, $phone);\n }\n elseif (strstr($phone, 'fax'))\n {\n $iconPhone = '/formitive/icons/fax.png'; \n $phone = str_replace('(fax)', null, $phone);\n }\n else\n {\n $iconPhone = '/formitive/icons/phone.png';\n $phone = str_replace('(home)', null, $phone);\n }\n $phone = $this->format_phonenumber($phone);\n\n if (!$viewUnreadOnly OR $row['accessed'] == 0)\n {\n $t .= (!$viewUnreadOnly AND $row['accessed'] == 0)? '<tr class=\"even gradeC\">': '<tr>';\n $t .= ' <td><a href=\"'. $linkPDF .'\" target=\"_blank\"><img src=\"'. $iconPDF .'\" height=\"28px\"></a></td>\n <td style=\"vertical-align:middle; padding-left: 0px;\"><a href=\"'. $linkPDF .'\" target=\"_blank\">'. $name .'</a></td>\n <td style=\"vertical-align:middle; padding-left: 0px;\"><a href=\"mailto:'. $row['email'] .'\">'. $row['email'] .'</a></td>\n <td><img src=\"'. $iconPhone .'\" height=\"28px\"></td>\n <td style=\"vertical-align:middle; padding-left: 0px;\">'. $phone .'</td>\n <td style=\"vertical-align:middle; padding-left: 0px;\">\n <form method=\"post\" action=\"/apps/Formitive/action\">\n <select name=\"action-archive\" size=\"1\">';\n if ($status != 'archived') $t .= '<option value=\"'. $row['id'] .'\">Archive</option>';\n $t .='</select>\n <input type=\"submit\" value=\">\" />\n </form>\n </td>\n </tr>';\n }\n }\n }\n \n $t .= '</tbody>\n </table>\n </div>';\n \n \n $returnView->set_content($t);\n return $returnView;\n }", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "public function index()\n {\n $ugovori = Ugovor::all();\n $vrsteImovine = VrsteImovine::all();\n //$iznosiNaknade = IznosNakade::all();\n return view('ugovori.pregled')\n ->with('ugovori', $ugovori)\n ->with('vrste_imovine', $vrsteImovine);\n }", "function Dojo_view() \n{\n $target = params('dojo');\n $target = str_replace('%20', ' ', $target);\n\n $dojo = Find_dojo($target);\n $dojo->judoka = Find_judoka_by_dojo($dojo->GUID);\n \n set('Dojo', Find_dojo($target));\n set('Judoka', Find_judoka_by_dojo($dojo->GUID));\n\n return html('dojo/view.html.php');\n}", "public function testView()\n {\n if ('travis' === env('APP_ENV')) {\n $this->markTestSkipped('travis skipped database integrate tests');\n }\n \n $this->visit('/frontend/amt_als_rpt/1')\n ->see('董小麒一號')\n ;\n }" ]
[ "0.7491702", "0.719649", "0.6819833", "0.67991674", "0.679616", "0.67376083", "0.67373234", "0.67373234", "0.67117566", "0.67065614", "0.6664889", "0.6651729", "0.6651729", "0.6651729", "0.6651729", "0.66400385", "0.65891606", "0.6580223", "0.6524397", "0.65041894", "0.6493766", "0.6493766", "0.6474326", "0.64715964", "0.64098376", "0.6400675", "0.6392879", "0.63620013", "0.63601553", "0.6344442", "0.63202715", "0.63078797", "0.6299376", "0.6287642", "0.62777597", "0.62748903", "0.62351394", "0.61952716", "0.6188987", "0.61793214", "0.6173038", "0.6168294", "0.61659664", "0.616309", "0.61593205", "0.6157043", "0.61550933", "0.6149526", "0.61480135", "0.6146997", "0.6139926", "0.61367977", "0.6117716", "0.61176103", "0.61171764", "0.6111515", "0.60980064", "0.6094906", "0.6094906", "0.60934126", "0.6082182", "0.60777044", "0.6062948", "0.6044677", "0.6035724", "0.6035067", "0.603395", "0.60245544", "0.60235244", "0.6012896", "0.60099936", "0.59933066", "0.5992098", "0.5985913", "0.5977692", "0.59741634", "0.5968636", "0.59652233", "0.5964272", "0.5958768", "0.59535956", "0.59532124", "0.5952821", "0.59464526", "0.5937305", "0.5932553", "0.59320396", "0.59320396", "0.59235", "0.5917285", "0.5917161", "0.59163344", "0.59151936", "0.59137166", "0.5912144", "0.5903918", "0.59013057", "0.589906", "0.5898746", "0.5892315", "0.5888989" ]
0.0
-1
ACTIVATE FUNCTIONS Robert / 120218
public function activate_recipe($id){ $this->db->query(" UPDATE recipe re SET re.status = 'A' WHERE md5(re.id) = '$id' "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activate() {\r\r\n }", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "private static function single_activate() {\n\t\t// @TODO: Define activation functionality here\n\t}", "function activate() {\n }", "public function activate();", "public function activate();", "public static function activation() {\n /*Activation functions here*/\n\n }", "public function activate() {\n\t\t\n\t}", "static function activate() {\n\t}", "public static function activate(){\n }", "public static function activate() {\n\n }", "function activation_hook() {\n\n\t}", "abstract function activation();", "public static function activate()\n {\n }", "public function activate() {\n\t\t// TODO define activation functionality here\n\t}", "public function activate() {\n\t\t\t// just in case I want to do anything on activate\n\t\t}", "function scl_activate()\n{\n //\n}", "public function activate(){\n\t\treturn $this->_sendPacketToController(self::ACTIVATE);\n\t}", "public function activate() {\n\n }", "public function activate() {\n\n }", "public function activate() {\n\n }", "function on_activation ()\n{\n}", "function on_activation ()\n{\n}", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "public static function activate()\n\t\t{\n\t\t\t// Do nothing\n\t\t}", "function Activar(){\r\n\r\n}", "public function activationCode();", "public function setActivation(): void;", "public function activate()\r\n\t{\r\n\t\treturn $this->_changeStatus(1);\r\n\t}", "function activate() {\n\t\t// do not generate any output here\n\t}", "public static function activate() {\n\t\t\t// Do nothing\n\t\t}", "function protection_code_activation() {\n\t\n\t}", "function activate() {\n\t\tregister_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) );\n\t}", "protected function activateSelf() {}", "public function register_activation();", "function setActive() ;", "function isActive() ;", "public static function activate ()\n\t{\n\t\t// Create or update options\n\t\tself::generate_options ();\n\t}", "public static function activate()\n {\n // Do nothing\n }", "function edd_per_product_button_activation() {\n\t/* Activation functions here */\n}", "function activation()\n {\t\n\t\t$data['fal'] = $this->fal_front->activation();\n\t\t$this->load->view($this->_container, $data); \n }", "public function hasActivateCode(){\n return $this->_has(3);\n }", "static function handle_activate()\n\t{\n\t\tself::handle_multi_site( 'activate' );\n\t}", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key))\n\t\t{\n\t\t\t// success\n\t\t\t//Add it into newletter\n\t\t\t$user = $this->database->GetUserById($user_id);\n\t\t\tadd_subscriber($user['email'], $user['username']);\n\t\t\t\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "function activate()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Activate user\n\t\tif ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_completed'));\n\t\t\t\t\t\tredirect('/auth/login');\n\n\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->session->set_flashdata('message', $this->lang->line('auth_message_activation_failed'));\n\t\t\tredirect('/auth/login');\n\t\t\t//$this->_show_message($this->lang->line('auth_message_activation_failed'));\n\t\t}\n\t}", "function mailmaga_x_activate(){\n\t$mailmaga_x_data = new Mailmaga_x_install();\n\t$mailmaga_x_data->activate();\n}", "public function GetActive ();", "public function activateAction()\n {\n $process = User::activate($this->route_params['token']);\n\n if($process){\n Flash::addMessage('Account activated successfully','success');\n $this->redirect('/Login/index');\n }else{\n Flash::addMessage('Oops! Can\\'t activate your account. Activation link is too old or wrong.','danger');\n $this->redirect('/register/activation');\n }\n\n\n }", "public static function mjj_salt_activate(){\n\t\tself::mjj_get_salt();\n\t\treturn;\n\t}", "public function hasActivateCode(){\n return $this->_has(10);\n }", "public function hasActivateCode(){\n return $this->_has(10);\n }", "public function activate()\n {\n $response = $this->response();\n /* le hash de l'email */\n $emailHash = $this->uri->segment(3);\n /* le log d'activation */\n $logID = $this->uri->segment(4);\n if ($this->oauth_web->activate($emailHash, $logID)) {\n redirect();\n // $response[\"status\"] = true;\n }\n // $this->output->set_output(json_encode($response));\n }", "function spcode_activate() {\n // Do nothing\n}", "function activate()\n {\n $user_id\t\t= $this->uri->segment(3);\n $new_email_key\t= $this->uri->segment(4);\n\n // Activate user\n if ($this->tank_auth->activate_user($user_id, $new_email_key)) {\t\t// success\n $this->tank_auth->logout();\n $this->_show_message($this->lang->line('auth_message_activation_completed').' '.anchor('/auth/login/', 'Login'));\n\n } else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n $this->_show_message($this->lang->line('auth_message_activation_failed'));\n }\n }", "function fann_set_activation_function_hidden($ann, $activation_function)\n{\n}", "public function activate_extension(){}", "function activate_account_via_email_link() {\r\n\t\t\tif ( isset($_REQUEST['act']) && $_REQUEST['act'] == 'activate_via_email' && isset($_REQUEST['hash']) && is_string($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 &&\r\n\t\t\t isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id']) ) { // valid token\r\n\r\n\t\t\t\t$user_id = absint( $_REQUEST['user_id'] );\r\n\t\t\t\tdelete_option( \"um_cache_userdata_{$user_id}\" );\r\n\r\n\t\t\t\tum_fetch_user( $user_id );\r\n\r\n\t\t\t\tif ( strtolower($_REQUEST['hash']) !== strtolower( um_user('account_secret_hash') ) )\r\n\t\t\t\t\twp_die( __( 'This activation link is expired or have already been used.','ultimate-member' ) );\r\n\r\n\t\t\t\tUM()->user()->approve();\r\n\t\t\t\t$redirect = ( um_user('url_email_activate') ) ? um_user('url_email_activate') : um_get_core_page('login', 'account_active');\r\n\t\t\t\t$login = (bool) um_user('login_email_activate');\r\n\r\n\t\t\t\t// log in automatically\r\n\t\t\t\tif ( ! is_user_logged_in() && $login ) {\r\n\t\t\t\t\t$user = get_userdata($user_id);\r\n\t\t\t\t\t$user_id = $user->ID;\r\n\r\n\t\t\t\t\t// update wp user\r\n\t\t\t\t\twp_set_current_user( $user_id, $user->user_login );\r\n\t\t\t\t\twp_set_auth_cookie( $user_id );\r\n\r\n\t\t\t\t\tob_start();\r\n\t\t\t\t\tdo_action( 'wp_login', $user->user_login, $user );\r\n\t\t\t\t\tob_end_clean();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tum_reset_user();\r\n\t\t\t\t/**\r\n\t\t\t\t * UM hook\r\n\t\t\t\t *\r\n\t\t\t\t * @type action\r\n\t\t\t\t * @title um_after_email_confirmation\r\n\t\t\t\t * @description Action on user activation\r\n\t\t\t\t * @input_vars\r\n\t\t\t\t * [{\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"}]\r\n\t\t\t\t * @change_log\r\n\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t * @usage add_action( 'um_after_email_confirmation', 'function_name', 10, 1 );\r\n\t\t\t\t * @example\r\n\t\t\t\t * <?php\r\n\t\t\t\t * add_action( 'um_after_email_confirmation', 'my_after_email_confirmation', 10, 1 );\r\n\t\t\t\t * function my_after_email_confirmation( $user_id ) {\r\n\t\t\t\t * // your code here\r\n\t\t\t\t * }\r\n\t\t\t\t * ?>\r\n\t\t\t\t */\r\n\t\t\t\tdo_action( 'um_after_email_confirmation', $user_id );\r\n\r\n\t\t\t\texit( wp_redirect( $redirect ) );\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "function activate() \n {\n // prepare the options\n $this->get_options();\n // set the WordPress hooks\n $this->wp_hooks();\n }", "public function activate()\n\t{\n\t\techo \"fight...\\n\";\n\t}", "function activate_wp_book() {\n Inc\\Base\\Activate::activate();\n}", "function instant_ide_manager_activate() {\n\t\n\tinstant_ide_manager_activate_pre();\n\tinstant_ide_manager_activate_post();\n\t\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}", "public function sendActivation()\n\t{\n\t}", "public function plugin_activate_hook() {\r\n add_option( 'woolentor_do_activation_redirect', TRUE );\r\n add_option( 'woolentor_do_activation_library_cache', TRUE );\r\n }", "function activate($key)\n {\n // activate account\n $result = $this->user_model->activate_account($key);\n \n switch($result)\n {\n case 0: // If activation key not matched with any account\n $msg = 'No account is related with this activation key, either your account is already activated or key is expired !!!'; \n $type = \"danger\";\n break;\n \n case 1: // Account activated\n $msg = 'Congratulations, your account is activated now. Login here';\n $type = \"success\"; \n break;\n \n case 2: // Activation key expired\n $msg = 'Activation key expired, create new account.';\n $type = \"warning\";\n break; \n \n default:\n break;\n \n }\n\n // set notification message to show on page\n $this->base->set_message($msg, $type); \n \n $this->index();\n\n return true;\n }", "function active()\r\n {\r\n return true;\r\n }", "public function activate() {\n\t\t/**\n\t\t * Fires when the plugin is being activated.\n\t\t *\n\t\t * @since 7.0\n\t\t */\n\t\tdo_action('audition_activate');\n\t}", "public function getActiveState();", "public function activate() {\r\n\r\n $this->checkPHPVersion();\r\n $this->checkCoinsDir();\r\n\r\n $this->addOptions();\r\n $this->createOrdersTable();\r\n\r\n API::downloadCoinsIcons();\r\n\r\n CryptoExchange::addRewriteRule();\r\n flush_rewrite_rules();\r\n\r\n }", "function users_user_activation($args)\n{\n $code = base64_decode(FormUtil::getPassedValue('code', (isset($args['code']) ? $args['code'] : null), 'GETPOST'));\n $code = explode('#', $code);\n\n if (!isset($code[0]) || !isset($code[1])) {\n return LogUtil::registerError(__('Error! Could not activate your account. Please contact the site administrator.'));\n }\n $uid = $code[0];\n $code = $code[1];\n\n // Get user Regdate\n $regdate = pnUserGetVar('user_regdate', $uid);\n\n // Checking length in case the date has been stripped from its space in the mail.\n if (strlen($code) == 18) {\n if (!strpos($code, ' ')) {\n $code = substr($code, 0, 10) . ' ' . substr($code, -8);\n }\n }\n\n if (DataUtil::hash($regdate, 'md5') == DataUtil::hash($code, 'md5')) {\n $returncode = pnModAPIFunc('Users', 'user', 'activateuser',\n array('uid' => $uid,\n 'regdate' => $regdate));\n\n if (!$returncode) {\n return LogUtil::registerError(__('Error! Could not activate your account. Please contact the site administrator.'));\n }\n LogUtil::registerStatus(__('Done! Account activated.'));\n return pnRedirect(pnModURL('Users', 'user', 'loginscreen'));\n } else {\n return LogUtil::registerError(__('Sorry! You entered an invalid confirmation code. Please correct your entry and try again.'));\n }\n}", "abstract public function activate( $network_wide );", "function active()\n\t{\n\t\treturn true;\n\t}", "public function can_activate(): bool;", "public function start_tran();", "function activate ()\n\t{\n\t\tswitch ($this->getAction ())\n\t\t{\n\t\t\tcase 'modifyUser':\n\t\t\t\tif ($this->getUserName () == 'test')\n\t\t\t\t{\n\t\t\t\t\tdie ('not allowed for test user');\n\t\t\t\t}\n\t\t\t\t$checkPasswd = true;\n\t\t\t\t$user = $this->itemFactory->requestToUser ($checkPasswd);\n\t\t\t\t$this->operations->modifyUser ($this->getUserName(), $user);\n\t\t\t\tHeader (\"Location: index.php\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tHeader (\"Location: index.php\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "function _deactivate() {}", "public function AppActivate ( $app )\n\t {\n\t\t$this -> ShellInstance -> AppActivate ( $app ) ;\n\t }", "function testActivateSuccess() {\r\n $this->User =& new User();\r\n \r\n \t//check if the user is not activated yet\r\n \t$activated = $this->User->field('activated', array('id'=>'1'));\r\n \t$this->assertEqual('no', $activated);\r\n \r\n \t// should activate the first user.\r\n $result = $this->User->activate('1bc29b36f623ba82aaf6724fd3b16718');\r\n $this->assertTrue($result);\r\n \t\t\r\n \t\t//check if the activation really worked\r\n \t$activated = $this->User->field('activated', array('id'=>'1'));\r\n \t$this->assertEqual('yes', $activated);\r\n \t\r\n \t\r\n \t\r\n \t//test done, set data back to original values...\r\n \t$this->User->id = 1;\r\n \t$this->User->saveField('activated', 'no');\r\n }", "public function activate(){\r\n\t\t$id = $this->uri->segment(3);\r\n\t\t$code = $this->uri->segment(4);\r\n\r\n\t\t//fetch requests details\r\n\t\t$request = $this->requests_model->getRequestById($id);\r\n \r\n\r\n\t\t//if code matches\r\n\t\tif($request['code'] == $code){\r\n\t\t\t//update user active status\r\n\t\t\t// $data['activate'] = true;\r\n\t\t\t$query = $this->accounts_model->updateActivate($id);\r\n\r\n\t\t\tif($query){\r\n\r\n\t\t\t\t$row = $this->accounts_model->getCheckUser($request['email']);\r\n\r\n\t\t\t\t$this->session->set_userdata('is_user', $row['type']);\r\n\t\t\t\t$this->session->set_userdata('myName', \t$row['firstname'].\" \".$row['lastname']);\r\n\t\t\t\t$this->session->set_userdata('myEmail', $row['email']);\r\n\t\t\t\t$this->session->set_userdata('myId', \t$row['id']);\r\n\t\t\t\t$this->session->set_userdata('myRole', \t$row['role']);\r\n\r\n\t\t\t\t$this->session->set_flashdata('msg', 'User activated successfully');\r\n\t\t\t\tredirect('main');\r\n\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\t$this->session->set_flashdata('error_msg', 'Something went wrong in activating account');\r\n\t\t\t\tredirect('login'); \r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\t\t\t\r\n\t\t\t$this->session->set_flashdata('error_msg', 'Cannot activate account. Code didnt match');\r\n\t\t\tredirect('login'); \r\n\t\t}\r\n \r\n\t}", "function activateMember2($username)\r\n\t{\r\n\t\t$username = funcs::check_input($username);\r\n\r\n\t\t$sql = \"SELECT isactive FROM \".TABLE_MEMBER.\"\r\n\t\t\t\t WHERE \".TABLE_MEMBER_USERNAME.\"='\".$username.\"'\";\r\n\t\t$row = DBconnect::get_nbr($sql);\r\n\t\tif($row == 0)\r\n\t\t{\r\n\t\t\t$sql = \"UPDATE \".TABLE_MEMBER.\" SET \".TABLE_MEMBER_ISACTIVE.\"=1\r\n\t\t\t\t\t\tWHERE \".TABLE_MEMBER_USERNAME.\"='\".$username.\"' LIMIT 1\";\r\n\t\t\tDBconnect::execute($sql);\r\n\r\n\t\t\t$userid = funcs::getUserid($username);\r\n\r\n\t\t\t//Hauke\r\n\t\t\t$membership = 3;\r\n\t\t\t$rate = 1;\r\n\t\t\t$paid_via = 3;\r\n\t\t\t$payment_complete = 1;\r\n\t\t\t$today = date(\"Y-m-d\");\r\n\r\n\t\t\tfuncs::insertpayment($userid,$membership,$rate,$paid_via, $payment_complete);\r\n\r\n\t\t\t$sql = \"UPDATE \".TABLE_PAY_LOG.\" SET \".\"real_name\".\"='$real_name',\r\n\t\t\t\t\t\t\t\t\t\t\t \t \".\"real_street\".\"='$street',\r\n\t\t\t\t\t\t\t\t\t\t\t\t \".\"real_city\".\"='$city',\r\n\t\t\t\t\t\t\t\t\t\t\t\t \".\"sum_paid\".\"='0',\r\n\t\t\t\t\t\t\t\t\t\t\t\t \".\"cancelled\".\"='1',\r\n\t\t\t\t\t\t\t\t\t\t\t\t \".\"cancelled_date\".\"='$today'\r\n\t\t\t\t\t\t\t\t\t \t WHERE \".\"username\".\"='$username'\";\r\n\t\t\tDBconnect::execute($sql);\r\n\r\n\t\t\t$sql = \"UPDATE \".TABLE_MEMBER.\" SET \".\"type\".\"='$membership',\r\n\t\t\t\t\t\t\t\t\t\t\".\"signup_datetime=now(),\r\n\t\t\t\t\t\t\t\t\t\t\".\"advertise_regist='2'\r\n\t\t\t\t\t\t\t\t\t \t WHERE username ='$username'\";\r\n\t\t\tDBconnect::execute($sql);\r\n\r\n\t\t\t//Hauke end\r\n\r\n\t\t\t$subject = funcs::getText($_SESSION['lang'], '$first_time_inbox_subject');\r\n\t\t\t$message = funcs::getText($_SESSION['lang'], '$first_time_inbox_message');\r\n\t\t\t$sql = \"INSERT INTO \".TABLE_MESSAGE_INBOX.\"\r\n\t\t\t\t\tSET \".TABLE_MESSAGE_INBOX_TO.\"=\".$userid.\",\r\n\t\t\t\t\t\".TABLE_MESSAGE_INBOX_FROM.\"=1,\r\n\t\t\t\t\t\".TABLE_MESSAGE_INBOX_SUBJECT.\"='\".$subject.\"',\r\n\t\t\t\t\t\".TABLE_MESSAGE_INBOX_MESSAGE.\"='\".$message.\"',\r\n\t\t\t\t\t\".TABLE_MESSAGE_INBOX_DATETIME.\"='\".funcs::getDateTime().\"'\";\r\n\t\t\tDBconnect::execute($sql);\r\n\t\t\tself::NewSorting($username);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "function activate()\n {\n if( $this->attribute( 'is_temporary' ) )\n {\n $this->setAttribute( 'is_temporary', 0 );\n\n $nextID = $this->getNewID();\n $this->setAttribute( 'order_nr', $nextID );\n $this->store();\n\n // Create an order status history element that matches the current status\n $this->createStatusHistory();\n }\n }", "function is_active()\n {\n }", "function onActivate(&$controller) {\n }", "function activateCheck( $action_name ) {\n switch ( $action_name ) {\n case ONAPP_ACTIVATE_GETLIST:\n case ONAPP_ACTIVATE_SAVE:\n case ONAPP_ACTIVATE_DELETE:\n exit( 'Call to undefined method ' . __CLASS__ . '::' . $action_name . '()' );\n break;\n }\n }", "public function activate(){\n # Enable Single Sign-On\n if(in_array(\"login\", $this->features, TRUE)){\n $this->enable_sso();\n }\n }", "public function activate() {\n $activator = new JWP\\JPE\\Activator();\n $activator->run();\n }", "function activate_extension()\n\t{\n\t\treturn TRUE;\n\t}", "public function activate(): void\n {\n if ($this->selectedRowsQuery->count() > 0) {\n Role::whereIn('id', $this->selectedKeys())->update(['is_active' => 1]);\n }\n\n $this->resetSelected();\n }", "public function activate($username);", "public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }", "public function activate()\n\t{\n\t\techo \"shot...\\n\";\n\t}", "function VM_activateNetboot($vmName, $activate)\n{\n\tif ($activate)\n\t\tVM_rebootAndActivateNetboot($vmName);\n\telse\n\t\tVM_rebootAndDisableNetbootAfterInstall($vmName);\n\n/*\n\t$info = VM_getSWandHost($vmName);\n\n\t//Check if it is a VM client\n\tif ($info === false)\n\t\treturn(false);\n\telse\n\t{\n\t\t//Create the command string for (de)activating network booting and execute it on the VM host\n\t\t$cmd = VM_activateNetbootCMD($info['vmSoftware'], $vmName, $activate);\n\t\t$ret = CLIENT_executeOnClientOrIP($info['vmHost'],\"VM_activateNetboot\",\"$cmd\",\"m23-vbox\",false);\n\t\treturn($ret);\n\t}\n*/\n}", "function hook_activate() {\r\n\r\n if (!current_user_can('activate_plugins'))\r\n return;\r\n $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';\r\n check_admin_referer(\"activate-plugin_{$plugin}\");\r\n }", "public function actionActivation() {\n\t\t$email = NData::base64UrlDecode($_GET['e']);\n\t\t$activekey = $_GET['activekey'];\n\t\tif ($email&&$activekey) {\n\t\t\t$user = UserModule::userModel()->notsafe()->findByAttributes(array('email'=>$email));\n\t\t\tif(isset($user) && $user->email_verified == 0 && $user->status == 1){\n\t\t\t\t// user is active but has not verified his email\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t\t$this->render('message',array('title'=>UserModule::t(\"Email Verfied\"),'content'=>UserModule::t(\"Thank you! We now know you are you!\")));\n\t\t\t} elseif (isset($user) && $user->status==1 && $user->email_verified==1) {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Your account is active.\")));\n\t\t\t} elseif(isset($user->activekey) && $this->checkActivationKey($user, $activekey)) {\n\t\t\t\t$user->activekey = crypt(microtime());\n\t\t\t\t$user->status = 1;\n\t\t\t\t$user->email_verified = 1;\n\t\t\t\t$user->save();\n\t\t\t $this->render('activation');\n\t\t\t\t$e = new CEvent($this, array('user'=>$user));\n\t\t\t\tUserModule::get()->onActivation($e);\n\t\t\t} else {\n\t\t\t $this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->render('message',array('title'=>UserModule::t(\"User activation\"),'content'=>UserModule::t(\"Incorrect activation URL.\")));\n\t\t}\n\t}", "function tcf_activate() {\n\t$default = array(\n\t\t'logo' => TFC_URL . '/img/logo.png',\n\t\t'auto_rotate' => '',\n\t\t'auto_rotate_speed' => 7000,\n\t\t'transition_type' => 'slide'\n\t);\n\n\t$tfc = get_option('tfc');\n\n\tif(empty($tfc)) {\n\t\tupdate_option($tfc, $default);\n\t}\n}", "function activateCheck( $action_name ) {\n switch ( $action_name ) {\n case ONAPP_ACTIVATE_LOAD:\n case ONAPP_ACTIVATE_SAVE:\n case ONAPP_ACTIVATE_DELETE:\n exit( 'Call to undefined method ' . __CLASS__ . '::' . $action_name . '()' );\n break;\n }\n }", "function cec29_ald_functions_activation() {\n\t\t\n\t\t// get currently activated plugins\n\t\t$current_plugin = get_option(\"active_plugins\");\n\t\t\n\t\tif( count( $current_plugin ) > 0) {\n\t\t\t$required_plugins = array(\n\t\t\t\t'paid-memberships-pro/paid-memberships-pro.php',\n\t\t\t\t'pronamic-google-maps/pronamic-google-maps.php', \n\t\t\t\t'theme-my-login/theme-my-login.php' // @since 0.2.0\n\t\t\t) ;\n\t\t\tforeach( $required_plugins as $plugin_name ) {\n\t\t\t\tif( !in_array($plugin_name, $current_plugin ) ) {\n\t\t\t\t\t$error = __( \"Cette extension requiert \", 'cec29-ald-functions' ) ;\n\t\t\t\t\t$error .= $plugin_name . __( \". Merci de l'installer et l'activer avant d'activer cette extension.\", 'cec29-ald-functions' ) ;\n\t\t\t\t\twp_die( $error ) ;\n\t\t\t\t} \t\n\t\t\t}\n\t\t} else {\n\t\t\t$error = __( \"Aucun plugin n'est activé.\", 'cec29-ald-functions' ) ;\n\t\t\twp_die( $error ) ;\n\t\t}\n\t\t\n\t\t// register the custom taxonomy\n\t\tcec29_register_secteur_taxonomy();\n\t\t\n\t\t// reflush (in order to create the new permalink system)\n\t\t// see http://code.tutsplus.com/articles/the-rewrite-api-post-types-taxonomies--wp-25488\n\t\tflush_rewrite_rules();\n\t}", "public function pasaje_abonado();", "function instant_ide_manager_activate_pre() {\n\t\n\tif ( ! get_option( 'instant_ide_manager_access_pin' ) )\n\t\tupdate_option( 'instant_ide_manager_access_pin', '' );\n\t\t\n\tif ( ! get_option( 'instant_ide_manager_access_status' ) )\n\t\tupdate_option( 'instant_ide_manager_access_status', 'locked' );\n\t\n\tif ( file_exists( IIDEM_IIDE_DIR . '/iide-constants.php' ) ) {\n\t\t\n\t\tinclude_once( IIDEM_IIDE_DIR . '/iide-constants.php' );\n\t\t\n\t\tif ( version_compare( IIDE_VERSION, IIDE_LATEST_VERSION, '>=' ) )\n\t\t\treturn;\n\t\t\t\n\t\t\t$current_iide_dir = IIDEM_IIDE_DIR;\n\t\t\tinstant_ide_manager_backup_files();\n\t\t\tinstant_ide_manager_delete_dir( IIDEM_IIDE_DIR );\n\t\t\tinstant_ide_manager_copy_dir( IIDEM_IDE_DIR . '/instant-ide', $current_iide_dir );\n\t\t\tinstant_ide_manager_restore_files();\n\t\t\n\t}\n\t\t\n}", "public function getActivateTpl(){\n return $this->templates['activate'];\n }", "function activation($pConsumerBO)\n\t\t{\n\t\t\t/// Calling Stored Procedure\t\t\n\t\t\t$strQuery = \"CALL CONSUMER_ACTIVATE_CODE_UPDATE(?,?)\";\n\t\t\t$objStatement=$this->objDB->executePrepare($strQuery);\n\t\t\t$objStatement->bind_param(\"ss\",$pConsumerBO->getConsumerEmail(), $pConsumerBO->getConsumerActivationCode());\n\t\t\t$objStatement->execute();\n\t\t\t\n\t\t\t/// Get results from Stored Procedurs\n\t\t\t$objStatement->bind_result($intStatus);\n\t\t\t$objStatement->fetch();\n \t\t\t\n\t\t\t/// Get error no from stored procedure\n\t\t\t$this->intErrorNo=$this->objDB->geterrornumber();\n\t\t\n\t\t\tif ($this->intErrorNo!=0) // Error exits\n\t\t\t{\n\t\t\t\t$this->strErrorMessage=$this->objDB->geterrormessage();\n\t\t\t\tthrow new SQLException($this->strErrorMessage);\n\t\t\t}\n\t\t\n\t\t\t$objStatement->close(); \n\t\t\treturn $intStatus;\n\t }" ]
[ "0.70985067", "0.69146836", "0.69146836", "0.680798", "0.6802948", "0.6802948", "0.67752624", "0.6676155", "0.6646347", "0.6546279", "0.6491912", "0.64696723", "0.64435494", "0.64126635", "0.6324273", "0.6316144", "0.6308403", "0.62336814", "0.61588573", "0.61588573", "0.61588573", "0.6151335", "0.6151335", "0.61388004", "0.61388004", "0.60541815", "0.6037808", "0.6010694", "0.5942968", "0.59424454", "0.59402424", "0.5924093", "0.58889204", "0.5875661", "0.5802418", "0.57841164", "0.5759801", "0.5737735", "0.5707559", "0.5704958", "0.56981564", "0.5681647", "0.5646997", "0.5601897", "0.5586653", "0.5559953", "0.5556566", "0.5545053", "0.5531633", "0.55255294", "0.55255294", "0.5494066", "0.5479641", "0.54729956", "0.5471837", "0.5469435", "0.54355294", "0.5428349", "0.53928685", "0.53881663", "0.5387741", "0.5314703", "0.5313697", "0.5308483", "0.5287935", "0.52873784", "0.52844477", "0.5284127", "0.5281496", "0.5279859", "0.52771735", "0.52668285", "0.52533317", "0.5244955", "0.52374756", "0.52309334", "0.52266616", "0.52190167", "0.52117836", "0.52093536", "0.52087927", "0.52038866", "0.5201597", "0.5193607", "0.5181392", "0.5171351", "0.5167991", "0.5166108", "0.5164927", "0.51606447", "0.5157783", "0.51549494", "0.5152405", "0.51500344", "0.51447093", "0.5140137", "0.5136901", "0.51337594", "0.51186574", "0.5115664", "0.51056296" ]
0.0
-1
mngr to new mngr
public function edit_branch_newmngr($mngr_id){ $this->db->query(" UPDATE branch_manager bm SET bm.status = 'U' WHERE bm.id = '$mngr_id' "); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __clone() {\n\t\tif ($this->dimensions instanceof Collection) {\n\t\t\t$existingDimensions = $this->dimensions->toArray();\n\t\t\t$this->dimensions = new ArrayCollection();\n\t\t\t/** @var NodeDimension $existingDimension */\n\t\t\tforeach ($existingDimensions as $existingDimension) {\n\t\t\t\t$this->dimensions->add(new NodeDimension($this, $existingDimension->getName(), $existingDimension->getValue()));\n\t\t\t}\n\t\t}\n\t}", "public function __clone()\n {\n $metrics = [];\n foreach ($this->metrics as $metric) {\n $metrics[] = clone $metric;\n }\n $this->setMetrics($metrics);\n }", "function import_gml_to_db() {\n\t\tglobal $GUI;\n\t\t$result = $this->get_source_srid();\n\t\tif (! $result['success']) {\n\t\t\treturn array(\n\t\t\t\t'succes' => false,\n\t\t\t\t'msg' => 'Import der GML in die Datenbank mit ogr2ogr_gmlas fehlgeschlagen Fehler: ' . $result['msg']\n\t\t\t);\n\t\t}\n\t\t$this->input_epsg = $result['epsg'];\n\t\t$this->xsd_location = '/var/www/html/modell/xsd/' . $this->get_xsd_version() . '/XPlanung-Operationen.xsd';\n\n\t\t# TODO should the target EPSG be stelle or rolle specific?\n\t\t$this->epsg = $GUI->Stelle->epsg_code;\n\t\t$this->build_basic_tables();\n\t\t$result = $this->ogr2ogr_gmlas();\n\t\tif (!$result['success']) {\n\t\t\tif ($GUI->formvars['format'] != 'json_result') {\n\t\t\t\techo 'Laden der Daten mit GML-AS fehlgeschlagen. Bitte kontaktieren Sie Ihren Administrator!';\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\t\t#ToDo pk: Hier prüfen ob mindestens ein Plan und ein dazugehöriger Bereich angelegt wurden.\n\t\t\t\n\t\t# $tables = $this->get_all_tables_in_schema($this->gmlas_schema);\n\n\t\t# Revert the geom of GML to database specific winding order of vertices (CW/RHR IN DB and Shape, CCW/LHR in GML)\n\t\t# NOTE:\n\t\t# As lines have to be reverted as well, it cannot be confirmed automatically whether the order is correct.\n\t\t# It must be assumed that source data conforms to the GML standard (left hand order) on all geometries\n\t\t# For Polygons alone, this could be deduced through an inside/outside check (e.g. with ST_ForceRHR())\n\t\t$fachobjekte_tables_and_geometries = $this->get_fachobjekte_geometry_tables_attributes($this->gmlas_schema);\n\t\tif (!empty($fachobjekte_tables_and_geometries)) {\n\t\t\tforeach ($fachobjekte_tables_and_geometries as $fachobjekt_table_and_geometry) {\n\t\t\t\t$this->revert_vertex_order_for_table_with_geom_column_in_schema($fachobjekt_table_and_geometry['table_name'],$fachobjekt_table_and_geometry['column_name'],$this->gmlas_schema);\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\t'success' => true,\n\t\t\t'msg' => 'ogr2ogr_gmlas output: ' . $result['msg'],\n\t\t\t'url' => $result['url']\n\t\t);\n\t}", "public function toGram(): self\n {\n if (! isset($this->matric_ton)) {\n throw new MissingConversionUnitException();\n }\n\n $this->weight = $this->matric_ton * 1000000;\n\n return $this;\n }", "function extract_gml_class($classname) {\n\t\t#$this->import_gml_to_db();\n\t\t#$this->extract_to_form($classname);\n\t\t/**\n\t\t\tToDo das folgende löschen wenn das obige freigeschaltet ist und an den Stellen wo extract_gml_class aufgerufen wird die anderen beiden aufrufen und diese Funktion dann löschen nach Test.\n\t\t*/\n\t\tglobal $GUI;\n\t\t\n\t\t$result = $this->get_source_srid();\n\t\tif (! $result['success']) {\n\t\t\t$GUI->add_message('warning', $result['msg']);\n\t\t\t$GUI->main = '../../plugins/xplankonverter/view/upload_xplan_gml.php';\n\t\t\t$GUI->output();\n\t\t\texit;\n\t\t}\n\t\t$this->input_epsg = $result['epsg'];\n\t\t$this->xsd_location = '/var/www/html/modell/xsd/' . $this->get_xsd_version() . '/XPlanung-Operationen.xsd';\n\t\t# TODO should the target EPSG be stelle or rolle specific?\n\t\t$this->epsg = $GUI->Stelle->epsg_code;\n\t\t$this->build_basic_tables();\n\t\t$gmlas_output = $this->ogr2ogr_gmlas();\n\t\tif ($gmlas_output == \"Nothing returned from ogr2ogr curl request\") {\n\t\t\techo 'Laden der Daten mit GML-AS fehlgeschlagen. Bitte kontaktieren Sie Ihren Administrator!';\n\t\t\treturn;\n\t\t}\n\t\t# $tables = $this->get_all_tables_in_schema($this->gmlas_schema);\n\n\t\t# Revert the geom of GML to database specific winding order of vertices (CW/RHR IN DB and Shape, CCW/LHR in GML)\n\t\t# NOTE:\n\t\t# As lines have to be reverted as well, it cannot be confirmed automatically whether the order is correct.\n\t\t# It must be assumed that source data conforms to the GML standard (left hand order) on all geometries\n\t\t# For Polygons alone, this could be deduced through an inside/outside check (e.g. with ST_ForceRHR())\n\t\t$fachobjekte_tables_and_geometries = $this->get_fachobjekte_geometry_tables_attributes($this->gmlas_schema);\n\t\tif (!empty($fachobjekte_tables_and_geometries)) {\n\t\t\tforeach ($fachobjekte_tables_and_geometries as $fachobjekt_table_and_geometry) {\n\t\t\t\t$this->revert_vertex_order_for_table_with_geom_column_in_schema($fachobjekt_table_and_geometry['table_name'],$fachobjekt_table_and_geometry['column_name'],$this->gmlas_schema);\n\t\t\t}\n\t\t}\n\n\t\t$layername = '';\n\t\t$tablename = strtolower($classname); #for DB\n\t\t\n\t\tswitch ($classname) {\n\t\t\tcase 'BP_Plan' : {\n\t\t\t\t$layername = 'B-Pläne';\n\t\t\t\t$GUI->formvars['chosen_layer_id'] = XPLANKONVERTER_BP_PLAENE_LAYER_ID;\n\t\t\t} break;\n\t\t\tcase 'FP_Plan' : {\n\t\t\t\t$layername = 'F-Pläne';\n\t\t\t\t$GUI->formvars['chosen_layer_id'] = XPLANKONVERTER_FP_PLAENE_LAYER_ID;\n\t\t\t} break;\n\t\t\tcase 'RP_Plan' : {\n\t\t\t\t$layername = 'R-Pläne';\n\t\t\t\t$GUI->formvars['chosen_layer_id'] = XPLANKONVERTER_RP_PLAENE_LAYER_ID;\n\t\t\t} break;\n\t\t\tcase 'SO_Plan' : {\n\t\t\t\t$layername = 'SO-Pläne';\n\t\t\t\t$GUI->formvars['chosen_layer_id'] = XPLANKONVERTER_SO_PLAENE_LAYER_ID;\n\t\t\t} break;\n\t\t\tdefault : {\n\t\t\t\t#Default = BP_Plan\n\t\t\t\t$layername = 'B-Pläne';\n\t\t\t\t$GUI->formvars['chosen_layer_id'] = XPLANKONVERTER_BP_PLAENE_LAYER_ID;\n\t\t\t} break;\n\t\t}\n\n\t\t$gml_id = $this->parse_gml_id($classname);\n\t\tif(empty($gml_id)){\n\t\t\t$GUI->add_message('warning', 'Es konnte keine Klasse ' . $classname . ' mit Pflichtattribut gml:id gefunden werden');\n\t\t\treturn;\n\t\t}\n\n\t\t# Mapping of input to output schema\n\t\t# Dynamic function\n\t\t$formdata = array();\n\t\t$fill_form_table = 'fill_form_' . $tablename;\n\t\t$formdata = $this->$fill_form_table($gml_id);\n\t\t$rect = ms_newRectObj();\n\n\t\t# iterate over all attributes as formvars\n\t\tforeach ($formdata as $r_key => $r_value) {\n\t\t\tif ($r_key == 'externereferenz') {\n\t\t\t\t# TODO Das ist die Stelle wo man prüfen kann ob die hochgeladenen Dateien mit den referenzurl übereinstimmen\n\t\t\t\t$referenzen = json_decode($r_value);\n\t\t\t\tif (is_array($referenzen) AND count($referenzen) > 0) {\n\t\t\t\t\t$document_url = $GUI->user->rolle->getLayer($GUI->formvars['chosen_layer_id'])[0]['document_url'];\n\t\t\t\t\tforeach ($referenzen AS $referenz) {\n\t\t\t\t\t\t$path_parts = pathinfo(basename($referenz->referenzurl));\n\t\t\t\t\t\t$referenz->referenzurl = $document_url . $path_parts['filename'] . '-' . $GUI->formvars['random_number'] . '.' . $path_parts['extension']; \n\t\t\t\t\t}\n\t\t\t\t\t$r_value = str_replace('\\/', '/', json_encode($referenzen));\n\t\t\t\t}\n\t\t\t}\n\t\t\t$GUI->formvars['attributenames'][] = $r_key;\n\t\t\t$GUI->formvars['values'][] = $r_value;\n\t\t\t# for filling the geometry data\n\t\t\tif ($r_key == 'newpathwkt') {\n\t\t\t\t$GUI->formvars['newpathwkt'] = $r_value;\n\t\t\t\t$GUI->formvars['pathwkt'] = $GUI->formvars['newpathwkt'];\n\t\t\t}\n\t\t\t# for drawing the data onto the polygoneditor\n\t\t\tif ($r_key == 'newpath') {\n\t\t\t\t$GUI->formvars['newpath'] = transformCoordsSVG($r_value);\n\t\t\t}\n\t\t\tif ($r_key == 'oid') {\n\t\t\t\t$oid = $r_value;\n\t\t\t}\n\t\t}\n\t\tif (empty($oid)) {\n\t\t\t$oid = $this->trim_gml_prefix_if_exists($gml_id); # workaround for now\n\t\t}\n\n\t\t# get extent of geometry for zooming \n\t\t$extent = $this->get_bbox_from_wkt($GUI->formvars['pathwkt']);\n\t\t$GUI->formvars = $GUI->formvars + $extent;\n\t\t$GUI->formvars['checkbox_names_' . $GUI->formvars['chosen_layer_id']] = 'check;' . $layername . ';' . $tablename . ';' . $oid . '|';\n\t\t$GUI->formvars['check;' . $layername .';' . $tablename . ';' . $oid] = 'on';\n\t\t$GUI->formvars['attributenames'][] = 'layer_schemaname';\n\t\t$GUI->formvars['values'][] = $this->gmlas_schema;\n\t\t #print_r($GUI->formvars);\n\t}", "public function Matrix($wine)\n{\n\tfor($i=0; $i<=$wine; $i++)\n\tfor($j=0; $j<=$wine; $j++) \n\t\n\t$this->glasses[$i][$j]=0;\n}", "function garr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"f32\",$n,$m);\n\t\t}", "function crear_matriz($gmat,$numero){\r\n foreach(range(0,$numero) as $row){\r\n foreach(range(0,$numero) as $col){\r\n $gmat[$row][$col] = 0;\r\n }\r\n }\r\n return $gmat;\r\n}", "function &addNew($class, $params = null, $additional = false)\n {\n include_once 'Image/Graph.php';\n $element =& Image_Graph::factory($class, $params);\n if ($additional === false) {\n $obj =& $this->add($element);\n } else {\n $obj =& $this->add($element, $additional);\n }\n return $obj;\n }", "public function newGrid()\n {\n\tforeach($this->cases as $case) {\n $case->figures->unsetAll() ;\n }\n return $this->cases ;\n }", "public function setNomGrp($nom_grp)\n {\n $this->nom_grp = $nom_grp;\n\n return $this;\n }", "function ogr2ogr_gmlas() {\n\t\t# For Logging add: . ' >> /var/www/logs/ogr_' . $gml_id . '.log 2>> /var/www/logs/ogr_' . $gml_id . '.err'\n\t\t# escape for passwords with shell \n\t\t#$cmd = $this->docker_gdal_cmd . ' ' . OGR_BINPATH_GDAL . 'ogr2ogr -f \"PostgreSQL\" PG:\"' . $this->pgdatabase->get_connection_string_p() . ' SCHEMAS=' . $this->gmlas_schema .'\" GMLAS:' . $this->gml_location . ' -oo REMOVE_UNUSED_LAYERS=YES -oo XSD=' . $this->xsd_location;\n\t\t#echo $cmd;\n\t\t#exec($cmd, $output, $error_code);\n\t\t#echo '<pre>'; print_r($output); echo '</pre>';\n\t\t#echo 'Error-Code:' . $error_code;\n\t\t\n\t\t$gdal_container_connect = 'gdalcmdserver:8080/t/?tool=ogr2ogr&param=';\n\t\t$param_1 = urlencode('-f \"PostgreSQL\" PG:');\n\t\t$connection_string = urlencode('\"' . $this->pgdatabase->get_connection_string() . ' SCHEMAS=' . $this->gmlas_schema . '\" ');\n\t\t$param_2 = urlencode('GMLAS:' . \"'\" . $this->gml_location . \"'\" . ' -oo REMOVE_UNUSED_LAYERS=YES -oo XSD=' . $this->xsd_location); \n#\t\t$param_2 = urlencode('GMLAS:' . \"'\" . $this->gml_location . \"'\" . ' -oo REMOVE_UNUSED_LAYERS=YES');\n\n\t\t$url = $gdal_container_connect . $param_1 . $connection_string . $param_2;\t\n\n\t\t$ch = curl_init();\n\t\t#$url = curl_escape($ch, $url);\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,300);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$success = strpos($output, 'ERROR') === false;\n\t\t$result = json_decode($output);\n\t\treturn array(\n\t\t\t'success' => $success,\n\t\t\t'msg' => ($success ? $result->stdout : $result->err . $result->stderr),\n\t\t\t'url' => str_replace($this->pgdatabase->get_credentials($this->pgdatabase->connection_id)['password'], 'secret', $url)\n\t\t);\n\t}", "public function toMilligram(): self\n {\n if (! isset($this->matric_ton)) {\n throw new MissingConversionUnitException();\n }\n\n $this->weight = $this->matric_ton * 1000000000;\n\n return $this;\n }", "public function __clone() {\n\t\t$this->_instanceNum = 0;\n\t\t$this->getInstanceNum();\n\t}", "private function _presetIdentity()\n\t{\n\t\t$this->setMatrixAt(0, 0, 1.00);\t// 1 0 0 0\n\t\t$this->setMatrixAt(1, 1, 1.00);\t// 0 1 0 0\n\t\t$this->setMatrixAt(2, 2, 1.00);\t// 0 0 1 0\n\t\t$this->setMatrixAt(3, 3, 1.00);\t// 0 0 0 1\n\t}", "public function toGDImage() {}", "public function setNM($nM)\n {\n $this->nm = $nM;\n\n return $this;\n }", "public function createGraph()\n {\n return $this->vertex->getGraph()->createGraphCloneEdges($this->getEdges());\n }", "private function __clone () {}", "protected function _createCidToGidMap() {}", "private function __clone(){\n\t\t\n\t}", "private function __clone(){ }", "public function colorMatrix() {}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "public function constructNotSquare(){\n $this->nbRows = 0;\n $this->nbSeatsPerRow = 0;\n $this->rowLabel = 1;\n $this->seatLabel = 1;\n }", "private function __clone(){\n\n }", "public function setNcm($ncm)\n {\n $this->ncm = $ncm;\n\n return $this;\n }", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "public function __clone() {\n $this->components = Arrays::copy($this->components);\n }", "static function recreateTree() {\n global $DB;\n\n // Reset the tree\n $DB->update(\n 'glpi_ipnetworks', [\n 'ipnetworks_id' => 0,\n 'level' => 1,\n 'completename' => new \\QueryExpression($DB->quoteName('name'))\n ], [true]\n );\n\n // Foreach IPNetwork ...\n $iterator = $DB->request([\n 'SELECT' => 'id',\n 'FROM' => self::getTable()\n ]);\n\n $network = new self();\n\n while ($network_entry = $iterator->next()) {\n if ($network->getFromDB($network_entry['id'])) {\n $input = $network->fields;\n // ... update it by its own entries\n $network->update($input);\n }\n }\n }", "private function __clone() { \n\n\t}", "protected function materializeToWorkspace($workspace) {\n\t\t$newNodeData = new NodeData($this->path, $workspace, $this->identifier, $this->dimensionValues);\n\t\t$this->nodeDataRepository->add($newNodeData);\n\n\t\t$newNodeData->similarize($this);\n\t\treturn $newNodeData;\n\t}", "public function assign($grid) \n\t{\n\t\t$this->grid\t= $grid;\n\t\t//$this->display_grid($grid);\n\t\t\n\t\t// Initalize new array for processing\n\t\t$this->clonedGrid\t= array();\n\t\t\n\t\t// Set array to track the Column Min\n\t\t$this->colMin = array();\n\t\t\n\t\t// Get the higest SS score possible\n\t\t$maxValue\t= max(array_map(\"max\", $grid));\n\t\t// Negate all numbers then add back Max \"Because the objective is to maximize the total cost we negate all elements\"\n\t\t$this->preprocess($maxValue);\n\t\t\n\t\t// Make the Grid Square so we have the same number of rows and columns\n\t\t$this->pad_grid($this->clonedGrid);\n\t\t\n\t\t//$this->display_grid($this->clonedGrid);\n\t\t// Subtract the min numbers from Rows\n\t\t$this->subtract_min_rows();\n\t\t\n\t\t// Subtract the min numbers from Cols\n\t\t$this->subtract_min_cols();\n\t\t\n\t\t// Add lines to cover all zeros\n\t\t$this->cover_zeros();\n\t\t//$this->display_grid($this->clonedGrid);\n\t\t\n\t\t// TODO: Figure out why it's count + 1 in this loop\n\t\t// Until we are at more lines (+ one for some reason keep adding lines and covering zeros with lines\n\t\twhile ( $this->numLines < count($this->clonedGrid) + 1) {\n\t\t\t$this->create_additional_zeros();\n\t\t\t$this->cover_zeros();\n\t\t\t//$this->display_grid($this->clonedGrid);\n\t\t\t//$this->display_grid($this->lines) ;\n\t\t\t\n\t\t}\n\t\t\n\t\t// Return Vars\n\t\t$reservedColumns =array();\n\t\t$this->rows =array();\n\t\t\n\t\t$this->build_output(0, $reservedColumns); \n\t\t\n\t\treturn array($this->rows, count($this->rows));\n\t\t\n\t\n\t\t\n\t}", "final private function __clone(){\n\t\t\n\t}", "private function __clone(){\n }", "private function __clone(){\n }", "public function __clone()\n {\n $this->reset(TRUE);\n }", "public function toMatricTon(): self\n {\n if (! isset($this->gram)) {\n throw new MissingConversionUnitException();\n }\n\n $this->weight = $this->gram / 1000000;\n\n return $this;\n }", "public function reset()\n\t{\n\t\t$this->_masks = [];\n\t\treturn $this;\n\t}", "public function __clone();", "public function __clone();", "private function __clone(){\n\t}", "function getArticleMngt(){\n if ($this->articleMngtClass == NULL)\n return NULL;\n $c = $this->articleMngtClass;\n return new $c($this);\n }", "final private function __clone(){}", "protected function __clone(){}", "public function copyMatrix(): matrix {\n return clone $this;\n }", "public function reset()\n\t{\n\t\t$this->_coordinates = array();\n\t\treturn $this;\n\t}", "private function __clone() { }", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "private function __clone ()\n\t{}", "public function toOunce(): self\n {\n if (! isset($this->matric_ton)) {\n throw new MissingConversionUnitException();\n }\n\n $this->weight = $this->matric_ton * 35273.9619;\n\n return $this;\n }", "public function setmnem($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->mnem !== $v) {\n $this->mnem = $v;\n $this->modifiedColumns[] = ActionTypePeer::MNEM;\n }\n\n\n return $this;\n }", "public function make_numeric(){\n\t\t//0Back\n\t\tif(!is_numeric($this->avg_reaction_time_m_no_faces)) $this->avg_reaction_time_m_no_faces = -1;\n\t\tif(!is_numeric($this->accuracy_m_no_faces)) $this->accuracy_m_no_faces = -1;\n\t\tif(!is_numeric($this->avg_reaction_time_m_faces)) $this->avg_reaction_time_m_faces = -1;\n\t\tif(!is_numeric($this->accuracy_m_faces)) $this->accuracy_m_faces = -1;\n\n\t\t//2back\n\t\tif(!is_numeric($this->avg_reaction_time_aba_no_faces)) $this->avg_reaction_time_aba_no_faces = -1;\n\t\tif(!is_numeric($this->accuracy_aba_no_faces)) $this->accuracy_aba_no_faces = -1;\n\t\tif(!is_numeric($this->avg_reaction_time_aba_faces)) $this->avg_reaction_time_aba_faces = -1;\n\t\tif(!is_numeric($this->accuracy_aba_faces)) $this->accuracy_aba_faces = -1;\n\n\t\t//Faces-NoFaces\n\t\tif(!is_numeric($this->avg_reaction_time_faces)) $this->avg_reaction_time_faces = -1;\n\t\tif(!is_numeric($this->accuracy_faces)) $this->accuracy_faces = -1;\n\t\tif(!is_numeric($this->avg_reaction_time_no_faces)) $this->avg_reaction_time_no_faces = -1;\n\t\tif(!is_numeric($this->accuracy_no_faces)) $this->accuracy_no_faces = -1;\n\t}", "private function __clone() {\r\n \r\n }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }" ]
[ "0.49317312", "0.4572076", "0.4486551", "0.4382335", "0.43354473", "0.43317008", "0.4310794", "0.43000287", "0.42978895", "0.42939845", "0.42914474", "0.4242475", "0.4239564", "0.42335218", "0.42171478", "0.42069352", "0.41924334", "0.41902328", "0.4189087", "0.41852427", "0.41555697", "0.41520682", "0.41395673", "0.41184023", "0.41184023", "0.41184023", "0.41184023", "0.41184023", "0.41184023", "0.41184023", "0.41184023", "0.41184023", "0.41184023", "0.41184023", "0.4110998", "0.4109393", "0.41089958", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.40875497", "0.407988", "0.40702382", "0.40505108", "0.40457976", "0.40450388", "0.4043998", "0.40419528", "0.40419528", "0.403765", "0.40355968", "0.4032358", "0.4030604", "0.4030604", "0.40272307", "0.40221134", "0.40149692", "0.4010106", "0.40059614", "0.40033197", "0.399774", "0.3995777", "0.3995777", "0.3995777", "0.3995777", "0.3995777", "0.3995777", "0.3995777", "0.39908406", "0.39832228", "0.39753968", "0.3971379", "0.39713457", "0.39687818", "0.39687818", "0.39687818", "0.39687818", "0.39687818", "0.39687818" ]
0.4942492
0
echo "halaman auto refresh setiap 5 detik: ".rand(99,2); //Hanya contoh saja..
function ajaxdatarekapbulanan(){ $bulan = $this->uri->segment('3'); $tahun = $this->uri->segment('4'); $nama_wp = $this->uri->segment('5'); $rekap = $this->Mrekap->getdata($bulan, $tahun, $nama_wp); $total; foreach ($rekap as $res) { $total += $res->omset; } $data = array( 'bulan'=>$bulan, 'tahun'=>$tahun, 'total' => $total, 'rekap' => $rekap, ); $this->load->view('rekap/kontenajaxrekapbulanan',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function random_angka($panjang) {\n $r = ''; //set string kosong\n //mengulang sebanyak $panjang dengan angka random dari 0-9\n for ($x=0; $x<$panjang; $x++) $r .= random_int(0, 9);\n return $r; //mereturn hasil string yang berisi angka random tadi\n}", "public function random();", "function bunch(){\r\n $rand = rand(1, 6);\r\n return \"bunch\" . $rand;\r\n}", "function challangeRandom() {\r\n // random number between 10 and 99\r\n $random = rand(10,99);\r\n $say = \"<Say voice='gcloud.en-GB-Standard-F' loop='2'>Please type the following number, $random, then press pound.</Say>\";\r\n return [$random, $say];\r\n}", "function random(){\n $randomnummer = rand(1,6);\n return $randomnummer;\n}", "protected function rand(){\n\n return Str::random(25);\n\n }", "public function run(){\n\t\t$this->test[]=rand(0, 10);\n\t}", "function rewards(){\r\n $rand = rand(1, 5);\r\n return \"rewards\" . $rand;\r\n}", "function random(int $min, int $max){\n\treturn \"Random entre \".$min.\" et \".$max;\n}", "function p3_ex2() {\n $rand = mt_rand(1, 100); // mt_rand is very better\n for ($i = 0; $i <= 20; $i++) {\n if ($i % 5 == 0 && $i != 0)\n $return .= 'resultat : '.($i * $rand).'<br />';\n else\n $return .= 'resultat : '.($i * $rand).', ';\n }\n\n return $return;\n}", "public function actionMuestraPunto(){\n $d=0;\n $date=\"\";\n $dateTime=date(\"Y-m-d H:i:s\"); \n $mt = explode(' ', microtime()); \n $d=mt_rand(0,30); \n $time=strtotime ( date(\"Y-m-d H:i:s\") )*1000;\n echo CJSON::encode(array(\"temp\"=>$d,\"time\"=>$time)); \n }", "function postit(){\r\n $rand = rand(1, 4);\r\n return \"postit\" . $rand;\r\n}", "function ran()\r\n\t{\r\n\t\tsrand((double)microtime()*1000000^getmypid());\r\n\t}", "function random_numbers($ms) {\n\t\t\t\t\n\t\t\t\t$n = rand(0, $ms);\n\t\t\t\t\n\t\t\t\treturn $n;\n\t\t\t\t\n\t\t\t}", "function Start_Again() {\n\t//choose new number\n $number = rand(1,100);\n //print text guess a number\n print(\"Guess a number between 1 and 100\");\n Display_Form($number);\n}", "function rollDie() {\r\n\t$roll = rand(1,6);\r\n\techo $roll . ' ';\r\n}", "function getSpin(){\n\t$s=rand(1,38);\n\treturn $s;\n}", "function random($car) {\n\t$string = \"\";\n\t$chaine = \"abcdefghijklmnpqrstuvwxy\";\n\tsrand((double)microtime()*1000000);\n\tfor($i=0; $i<$car; $i++) {\n\t\t$string .= $chaine[rand()%strlen($chaine)];\n\t}\n\treturn $string;\n}", "function random() {\n echo StringHelper::random(48);\n echo \"<br />\";\n echo StringHelper::random(16);\n echo \"<br />\";\n echo CryptHelper::generateKey(24);\n echo \"<br />\";\n echo CryptHelper::generateKey(8);\n }", "public function randomFunc() {\n return \"RANDOM\";\n }", "function generate_nomor_rekening() {\n global $conn; //memanggil global variabel koneksi\n $sudah_ada = true; //asumsi sudah ada di databse\n while ($sudah_ada) {\n //mengacak angka rekening dengan format 0002-01-######-##-# dengan bantuan fungsi random di atas\n $re = '0002-01-'.random_angka(6).'-'.random_angka(2).'-'.random_angka(1);\n //melakukan select pada tabel rekening dengan data random tadi\n $q = $conn->prepare(\"SELECT * FROM rekening WHERE nomor_rekening='$re'\");\n $q->execute();\n //mengeset $sudah_ada dengan nilai hasil select, jika kebetulan memang sudah ada maka akan bernilai true, dan looping mengacak lagi\n @$sudah_ada = $q->fetchAll();\n }\n return $re;\n}", "function fetch_credit() {\n return rand(60, 100);\n}", "function w18ol_ajax_get_oneliner() {\n\tglobal $oneliners;\n\t$oneliner_index = array_rand($oneliners);\n\t$oneliner = $oneliners[$oneliner_index];\n\techo $oneliner;\n\t// echo $oneliners[array_rand($oneliners)];\n\twp_die();\n}", "function call_15_rand($min,$max) {\n $risposta = [];\n // Generiamo 15 numeri (suppongo compresi tra 1 e 20):\n $i = 0;\n while ($i < 15) {\n $attuale = random_int($min,$max);\n while (array_search($attuale,$risposta) !== false) {\n $attuale = random_int($min,$max);\n }\n $risposta[$i] = $attuale;\n $i = $i + 1;\n }\n return $risposta;\n}", "public function randomize()\n {\n return mt_rand(1, $this->maxnumber());\n }", "function gallo_cita_random() {\n$vector = array(\n\t1 => \"Es posible robar las ideas, pero nadie puede robar su puesta en práctica ni la pasión por ellas. (Timothy Ferriss).\",\n\t2 => \"La medicina es una ciencia de la incertidumbre y un arte de la probabilidad. (William Osler).\",\n\t3 => \"La medicina es el arte de disputar los hombres a la muerte de hoy, para cedérselos en mejor estado, un poco más tarde. (Noel Clarasó)\",\n);\n$numero = rand(1,3);\necho \"$vector[$numero]\";\n}", "public function findRandom();", "public function random(): int\n {\n return rand(1, 100);\n }", "function createpass(){\n$s=\"\";\nfor ($i=0;$i<7;$i++)\n$s.=rand(0,9);\nreturn $s;\n}", "function genNum(){\n $cant = 20;\n $posit = 0;\n for($i=0; $i<$cant; $i++){\n $num = rand(-99,99);\n echo $num .\" , \";\n $posit = NumPost($num,$posit);\n }\n return $posit;\n}", "function aurora_borealis() {\n\t$chosen = steamed_hams_get_lyric();\n\techo \"<p id='seymour'>$chosen</p>\";\n}", "protected function generate()\n {\n\t\t$this->value = md5(uniqid(rand(), true));\n }", "function randomTest(){\n $treatment = $this->getTreatment();\n $username = $this->generateUsername();\n $hashed = $this->generateMD5Pass();\n $extra = array('username' =>$username,\n\t\t 'treatment' => $treatment,\n\t\t 'hash' => $hashed);\n $output = $this->outputBoilerplate('test.html', $extra);\n return $output; \n }", "function random_charo( $panjang ) { \n $karakter = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; \n $string = ''; \n for ( $i = 0; $i < $panjang; $i++ ) { \n $pos = rand( 0, strlen( $karakter ) - 1 ); \n $string .= $karakter{$pos}; \n } \nreturn \"OPERA\";\n}", "function gooi(){\n $ogen = array(random(),random(),random(),random(),random());\n for($i = 0;$i<5;$i++){\n $strings = (\"nummer \".($i + 1).\" is \".$ogen[$i].\"<br>\");\n echo $strings;\n }\n $sum = array_sum($ogen);\n var_export(\"het totaal is \".$sum);\n}", "function randnum($i)\n{\n $arr = array();\n while (count($arr) < $i) {\n $arr[] = rand(1, 9);\n $arr = array_unique($arr);\n }\n $_SESSION['vcode'] = implode($arr);\n return implode($arr);\n}", "public static function random()\n {\n return '#' . str_pad(dechex(mt_rand(0, 0xFFFFFF)), 6, '0', STR_PAD_LEFT);\n }", "function p3_ex3() {\n $hundred = 100;\n $rand = mt_rand(1, 100);\n for ($i = 20; $hundred >= $i; $hundred--) {\n if ($hundred % 5 == 0 && $hundred != 100)\n $return .= 'resultat : '.($hundred * $rand).'<br />';\n else\n $return .= 'resultat : '.($hundred * $rand).', ';\n }\n\n return $return;\n}", "public static function random(){\n $conexion = StorianDB::connectDB();\n $query = $conexion->query(\"SELECT * FROM cuento ORDER BY RAND() LIMIT 1\");\n return $tabla = $query->fetchObject();\n }", "function rand_blade(){\n\t\t$list = array ('blade', 'broadsword', 'claymore', 'dao', 'gladius', 'katana', 'longsword', 'odachi', 'rapier', 'sabre', 'shortsword', 'sword', 'wakazashi');\n\t\t$i = count($list);\n\t\treturn $list[mt_rand(0,$i-1)];\n\t}", "public static function generateCode()\n {\n return Str::random(10);\n }", "function stat_player(){\n // richiamo la funzione per generare il codice giocatore\n $codice_giocatore = genera_codice();\n // genero le statistiche giocatore\n $punti_fatti= rand(0, 100);\n $rimbalzi = rand(30, 200);\n $falli = rand(0, 100);\n\n // mi genero le percentuali\n $perc2= rand(0,1000)/10;\n $perc3= (100 - $perc2);\n\n $giocatore =[\n [\n 'id'=>$codice_giocatore,\n 'punti fatti'=> $punti_fatti,\n 'rimbalzi'=>$rimbalzi,\n 'falli'=>$falli,\n 'perc. tiri da 2'=>$perc2,\n 'perc. tiri da 3'=>$perc3\n ]\n ];\n return $giocatore ;\n}", "public function throwDice()\n {\n $this->value = rand(1, 6);\n }", "function _randomSteps(){\n return rand(3000, 9000);\n }", "function php05($min,$max){\n\t$random = rand($min,$max);\n\treturn $random;\n}", "public function Locomover()\n {\n echo \"<br>Saltando\";\n }", "function greeting()\r\n\t{\r\n\t\t$greeting = array(\r\n\t\t\t'Hi!', 'Hello,', 'Hello there,', 'Hi there,',\r\n\t\t\t'Hey yo!', 'Zzup!', 'Yo, man!', 'Sup?!',\r\n\t\t\t'Holla!', 'Hallo,', 'Bonos díes!', 'Saluton!',\r\n\t\t\t'Bonjour!', 'Salut!', 'Aloha!', 'Salute,',\r\n\t\t\t'¡Hola!', 'Ciao!',\r\n\t\t);\r\n\t\treturn $greeting[array_rand($greeting)];\r\n\t}", "function mutasi($induk){\n\t\t$pm = 0.11;\n\t\t$jumlah_gen = count($induk);\n\t\tfor ($i=0; $i < $jumlah_gen; $i++) { \n\t\t\t$random = rand(0,10)/10;\n\t\t\tif($random <= $pm){\n\t\t\t\t$induk[$i] = rand(0,10);\n\t\t\t}\n\t\t}\n\t\treturn $induk;\n\t}", "protected function randomIndex() {\n return mt_rand(1, 10);\n }", "public function genarateCodeinc( $num = 12 ){\n $resultat = array();\n $user =\"\";\n $username = \"abcdefghijklmnpqrstuvwxy123456789ABCDEFGHIJKLMNPQRSTUVWXY\";\n srand((double)microtime()*1000000);\n for($i=0; $i<$num; $i++) {\n $user .= $username[rand()%strlen($username)];\n }\n $resultat=$user;\n return $resultat;\n }", "public function baru(){\n $six_digit_random_number = mt_rand(000001, 999999);\n $s=new userId;\n $userid = $s->create($six_digit_random_number);\n return $six_digit_random_number.$userid;\n }", "function passgen() {\r\n\t$pw = '';\r\n\t$pw_lenght = 8;\r\n $zeichen = \"0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\";\r\n $array_b = explode(\",\",$zeichen);\r\n for($i=0;$i<$pw_lenght;$i++) {\r\n \tsrand((double)microtime()*1000000);\r\n $z = rand(0,25);\r\n $pw .= \"\".$array_b[$z].\"\";\r\n }\r\n\treturn $pw;\r\n}", "function genera_password($num=8,$randnum=0){ // By Kernellover \n $voc = 'aeiou'; \n $con = 'bcdfgjklmnpqrstwxyz';\n\t$nvoc = strlen($voc)-1;\n\t$ncon = strlen($con)-1;\n\t$psw =mt_rand(0,1)?$con[mt_rand(0,$ncon)]:''; // defineix si comença per vocal o consonant\n\n\t\n for ($n=0; $n<=ceil($num/2); $n++){ \n $psw .= $voc[mt_rand(0,$nvoc)]; \n $psw .= $con[mt_rand(0,$ncon)]; \n }\n\n\t$cua=$randnum?mt_rand(1,$randnum):'';\n\t$psw = str_replace (array('q','quu','yi','iy'),array('qu','que','ya','ya'),$psw);\n $psw = substr($psw,0,$num-strlen($cua)).$cua; \n\n\n return $psw; \n}", "public function orderRandom();", "function welcomeBanner()\r\n{\r\n\t$welcomeWords = array(\"Welcome\", \"Salutations\", \"Bonjour\", \"Hello\", \"G'Day\", \"Guten Tag\", \"Buona Giornata\", \"Yoi Tsuitachi\", \"M'athcho maroon\", \"Hey\", \"Good to see you\", \"Hi\", \"Howdy\",\"Sup\", \"Hiya\");\r\n\treturn $welcomeWords[rand(0,sizeof($welcomeWords)-1)];\r\n}", "function skaiciavimasIki25 () {\n static $skaicius = 0;\n $skaicius++;\n if ($skaicius <= 25) {\n echo \"Working...<br />\";\n skaiciavimasIki25();\n }\n echo \"Jeigu baigei, dar pavaryk iki 25 <br />\";\n}", "public static function seedRand() {\r\n\t\tsrand((int)((($m=microtime(true))-((int)$m))*pow(10,(int)log10(PHP_INT_MAX)))); \r\n\t}", "protected function fetchDCRoll(): int {\n return rand(1, 1000);\n }", "public static function getRandomValue()\n {\n preg_match('/0.([0-9]+) ([0-9]+)/', microtime(), $regs);\n return $regs[2].$regs[1].sprintf('%03d', rand(0, 999));\n }", "static function getDesktopRand();", "function generatechallenge(){\n\tsrand();\n\t//create the challenge variable\n\t$challenge=\"\";\n\t//fill the challenge variable\n\tfor($i=0; $i<80; $i++)\n\t{\n\t\t$challenge.=dechex(rand(0,15));\n\t}\n\t$_SESSION['challenge']=$challenge;\n\treturn $challenge;\n}", "function generate_otp_code(){\n return rand(1000,9999);\n}", "private function randomString() {\r\n\t\t\t$rand=md5(microtime(true));\r\n\t\t\treturn $rand;\r\n\t\t}", "function src_tarpit() {\n\t$h = fopen('/dev/random', 'rb');\n\n\t$len = 8192;\n\t$sleep = 5;\n\t$max_time = 60 * 5;\n\n\t$wait = 0;\n\n\twhile ($wait < $max_time) {\n\t\t$contents = fread($h, $len);\n\t\techo $contents;\n\t\tflush();\n\t\tsleep($sleep);\n\t\t$wait += $sleep;\n\t}\n}", "function challangeWhichIsMore() {\r\n // random numbers between 10 and 99\r\n $random1 = rand(10,99);\r\n $random2 = rand(10,99);\r\n while ($random1==$random2) { // ensure that the numbers are not the same\r\n $random2 = rand(10,99);\r\n }\r\n $say = \"<Say voice='gcloud.en-AU-Standard-D' loop='2'>Which number is more. <break strength='strong' /> <prosody rate='75%'>$random1, or $random2</prosody>. <break strength='strong' /> Please type the answer then press pound.<break strength='x-strong' /></Say>\";\r\n return [max($random1, $random2), $say];\r\n}", "function generaPass(){\n $cadena = \"1234567890\";\n //Obtenemos la longitud de la cadena de caracteres\n $longitudCadena=strlen($cadena);\n \n //Se define la variable que va a contener la contraseña\n $pass = \"\";\n //Se define la longitud de la contraseña, en mi caso 10, pero puedes poner la longitud que quieras\n $longitudPass=5;\n \n //Creamos la contraseña\n for($i=1 ; $i<=$longitudPass ; $i++){\n //Definimos numero aleatorio entre 0 y la longitud de la cadena de caracteres-1\n $pos=rand(0,$longitudCadena-1);\n \n //Vamos formando la contraseña en cada iteraccion del bucle, añadiendo a la cadena $pass la letra correspondiente a la posicion $pos en la cadena de caracteres definida.\n $pass .= substr($cadena,$pos,1);\n }\n return $pass;\n}", "private function generate_code()\n\t\t{\n\t\t\t$code = \"\";\n\t\t\tfor ($i = 0; $i < 5; ++$i) \n\t\t\t{\n\t\t\t\tif (mt_rand() % 2 == 0) \n\t\t\t\t{\n\t\t\t\t\t$code .= mt_rand(0,9);\n\t\t\t\t} else \n\t\t\t\t{\n\t\t\t\t\t$code .= chr(mt_rand(65, 90));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn $code; \n\n\t\t}", "function CriaCodigo() { //Gera numero aleatorio\r\n for ($i = 0; $i < 40; $i++) {\r\n $tempid = strtoupper(uniqid(rand(), true));\r\n $finalid = substr($tempid, -12);\r\n return $finalid;\r\n }\r\n }", "function challangePlus() {\r\n // random number between 8 and 94\r\n $random1 = rand(8,94);\r\n $random2 = rand(2,5);\r\n $say = \"<Say voice='gcloud.en-GB-Standard-F' loop='2'>Please type the total of <prosody rate='75%'>$random1 plus $random2</prosody>, then press pound.</Say>\";\r\n return [$random1+$random2, $say];\r\n}", "private function genCode()\r\n\t{\r\n\t\t$digits = 10;\r\n\t\treturn rand(pow(10, $digits-1), pow(10, $digits)-1);\r\n\t}", "function generaPass($longi){\r\n\t$cadena = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\r\n\t//Obtenemos la longitud de la cadena de caracteres\r\n\t$longitudCadena=strlen($cadena);\r\n\r\n\t//Se define la variable que va a contener la contraseņa\r\n\t$pass = \"\";\r\n\t$longitudPass=$longi;\r\n\r\n\t//Creamos la contraseņa\r\n\tfor($i=1 ; $i<=$longitudPass ; $i++){\r\n\t\t//Definimos numero aleatorio entre 0 y la longitud de la cadena de caracteres-1\r\n\t\t$pos=rand(0,$longitudCadena-1);\r\n\r\n\t\t$pass .= substr($cadena,$pos,1);\r\n\t}\r\n\treturn $pass;\r\n}", "public function autoCode(){\n $length=8;\n $randstr = \"\";\n srand((double)microtime() * 1000000);\n //our array add all letters and numbers if you wish\n $chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');\n for ($rand = 1; $rand <= $length; $rand++) {\n $random = rand(0, count($chars) - 1);\n $randstr .= $chars[$random];\n }\n return ($randstr.'/'.date('y'));\n }", "function RandomString($num) {\r\r\n mt_srand((double)microtime()*1000000);\r\r\n while (strlen($pass) < $num) {\r\r\n $i = chr(mt_rand (48,57)); \r\r\n $pass = $pass.$i; \r\r\n }\r\r\n return ($pass); \r\r\n}", "function newSeq5($num, $post = false)\n{\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n\n\n $a0 = intval(rand(-30, -20));\n while ($a0 == 0) {\n $a0 = intval(rand(-30, -20));\n }\n\n $a1 = intval(rand(20, 30));\n while ($a1 == 0) {\n $a1 = intval(rand(20, 30));\n }\n\n $a2 = intval(rand(-30, 30));\n while ($a2 == 0) {\n $a2 = intval(rand(-30, 30));\n }\n\n $r = intval(rand(-5, 5));\n while ($r == 0) {\n $r = intval(rand(-5, 5));\n }\n\n $m = intval(rand(2, 4));\n $a = [$a0, $a1, $a2];\n //An = (An-1 + An-2) *R\n for ($i = 3; $i <= 6; $i++) {\n $a[] = $r * ($a[$i - 3] + $a[$i - 2] + $a[$i - 1]);\n }\n\n $title = '';\n //An = (An-1 + An-2) *R\n for ($i = 0; $i < 6; $i++) {//miss 7\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n // 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[6];\n// An = (An-1 + An-2 +An-3) *R, 填中间\n// $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n\n if ($r > 0) {\n $hint = \"A[n]=$r*(A[n-1] + A[n-2] + A[n-3])\";\n } else {\n $hint = \"A[n]=($r)*(A[n-1] + A[n-2] + A[n-3])\";\n }\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n\n}", "function newSeq6($num, $post = false)\n{\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n\n\n $a0 = intval(rand(-30, -20));\n while ($a0 == 0) {\n $a0 = intval(rand(-30, -20));\n }\n\n $a1 = intval(rand(20, 30));\n while ($a1 == 0) {\n $a1 = intval(rand(20, 30));\n }\n\n\n $r = intval(rand(-5, 5));\n while ($r == 0) {\n $r = intval(rand(-5, 5));\n }\n\n $b = $r > 0 ?\n intval(rand(-40, -20))\n : intval(rand(20, 40));\n\n\n $m = intval(rand(2, 4));\n $a = [$a0, $a1];\n //An = (An-1 + An-2) *R\n for ($i = 2; $i <= 6; $i++) {\n $a[] = $r * ($a[$i - 2] + $a[$i - 1]) + $b;\n }\n\n $title = '';\n //An = (An-1 + An-2) *R +b\n for ($i = 0; $i < 6; $i++) {//miss 7\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n // 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[6];\n// An = (An-1 + An-2) *R + b, 填中间\n// $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n // hint An = R*(An-1 + An-2)\n\n if ($r > 0) {\n $hint = \"A[n]=$r*(A[n-1] + A[n-2])\";\n } else {\n $hint = \"A[n]=($r)*(A[n-1] + A[n-2])\";\n }\n\n if ($b > 0) {\n $hint = $hint . \"+$b\";\n } else {\n $hint = $hint . \"$b\";\n }\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n\n}", "function r(){\n\t\t\n\t\t$chars = '0123456789';\n\t\t$s = substr(str_shuffle(str_repeat($chars, 5)), 0, 5);\n\t\treturn $s;\t\t\t\n\t\t}", "public static function getRandomValue(): string\n {\n $values = self::getValues();\n return $values[array_rand($values)];\n }", "function rand_num() {\n\t\t\t\t\n\t\t\t\t$r = rand(1000000, 9999999);\n\t\t\t\treturn $r;\n\t\t\t\n\t\t\t}", "function randNomeArquivo(){\n\twhile(true){\n\t\t$rand = rand(0, 10000);\n\t\t$pasta = (int)($rand/100);\n\t\t$sub_pasta = (int)($rand/100);\n\t\tif(!file_exists('arquivos/'.$pasta.'/'.$sub_pasta.'/'.$rand.'.txt')){\n\t\t\treturn $rand;\n\t\t}\n\t}\n}", "public function getDynamicValue()\n {\n return rand(1, 100);\n }", "public function getRnd($gen) {\n if(empty($gen) || $gen == \"any\") {\n $condition = \"\";\n } else {\n $condition = \" WHERE genres like '%\" . $gen . \"%'\";\n }\n $query = \"SELECT * FROM movies \".$condition.\" ORDER BY RAND() LIMIT 24\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_CLASS);\n if($result) {\n return json_response(200, \"Et Voilà !\", $result);\n } else {\n return json_response(404, \"Ups, couldn't find anything\");\n }\n }", "function randomPassword()\r\n{\r\n\r\n$digit = 6;\r\n$karakter = \"ABCDEFGHJKLMNPQRSTUVWXYZ23456789\";\r\n\r\nsrand((double)microtime()*1000000);\r\n$i = 0;\r\n$pass = \"\";\r\nwhile ($i <= $digit-1)\r\n{\r\n$num = rand() % 32;\r\n$tmp = substr($karakter,$num,1);\r\n$pass = $pass.$tmp;\r\n$i++;\r\n}\r\nreturn $pass;\r\n}", "function genrateReportCode() {\n $chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ023456789\";\n srand((double) microtime() * 1000000);\n $i = 0;\n $pass = '';\n\n while ($i <= 7) {\n $num = rand() % 33;\n $tmp = substr($chars, $num, 1);\n $pass = $pass . $tmp;\n $i++;\n }\n return $pass;\n}", "function random_code($limit = 8)\n\t{\n\t return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit);\n\t}", "function refresh($cooldown){\r\n\t\techo(\"<meta http-equiv='refresh' content='0'>\"); \r\n\r\n\t}", "static function getMobileRand();", "function slRandomChar()\n{\n\t$char = '';\n\tfor ($i = 0; $i < 20; $i++)\n\t\t$char .= rand(0, 9);\n\treturn ($char);\n}", "function displaySymbol($randomValue){\n //using conditions\n //$randomValue = rand(0,4);\n echo $randomValue;\n \n /*\n if($randomValue == 0){\n $symbol =\"cherry\";\n }\n else if($randomValue == 1){\n $symbol =\"grapes\";\n }\n else if($randomValue == 2){\n $symbol =\"lemon\";\n }\n else if($randomValue == 3){\n $symbol =\"orange\";\n }\n else {\n $symbol =\"seven\";\n }\n */\n \n //trhee or more if statements\n switch ($randomValue){\n case 0 :\n $symbol =\"cherry\";\n break;\n case 1 :\n $symbol =\"grapes\";\n break;\n case 2 :\n $symbol =\"lemon\";\n break;\n case 3 :\n $symbol =\"orange\";\n break;\n case 4 :\n $symbol =\"seven\";\n break;\n }\n echo \"<img src='img/$symbol.png' alt='$symbol' title='\". ucfirst($symbol) .\"' width='70' >\";\n }", "function tf_md5rand() {\r\n return md5( time() .'-'. uniqid(rand(), true) .'-'. mt_rand(1, 1000) );\r\n }", "public function gen_random_string(){\n\t\t$chars =\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890\";\n\t\t$final_rand='';\t\t\n\t\tfor($i=0;$i<4; $i++) {\t\t \n\t\t$final_rand .= $chars[ rand(0,strlen($chars)-1)];\n\t\t}\t\t\n\t\treturn $final_rand;\t\n\t}", "public function generateOtp() \n {\n return rand(100000,999999);\n }", "function createRandomToken(){\n\t\t\t$chars = \"abcdefghijkmnopqrstuvwxyz023456789\";\n\t\t\tsrand((double)microtime()*1000000);\n\t\t\t$i = 0;\n\t\t\t$pass = '' ;\n\t\t\twhile ($i <= 7){\n\t\t\t\t$num = rand() % 33;\n\n\t\t\t\t\t\t\t$tmp = substr($chars, $num, 1);\n\n\t\t\t\t\t\t\t$pass = $pass . $tmp;\n\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn $pass;\n\t\t\t\t\t\t}", "public function generateResiNo()\n {\n\n $resi = 'AMSYS'.date('U').random_int(100, 999);\n return $resi;\n }", "function get_random_response_id($connect){\n $q='RES'.rand(2000,2999);\n $id=check_response_in_DB($q,$connect); \n return $id;\n}", "function stringa_casuale($length) {\n $caratterivalidi = \"abcdefghijklmnopqrstuxyvwzABCDEFGHIJKLMNOPQRSTUXYVWZ0123456789\";\n $num_car_validi = strlen($caratterivalidi);\n $risultato = \"\";\n for ($i = 0; $i < $length; $i++) {\n $index = mt_rand(0, $num_car_validi - 1);\n $risultato .= $caratterivalidi[$index];\n }\n return $risultato;\n}", "function randomise() {\n\n list($usec, $sec) = explode(' ', microtime());\n\n return (float) $sec + ((float) $usec * 100000);\n\n}", "public function randomColor() {\n $str = '';\n for($i = 0 ; $i < 6 ; $i++) {\n $randNum = rand(0 , 15);\n switch ($randNum) {\n case 10: $randNum = 'A'; break;\n case 11: $randNum = 'B'; break;\n case 12: $randNum = 'C'; break;\n case 13: $randNum = 'D'; break;\n case 14: $randNum = 'E'; break;\n case 15: $randNum = 'F'; break;\n }\n $str .= $randNum;\n }\n return $str;\n }", "function generate_random_number($start, $end, $flag){\r\n\tglobal $g_var;\r\n\tsrand((double)microtime()*1000000);\r\n\t$random = (rand($start,$end));\r\n\t\r\n\treturn $random;\r\n}", "function randomPassword()\n{\n\n$digit = 6;\n$karakter = \"ABCDEFGHJKLMNPQRSTUVWXYZ23456789\";\n\nsrand((double)microtime()*1000000);\n$i = 0;\n$pass = \"\";\nwhile ($i <= $digit-1)\n{\n$num = rand() % 32;\n$tmp = substr($karakter,$num,1);\n$pass = $pass.$tmp;\n$i++;\n}\nreturn $pass;\n}", "function random($max) {\r\n\t// create random number between 0 and $max\r\n\tsrand((double)microtime() * 1000000);\r\n\t$r = round(rand(0, $max));\r\n\tif ($r!=0) $r=$r-1;\r\n\treturn $r;\r\n}", "public function userSeedRuin()\n {\n return $this->randInt(9);\n }" ]
[ "0.6906557", "0.6680179", "0.66496146", "0.6622255", "0.66033506", "0.65160644", "0.6433166", "0.63757443", "0.6374291", "0.6364827", "0.63255394", "0.6302749", "0.6284797", "0.6235078", "0.6231682", "0.6217912", "0.62039447", "0.61991197", "0.6195205", "0.6174543", "0.6115846", "0.608982", "0.60743946", "0.60697216", "0.60633934", "0.60526353", "0.6041858", "0.60078955", "0.5987164", "0.59771115", "0.5975675", "0.59481144", "0.59279275", "0.5926354", "0.5905282", "0.59043765", "0.5892911", "0.5891739", "0.58888125", "0.5885479", "0.5882733", "0.5882452", "0.5873633", "0.58619684", "0.5855392", "0.5852773", "0.5849854", "0.58435214", "0.58260065", "0.58192635", "0.58152133", "0.5814258", "0.5811226", "0.58055687", "0.58031005", "0.5799998", "0.57999223", "0.57933664", "0.579164", "0.57890034", "0.57777125", "0.57724404", "0.57723427", "0.57709247", "0.57699484", "0.57678354", "0.5765749", "0.57656026", "0.5750831", "0.57466483", "0.5729536", "0.572946", "0.5729127", "0.5727547", "0.57228094", "0.5720781", "0.57161003", "0.5703177", "0.5700138", "0.568914", "0.568295", "0.5682463", "0.56819636", "0.568083", "0.56749105", "0.5673886", "0.5673453", "0.5662373", "0.5654629", "0.56483996", "0.56477094", "0.56431913", "0.5634085", "0.5633116", "0.5632071", "0.5630887", "0.5627931", "0.56144315", "0.5612145", "0.55999804", "0.5597118" ]
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { // Check permission delete current user. if (MemberHelper::checkLogin()->id == $request->id && MemberHelper::getCurrentUserRole() != ADMIN) { $errors[] = sprintf(trans('validation.not_direct_access')); return view('errors.system_error')->with('errors', $errors); } return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
///warranty_claim_type SECTION START HERE...................
public function get_all_warranty_claim_types(){ $this->db->select('*'); $this->db->from('tbl_warranty_claim_type'); $this->db->order_by('time_stamp','asc'); $result_query=$this->db->get(); $result=$result_query->result(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function determainclaimType()\r\n {\r\n // 9 digits\r\n if (preg_match($this->keycodeRegex, $this->keycode) == false)\r\n {\r\n $this->claimType = \"invaild-keycode\";\r\n }\r\n \r\n // if keycode is NOT null, then search in the database\r\n else if ($this->keycode != null)\r\n {\r\n $result = mysql_query(\"SELECT Keycode, Claimable, Repairable, WarrantyMonths\r\n FROM Product \r\n WHERE Product.Keycode = $this->keycode\");\r\n\r\n $array = mysql_fetch_array($result);\r\n\r\n // if keycode is null, item does not exist in the database\r\n //if ($array[\"Keycode\"] == false)\r\n if (empty($array))\r\n {\r\n $this->claimType = \"keycode-not-found\";\r\n }\r\n // if product is claimable and repairable\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 1)\r\n { \r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) \r\n {\r\n //// check warranty period\r\n $this->claimType = \"repair-warranty\";\r\n }\r\n else\r\n {\r\n // check warranty period\r\n $this->claimType = \"repair-no-warranty\";\r\n }\r\n }\r\n else // transactionResult number rows is zero, this means no transaction was founds\r\n { \r\n $this->claimType = \"repair-no-transaction\";\r\n }\r\n }\r\n // if product offers a finanical claim\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"finanical-warranty\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"finanical-outside-warranty\";\r\n }\r\n }\r\n else // transactionResult's rows was zero so no tranaction number was found\r\n {\r\n $this->claimType = \"finanical-no-transaction\";\r\n }\r\n }\r\n // if a product is NOT claimable with supplier\r\n else if ($array[\"Claimable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are above zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"not-claimable-refund\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"not-claimable-outside-warranty\";\r\n }\r\n }\r\n else // no vaild transaction number provided\r\n {\r\n $this->claimType = \"not-claimable-no-transaction\";\r\n }\r\n }\r\n }\r\n \r\n }", "public function setClaimType($claimType)\r\n {\r\n if ($claimType == \"repair-warranty\" || $claimType == \"repair-no-warranty\" ||\r\n $claimType == \"repair-no-transaction\")\r\n {\r\n $this->claimType = $claimType;\r\n }\r\n else\r\n {\r\n die(\"<h2> Error - Invaild Claim Type provided for setClaimType() method. Must be ethier repair-warranty, repair-no-warranty or repair-no-transaction.</h2>\");\r\n }\r\n }", "public function rolewise_payspec(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t\t\n\t\t$data['roleDebit'] = $this->ledger_model->roleDebit();\n\t\t$data['roleCredit'] = $this->ledger_model->roleCredit();\n\t\t\n\t\t\n\t\t\n\t\ttheme('rolewise_payspec',$data);\n\t}", "public function userwise_payspec(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t\t\n\t\t$data['userDebit'] = $this->ledger_model->userDebit();\n\t\t$data['userCredit'] = $this->ledger_model->userCredit();\n\t\t\n\t\t\t\n\t\t\n\t\ttheme('userwise_payspec',$data);\n\t}", "function TataCapitalPL($net_salary, $company, $category, $DOB, $Company_Type, $Primary_Acc, $reqtenure, $reqloanamount) {\n\t\t $exactnet_salary = $net_salary;\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"4\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n\n if ($category == \"TATA Group\" || $category == \"TATA GROUP\") {\n if ($net_salary >= 60000) {\n $interestrate = \"12.50\";\n $intr = 12.50;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"12.75\";\n $intr = 12.75;\n } else if ($net_salary >= 20000 && $net_salary < 30000) {\n $interestrate = \"12.75\";\n $intr = 12.75;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $proc_Fee = \"1.25%\";\n } else if ($category == \"Super Cat A\" || $category == \"Super CAT A\" || $category == \"SUPER CAT A\") {\n\t\t\t if ($net_salary >= 100000) {\n $interestrate = 12.50;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else if ($net_salary >= 60000 && $net_salary < 100000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_Fee = \"1.25%\";\n } else if ($net_salary <= 30000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_Fee = \"1.25%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else if ($category == \"CAT A\") {\n if ($net_salary >= 100000) {\n $interestrate = 13.90;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else if ($net_salary >= 60000 && $net_salary < 100000) {\n $interestrate = 14.35;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = 16.50;\n $intr = $interestrate;\n $proc_Fee = \"1.50%\";\n } else if ($net_salary <= 30000) {\n $interestrate = 17;\n $intr = $interestrate;\n $proc_Fee = \"1.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else if ($category == \"CAT B\") {\n if ($net_salary >= 100000) {\n $interestrate = 14.50;\n $intr = $interestrate;\n $proc_Fee = \"1%\";\n } else if ($net_salary >= 60000 && $net_salary < 100000) {\n $interestrate = 15;\n $intr = $interestrate / 1200;\n $proc_Fee = \"1%\";\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = 17;\n $intr = $interestrate;\n $proc_Fee = \"1.75%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else if ($category == \"CAT C\") {\n if ($net_salary >= 60000) {\n $interestrate = \"17\";\n $intr = 17;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"17\";\n $intr = 17;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $proc_Fee = \"2%\";\n } else if ($category == \"GOVT\") {\n if ($net_salary >= 60000) {\n $interestrate = \"16.50\";\n $intr = 16.5;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"17\";\n $intr = 17;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $proc_Fee = \"2%\";\n } else {\n if ($net_salary >= 60000) {\n $interestrate = \"19\";\n $intr = 19;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"19.50\";\n $intr = 19.50;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n }\n\t\t //special Clause \n /*if (($category == \"TATA Group\" || $category == \"TATA GROUP\" || $category == \"Super Cat A\" || $category == \"Super CAT A\" || $category == \"CAT A\" || $category == \"CAT B\") && $net_salary >= 100000) {\n $interestrate = \"14.99\";\n $intr = 14.99;\n $proc_Fee = \"1.25%\";\n } else {\n $interestrate = \"15.99\";\n $intr = 15.99;\n $proc_Fee = \"1.50%\";\n }*/\n\n //Calculate Tenure\n if ($category == \"TATA Group\" || $category == \"Super Cat A\" || $category == \"Super CAT A\") {\n if ($term > 72) {\n $calcterm = 66;\n $getterm = 5.5;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n } else if ($category == \"CAT A\" || $category == \"CAT B\" || $category == \"GOVT\") {\n if ($term > 48) {\n $calcterm = 48;\n $getterm = 4;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n } else {\n if ($term > 36) {\n $calcterm = 36;\n $getterm = 3;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n }\n\t\t\n // Multiplier\n if ($category == \"TATA Group\" || $category == \"Super Cat A\" || $category == \"Super CAT A\") {\n if ($calcterm >= 49 && $calcterm <= 66) {\n $loan_amt = $net_salary * 18;\n } else if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 15;\n } else if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 12;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 10;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"CAT A\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } else if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 14;\n } else if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"CAT B\" || $category == \"GOVT\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } else if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } else if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 8;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"CAT C\") {\n if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 8;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else {\n if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 8;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n } else {\n $loan_amt = 0;\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t{\n\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n\t\tif($loan_amt >= 600000)\n\t\t{\n if (($category == \"TATA Group\" || $category == \"TATA GROUP\" || $category == \"Super Cat A\" || $category == \"Super CAT A\") && $loan_amt >= 600000) {\n $interestrate = 12.50;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } elseif (($category == \"CAT A\" || $category == \"CAT B\") && $loan_amt >= 600000) {\n $interestrate = 13.90;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else {\n $interestrate = 17;\n $intr = 17;\n $proc_Fee = \"2%\";\n }\n\t\t}\n //MAx Loan Amount\n if ($intr > 0) {\n if ($category == \"TATA Group\" || $category == \"TATA GROUP\" || $category == \"Super Cat A\" || $category == \"Super CAT A\" || $category == \"CAT A\") {\n if ($loan_amt >= 1500000) {\n $loan_amount = 1500000;\n } else {\n $loan_amount = $loan_amt;\n }\n } else {\n if ($loan_amt >= 1500000) {\n $loan_amount = 1500000;\n } else {\n $loan_amount = $loan_amt;\n }\n }\n $getemicalc = round($loan_amount * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $calcterm))));//getController()->Common()->getEMI($loan_amount, $intr, $calcterm);\n $fterm = $calcterm / 12;\n }\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $calcterm))));\n $details['bank_code'] = \"Tata Capital\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($loan_amount);\n $details['processing_fee'] = $proc_Fee;\n $details['category'] = $category;\n return($details);\n }", "public function add_terms_of_use_field() {\n\t?>\n\t\t<p style=\"width:100%; margin-bottom:1em;\">\n\t\t<input name=\"rcp_terms_agreement\" id=\"rcp_terms_agreement\" class=\"required\" type=\"checkbox\"/>\n\t\t<label style=\"width:90%\" for=\"rcp_terms_agreement\">Read and Agree to <a href=\"/terms-of-service\" target=\"_blank\">Our Terms, Conditions and Privacy Policy</a> <em>(required)</em></label>\n\t\t</p>\n\t<?php\n\t}", "function HdfcBankPL($net_salary, $clubbed_emi, $company, $category, $DOB, $Company_Type, $Primary_Acc, $reqtenure, $reqloanamount) {\n $exactnet_salary = $net_salary;\n $exactnet_salaryTO = $net_salary - $clubbed_emi;\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n $interestrate = '';\n $getemicalc = 0;\n $pro_fee = '';\n $getterm = 0;\n $getloanamout = 0;\n $crprecordcount = 0;\n\t\t$gtcropcomp=\"Select interest_rate_csa ,interest_rate_noncsa From pl_company_hdfc Where (company_name like '%\".$company.\"%' and status=1)\";\n\t\tlist($alreadyExist,$hdfcrowar)=Mainselectfunc($gtcropcomp,$array = array());\n\n if (count($hdfcrowar) > 0) {\n $icicirow = array(\"interest_rate_csa\" => $hdfcrowar[\"interest_rate_csa\"], \"interest_rate_noncsa\" => $hdfcrowar[\"interest_rate_noncsa\"]);\n $crprecordcount = $icicirow[\"interest_rate_csa\"];\n }\n\t\t\t\telse\n\t\t\t{\n\t\t\t\t\t$crprecordcount=0;\n\t\t\t}\n \n if ($crprecordcount > 0) {\n if ($Primary_Acc == \"HDFC\" || $Primary_Acc == \"HDFC Bank\" || $Primary_Acc == \"hdfc\") {\n list($main, $gen) = explode('.', $icicirow[\"interest_rate_csa\"]);\n if ($gen == 00) {\n $interestrate = $main . \" \";\n } else {\n $interestrate = $icicirow[\"interest_rate_csa\"] . \" \";\n }\n\n $intr = $icicirow[\"interest_rate_csa\"];\n } else {\n list($main, $gen) = explode('.', $icicirow[\"interest_rate_noncsa\"]);\n if ($gen == 00) {\n $interestrate = $main . \"\";\n } else {\n $interestrate = $icicirow[\"interest_rate_noncsa\"];\n }\n\n $intr = $icicirow[\"interest_rate_noncsa\"];\n }\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n $pro_fee = \"Rs. 1000 - 1.75%\";\n } else {\n $getloanamout = 0;\n if ($category == \"Super A\" || $category == \"SUPER A\") {\n if ($exactnet_salary <= 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 6;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 12;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 21;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 21;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 21;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n }//SUPER A\n elseif ($category == \"Cat A\" || $category == \"CAT A\" || $category == \"CSA A\") {\n if ($exactnet_salary <= 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 6;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 17;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n }//CAT A CSA A\n elseif ($category == \"CAT GB\" || $category == \"GOVT\" || $Company_Type == 4 || $Company_Type == 5 || $Company_Type == 6) {\n if ($exactnet_salary >= 75000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\")) {\n $interestrate = \"15.5\";\n $intr = 15.5;\n } else {\n $interestrate = \"15.5\";\n $intr = 15.5;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 17;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n if ($exactnet_salary >= 50000 && $exactnet_salary < 75000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\")) {\n $interestrate = \"15.5\";\n $intr = 15.5;\n } else {\n $interestrate = \"15.5\";\n $intr = 15.5;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 17;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary >= 35000 && $exactnet_salary < 50000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\")) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n } else {\n $interestrate = \"15.75\";\n $intr = 15.75;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary < 35000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\") && $exactnet_salary >= 20000) {\n $interestrate = \"17.75\";\n $intr = 17.75;\n } else {\n $interestrate = \"17.75\";\n $intr = 17.75;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n if ($Primary_Acc == 'HDFC') {\n $pro_fee = \"2%\";\n } else {\n $pro_fee = \"2.5%\";\n }\n } elseif ($category == \"CAT B\" || $category == \"CSA B\") {\n if ($exactnet_salary <= 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n } elseif ($category == \"CAT C\" || $category == \"CSA C\") {\n if ($exactnet_salary >= 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 6;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n }\n } elseif ($exactnet_salary >= 50000 && ($exactnet_salary < 75000)) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n }\n } elseif ($exactnet_salary >= 35000 && ($exactnet_salary < 50000)) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n }\n } elseif ($exactnet_salary >= 25000 && ($exactnet_salary < 35000)) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n }\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n }//CAT C\n elseif ($category == \"Cat D\" || $category == \"CAT D\" || $category == \"CSA D\") {\n if ($exactnet_salary < 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary >= 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n } else {\n if ($exactnet_salary >= 25000) {\n $interestrate = \"19.50\";\n $intr = 19.50;\n\n if ($term == 12) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term == 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term == 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n // ASK//\n if ($Primary_Acc == 'HDFC') {\n if ($Loan_Amount_Eli > 150000) {\n $getloanamout = 150000;\n } else {\n $getloanamout = $Loan_Amount_Eli;\n }\n $pro_fee = \"2%\";\n } else {\n if ($Loan_Amount_Eli > 75000) {\n $getloanamout = 75000;\n } else {\n $getloanamout = $Loan_Amount_Eli;\n }\n $pro_fee = \"2.5%\";\n }\n } else {\n $getloanamout = 0;\n $intr = 0;\n $interestrate = 0;\n }\n }\n } //special companies\n\t\t\t\n\t\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n\t\t\t\n //for clause above 10lacs\n if (($category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT C\" || $category == \"CAT D \" || $category == \"CAT GB\" || $category == \"CSA A\" || $category == \"CSA B\" || $category == \"CSA C\" || $category == \"CSA D\" || $category == \"GOVT\" || $category == \"Super A\" || $Company_Type == 4 || $Company_Type == 5 || $Company_Type == 6)) {\n if ($getloanamout >= 1000000 && $exactnet_salary >= 75000) {\n if ($getloanamout >= 2000000) {\n $interestrate = \"11.49\";\n $intr = 11.49;\n $pro_fee = \"Rs. 2999\";\n } elseif ($getloanamout >= 1500000 && $getloanamout < 2000000) {\n $interestrate = \"12.75\";\n $intr = 12.75;\n $pro_fee = \"Rs. 3999\";\n } elseif ($getloanamout >= 1000000 && $getloanamout < 1500000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $pro_fee = \"Rs. 4999\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n $spl_category = 1;\n } else {\n $chkclause = 14.5 / 1200;\n if ((($exactnet_salary >= 40000 && $exactnet_salary < 75000) && ($getloanamout >= 500000 && $getloanamout <= 1000000)) && ($category == \"CAT B\" || $category == \"CAT A\" || $category == \"Super A\" || $category == \"CSA A\" || $category == \"CSA B\" || $category == \"CAT C\" || $category == \"CSA C\") && $intr > $chkclause) {\n $interestrate = \"14.5\";\n $intr = 14.5;\n $pro_fee = \"0.8%\";\n } else {\n $getloanamout = $getloanamout;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n if ($Primary_Acc == 'HDFC') {\n $pro_fee = \"2%\";\n } else {\n $pro_fee = \"Rs. 999\";\n }\n }\n }\n }\n \n if (($category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT C\" || $category == \"CAT D \" || $category == \"CAT GB\" || $category == \"CSA A\" || $category == \"CSA B\" || $category == \"CSA C\" || $category == \"CSA D\" || $category == \"GOVT\" || $category == \"Super A\") && $spl_category = \"\") {\n if ($exactnet_salary >= 50000) {\n $pro_fee = \"0.80%\";\n } else {\n $pro_fee = \"Rs. 999\";\n }\n }\n\n $alac = 100000;\n $peremicalc = round($alac * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($alac, $intr, $term);\n $tilldate = Date('Y-m-d');\n if ($tilldate <= '2016-08-16') {\n $pro_fee = \"0% (Till 16th Aug*)\";\n }\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $term))));\n $details['bank_code'] = \"HDFC Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $pro_fee;\n $details['category'] = $category;\n return($details);\n\t\t}", "function feature_license_regulatory_approval_add() {\n\n// feature_license_add_exclusions_form_validate(&$form_stats);\n\n feature_license_add_exclusions_form_submit();\n return drupal_get_form('feature_license_add_exclusions_form');\n}", "function monsterinsights_get_license_key_type() {\n\t$type = false;\n\t$license = monsterinsights_get_license();\n\tif ( ! empty( $license['type'] ) && is_string( $license['type'] ) ) {\n\t\tif ( in_array( $license['type'], array( 'master', 'pro', 'plus', 'basic' ) ) ) {\n\t\t\t$type = $license['type'];\n\t\t}\n\t}\n\treturn $type;\n}", "function setSyncWarranty()\n {\n }", "public function inquire_bill_get(){\r\n// if (!$this->pronet_model->inquire_bill(1, '002', '0000000',0, null, 'E004', 3)) {\r\n if (!$this->pronet_model->inquire_bill(1, '101', '999999999999',0, null, 'E007', 10)) {//test for financial services using genesis\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "public function requirements()\n\t{\n\t\t$data['title'] = 'Requirements';\n\t\t$data['requirementsdata'] = $this->getrequirement();\n\t\t$data['facilityall'] = $this->getallfacility();\n\t\t$data['unittype'] = $this->getunit();\n\t\t$data['ratereferrence'] = $this->getratereferrence();\n\t\t$this->template\n\t\t\t->set_layout('student_template')\n\t\t\t->build('requirements',$data);\n\t}", "function getFieldMedicLicence(){\n\t\t$set_upmsg = get_option('axceleratelink_srms_upmsg'); \n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_medicarelicence');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_medicarelicence');\n\t\t$tooltip = setToolTipNotification(\"medicarelicence\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('medical') === 'medical' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label></br>\";\n\t\t\t//$form_ret .= '<div id=\"fileMedicLiscence_con\"></div><br>';\n\t\t\t$form_ret .= '<input name=\"fileMedicLiscence\" id=\"fileMedicLiscence\" type=\"file\" multiple=\"false\" data-value=\"\" class=\"srms-field '.(get_axl_req_fields('medical') === 'medical' ? 'input-file-required' : '').'\">';\n\t\t\t$form_ret .= '<br><i>'.$set_upmsg[2].'</i>';\n\t\t\t$form_ret .= wp_nonce_field( 'fileMedicLiscence', 'fileMedicLiscence_upload_nonce' );\n\t\t\t$form_ret .= '<br>';\n\t\t}\n\t\treturn $form_ret;\n\t}", "function documentdetails($data,$type,$client_brand){ \n\t\ttry{\n\t\t\tif($type == 'email'){\n\t\t\t\t$uri = \"https://rightsignature.com/api/documents.json?recipient_email=\".$data;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$uri = \"https://rightsignature.com/api/documents/\".$data.\".json\";\n\t\t\t}\n\t\t\t\n\t\t\t// get the secure token from db\n\t\t\t$secure_token = TblAcaBrands::find()->where(['brand_id'=>$client_brand])->One();\n\t\t/*\tif(!empty($secure_token->secure_token)){\n\t\t\t\t$token = $secure_token->secure_token;\n\t\t\t\t\n\t\t\t}\n\t\t\telse{*/\n\t\t\t\t\n\t\t\t\t$token='nNVOqQXgEziK6AhOJ1QmV3CNvBDDs5IC2V133rQM';\n\t\t\t/*}*/\n\t\t\t\n\t\t\t//$headers = array(\"Content-type: application/json\", \"api-token: tPHIJhDqqcXz8yRhcYvFmclj11DyJta4RmIbXYD5\");\n\t\t\t$headers = array(\"Content-type: application/json\", \"api-token: \".$token);\n\t\t\t\t\t \n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 300);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t\t\t \n\t\t\t$curl_response = curl_exec ($ch);\n\t\t\t\n\t\t\treturn json_decode($curl_response);\n\t\t\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn '';\n\t\t}\n\t}", "function rsm_sc_payment_types() {\n\n\tob_start();\n\trsm_get_template( 'rsm-payment-types.php' );\n\treturn ob_get_clean();\n\n}", "public function get_warranty_claim_status($claim_status, $warranty_claim_type_id, $from_date, $to_date) {\n $this->db->select('tbl_warranty_claim.*,tbl_item.item_name, tbl_item.part_no, tbl_item.unit , tbl_sales.customer_type,\n tbl_sales.customer_id, tbl_sales.customer_name, tbl_sales.dealer_id, tbl_sales.dealer_name, tbl_sales.sales_date');\n $this->db->from('tbl_warranty_claim');\n $this->db->join('tbl_item','tbl_warranty_claim.item_id = tbl_item.item_id');\n $this->db->join('tbl_sales','tbl_warranty_claim.sales_id = tbl_sales.sales_id');\n\n if($claim_status != ''){\n switch ($claim_status) {\n case '1':\n $this->db->where('tbl_warranty_claim.approval_status >= 0 \n and tbl_warranty_claim.approval_status <= 2');\n break;\n\n case '2':\n $this->db->where('tbl_warranty_claim.approval_status >= 2');\n break;\n\n case '3':\n $this->db->where('tbl_warranty_claim.approval_status < 0');\n break;\n \n default:\n break;\n }\n \n }\n\n if($warranty_claim_type_id != ''){\n $this->db->where('tbl_warranty_claim.warranty_claim_type_id',$warranty_claim_type_id);\n }\n\n $this->db->where('tbl_warranty_claim.time_stamp >=',$from_date);\n $this->db->where('tbl_warranty_claim.time_stamp <=',$to_date);\n\n $result_query=$this->db->get();\n $result=$result_query->result();\n return $result;\n }", "function _erpal_contract_helper_invoice_helper_config_form_alter(&$form, &$form_state) {\n $form['billable_texts']['contract_billable_texts'] = array(\n '#type' => 'textfield',\n '#title' => t('Contract billable texts'),\n '#description' => t('This text will be used as subject for billables in contract context.'),\n '#default_value' => _erpal_contract_helper_get_billable_text(),\n '#maxlength' => 255,\n '#suffix' => theme('token_tree', array(\n 'token_types' => array('erpal_contract_billable_subject'),\n 'global_types' => FALSE,\n 'click_insert' => TRUE,\n ) \n ),//add available tokens to the form\n '#weight' => 10, //show it at the end\n );\n \n $form['submit']['#submit'][] = '_erpal_contract_helper_invoice_helper_config_form_submit';\n}", "function CK12()\n {\n global $template;\n global $id,$top_url;\n\n $val_item = array ( \"supply_code\"=>\"공급처 코드\" );\n $this->validate ( $val_item );\n\n // 상세 정보 가져온다\n $data = $this->get_detail( $id );\n\n $master_code = substr( $template, 0,1);\n include \"template/\" . $master_code .\"/\" . $template . \".htm\";\n }", "function _civicrm_api3_configexport_export_spec(array &$spec) {\n $spec['entity_type']['api.required'] = 1;\n $spec['entity_id']['api.required'] = 1;\n}", "private function mtii_decline_biz_premises_reg($invoice_number_from_doc_title, $doc_id)\n {\n $result = array();\n global $mtii_biz_prem_db_main;\n $doc_info = $mtii_biz_prem_db_main->get_by('invoice_number_filled_against', $invoice_number_from_doc_title);\n $doc_info_from_cp = get_page_by_title($invoice_number_from_doc_title, OBJECT, 'mtii_biz_prem_reg');\n\n $doc_id_from_db = $doc_info->application_form_id;\n if ($doc_info_from_cp->ID == $doc_id) {\n $already_approved = $doc_info->is_admin_approved;\n if ($already_approved==\"Declined\") {\n $result['status'] = \"Already Declined\";\n } else {\n delete_post_meta($doc_info_from_cp->ID, 'is_admin_approved');\n update_post_meta($doc_info_from_cp->ID, 'is_admin_approved', 'Declined');\n $doc_info_array = ( array ) $doc_info;\n $doc_info_array[\"is_admin_approved\"] = \"Declined\";\n $updated_biz_premise = $mtii_biz_prem_db_main->update($doc_id_from_db, $doc_info_array);\n if ($updated_biz_premise == false) {\n $result['status'] = \"error\";\n } else {\n $tasks_performer = new TasksPerformer;\n $doc_author = $doc_info->user_id;\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 $author_message = 'Hello '.$full_name.',<br /><br />'.\n 'Your registration with the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been declined by the site Administrator.<br /><br />'.\n '<strong>Reason for Declining: '.$_REQUEST[\"reason_for_decline\"].'</strong><br /><br />'.\n 'You can login to <a href=\"'.site_url().'\">our website</a> '.\n 'to adjust registration records and resubmit for re-approval.'.\n 'Thank you!';\n $mail_content = $tasks_performer->create_email_from_template('Business Premise Application Declined!', $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'Business Premises Application Declined', $mail_content, $headers);\n $result['status'] = \"success\";\n $result['approved'] = false;\n }\n }\n }\n return $result;\n }", "private function mtii_decline_registration($invoice_number_from_doc_title, $reg_id, $reg_catg)\n {\n $result = array();\n global $mtii_ngo_cbo_db_table;\n global $mtii_db_coop_main_form;\n\n\n $reg_catg_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 $reg_catg_info_in_db = $mtii_ngo_cbo_db_table->get_by('invoice_number_filled_against', $invoice_number_from_doc_title);\n\n if (!$reg_catg_info) {\n return null;\n exit;\n }\n if ($reg_catg_info->ID == $reg_id) {\n // $already_approved = $reg_catg==\"Cooperative\" ? get_post_meta($reg_id, 'admin_approved', true) :\n // get_post_meta($reg_id, 'is_admin_approved', true);\n $reg_catg==\"Cooperative\" ? delete_post_meta($reg_id, 'admin_approved') :\n delete_post_meta($reg_id, 'is_admin_approved');\n\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\"] = \"Declined\";\n $doc_id_from_db = $reg_catg_info[\"application_form_id\"];\n $updated_data = $mtii_db_coop_main_form->update($doc_id_from_db, $reg_catg_info);\n if ($updated_data && !$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 }\n }\n $meta_update = $reg_catg==\"Cooperative\" ? update_post_meta($reg_id, 'admin_approved', \"not approved\")\n : update_post_meta($reg_id, 'is_admin_approved', \"Declined\");\n if ($reg_catg==\"ngoAndCbo\") {\n $reg_catg_info_in_db->is_admin_approved = 'Declined';\n $update_approval_in_db = $mtii_ngo_cbo_db_table->update(\n $reg_catg_info_in_db->application_form_id, (array) $reg_catg_info_in_db\n );\n }\n if ($meta_update == false || ($reg_catg==\"ngoAndCbo\" && !$update_approval_in_db)) {\n $result['status'] = \"error\";\n $result['status4'] = $update_approval_in_db;\n $result['status5'] = $reg_catg_info_in_db;\n } else {\n $tasks_performer = new TasksPerformer;\n $doc_author = get_post_meta($reg_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 if ($reg_catg==\"Cooperative\") {\n $author_message = 'Hello '.$full_name.',<br /><br />'.\n 'Your signed documents for the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been declined by the site Administrator. <br /><br />'.\n '<strong>Reason for Declining: '.$_REQUEST[\"reason_for_decline\"].' </strong><br /><br />'.\n 'You can login to <a href=\"'.site_url().'\">our website</a> '.\n 'to upload a better signed document and re-submit for approval.'.\n 'Thank you!';\n } else {\n $author_message = 'Hello '.$full_name.',<br /><br />'.\n 'Your registration for the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been declined by the site Administrator.<br /><br />'.\n '<strong>Reason for Declining: '.$_REQUEST[\"reason_for_decline\"].'</strong><br /><br />'.\n 'You can login to <a href=\"'.site_url().'\">our website</a> '.\n 'to adjust registration records and resubmit for re-approval.'.\n 'Thank you!';\n }\n $declined_statement = $reg_catg==\"Cooperative\" ? 'Your Upload has been Declined!'\n : 'Your Registration has been Declined!';\n\n $mail_content = $tasks_performer->create_email_from_template($declined_statement, $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'MTII Declined Registration', $mail_content, $headers);\n $result['status'] = \"success\";\n $result['approved'] = false;\n }\n }\n // else {\n // $result['status'] = \"success\";\n // $result['approved'] = false;\n // $result['creapy'] = \"CREAAAAAPPPYYY\";\n // $result['reg_catg_info'] = $reg_catg_info;\n // $result['id'] = $reg_id;\n // }\n return $result;\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "public function get_licence()\n {\n return 'Licensed on the same terms as Composr';\n }", "function IIFLbankPL($net_salary,$clubbed_emi,$company,$category,$DOB,$Company_Type, $reqtenure, $reqloanamount)\n\t{\n\t\t $net_salary= $net_salary - $clubbed_emi;\n\t\tlist($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"60\");\n\n\tif($category==\"SUPER CAT A\")\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 0;\n\t\t\t\t\t$intr=0;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1%\";\n\n\t\t\t}\n\t\telseif($category==\"CAT A\" || $category==\"CAT B\")\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 0;\n\t\t\t\t\t$intr=0;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1%\";\n\t\t\t\t//tenure\n\t\t\t\tif($category==\"CAT A\")\n\t\t\t\t{\n\t\t\t\t\tif($calterm>48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=48;\n\t\t\t\t\t\t$calprint_term=4;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($category==\"CAT B\")\n\t\t\t\t{\n\t\t\t\t\tif($calterm>36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=36;\n\t\t\t\t\t\t$calprint_term=3;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}//CAT B\n\t\telse\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1.50%\";\n\t\t\t\tif($calterm>36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=36;\n\t\t\t\t\t\t$calprint_term=3;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t}\n\t\t//non cat company\n\t\t$term=$calterm;\n\t\t$print_term=$calprint_term;\n\t\t\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//foir\n\t\t$princ=100000;\n\t\t$perlacemi=round($princ * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\n\t\tif($category==\"SUPER CAT A\" || $category==\"CAT A\")\n\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (60/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}elseif($category==\"CAT B\")\n\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (55/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$firstnet_salary=($net_salary* (50/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}//foir end\n\t\t\n\t\tif($category==\"SUPER CAT A\")\n\t\t{\n\t\t\tif($finalloanamount_dbr>2500000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 2500000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\t\telseif($category==\"CAT A\")\n\t\t{\n\t\t\tif($finalloanamount_dbr>2000000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 2000000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($finalloanamount_dbr>1500000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 1500000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\n\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\n\t\t$getterm=$print_term;\n\t\t$getemicalc=round($getloanamout * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\t\t\t\n\t\t\t$details['bank_code'] = \"IIFL\";\n\t\t\t$details['interest_rate'] = interestRateFormat($interestrate);\n\t\t\t$details['emi'] = $getemicalc;\n\t\t\t$details['emiperlac'] = $emiperlac;\n\t\t\t$details['tenure'] = $getterm;\n\t\t\t$details['loan_amount'] = round($getloanamout);\n\t\t\t$details['processing_fee'] = $proc_Fee;\n\t\t\t$details['category'] = $category;\n\t\t\treturn($details);\n\t}", "function Generate($objInvoice, $objAccount)\n \t{\n \t\t\n \t}", "public function get_licence()\n {\n return 'MIT License';\n }", "public function display_eligibility_type($type){\n\t\tif($type == 'PI'){\n\t\t\t$st = 'Profile Shortlisting';\n\t\t}else if($type == 'PS'){\t\n\t \t\t$st = 'Profile Sending';\n\t\t}else if($type == 'PC'){\n\t\t\t$st = 'Position Closing';\n\t\t}\n\t\treturn $st;\n\t}", "function display_bank_header(&$order)\n{\n\tglobal $Ajax, $Refs;\n\t$payment = $order->trans_type == ST_BANKPAYMENT;\n\n\t$customer_error = false;\n\tdiv_start('pmt_header');\n\n\tstart_outer_table(TABLESTYLE2, \"width=90%\"); // outer table\n\n\ttable_section(1);\n\t\n date_row(_(\"Date:\"), 'date_', '', true, 0, 0, 0, null, true);\n\n\tref_row(_(\"Reference:\"), 'ref', '');\n\n\ttable_section(2, \"33%\");\n\n\tif (!isset($_POST['PayType']))\n\t{\n\t\tif (isset($_GET['PayType']))\n\t\t\t$_POST['PayType'] = $_GET['PayType'];\n\t\telse\n\t\t\t$_POST['PayType'] = \"\";\n\t}\n\tif (!isset($_POST['person_id']))\n\t{\n\t\tif (isset($_GET['PayPerson']))\n\t\t\t$_POST['person_id'] = $_GET['PayPerson'];\n\t\telse\n\t\t\t$_POST['person_id'] = \"\";\n\t}\n\tif (isset($_POST['_PayType_update'])) {\n\t\t$_POST['person_id'] = '';\n\t\t$Ajax->activate('pmt_header');\n\t\t$Ajax->activate('code_id');\n\t\t$Ajax->activate('pagehelp');\n\t\t$Ajax->activate('editors');\n\t\t$Ajax->activate('footer');\n\t}\n payment_person_types_list_row( $payment ? _(\"Pay To:\"):_(\"From:\"),\n\t\t 'PayType', $_POST['PayType'], true);\n switch ($_POST['PayType'])\n {\n\t\tcase PT_MISC :\n \t\ttext_row_ex($payment ?_(\"To the Order of:\"):_(\"Name:\"),\n\t\t\t\t 'person_id', 40, 50);\n \t\tbreak;\n\t\t//case PT_WORKORDER :\n \t//\tworkorders_list_row(_(\"Work Order:\"), 'person_id', null);\n \t//\tbreak;\n\t\tcase PT_SUPPLIER :\n \t\tsupplier_list_row(_(\"Supplier:\"), 'person_id', null, false, true, false, true);\n \t\tbreak;\n\t\tcase PT_CUSTOMER :\n \t\tcustomer_list_row(_(\"Customer:\"), 'person_id', null, false, true, false, true);\n\n \tif (db_customer_has_branches($_POST['person_id']))\n \t{\n \t\tcustomer_branches_list_row(_(\"Branch:\"), $_POST['person_id'], \n\t\t\t\t\t'PersonDetailID', null, false, true, true, true);\n \t}\n \telse\n \t{\n\t\t\t\t$_POST['PersonDetailID'] = ANY_NUMERIC;\n \t\thidden('PersonDetailID');\n \t}\n \t$trans = get_customer_habit($_POST['person_id']); // take care of customers on hold\n \tif ($trans['dissallow_invoices'] != 0)\n \t{\n \t\tif ($payment)\n \t\t{\n \t\t\t$customer_error = true;\n\t\t\t\t\tdisplay_error(_(\"This customer account is on hold.\"));\n \t\t}\n \t\telse\t\t\t\n\t\t\t\t\tdisplay_warning(_(\"This customer account is on hold.\"));\n \t}\t\t\n \t\tbreak;\n\n\t\tcase PT_QUICKENTRY :\n\t\t\tquick_entries_list_row(_(\"Type\").\":\", 'person_id', null, ($payment ? QE_PAYMENT : QE_DEPOSIT), true);\n\t\t\t$qid = get_quick_entry(get_post('person_id'));\n\t\t\tif (list_updated('person_id')) {\n\t\t\t\tunset($_POST['totamount']); // enable default\n\t\t\t\t$Ajax->activate('footer');\n\t\t\t\t$Ajax->activate('totamount');\n\t\t\t}\n\t\t\tamount_row($qid['base_desc'].\":\", 'totamount', price_format($qid['base_amount']),\n\t\t\t\t null, \"&nbsp;&nbsp;\".submit('go', _(\"Go\"), false, false, true));\n\t\t\tbreak;\t\n\t\t//case payment_person_types::Project() :\n \t//\tdimensions_list_row(_(\"Dimension:\"), 'person_id', $_POST['person_id'], false, null, true);\n \t//\tbreak;\n }\n\n\ttable_section(3, \"33%\");\n\n\tif (!$order->order_id && !get_post('bank_account'))\n\t{\n\t\tif ($_POST['PayType'] == PT_CUSTOMER)\n\t\t\t$_POST['bank_account'] = get_default_customer_bank_account($_POST['person_id']);\n\t\telseif ($_POST['PayType'] == PT_SUPPLIER)\t\n\t\t\t$_POST['bank_account'] = get_default_supplier_bank_account($_POST['person_id']);\n\t\telse\n\t\t\tunset($_POST['bank_account']);\n\t}\t\t\n \n bank_accounts_list_row( $payment ? _(\"From:\") : _(\"Into:\"), 'bank_account', null, true);\n if ($payment)\n\t\tbank_balance_row($_POST['bank_account']);\n\n\t$bank_currency = get_bank_account_currency($_POST['bank_account']);\n\n\texchange_rate_display(get_company_currency(), $bank_currency, $_POST['date_']);\n\n\tend_outer_table(1); // outer table\n\n\tdiv_end();\n\tif ($customer_error)\n\t{\n\t\tend_form();\n\t\tend_page();\n\t\texit;\n\t}\n}", "function view_voucher($demand_id)\n {\n }", "public function freeDocCreditMemoOrCancellation($type, $amountGross, $taxCode, $invoiceFieldsArr, tx_ptgsauserreg_customer $customerObj, $note='', $date= '') {\n trace('[METHOD] '.__METHOD__);\n \n $gsaShopTransactionAccessorObj = tx_ptgsashop_gsaTransactionAccessor::getInstance();\n $gsaAccountingTransactionAccessorObj = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance();\n // Freie Gutschrift\n $docFieldsArr = array(); // prepare documentFieldsArray\n $docFieldsArr['NUMMER'] = 0; // will be overwritten/set by insertTransactionDocument(): database ID of the record\n\n trace($taxCode,0,'$taxCode');\n $schriftNr = $gsaAccountingTransactionAccessorObj->getNextSchriftNr();\n trace($schriftNr,0,'$shriftnr');\n if ($date == '') {\n \t$date = date('Y-m-d');\n }\n if($amountGross != $invoiceFieldsArr['ENDPRB']) {\n $taxRate = tx_pttools_finance::getTaxRate($invoiceFieldsArr['ENDPRB'], $invoiceFieldsArr['ENDPRN']);\n trace($taxRate,0,'$taxRate');\n trace($amountGross,0,'$amountGross');\n $amountNet = round(tx_pttools_finance::getNetPriceFromGross($amountGross, $taxRate),2);\n } else {\n $amountNet = $invoiceFieldsArr['ENDPRN'];\n }\n if ($type == 'creditMemo') {\n $erfart = 'GU';\n $docFieldsArr['ERFART'] = '05GU';\n $docFieldsArr['NEUGU'] = 1;\n $docFieldsArr['BEZSUMME'] = 0.000; \n $tmpDataArr['comment'] = 'Automatisch generierte freie Gutschrift ';\n } else if ($type == 'cancellation') {\n \t$erfart = 'ST';\n \t$docFieldsArr['ERFART'] = '06ST';\n $docFieldsArr['BEZSUMME'] = - $amountGross; \n $docFieldsArr['SKONTOBETRAG'] = 0.000; \n $tmpDataArr['comment'] = 'Automatisch generiertes freies Storno ';\n } else {\n throw new tx_pttools_exception('Wrong type', 3, 'Type :'.$type);\n }\n \n $docFieldsArr['NUMMER'] = 0; // ### TODO: ERP GUI writes a different number based on file OPNR.INI (not multi-user safe!) // will be overwritten/set by insertTransactionDocument(): outstanding items numbers of invoices (ERP: \"Offene Posten\")\n $docFieldsArr['SCHRIFTNR'] = $schriftNr; \n # $insertFieldsArr['FSCHRIFT.SCHRIFTNR'] = $this->getNextNumber('VORGANG'); // DO NOT UNCOMMENT (see todo note below)! // continued transaction document number (\"fortlaufende Vorgangsnummer\")\n $docFieldsArr['GEBUCHT'] = 1; \n $docFieldsArr['GEDRUCKT'] = 1; \n $docFieldsArr['AUFTRAGOK'] = 1; \n $docFieldsArr['RESTOK'] = 1; \n $docFieldsArr['GEMAILT'] = 0; \n $docFieldsArr['DATUM'] = $date;\n $docFieldsArr['AUFNR'] = ''; // will be overwritten/set by insertTransactionDocument(): transaction document number (ERP: \"Vorgangsnummer\")\n $docFieldsArr['ADRINR'] = $customerObj->get_gsauid(); // Adress number from Customer\n $docFieldsArr['LIEFERINR'] = 0; // Nothing to deliver\n $docFieldsArr['ENDPRB'] = $amountGross;\n $docFieldsArr['ENDPRN'] = $amountNet;\n $docFieldsArr['PRBRUTTO'] = $customerObj->get_gsa_prbrutto(); //Gross Flag od customer \n\n //$docFieldsArr['BEZSUMME'] = 0.0000; see above\n $docFieldsArr['GUTSUMME'] = 0.0000;\n $docFieldsArr['LTERMIN'] = date('d.m.Y');\n $docFieldsArr['SKONTO1'] = 0.0000;\n $docFieldsArr['SKTAGE1'] = 0.0000;\n $docFieldsArr['SKONTO2'] = 0.0000;\n $docFieldsArr['SKTAGE2'] = 0.0000;\n $docFieldsArr['TAGNETTO'] = $customerObj->get_gsa_tagnetto();\n $docFieldsArr['VERSART'] = $invoiceFieldsArr['VERSART']; // Type of dispatch\n $docFieldsArr['ZAHLART'] = $customerObj->get_paymentMethod();\n $docFieldsArr['GESRAB'] = 0.0000;;\n $docFieldsArr['GESRABTYPE'] = 0;\n $docFieldsArr['RABATTGR'] = 0.0000;\n $docFieldsArr['PREISGR'] = $customerObj->get_priceGroup();\n $docFieldsArr['AUSLAND'] = $customerObj->get_isForeigner();\n $docFieldsArr['EGAUSLAND'] = $customerObj->get_isEUForeigner();\n $docFieldsArr['FLDC02'] = $invoiceFieldsArr['FLDC02']; // Invoice Number when overpament (starts with RE-)or coupon code (CO-) if coupon or partnerlink code (PL-) \n $docFieldsArr['FLDN01'] = $invoiceFieldsArr['FLDN01']; // dispatchcost \n $docFieldsArr['FLDN02'] = $invoiceFieldsArr['FLDN02']; // \n $docFieldsArr['FLDN03'] = $invoiceFieldsArr['FLDN03']; // \n $docFieldsArr['FLDN04'] = $invoiceFieldsArr['FLDN04']; // \n $docFieldsArr['INKOPF'] = '';\n $docFieldsArr['INFUSS'] = '';\n $docFieldsArr['BEMERKUNG'] = $tmpDataArr['comment'];\n //$docFieldsArr['FIBUBELEG'] = ''; //TODO don't know where ist is set in GSAUFTRAG \n $docFieldsArr['EURO'] = 1;\n $docFieldsArr['IVERTNR'] = 0;\n $docFieldsArr['KUNDGR'] = $customerObj->get_gsa_kundgr();\n $docFieldsArr['AUSKASSE'] = 0;\n $docFieldsArr['NAME'] = ($customerObj->get_company() == '' ? $customerObj->get_lastname() : \n $customerObj->get_company()); \n $docFieldsArr['GESGEWICHT'] = 0.0000; # TODO: find out where this comes from and what it is needed for \n $docFieldsArr['P13B'] = 0;\n $docFieldsArr['RMNEU'] = 1;\n $docFieldsArr['UHRZEIT'] = date('Y-m-d H:i:s'); # TODO: ERP GUI writes nonsense here (e.g. '1899-12-30 13:10:27')\n $docFieldsArr['EGIDENTNR'] = $customerObj->get_euVatId(); \n\n\n // not set in GSAUFTRAG would be nice to set it \n $docFieldsArr['LETZTERUSER'] = $note; // data type: varchar(30)\n $docFieldsArr['LETZTERUSERDATE'] = date('Y-m-d H:i:s');\n trace($docFieldsArr,0,'$docFieldsArr');\n if (self::TEST_MODE == false) {\n // write record if not TEST_MODE\n $docRecordId = $gsaShopTransactionAccessorObj->insertTransactionDocument($docFieldsArr, $erfart);\n } \n \n $this->freePosCreditMemoOrCancellation($type,$amountNet, $taxCode, $docRecordId, $customerObj);\n\n if ($type == 'cancellation') {\n //decrease accounting balance \n $customerObj->registerTransactionPayment(-$amountGross, 0); \n // insert in table ZAHLUNg with negative amount\n $paymentUpdateFieldsArr['NUMMER'] = 0; // will be overwritten/set by insertPayment()\n $paymentUpdateFieldsArr['OPNUMMER'] = -1; // will be overwritten/set by insertPayment()\n $paymentUpdateFieldsArr['BETRAG'] = (double)-$amountGross;\n $paymentUpdateFieldsArr['DATUM'] = $date;\n $paymentUpdateFieldsArr['AUFINR'] = $docRecordId;\n $paymentUpdateFieldsArr['BEMERKUNG'] = $note;\n $paymentUpdateFieldsArr['BANK'] = $this->classConfigArr['shopOperatorBankName'];\n $paymentUpdateFieldsArr['EURO'] = '1';\n $paymentUpdateFieldsArr['AUSGUTSCHRIFTEN'] = '0.000';\n if ($this->classConfigArr['shopOperatorFinanceAccount']) {\n $paymentUpdateFieldsArr['FIBUKTO'] = $this->classConfigArr['shopOperatorFinanceAccount'];\n }\n trace($paymentUpdateFieldsArr,0,'$paymentUpdateFieldsArr'); //TODO: whats that\n $gsaAccountingTransactionAccessorObj->insertPayment($paymentUpdateFieldsArr);\n }\n return $docRecordId;\n }", "function hook_openid_connect_claims_alter(array &$claims) {\n $claims['custom_claim'] = [\n 'scope' => 'profile',\n 'title' => 'Custom Claim',\n 'type' => 'string',\n 'description' => 'A custom claim from provider',\n ];\n}", "function IndusIndPL($strnet_salary, $company, $category, $DOB, $clubbed_emi, $city, $reqtenure, $reqloanamount) {\n $net_salary = $strnet_salary;\n\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n\n if ($category == \"A+\" || $category == \"CAT A\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = \"12.99\";\n $intr = $interestrate;\n $proc_fee = \"0.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"13.75\";\n $intr = $interestrate ;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"14.75\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"13.50\";\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.25\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } elseif ($term == 60) {\n $getterm = 5;\n } else {\n $getterm = 5;\n }\n } else if ($category == \"CAT B\" || $category == \"CAT G\" || $category == \"C1000\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 14.00;\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 15.00;\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 16.00;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else if ($category == \"CAT C\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 17.50;\n $intr = $interestrate;\n $proc_fee = \"1.25%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 18;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 19;\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"18.50\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"19\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"20\";\n $intr = $interestrate;\n $proc_fee = \"2.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else {\n /* if ($net_salary >= 100000) {\n $interestrate = \"17\";\n $intr = 17;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 50000 && $net_salary < 100000) {\n $interestrate = \"17.5\";\n $intr = 17.5;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"18\";\n $intr = 18;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }*/\n }\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $princ = 100000;\n if ($intr > 0) {\n $perlacemi = round($princ * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($princ, $intr, $term);\n //Calculate Loan Amount\n if ($net_salary >= 50000) {\n $firstnet_salary = ($net_salary * (70 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else if ($net_salary >= 25000 && $net_salary < 50000) {\n $firstnet_salary = ($net_salary * (50 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else {\n $finalloanamount_dbr = 0;\n }\n } else {\n $finalloanamount_dbr = 0;\n }\n //other eiligibility\n if ($net_salary >= 50000) {\n $finalloanamount_other = $net_salary * 18;\n } else {\n $finalloanamount_other = $net_salary * 18;\n }\n $finalloanamount = 0;\n if ($finalloanamount_other < $finalloanamount_dbr) {\n $finalloanamount = $finalloanamount_other;\n } else {\n $finalloanamount = $finalloanamount_dbr;\n }\n if ($finalloanamount > 2500000) {\n if (strlen($category) > 1) {\n $getloanamout = 2500000;\n } else {\n $getloanamout = 700000;\n }\n } else {\n if (strlen($category) > 1) {\n $getloanamout = $finalloanamount;\n } else {\n if ($finalloanamount > 700000) {\n $getloanamout = 700000;\n } else {\n $getloanamout = $finalloanamount;\n }\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n if ($intr > 0) {\n if (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 700000 && $getloanamout < 1500000 && $net_salary >= 75000) {\n $interestrate = \"13.49\";\n $intr = 13.49;\n $proc_fee = \"0.49%\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 1500000 && $net_salary >= 100000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_fee = \"Rs. 4999\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n }\n } else {\n $getemicalc = 0;\n }\n\t\t\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $term))));\n $details['bank_code'] = \"Indus Ind Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $proc_fee;\n $details['category'] = $category;\n return($details);\n }", "public function getLegalDocumentTypeByRemarkId ($remarkTypeId)\r\n {\r\n $legalDocumentType = 0;\r\n\r\n if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_BIR_PERMIT ) {\r\n $legalDocumentType = LegalDocumentType::TYPE_BIR_PERMIT;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_MAYORS_PERMIT ) {\r\n $legalDocumentType = LegalDocumentType::TYPE_MAYORS_PERMIT;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_DTI_SEC_PERMIT) {\r\n $legalDocumentType = LegalDocumentType::TYPE_DTI_SEC_PERMIT;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_FORM) {\r\n $legalDocumentType = LegalDocumentType::TYPE_FORM_M11501;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_SSS) {\r\n $legalDocumentType = LegalDocumentType::TYPE_SSS;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_PAG_IBIG) {\r\n $legalDocumentType = LegalDocumentType::TYPE_PAG_IBIG;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_POSTAL) {\r\n $legalDocumentType = LegalDocumentType::TYPE_POSTAL;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_PASSPORT) {\r\n $legalDocumentType = LegalDocumentType::TYPE_PASSPORT;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_DRIVERS_LICENSE) {\r\n $legalDocumentType = LegalDocumentType::TYPE_DRIVERS_LICENSE;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_PRC) {\r\n $legalDocumentType = LegalDocumentType::TYPE_PRC;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_VOTERS_ID) {\r\n $legalDocumentType = LegalDocumentType::TYPE_VOTERS_ID;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_SCHOOL_ID) {\r\n $legalDocumentType = LegalDocumentType::TYPE_SCHOOL_ID;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_TIN) {\r\n $legalDocumentType = LegalDocumentType::TYPE_TIN;\r\n }\r\n else if ($remarkTypeId == ApplicationRemarkType::TYPE_VALID_ID) {\r\n $legalDocumentType = LegalDocumentType::TYPE_VALID_ID;\r\n }\r\n\r\n return $legalDocumentType;\r\n }", "function user_agreement() {\n\t\t$agreement = $this->agreementmdl->getLast();\n\n\t\tif ($this->input->post('iagree') && $this->input->post('submit')) {\n\t\t\t$this->usermdl->submitContractAgreement($this->getUserId(), $agreement->agreement_id);\n\t\t\tredirect();\n\t\t}\n\t\telseif ($this->input->post('cancel')) {\n\t\t\tredirect('welcome/logout');\n\t\t}\n\t\t$this->tpl->assign(\"terms\", $agreement->agreement_text);\n\t\t$this->tpl->assign_include(\"dynamic_tpl\", \"sys_msgs/terms\");\n\t\t$this->tpl->view(\"sys_msgs/sys_msg\", $this->lang->language);\n\t}", "public function disclaimer() {\n// $data = ['terms' => $terms];\n $data = '';\n\n $viewname = Config('constants.frontendView') . '.disclaimer';\n return Helper::returnView($viewname);\n }", "public function getClaimType()\r\n {\r\n return $this->claimType;\r\n }", "function AccountsBody()\n\t{\t$this->DiscountBody();\n\t}", "function example_price_free_delivery_note()\n{\n ?>\n <style>\n .delivery-note .head-item-price,\n .delivery-note .head-price,\n .delivery-note .product-item-price,\n .delivery-note .product-price,\n .delivery-note .order-items tfoot {\n display: none;\n }\n .delivery-note .head-name,\n .delivery-note .product-name {\n width: 50%;\n }\n .delivery-note .head-quantity,\n .delivery-note .product-quantity {\n width: 50%;\n }\n .delivery-note .order-items tbody tr:last-child {\n border-bottom: 0.24em solid black;\n }\n </style>\n <?php\n}", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$arrBDAplicar = array('erpplacacentro','erpplacacentro_CAPA','erpplacacentro_DES' );\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode as moneda,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tIFNULL(paymentmethods.codesat,'') as paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans \n\t\t\t\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t\t\t\tINNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON debtortrans.debtorno = custbranch.branchcode\n\t\t\t\tINNER JOIN currencies ON debtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON stockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON stockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n \n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= number_format($myrow['ovamount'], 2, '.', '');\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=number_format($myrow['ovamount']+$myrow['ovgst'],2,'.','');\n\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=number_format($myrow['ovgst'],'.','');\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento) as descuento\n\t\t\t\t FROM stockmoves\n\t\t\t\t WHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}else{\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento+(IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*totaldescuento)) as descuento\n\t\t\t \t\t\tFROM stockmoves inner join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t-- LEFT JOIN taxauthrates ON stockmaster.taxcatid = taxauthrates.taxcatid\n\t\t\t\t\t\t\tLEFT JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\n\t\t\t\t\t \t\tWHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}\n\t\t//descuento\n\t\t$descuento=number_format($descuento,2,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n \n\t\t$moneda=$myrow['currcode'];\n \n\t\t// CANTIDAD CON LETRAS\n\t\t$amount = number_format($myrow['ovamount'],3);\n\t\t$ovgst = number_format($myrow['ovgst'],2);\n\t\t$rountotal = $amount + $ovgst ;\n\t\t$rountotal = number_format($rountotal,2);\n\t\t$totaletras=round($myrow['ovamount']+$myrow['ovgst'],2);\n\n\t\t$totalx=str_replace(',','',$total);\n\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\n\t\t$separa2=explode(\".\",$totalx,4);//\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\tif ($moneda=='MXN'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\t\t}//\n\t\telse\n\t\t{\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=number_format($myrow['cambio'],6,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"99\";\n\t\t}\n\t\t\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\t\t\n\t\t\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\t\t\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\n\t\tif (in_array($_SESSION['DatabaseName'], $arrBDAplicar)) {\n\t\t\t$charelectronic=$charelectronic.'|';\n\t\t}\n\t\telse{\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t}\n\t\t\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\n\t\tif ($imprimepublico==0 || in_array($_SESSION['DatabaseName'], $arrBDAplicar)){\n $colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\tif ($_SESSION['DecimalPlacesInvoice']==''){\n\t\t$_SESSION['DecimalPlacesInvoice']=6;\n\t}\n\t$decimalplaces=$_SESSION['DecimalPlacesInvoice'];\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],4,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=11\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n $descrnarrative = str_replace('|', '-', $descrnarrative);\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\t// consultar cantidad restante para tyqsa en remisones contra orden de trabajo\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";*/\n\t\t\t\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t\n\t\t\t//IF($_SESSION)\n\t\t\t//ECHO $charelectronicdetail;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description']; \n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,2,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal'] - $totalRowAnticipo),6,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\t\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\t\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal']),6,'.','');\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=number_format($myrow3['taxrate']*($myrow2['subtotal']),6);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t\n\t//echo '<pre><br>'.$cadenaenviada; \n\treturn $cadenaenviada;\n}", "function template_preprocess_stripe_payment_sepa_mandate_info(array &$variables) {\n $payment = $variables['payment'];\n $variables['creditor_id'] = $payment->method->controller_data['creditor_id'];\n $variables['mandate_reference'] = $payment->stripe_sepa['mandate_reference'];\n $variables['iban_last4'] = $payment->stripe_sepa['last4'];\n}", "function ReviseQuantityAllowedDefinitionType()\n\t{\n\t\t$this->EbatNs_ComplexType('ReviseQuantityAllowedDefinitionType', 'urn:ebay:apis:eBLBaseComponents');\n\n\t}", "function getLicence_adh(){\r\n return $this->licence_adh;\r\n}", "public function getTypeTitle()\n {\n return 'Tokens Purchase';\n }", "function wcfm_wc_warranty_products_manage_meta_save( $new_product_id, $wcfm_products_manage_form_data ) {\r\n\t\tglobal $WCFM;\r\n\t\t\r\n\t\tif ( !empty( $_POST['product_warranty_default'] ) && $_POST['product_warranty_default'] == 'yes' ) {\r\n\t\t\tdelete_post_meta( $new_product_id, '_warranty' );\r\n\t\t} elseif ( isset($wcfm_products_manage_form_data['product_warranty_type']) ) {\r\n\t\t\t$product_warranty = array();\r\n\r\n\t\t\tif ( $wcfm_products_manage_form_data['product_warranty_type'] == 'no_warranty' ) {\r\n\t\t\t\t$product_warranty = array('type' => 'no_warranty');\r\n\t\t\t\tupdate_post_meta( $new_product_id, '_warranty', $product_warranty );\r\n\t\t\t} elseif ( $wcfm_products_manage_form_data['product_warranty_type'] == 'included_warranty' ) {\r\n\t\t\t\t$product_warranty = array(\r\n\t\t\t\t\t\t'type' => 'included_warranty',\r\n\t\t\t\t\t\t'length' => $wcfm_products_manage_form_data['included_warranty_length'],\r\n\t\t\t\t\t\t'value' => $wcfm_products_manage_form_data['limited_warranty_length_value'],\r\n\t\t\t\t\t\t'duration' => $wcfm_products_manage_form_data['limited_warranty_length_duration']\r\n\t\t\t\t);\r\n\t\t\t\tupdate_post_meta( $new_product_id, '_warranty', $product_warranty );\r\n\t\t\t} elseif ( $wcfm_products_manage_form_data['product_warranty_type'] == 'addon_warranty' ) {\r\n\t\t\t\t$no_warranty= (isset($wcfm_products_manage_form_data['addon_no_warranty'])) ? $wcfm_products_manage_form_data['addon_no_warranty'] : 'no';\r\n\t\t\t\t$amounts = $wcfm_products_manage_form_data['addon_warranty_amount'];\r\n\t\t\t\t$values = $wcfm_products_manage_form_data['addon_warranty_length_value'];\r\n\t\t\t\t$durations = $wcfm_products_manage_form_data['addon_warranty_length_duration'];\r\n\t\t\t\t$addons = array();\r\n\r\n\t\t\t\tfor ($x = 0; $x < count($amounts); $x++) {\r\n\t\t\t\t\tif (!isset($amounts[$x]) || !isset($values[$x]) || !isset($durations[$x])) continue;\r\n\r\n\t\t\t\t\t$addons[] = array(\r\n\t\t\t\t\t\t\t'amount' => $amounts[$x],\r\n\t\t\t\t\t\t\t'value' => $values[$x],\r\n\t\t\t\t\t\t\t'duration' => $durations[$x]\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$product_warranty = array(\r\n\t\t\t\t\t\t'type' => 'addon_warranty',\r\n\t\t\t\t\t\t'addons' => $addons,\r\n\t\t\t\t\t\t'no_warranty_option' => $no_warranty\r\n\t\t\t\t);\r\n\t\t\t\tupdate_post_meta( $new_product_id, '_warranty', $product_warranty );\r\n\t\t\t}\r\n\r\n\t\t\tif ( isset($wcfm_products_manage_form_data['warranty_label']) ) {\r\n\t\t\t\tupdate_post_meta( $new_product_id, '_warranty_label', stripslashes($wcfm_products_manage_form_data['warranty_label']) );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function discountvoucherpurchase_civicrm_postProcess($formName, &$form ) {\n if($formName == 'CRM_Contribute_Form_Contribution_Confirm' && isset($form->_id) && $form->_id == 24){\n $params = array(\n 'code' => $form->_params['contactID'] . '-' . $form->_params['contributionID'],\n 'description' => 'gift from ' . $form->_params['email-5'],\n 'amount' => 100,\n 'amount_type' => 1,\n 'count_max' => 1,\n 'memberships'=> array(7,22),\n 'version' => 3,\n 'multi_valued' => array('memberships' => 1),\n );\n $code = civicrm_api('DiscountCode', 'create', $params);\n }\n}", "function IciciBankPL($net_salary, $company, $category, $DOB, $Company_Type, $Primary_Acc, $reqtenure, $reqloanamount) {\n $exactnet_salary = $net_salary;\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n $calcterm = $term;\n $getterm = $print_term;\n\t\t$gtcropcomp=\"Select interest_rate,\tprocessing_fee From pl_company_icici Where (company_name like '%\".$company.\"%' and interest_rate>0)\";\n\t\tlist($alreadyExist,$icicirowar)=Mainselectfunc($gtcropcomp,$array = array());\n\t\n\t\tif (count($icicirowar) > 0) {\n $icicirow = array(\"interest_rate\" => $icicirowar[\"interest_rate\"], \"processing_fee\" => $icicirowar[\"processing_fee\"]);\n } else {\n $icicirow = array(\"interest_rate\" => 0, \"processing_fee\" => 0);\n }\n\n if ($icicirow[\"interest_rate\"] > 0) {\n $crprecordcount = $icicirow[\"interest_rate\"];\n } else {\n $crprecordcount = 0;\n }\n if ($crprecordcount > 0) {\n list($main, $gen) = explode('.', $icicirow[\"interest_rate\"]);\n if ($gen == 00) {\n $interestrate = $main;\n } else {\n $interestrate = $icicirow[\"interest_rate\"];\n }\n $intr = $icicirow[\"interest_rate\"];\n $proc_Fee = $icicirow[\"processing_fee\"];\n } else {\n if (strlen($category) > 1) {\n if ($net_salary >= 75000) {\n $interestrate = 15.35;\n $intr = $interestrate;\n } else if ($net_salary >= 50000 && $net_salary < 75000) {\n $interestrate = 15.40;\n $intr = $interestrate;\n } else if ($net_salary >= 35000 && $net_salary < 50000) {\n $interestrate = 15.45;\n $intr = $interestrate;\n } else if ($net_salary >= 20000 && $net_salary <= 35000) {\n $interestrate = 16.75;\n $intr = $interestrate;\n } elseif ($net_salary <= 20000) {\n $interestrate = 16.99;\n $intr = $interestrate;\n } else {\n $interestrate = 16.99;\n $intr = $interestrate;\n }\n if ((strncmp(\"ICICI\", $Primary_Acc, 5)) == 0) {\n $proc_Fee = \"2%\";\n } else {\n $proc_Fee = \"2.25%\";\n }\n } else {\n /*if ($Company_Type == 4 || $Company_Type == 6) {\n if ($net_salary >= 50000) {\n $interestrate = 15.49;\n $intr = $interestrate;\n $proc_Fee = \"1.49%\";\n } else if ($net_salary >= 35000 && $net_salary < 50000) {\n $interestrate = 15.75;\n $intr = $interestrate;\n $proc_Fee = \"1.70%\";\n } else if ($net_salary >= 20000 && $net_salary < 35000) {\n $interestrate = 16.99;\n $intr = $interestrate;\n $proc_Fee = \"1.70%\";\n } elseif ($net_salary < 20000) {\n $interestrate = 17.99;\n $intr = $interestrate;\n $proc_Fee = \"1.99%\";\n } else {\n $interestrate = 17.99;\n $intr = $interestrate;\n $proc_Fee = \"1.99%\";\n }\n } else { */\n if ($net_salary >= 75000) {\n $interestrate = 16.99;\n $intr = $interestrate;\n if ((strncmp(\"ICICI\", $Primary_Acc, 5)) == 0) {\n\t\t\t\t\t\t\t$proc_Fee = \"2%\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$proc_Fee = \"2.25%\";\n\t\t\t\t\t\t}\n } else if ($net_salary >= 50000 && $net_salary < 75000) {\n $interestrate = 17.49;\n $intr = $interestrate;\n if ((strncmp(\"ICICI\", $Primary_Acc, 5)) == 0) {\n\t\t\t\t\t\t\t$proc_Fee = \"2%\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$proc_Fee = \"2.25%\";\n\t\t\t\t\t\t}\n } else if ($net_salary >= 35000 && $net_salary < 50000) {\n $interestrate = 17.99;\n $intr = $interestrate;\n $proc_Fee = \"2.25%\";\n } else if ($net_salary >= 20000 && $net_salary < 35000) {\n $interestrate = 17.99;\n $intr = $interestrate;\n $proc_Fee = \"2.25%\";\n } elseif ($net_salary < 20000) {\n $interestrate = 18.49;\n $intr = $interestrate;\n $proc_Fee = \"2.25%\";\n } else {\n $interestrate = 18.49;\n $intr = $interestrate;\n $proc_Fee = \"2.25%\";\n }\n //}//else\n }\n }\n\n $princ = 100000;\n $perlacemi = round($princ * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($princ, $intr, $calcterm);\n\n //Calculate Loan Amount \n if ($net_salary >= 50000) {\n $firstnet_salary = ($net_salary * (65 / 100));\n $loan_amt1 = ($perlacemi > 0) ? ($firstnet_salary / $perlacemi * 100000) : 0;\n } else if ($net_salary < 50000) {\n $firstnet_salary = ($net_salary * (55 / 100));\n $loan_amt1 = ($perlacemi > 0) ? ($firstnet_salary / $perlacemi * 100000) : 0;\n } else {\n \n }\n\n // other method\n if ($category == \"Elite\" || $category == \"SuperPrime\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = $net_salary * 18;\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 15;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"Preferred\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = \"\";\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 7;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n } else {\n $loan_amt = 0;\n }\n }\n if ($loan_amt > 0 && $loan_amt1 > 0) {\n if ($loan_amt >= $loan_amt1) {\n $finalloanamount = $loan_amt1;\n } else {\n $finalloanamount = $loan_amt;\n }\n } else {\n if ($loan_amt > 0) {\n $finalloanamount = $loan_amt;\n }\n if ($loan_amt1 > 0) {\n $finalloanamount = $loan_amt1;\n }\n }\n\n //Exact Loan Amount\n if ($category == \"Elite\" || ($category == \"SuperPrime\" && (strncmp(\"ICICI\", $Primary_Acc, 5)) == 0)) {\n if ($finalloanamount >= 2000000) {\n $loan_amount = 2000000;\n } else {\n $loan_amount = $finalloanamount;\n }\n } else if (($category == \"SuperPrime\" && (strncmp(\"ICICI\", $Primary_Acc, 5)) != 0) || ($category == \"Preferred\" && (strncmp(\"ICICI\", $Primary_Acc, 5)) == 0)) {\n if ($finalloanamount >= 2000000) {\n $loan_amount = 2000000;\n } else {\n $loan_amount = $finalloanamount;\n }\n } else {\n if ((strncmp(\"ICICI\", $Primary_Acc, 5)) == 0) {\n if ($finalloanamount >= 2000000) {\n $loan_amount = 2000000;\n } else {\n $loan_amount = $finalloanamount;\n }\n } else {\n if ($finalloanamount >= 2000000) {\n $loan_amount = 2000000;\n } else {\n $loan_amount = $finalloanamount;\n }\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$loan_amount)\n\t\t\t\t{\n\t\t\t\t\t$loan_amount=$loan_amount;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loan_amount=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$loan_amount=$loan_amount;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n // Special Clause\n if (strlen($category) > 0) {\n if ($loan_amount >= 2000000 && (strlen($category) > 0)) {\n $interestrate = 11.59;\n $intr = $interestrate;\n $proc_Fee = \"4999\";\n \n } elseif (($loan_amount >= 1500000 && $loan_amount < 2000000) && (strlen($category) > 0)) {\n \n $interestrate = 11.99;\n $intr = $interestrate;\n $proc_Fee = \"3999\";\n \n } elseif (($loan_amount >= 1000000 && $loan_amount < 1500000) && (strlen($category) > 0)) {\n \n $interestrate = 12.49;\n $intr = $interestrate;\n $proc_Fee = \"3999\";\n \n } elseif (($loan_amount >= 500000 && $loan_amount < 1000000) && (strlen($category) > 0)) {\n \n $interestrate = 14.49;\n $intr = $interestrate;\n $proc_Fee = \"0.99%\";\n }\n } else {\n if ($loan_amount >= 2000000) {\n $interestrate = 14.99;\n $intr = $interestrate;\n $proc_Fee = \"1%\";\n } elseif (($loan_amount >= 1500000 && $loan_amount < 2000000)) {\n $interestrate = 15.99;\n $intr = $interestrate;\n $proc_Fee = \"1%\";\n } elseif (($loan_amount >= 1000000 && $loan_amount < 1500000)) {\n $interestrate = 16.49;\n $intr = $interestrate;\n $proc_Fee = \"1%\";\n } elseif (($loan_amount >= 500000 && $loan_amount < 1000000)) {\n $interestrate = 16.99;\n $intr = $interestrate;\n $proc_Fee = \"1.49%\";\n }\n }\n\n $getemicalc = round($loan_amount * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $calcterm))));//getController()->Common()->getEMI($loan_amount, $intr, $calcterm);\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $calcterm))));\n \n $details['bank_code'] = \"ICICI Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($loan_amount);\n $details['processing_fee'] = $proc_Fee;\n $details['category'] = $category;\n return($details);\n }", "function ooffice_write_competence( $competence ) {\r\n global $odt;\r\n \t\t if ($competence){\r\n $code = $competence->code_competence;\r\n $description_competence = $competence->description_competence;\r\n $ref_domaine = $competence->ref_domaine;\r\n $num_competence = $competence->num_competence;\r\n\t\t\t $nb_item_competences = $competence->nb_item_competences;\r\n $odt->SetFont('Arial','B',10); \r\n\t \t $odt->Write(0,recode_utf8_vers_latin1(trim(get_string('competence','referentiel').\" : \".stripslashes($code))));\r\n $odt->Ln(1);\r\n $odt->SetFont('Arial','',10); \r\n $odt->Write(0, recode_utf8_vers_latin1(trim(stripslashes($description_competence))));\r\n\t \t \t$odt->Ln(1);\r\n\t\t\t $odt->Ln(1);\r\n\t\t\t // ITEM\r\n\t\t\t $records_items = referentiel_get_item_competences($competence->id);\r\n if ($records_items){\t\t\t\t \r\n \t $odt->SetFont('Arial','B',10); \r\n\t $odt->Write(0,recode_utf8_vers_latin1(trim(get_string('items','referentiel'))));\r\n $odt->Ln(1);\r\n\r\n\t\t\t\t foreach ($records_items as $record_i){\r\n\t\t\t\t\t\tooffice_write_item( $record_i );\r\n\t\t\t\t }\r\n\t\t\t\t $odt->Ln(1);\r\n\t\t\t }\r\n }\r\n}", "function wppb_register_your_version_content() {\r\n\r\n ?>\r\n <div class=\"wrap wppb-wrap\">\r\n <?php\r\n if ( PROFILE_BUILDER == 'Profile Builder Pro' ){\r\n wppb_serial_form('pro', 'Profile Builder Pro');\r\n }elseif ( PROFILE_BUILDER == 'Profile Builder Hobbyist' ){\r\n wppb_serial_form('hobbyist', 'Profile Builder Hobbyist');\r\n }\r\n ?>\r\n\r\n </div>\r\n<?php\r\n}", "function get_gift_type($donation){\t\t//CC for Credit Card and ACHEFT for ACH Bank Deduction\n\t\tif($donation->donation_type = 'cc'){\n\t\t\t$dpo_gift_type = 'CC';\n\t\t}else{\n\t\t\t$dpo_gift_type = '';\n\t\t}\t\t\n\t\treturn $dpo_gift_type;\n\t}", "function DiscountBody()\n\t{\t\n\t}", "public function sendAcknowledgment($request_type) {\n if (isset($request_type)) {\n $content = NULL;\n switch ($request_type) {\n case 1: ///accept/acknowledge bill payments/data from gepg\n $content = \"<gepgPmtSpInfoAck><TrxStsCode>7201</TrxStsCode> </gepgPmtSpInfoAck>\";\n\n break;\n case 2://accept/acknowledge bill controll number details/data from gepg\n $content = \"<gepgBillSubRespAck><TrxStsCode>7101</TrxStsCode> </gepgBillSubRespAck>\";\n\n break;\n\n case 3://accept/acknowledge reconciliation request/data from gepg\n $content = \"<gepgSpReconcRespAck><ReconcStsCode>7101</ReconcStsCode></gepgSpReconcRespAck>\";\n\n break;\n }\n if ($content) {\n $signature = $this->generateSignature($content);\n\n $response = \"<Gepg>\" . $content . \"<gepgSignature>\" . $signature . \"</gepgSignature></Gepg>\";\n echo $response;\n }\n }\n }", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tdebtortrans.paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans INNER JOIN debtorsmaster ON\n\t\t\t\tdebtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON\n\t\t\t\tdebtortrans.branchcode = custbranch.branchcode\n\t\t\t\tAND debtortrans.debtorno = custbranch.debtorno\n\t\t\t\tINNER JOIN currencies ON\n\t\t\t\tdebtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON\n\t\t\t\tstockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON\n\t\t\t\tstockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= FormatNumberERP($myrow['ovamount']);\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=FormatNumberERP($myrow['ovgst']);\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento\n\t\t$descuento=FormatNumberERP($myrow['ovdiscount']);\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n\t\t$moneda=$myrow['currcode'];\n\t\t// CANTIDAD CON LETRAS\n\t\t$totaletras=$myrow['ovamount']+$myrow['ovgst'];\n\t\t$totalx=str_replace(',' ,'', FormatNumberERP($totaletras));\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\", FormatNumberERP($total));\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra, 'es');\n\t\t\n\t\t$zeroPad = \"\";\n\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t} else {\n\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t}\n\t\t\n\t\tif ($moneda == 'MXN') {\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t} else {\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=FormatRateNumberERP($myrow['cambio']);\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"No Identificado\";\n\t\t}\n\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\n\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0) {\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=11\n\t\t\t\t \tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t \t\tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\t\t\t\t\t\t\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\t\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\t\n\t\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t//echo '<pre><br>'.$cadenaenviada;\n\treturn $cadenaenviada;\n}", "public function test_addBillingCodeTypeAudit() {\n\n }", "function payment_fields() {\n?>\n\t\t<?php if ($this->tran_mode=='sandbox') : ?><p><?php _e('TEST MODE/SANDBOX ENABLED', WC_Authorize_SIM::TEXT_DOMAIN); ?></p><?php endif; ?>\n\t\t<?php if ($this->description) : ?><p><?php echo wpautop(wptexturize($this->description)); ?></p><?php endif; ?>\n<?php\n\n\t}", "function ooffice_write_certificat( $record, $referentiel_instance, $referentiel_referentiel, $liste_empreintes, $liste_poids, $param) {\r\nglobal $CFG;\r\nglobal $odt;\r\n \t// add comment and div tags\r\n\t\t\r\n\t\tif ($record){\r\n\t\t\t// DEBUG\r\n\t\t\t// echo \"DEBUG LIGNE 1021\";\r\n\t\t\t// print_r($referentiel_instance);\r\n\t\t\t$id = trim( $record->id );\r\n $commentaire_certificat = recode_utf8_vers_latin1(trim($record->commentaire_certificat));\r\n $synthese_certificat = recode_utf8_vers_latin1(trim($record->synthese_certificat));\r\n\t\t\t$competences_activite = recode_utf8_vers_latin1(trim($record->competences_activite)) ;\r\n $competences_certificat = recode_utf8_vers_latin1(trim($record->competences_certificat)) ;\r\n $decision_jury = recode_utf8_vers_latin1(trim($record->decision_jury));\r\n\t\t\tif ($record->date_decision){\r\n $date_decision = userdate(trim($record->date_decision));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$date_decision =\"\";\r\n\t\t\t}\r\n $userid = trim( $record->userid);\r\n $teacherid = trim( $record->teacherid);\r\n\t\t\tif ($teacherid!=0){\r\n\t\t\t\t$nom_prenom_teacher=recode_utf8_vers_latin1(referentiel_get_user_info($teacherid));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$nom_prenom_teacher=\"\";\r\n\t\t\t}\r\n \r\n $ref_referentiel = trim( $record->ref_referentiel);\r\n\t\t\t// $ref_referentiel=$referentiel_id;\r\n\t\t\t$verrou = trim( $record->verrou );\r\n\t\t\t$valide = trim( $record->valide );\r\n\t\t\t$evaluation = trim( $record->evaluation );\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// USER\r\n\t\t\tif (isset($record->userid) && ($record->userid>0)){\r\n\t\t\t\t$record_etudiant = referentiel_get_etudiant_user($record->userid);\r\n\t\t \tif ($record_etudiant){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$odt->SetLeftMargin(15);\r\n\t\t\t\t\t\r\n\t\t\t\t\tooffice_write_referentiel($referentiel_instance, $referentiel_referentiel, $param);\r\n\t\t\t\t\t\r\n\t\t\t\t\tooffice_write_etudiant( $record_etudiant, $param);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$odt->SetFont('Arial','',12);\r\n\t\t\t\t\tif ($param->certificat_sel_decision_jury){\r\n\t\t\t\t\t\tif (($date_decision!=\"\") && ($decision_jury!=\"\")){\r\n\t\t\t\t\t\t\t$odt->Write(1,$decision_jury);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// $odt->SetFont('Arial','B',10); \r\n\t\t\t\t\t// $odt->Write(1,\"ID : \");\r\n\t\t\t\t\t// $odt->SetFont('Arial','',10);\r\n\t\t\t\t\t// $odt->Write(1,\"$id\");\r\n\t\t\t\t\t// $odt->Ln(1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$odt->SetFont('Arial','B',12); \r\n \t$odt->Write(1,recode_utf8_vers_latin1(get_string('competences','referentiel')).\": \");\r\n\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\tif ($param->certificat_sel_activite_competences){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',9); \r\n\t \t$odt->Write(1,recode_utf8_vers_latin1(get_string('competences_activite','referentiel')).\": \");\r\n\t\t\t\t\t\t$odt->Ln(1); \r\n \t \tooffice_liste_competences_certificat($ref_referentiel, '/',':', $competences_activite, $liste_empreintes, 0, 9, 8);\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($param->certificat_sel_certificat_competences){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10); \r\n\t \t$odt->Write(1,recode_utf8_vers_latin1(get_string('competences_certificat','referentiel')).\": \");\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n \t \tooffice_liste_competences_certificat($ref_referentiel, '/',':', $competences_certificat, $liste_empreintes,0,10,9);\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (($param->certificat_sel_certificat_competences) \r\n && ($param->certificat_sel_certificat_detail)){\r\n\t\t\t\t\t\tooffice_referentiel_affiche_detail_competences('/',':',$competences_certificat, $liste_empreintes, $liste_poids);\r\n }\t\t\t\t\t\r\n\t\t\t\t\tif ($param->certificat_sel_certificat_pourcent){\r\n // $odt->SetFont('Arial','B',10);\r\n \t \t// $odt->Write(1,recode_utf8_vers_latin1(get_string('pourcentage','referentiel')).\" :\");\r\n\t\t\t\t\t // $odt->Ln(1);\r\n\t\t\t\t\t ooffice_referentiel_affiche_certificat_consolide($ref_referentiel, '/',':', $competences_certificat, 10,9,8);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($param->certificat_sel_commentaire){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10);\r\n \t \t$odt->Write(1,recode_utf8_vers_latin1(get_string('commentaire','referentiel')).\": \");\r\n\t\t\t\t\t\t$odt->SetFont('Arial','',10);\r\n \t \t$odt->Write(1,\"$commentaire_certificat \");\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10);\r\n \t \t$odt->Write(1,recode_utf8_vers_latin1(get_string('synthese_certificat','referentiel')).\": \");\r\n\t\t\t\t\t\t$odt->SetFont('Arial','',10);\r\n \t \t$odt->Write(1,\"$synthese_certificat \");\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($param->certificat_sel_decision_jury){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10);\r\n\t\t\t $odt->Write(1, recode_utf8_vers_latin1(get_string('decision','referentiel')).\" : \");\r\n\t\t\t\t\t\t$odt->SetFont('Arial','',10);\r\n\t\t \t $odt->Write(1,\"$decision_jury\");\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($param->certificat_sel_certificat_referents){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10);\r\n\t\t\t\t\t\t$odt->Write(1,recode_utf8_vers_latin1(get_string('enseignant','referentiel')).\" : \");\r\n\t\t\t\t\t\t$odt->SetFont('Arial','',10);\r\n\t\t\t\t\t\t$odt->Write(1,$nom_prenom_teacher);\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t$odt->Write(1,\" R�f�rentiel : $ref_referentiel\");\r\n\t\t\t\t\t$odt->Ln(1);\r\n\t\t $odt->Write(1,\" Verrou : $verrou, Valide : $valide, Evaluation : $evaluation\");\r\n\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t*/\r\n\t\t\t\t\t$odt->Ln(20);\r\n\t\t\t\t\t$odt->Writeparagraphe(1, get_string('date_signature','referentiel', date(\"d/m/Y\")));\r\n\t\t\t\t\t$odt->AddPage();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n}", "abstract function has_paid_plan();", "function kato_policy_print_type(){\n\tif(function_exists('the_field')){\n\t\t$type = get_field('type');\n\t\t$field = get_field_object('type');\n\t\t$label = $field['choices'][ $type ];\n\t\tprint '<li class=\"meta-type type-' . $type . '\">';\n\t\tprint $label;\n\t\tprint '</li>';\n\t}\n}", "public function testUpdateVendorComplianceSurvey()\n {\n }", "function create_industries()\r\n{\r\n\tglobal $NCTcontent;\r\n\r\n\t$handle = fopen('derived/institution_type/industry.txt', 'w+'); // binary update mode\r\n\tfwrite($handle, $NCTcontent);\r\n\tfclose($handle);\r\n\r\n}", "function qualificationServ(): string\n{\n $FtPqr = getFtPqr();\n $FtPqrCalificacion = $FtPqr->getLastCalificacion();\n\n return $FtPqrCalificacion ? $FtPqrCalificacion->getFieldValue('experiencia_servicio') : '-';\n}", "public function generateDocblock();", "public function getWarranty()\n {\n return $this->warranty;\n }", "public function testBillingDownloadInvoice()\n {\n }", "function main() {\n global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n $config = $BE_USER->getTSConfig('x4econgress');\n\t\t$this->id = $config['properties']['pidList'];\n\t\t$this->showFields = $config['properties']['showFields'];\n\t\t\n\t\tif(empty($this->showFields)){\n\t\t\t$this->showFields = 'name,firstname,type,address,zip,city,country,email,remarks';\n\t\t}\n\t\t\n // Access check!\n // The page will show only if there is a valid page and if this page may be viewed by the user\n $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n $access = is_array($this->pageinfo) ? 1 : 0;\n\t\t\n if (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id)) {\n\t\t\n // Draw the header.\n $this->doc = t3lib_div::makeInstance(\"bigDoc\");\n $this->doc->backPath = $BACK_PATH;\n //$this->doc->form='<form action=\"\" method=\"POST\">';\n $backUrl = 'http://'.$_SERVER['HTTP_HOST'].'/';\n\t\t\t$backUrl .= 'typo3/mod.php?M=txx4econgressM1_txx4econgressM1';\n\t\t\tif (isset($_POST['x4econgress_congresses'])) {\n\t\t\t\t$backUrl .= '&x4econgress_congresses='.$_POST['x4econgress_congresses'];\n\t\t\t}\n // JavaScript\n $this->doc->JScode = '\n <script language=\"javascript\" type=\"text/javascript\">\n script_ended = 0;\n function jumpToUrl(URL) {\n document.location = URL;\n }\n\t\t\t\t\tfunction jump(url,modName,mainModName)\t{\n\t\t\t\t\t// Clear information about which entry in nav. tree that might have been highlighted.\n\t\t\t\t\ttop.fsMod.navFrameHighlightedID = new Array();\n\t\t\t\t\t\n\t\t\t\t\tif (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav)\t{\n\t\t\t\t\t\ttop.content.nav_frame.refresh_nav();\n\t\t\t\t\t}\n\n\t\t\t\t\ttop.nextLoadModuleUrl = url;\n\t\t\t\t\ttop.goToModule(modName);\n\t\t\t\t\t}\n\t\t\t\t\tvar T3_THIS_LOCATION = top.getModuleUrl(top.TS.PATH_typo3+\"../typo3conf/ext/x4econgress/mod1/index.php?\");\n\t\t\t\t\tT3_THIS_LOCATION = \"'.urlencode($backUrl).'\";\n </script>\n ';\n $this->doc->postCode='\n <script language=\"javascript\" type=\"text/javascript\">\n script_ended = 1;\n if (top.fsMod) top.fsMod.recentIds[\"web\"] = '.intval($this->id).';\n </script>\n ';\n\n $headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br>\".$LANG->sL(\"LLL:EXT:lang/locallang_core.php:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n $this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n $this->content.=$this->doc->header($LANG->getLL(\"title\"));\n $this->content.=$this->doc->divider(5);\n\n // Render content:\n $this->moduleContent();\n\n\n // ShortCut\n if ($BE_USER->mayMakeShortcut()) {\n $this->content.=$this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n }\n\n $this->content.=$this->doc->spacer(10);\n } else {\n // If no access or if ID == zero\n\n $this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n $this->doc->backPath = $BACK_PATH;\n\n $this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n $this->content.=$this->doc->header($LANG->getLL(\"title\"));\n $this->content.=$this->doc->spacer(5);\n $this->content.=$this->doc->spacer(10);\n }\n }", "public function generate_acknowledgement() {\n \n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $usrid = $this->input->post('usr');\n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $usrid);\n\n $tanant = $this->courses_model->get_tenant_details();\n \n //sankar code starts here\n //resetting classroom location parameter id with category name\n $ack_data[classroom_location] = $this->meta_data[$ack_data[classroom_location]];\n $ack_data[cert_level] = $this->meta_data[$ack_data[certi_level]];\n //sankar code ends here\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n $Url = base_url() . 'payments/print_ack';\n\n $date = date('M d Y');\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date('h:i A', strtotime($ack_data[class_start_datetime]));\n \n /* skm code start for remark.\n reporting time skm start bcoz of sam request for AOP(67) on 18-may-17*/\n $time = strtotime($ack_data[class_start_datetime]);\n $reporting_time = date(\"H:i A\", strtotime('-30 minutes', $time));\n if($crsid == 67 || $crsid == 121)\n {\n $li = \"Report at center at $reporting_time to register for class\";\n }else{\n $li = \"Report at center at 8:30 AM to register for class\";\n }\n /* end */\n $tenant_id = TENANT_ID;\n if($tenant_id == 'T12')\n { \n $name = $tanant->contact_name;\n }else{\n\n $name = $gender. $ack_data[crse_manager][first_name] . ' ' . $ack_data[crse_manager][last_name];\n }\n \n $message3 = '\n <ol>\n <li>All participants please bring along their photo ID card with either their Nric/Fin number stated upon class date.</li>\n <li>Your NRIC, work permit or will be photocopied on the class date</li>\n <li>Trim finger nails and remove nail polish</li>\n <li>'.$li.'</li>\n </ol>';\n /* skm end */\n \n echo '<form action=\"' . $Url . '\" method=\"post\"><p> \n <a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n\t\t\t <h2 class=\"panel_heading_style\">Booking Acknowledgment</h2>\t\t\t \n\t\t\n\t\t\t Your seat has been temporarily booked. Please pay the class fees on or before the class start date.\n\t\t\tTemporary booking for <b>' . $ack_data[first_name] . ' ' . $ack_data[last_name] . ' </b> for <b> Course:\"' . $ack_data[crse_name] . ',Class:' . $ack_data[class_name] . ',Certificate Code:' . $ack_data[cert_level] . ' </b>\".</i><br>\n\t\t\t </br><strong>Class start date:</strong> ' . $startdate . '<br>\n\t\t\t </br><strong>Location:</strong> ' . $ack_data[classroom_location] . '<br>\n\t\t\t</br><strong>Contact Details:</strong> ' . $name . ',(Phone: ' . $tanant->tenant_contact_num . ',Email Id: ' . $tanant->tenant_email_id . ')\n </br><strong>Remark:</strong> ' . $message3 . '<br>\n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/>\n <input type=\"hidden\" value=\"' . $usrid . '\" name=\"userId\"/> \n <input type=\"hidden\" value=\"' . $ack_data . '\" name=\"ackdata\"/>\n <div style=\"clear:both;\"></div><br>\t\t\t \n\t\t\t <span style=\"float:right;\">\n\t\t\t<button class=\"btn btn-primary\" type=\"submit\">Print</button>\n\t\t\t </p></form> ';\n }", "public function createClaim()\n {\n // $claims = auth()->user()->policies;\n return view('client.create_claims');\n }", "function dprv_entitlements($dprv_subscription_type, &$dprv_max_file_count, &$dprv_back_digiprove_allowance)\r\n {\r\n \t // Declare and initialise subscription plan permissions:\r\n\t $dprv_daily_limits = array (5,20,100,500,-1); // Maximum Digiproves per day (-1 = unlimited)\r\n $dprv_max_file_counts = array (0,10,40,100,999); // Maximum number of media files in a post\r\n $dprv_back_digiprove_allowances = array(20,100,-1,-1,-1); // Maximum number of back-Digiproves (batch Digiproving of older posts)\r\n\r\n $dprv_today_limit = $dprv_daily_limits[0];\r\n\t $dprv_max_file_count = $dprv_max_file_counts[0];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[0];\r\n\t switch ($dprv_subscription_type)\r\n\t {\r\n\t\t case \"Personal\":\r\n\t\t {\r\n\t\t\t //$dprv_today_limit = 20;\r\n\t\t\t //$dprv_max_file_count = 10;\r\n //$dprv_back_digiprove_allowance = 100;\r\n \t $dprv_today_limit = $dprv_daily_limits[1];\r\n\t\t\t $dprv_max_file_count = $dprv_max_file_counts[1];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[1];\r\n\t\t\t break;\r\n\t\t }\r\n\t\t case \"Professional\":\r\n\t\t {\r\n\t\t\t //$dprv_today_limit = 100;\r\n\t\t\t //$dprv_max_file_count = 40;\r\n //$dprv_back_digiprove_allowance = -1; // Unlimited\r\n \t $dprv_today_limit = $dprv_daily_limits[2];\r\n\t\t\t $dprv_max_file_count = $dprv_max_file_counts[2];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[2];\r\n\t\t\t break;\r\n\t\t }\r\n\t\t case \"Corporate Light\":\r\n\t\t {\r\n\t\t\t //$dprv_today_limit = 500;\r\n\t\t\t //$dprv_max_file_count = 100;\r\n //$dprv_back_digiprove_allowance = -1; // Unlimited\r\n \t $dprv_today_limit = $dprv_daily_limits[3];\r\n\t\t\t $dprv_max_file_count = $dprv_max_file_counts[3];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[3];\r\n\t\t\t break;\r\n\t\t }\r\n\t\t case \"Corporate\":\r\n\t\t {\r\n\t\t\t //$dprv_today_limit = -1;\r\n\t\t\t //$dprv_max_file_count = 999;\r\n //$dprv_back_digiprove_allowance = -1; // Unlimited\r\n \t $dprv_today_limit = $dprv_daily_limits[4];\r\n\t\t\t $dprv_max_file_count = $dprv_max_file_counts[4];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[4];\r\n\t\t\t break;\r\n\t\t }\r\n\t\t default:\r\n\t\t {\r\n\t\t\t break;\r\n\t\t }\r\n\t }\r\n\t return $dprv_today_limit;\r\n }", "function dietaryShouldBeChecked($restriction) {\n\tif(isset($_SESSION['step2Complete']) && $_SESSION['step2Complete'] == true && isset($_SESSION['dietaryRestrictions']) && in_array($restriction, $_SESSION['dietaryRestrictions'])) {\n\t\treturn \"checked\";\n\t} else {\n\t\treturn \"\";\n\t}\n}", "public function addclaimstatus(){\n $response = $this->insertInToTable(CLAIM_STATUS, array(array('claim_status_name'=>$this->getData['addnewclaimstatus'], 'created_by'=>$this->Useconfig['user_id'], 'created_ip'=>commonfunction::loggedinIP())));\n return $response;\n }", "function _civicrm_api3_configexport_create_spec(array &$spec) {\n $spec['entity_type']['api.required'] = 1;\n $spec['entity_id']['api.required'] = 1;\n}", "function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}", "function weldata_theme_preprocess_print (&$variables) { \n \n $node = $variables['node'];\n $entity_wrapper = entity_metadata_wrapper('node', $node);\n \n if($node->type == 'wps' || $node->type == 'pqr' ){\n\n $variables['qualified_to'] = $entity_wrapper->field_qualified_to->value();\n $variables['date'] = format_date($entity_wrapper->field_date->value(), $type = 'wps_pqr');\n $variables['company_name'] = $entity_wrapper->field_company_name->value();\n $variables['revision_number'] = $entity_wrapper->log->value();\n $variables['welding_process'] = implode(', ', $entity_wrapper->field_welding_process->value());\n $variables['Type'] = implode(', ', $entity_wrapper->field_welding_type->value());\n\n // Reference Documents\n $variables['reference_documents'] = implode(\", \", $entity_wrapper->field_reference_documents->field_reference_documents_name->value());\n\n // Joint Design\n $joint_design = $entity_wrapper->field_joint_design_qw_402->value(); // Field Collection\n $variables['joint_design_name'] = $joint_design->field_joint_design_name[LANGUAGE_NONE][0]['value'];\n $variables['joint_root_spacing'] = $joint_design->field_root_spacing[LANGUAGE_NONE][0]['value'];\n $variables['joint_backing'] = $joint_design->field_backing[LANGUAGE_NONE][0]['value'];\n $variables['backing_material'] = $joint_design->field_backing_material[LANGUAGE_NONE][0]['value'];\n $variables['retainers'] = $joint_design->field_retainers[LANGUAGE_NONE][0]['value'];\n $variables['joint_other'] = $joint_design->field_other_joint_design[LANGUAGE_NONE][0]['value'];\n\n // Base Metals\n //Base Metal Library\n $base_material_library = $entity_wrapper->field_base_material_library->value(); // Entity Reference\n $variables['metal1_p_number'] = $base_material_library[0]->field_bml_p[LANGUAGE_NONE][0]['value'];\n $variables['metal1_group_number'] = $base_material_library[0]->field_bml_g[LANGUAGE_NONE][0]['value'];\n $variables['metal1_specification'] = $base_material_library[0]->title;\n $variables['metal1_grade'] = $base_material_library[0]->field_bml_grade[LANGUAGE_NONE][0]['value'];\n $variables['metal1_uns'] = $base_material_library[0]->field_bml_uns[LANGUAGE_NONE][0]['value'];\n\n $variables['welded_to_p_number'] = $base_material_library[1]->field_bml_p[LANGUAGE_NONE][0]['value'];\n $variables['welded_to_group_number'] = $base_material_library[1]->field_bml_g[LANGUAGE_NONE][0]['value'];\n $variables['welded_to_specification'] = $base_material_library[1]->title;\n $variables['welded_to_grade'] = $base_material_library[1]->field_bml_grade[LANGUAGE_NONE][0]['value'];\n $variables['welded_to_uns'] = $base_material_library[1]->field_bml_uns[LANGUAGE_NONE][0]['value'];\n\n //Base Metal Details\n\n $variables['base_maximum_pass_thickness'] = $entity_wrapper->field_wps_maximum_pass_thickness->value();\n $variables['base_metal_other'] = $entity_wrapper->field_wps_base_metal_other->value();\n\n //Thickness Range Qualified\n $pwht_minimum = weldata_get_array_value($node, 'field_wps_pwht_minimum'); \n $pwht_maximum = weldata_get_array_value($node, 'field_wps_pwht_maximum');\n\n $variables['complet_penetration_minimum'] = $pwht_minimum[0];\n $variables['partial_penetration_minimum'] = $pwht_minimum[1];\n $variables['impact_tested_minimum'] = $pwht_minimum[2];\n $variables['fillet_welds_minimum'] = $pwht_minimum[3];\n $variables['complet_penetration_maximum'] = $pwht_maximum[0];\n $variables['partial_penetration_maximum'] = $pwht_maximum[1];\n $variables['impact_tested_maximum'] = $pwht_maximum[2];\n $variables['fillet_welds_maximum'] = $pwht_maximum[3];\n\n $variables['diameter_type'] = $entity_wrapper->field_wps_diameter_type->value();\n $variables['diameter_minimum'] = $entity_wrapper->field_wps_minimum_diameter->value();\n $variables['diameter_maximum'] = $entity_wrapper->field_wps_maximum_diameter->value();\n\n /* Welding Processes */\n $gtaw = $entity_wrapper->field_gtaw->value(); // Getting Field Collection Entity\n\n // Filler Metal\n // Filler Metal Library\n $variables['filler1_classification'] = $gtaw->field_filler_metal_library[LANGUAGE_NONE][0]['entity']->title;\n $variables['filler1_sfa'] = $gtaw->field_filler_metal_library[LANGUAGE_NONE][0]['entity']->field_fml_specification[LANGUAGE_NONE][0]['value'];\n $variables['filler1_f_number'] = $gtaw->field_filler_metal_library[LANGUAGE_NONE][0]['entity']->field_fml_f_number[LANGUAGE_NONE][0]['value'];\n $variables['filler1_a_number'] = $gtaw->field_filler_metal_library[LANGUAGE_NONE][0]['entity']->field_fml_a_number[LANGUAGE_NONE][0]['value'];\n // Filler Metal Details\n $variables['filler1_size'] = $gtaw->field_filler_metal_size[LANGUAGE_NONE][0]['value'];\n $variables['filler1_chemical_analysis_or_trade_name'] = $gtaw->field_chemical_analysis[LANGUAGE_NONE][0]['value'];\n $variables['filler1_product_form_type'] = $gtaw->field_product_form_type[LANGUAGE_NONE][0]['value'];\n $variables['filler1_minimum'] = $gtaw->field_thickness_range_min[LANGUAGE_NONE][0]['value'];\n $variables['filler_maximum'] = $gtaw->field_thickness_range_max[LANGUAGE_NONE][0]['value'];\n // Consumeable Insert Details\n $variables['consumable_insert_classification'] = $gtaw->field_gtaw_consumable_insert[LANGUAGE_NONE][0]['entity']->title;\n $variables['consumable_insert_sfa'] = $gtaw->field_gtaw_consumable_insert[LANGUAGE_NONE][0]['entity']->field_fml_specification[LANGUAGE_NONE][0]['value'];\n $variables['consumable_insert_f_number'] = $gtaw->field_gtaw_consumable_insert[LANGUAGE_NONE][0]['entity']->field_fml_f_number[LANGUAGE_NONE][0]['value'];\n $variables['consumable_insert_a_number'] = $gtaw->field_gtaw_consumable_insert[LANGUAGE_NONE][0]['entity']->field_fml_a_number[LANGUAGE_NONE][0]['value'];\n $variables['consumable_insert_size'] = $gtaw->field_consumable_insert_size[LANGUAGE_NONE][0]['value'];\n\n // Position (QW-405)\n $variables['position_of_groove'] = $gtaw->field_position_of_groove[LANGUAGE_NONE][0]['value']; \n $variables['welding_progression'] = $gtaw->field_weld_progression[LANGUAGE_NONE][0]['value']; \n $variables['position_fillet'] = $gtaw->field_position_of_fillet[LANGUAGE_NONE][0]['value']; \n $variables['position_other'] = $gtaw->field_other_position[LANGUAGE_NONE][0]['value']; \n\n // Preheat (QW-406)\n $variables['preheat_temp'] = $gtaw->field_preheat_temperature[LANGUAGE_NONE][0]['value']; \n $variables['interpass_temp'] = $gtaw->field_interpass_temperature[LANGUAGE_NONE][0]['value']; \n $variables['preheat_maintenance'] = $gtaw->field_preheat_maintenance[LANGUAGE_NONE][0]['value']; \n $variables['preheat_other'] = $gtaw->field_other_preheat[LANGUAGE_NONE][0]['value'];\n\n // PWHT (QW-407)\n $pwht = $entity_wrapper->field_pwht->value();\n $variables['pwht_temp_range'] = $pwht->field_temperature_range[LANGUAGE_NONE][0]['value']; \n $variables['pwht_time_range'] = $pwht->field_time_range[LANGUAGE_NONE][0]['value']; \n $variables['pwht_heating_rate'] = $pwht->field_heating_rate[LANGUAGE_NONE][0]['value']; \n $variables['pwht_heating_type'] = $pwht->field_heating_method[LANGUAGE_NONE][0]['value'];\n $variables['pwht_cooling_rate'] = $pwht->field_cooling_rate[LANGUAGE_NONE][0]['value']; \n $variables['pwht_cooling_type'] = $pwht->field_cooling_method[LANGUAGE_NONE][0]['value'];\n $variables['pwht_other'] = $pwht->field_other_pwht[LANGUAGE_NONE][0]['value'];\n\n // Gas (QW-408)\n $variables['shieldgas_mixture'] = $gtaw->field_gas_mixture[LANGUAGE_NONE][0]['value']; \n $variables['trailinggas_mixture'] = $gtaw->field_gas_mixture[LANGUAGE_NONE][1]['value'];\n $variables['backinggas_mixture'] = $gtaw->field_gas_mixture[LANGUAGE_NONE][2]['value'];\n $variables['gas_other_mixture'] = $gtaw->field_gas_mixture[LANGUAGE_NONE][3]['value']; \n $variables['shieldgas_flow_rate'] = $gtaw->field_gas_flow_rate[LANGUAGE_NONE][0]['value']; \n $variables['trailinggas_flow_rate'] = $gtaw->field_gas_flow_rate[LANGUAGE_NONE][1]['value']; \n $variables['backinggas_flow_rate'] = $gtaw->field_gas_flow_rate[LANGUAGE_NONE][2]['value'];\n $variables['gas_other_flow_rate'] = $gtaw->field_gas_flow_rate[LANGUAGE_NONE][3]['value']; \n\n // Electrical (QW-409)\n $variables['current_polarity'] = $gtaw->field_polarity[LANGUAGE_NONE][0]['value']; \n $variables['ampere_range'] = $gtaw->field_ampere_range[LANGUAGE_NONE][0]['value']; \n $variables['voltage_range'] = $gtaw->field_voltage_range[LANGUAGE_NONE][0]['value']; \n $variables['pulsing_current'] = $gtaw->field_dc_pulsing_current[LANGUAGE_NONE][0]['value']; \n $variables['travel_speed'] = $gtaw->field_travel_speed[LANGUAGE_NONE][0]['value']; \n $variables['heat_input_max'] = $gtaw->field_maximum_heat_input[LANGUAGE_NONE][0]['value']; \n $variables['tungsten_size'] = $gtaw->field_tungsten_size[LANGUAGE_NONE][0]['value']; \n $variables['tungsten_type'] = $gtaw->field_tungsten_type[LANGUAGE_NONE][0]['value']; \n $variables['wire_feed_type'] = $gtaw->field_wire_feed_type[LANGUAGE_NONE][0]['value']; \n $variables['wire_feed_speed'] = $gtaw->field_gtaw_wire_feed_speed[LANGUAGE_NONE][0]['value']; \n $variables['electrical_other'] = $gtaw->field_other_electrical[LANGUAGE_NONE][0]['value'];\n\n // Technique (QW-410)\n $variables['string_weave'] = $gtaw->field_string_or_weave[LANGUAGE_NONE][0]['value']; \n $variables['orifice_gas_cup_size'] = $gtaw->field_orifice_gas_cup_size[LANGUAGE_NONE][0]['value']; \n $variables['multi_single_pass'] = $gtaw->field_multi_single_pass[LANGUAGE_NONE][0]['value']; \n $variables['multi_single_electrode'] = $gtaw->field_multiple_single_electrode[LANGUAGE_NONE][0]['value']; \n $variables['oscillation'] = $gtaw->field_oscillation[LANGUAGE_NONE][0]['value']; \n\n // Common Techniques\n $technique = $entity_wrapper->field_technique_qw_4010->value(); \n $variables['initial_interpass_cleaning'] = $technique->field_initial_interpass_cleaning[LANGUAGE_NONE][0]['value']; \n $variables['methode_back_gouging'] = $technique->field_back_gouging_method[LANGUAGE_NONE][0]['value']; \n $variables['peening'] = $technique->field_peening[LANGUAGE_NONE][0]['value']; \n $variables['surface_cleaning'] = $technique->field_surface_preparation[LANGUAGE_NONE][0]['value']; \n $variables['maximum_pass_thickness'] = $gtaw->field_maximum_pass_thickness[LANGUAGE_NONE][0]['value']; \n $variables['technique_other'] = $gtaw->field_other_technique[LANGUAGE_NONE][0]['value'];\n \n // Welding Procedure\n $welding_procedure = $entity_wrapper->field_wps->value();\n $variables['weld_layers_array'] = $welding_procedure->field_wp_weld_layer[LANGUAGE_NONE];\n $variables['welding_process_array'] = $welding_procedure->field_wp_welding_process[LANGUAGE_NONE];\n $variables['filler_metal_size_array'] = $welding_procedure->field_wp_filler_size[LANGUAGE_NONE];\n $variables['filler_metal_aws_class_array'] = $welding_procedure->field_wp_filler_class[LANGUAGE_NONE];\n $variables['gas_type_array'] = $welding_procedure->field_wp_gas_type[LANGUAGE_NONE];\n $variables['gas_flow_rate_array'] = $welding_procedure->field_wp_gas_flow_rate[LANGUAGE_NONE];\n $variables['polarity_array'] = $welding_procedure->field_wp_polarity[LANGUAGE_NONE];\n $variables['amps_range_array'] = $welding_procedure->field_wp_ampere_range[LANGUAGE_NONE];\n $variables['volts_range_array'] = $welding_procedure->field_wp_volts_range[LANGUAGE_NONE];\n $variables['travel_speed_array'] = $welding_procedure->field_wp_travel_speed[LANGUAGE_NONE];\n $variables['max_bead_width_array'] = $welding_procedure->field_wp_maximum_bead_width[LANGUAGE_NONE];\n\n // Certification Details\n // Names\n $certification_detials = weldata_get_array_value($node, 'field_certification_details');\n $certification_date = weldata_get_array_value($node, 'field_certification_date');\n\n $variables['prepared_by_name'] = $certification_detials[0];\n $variables['reviewed_by_name'] = $certification_detials[1];\n $variables['approved_by_name'] = $certification_detials[2];\n $variables['prepared_by_date'] = format_date($certification_date[0], $type = 'wps_pqr');\n $variables['reviewed_by_date'] = format_date($certification_date[1], $type = 'wps_pqr');\n $variables['approved_by_date'] = format_date($certification_date[2], $type = 'wps_pqr');\n\n $variables['note'] = $entity_wrapper->field_notes->value();\n\n \n //$variables['other_pwht'] = field_view_field('node', $node, 'field_other_pwht',$display);\n }\n\n /*----------------------WPS--------------------------*/\n\n if($node->type == 'wps'){\n $variables['wps_number'] = $node->title;\n\n $variables['joint'] = implode(\", \", $entity_wrapper->field_wps_scope->value());\n $variables['scope'] = $entity_wrapper->field_wps_scope_notes->value();\n\n $images = $entity_wrapper->field_joint_design_qw_402->field_wps_joint_design_image->value();\n //Images\n $variables['joint_image1'] = file_create_url($images[0]->field_joint_design[LANGUAGE_NONE][0]['uri']);\n $variables['joint_image2'] = file_create_url($images[1]->field_joint_design[LANGUAGE_NONE][0]['uri']);\n $variables['joint_image3'] = file_create_url($images[2]->field_joint_design[LANGUAGE_NONE][0]['uri']);\n $variables['joint_image4'] = file_create_url($images[3]->field_joint_design[LANGUAGE_NONE][0]['uri']);\n $variables['joint_image5'] = file_create_url($images[4]->field_joint_design[LANGUAGE_NONE][0]['uri']);\n $variables['joint_image6'] = file_create_url($images[5]->field_joint_design[LANGUAGE_NONE][0]['uri']);\n }\n\n/*---------------------- PQR --------------------------*/\n if($node->type == 'pqr') { \n $variables['pqr_number'] = $node->title; \n $variables['pqr_revision_number'] = $node->title;\n\n\n }\n\n\n}", "function add_actualisation()\n\t{\n\t\t$name=post_param('name');\n\t\t$subject=post_param('subject');\n\t\t$text=post_param('text');\n\t\t$send_time=post_param_integer('send_time');\n\t\tif (get_value('welcome_nw_choice')==='1')\n\t\t{\n\t\t\t$newsletter=post_param_integer('newsletter',NULL);\n\t\t} else\n\t\t{\n\t\t\t$newsletter=post_param_integer('newsletter',0);\n\t\t}\n\t\t$id=ocf_make_welcome_email($name,$subject,$text,$send_time,$newsletter);\n\t\treturn strval($id);\n\t}", "public function gen_inv_pdf_basedon_forgeigner($invoice_id, $is_subsidy) {\n //$this->output->enable_profiler();\n $tenant_id = $this->tenant_id;\n \n if (empty($invoice_id)) {\n return show_404();\n }\n if (empty($is_subsidy)) {\n $res = $this->classtraineemodel->get_company_invoice_foreigner($invoice_id);\n $text = 'f';\n } \n \n $result = $res[0];\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($invoice_id);\n //\n $result->invoice_label = $text;\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n }\n //$result->discount_rate = round($result->discount_rate, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n $total_unitfees = 0;\n $total_discount = 0;\n $total_gst = 0;\n $total_subsidy = 0;\n $total_inv_amount = 0;\n// $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $company_received = $this->classtraineemodel->company_payment_recd_forgeiner($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n// $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $company_refunded = $this->classtraineemodel->company_payment_refund_foreigner($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach ($res as $k => $row) \n {\n $received = empty($user_paid[$row->user_id]) ? 0 : $user_paid[$row->user_id];\n $refunded = empty($user_refund[$row->user_id]) ? 0 : $user_refund[$row->user_id];\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($row->total_amount_due + $refunded) - $received) <= 0){\n $payment_label = 'PAID';\n }\n else{ \n if($refunded > 0){\n $payment_label = 'REFUNDED'; \n } else{ \n if($received == 0){\n $payment_label = 'NOT PAID';\n }else if($received > 0){\n $payment_label = 'PART PAID';\n }\n }\n }\n \n $res[$k]->payment_label = $payment_label;\n $total_unitfees +=$row->class_fees;\n $total_discount += ($row->class_fees * ($result->discount_rate / 100));\n $total_gst += $row->gst_amount;\n $total_subsidy += $row->subsidy_amount;\n $total_inv_amount += $row->total_amount_due;\n $result->total_inv_amount1 = $row->total_inv_amount;\n \n }\n $result->payble_amount=$total_inv_amount+$refunded_amt-$received_amt;\n $result->total_unit_fees = round($total_unitfees, 2);\n $result->total_inv_discnt = round($total_discount, 2);\n $result->total_inv_subsdy = round($total_subsidy, 2);\n $result->total_gst = round($total_gst, 2);\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n $result->total_inv_amount = round($total_inv_amount, 2);\n \n $result->payment_due_details = $res;\n\n $this->load->helper('pdf_reports_helper');\n generate_company_pdf_invoice($result);\n }", "protected function getType()\n {\n return 'contribution type';\n }", "public function billing_status($type){\n\t\tif($type == 'A' || $type == 'A,A'){\n\t\t\t$st = 'Approved';\n\t\t}else if($type == 'W' || $type == 'W,W' || $type == 'A,W'){\t\n\t \t\t$st = 'Pending';\n\t\t}else if($type == 'R' || $type == 'A,R'){\t\n\t \t\t$st = 'Rejected';\n\t\t}\n\t\treturn $st;\n\t}", "function getOrDefineStuff(){\n // $co->setPackageObject(Package::getByHandle($this->pkgHandle));\n // $co->getOrDefine('SCOTTC_COMMERCE_CART_ABANDONED_PER_PAGE', 20);\n // $co->getOrDefine('SCOTTC_AFFILIATE_IGNORE_SUPER_USER', 0);\n // $co->getOrDefine('SCOTTC_AFFILIATES_TIMESTAMP_FORMAT', 'm/d/Y H:i:sa');\n // $co->getOrDefine('SCOTTC_AFFILIATES_GET_VAR_PREFIX', 'qAf');\n // $co->getOrDefine('SCOTTC_AFFILIATE_COOKIE_DAYS',14);\n // $co->getOrDefine('SCOTTC_AFFILIATE_USE_COOKIES',1);\n // $co->getOrDefine('SCOTTC_AFFILIATE_LOG_EARNINGS',1);\n // define('SCOTTECOMAFFILATESPACKAGEHANDLE',$this->getPackageHandle());\n }", "function cfc_edd_before_purchase_form() { ?>\n\n\n\n<?php echo edd_get_price_name() ?>\n\n\t<p><?php _e('Thank you for wanting to donate to CFCommunity! Before you continue please check the amount you would like to donate.', 'cfctranslation'); ?>\t</p>\n\n<?php }", "public function createInvoice()\r\n {\r\n }", "protected function getBoilerplate()\n {\n return '# Project Licenses\nThis file was generated by the [PHP Legal Licenses](https://github.com/Comcast/php-legal-licenses) utility. It contains the name, version and commit sha, description, homepage, and license information for every dependency in this project.\n\n## Dependencies\n\n';\n }", "function head() {\n global $_lib;\n\n $query = \"select max(RemittanceDaySequence) from invoicein where RemittanceSendtDateTime='\" . $_lib['sess']->get_session('Date') . \"' and Active=1\";\n #print \"Finn h¿yeste dag sekvens: $query\";\n $daysequence = $_lib['storage']->get_row(array('query' => $query));\n\n $query = \"select max(RemittanceSequence) from invoicein where Active=1\";\n #print \"Finn h¿yeste sekvens: $query\";\n $sequence = $_lib['storage']->get_row(array('query' => $query));\n \n #print \"<h2>Her kommer remitteringsfila p&aring; TelePay 2.0.1 formatet</h2>\";\n $transaction = new stdClass();\n $this->transaction->RemittanceSequence = $daysequence->RemittanceSequence + 1; #MŒ kalkuleres og settes\n $this->transaction->RemittanceDaySequence = $daysequence->RemittanceDaySequence; #MŒ kalkuleres og settes\n\n #$this->transaction->BatchID = 99; #MŒ kalkuleres og settes\n $this->transaction->Date = $_lib['sess']->get_session('Date');\n $this->transaction->Datetime = $_lib['sess']->get_session('Datetime');\n $this->transaction->VersionSoftware = '00001.00 LODO';\n \n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $this->transaction->CustomerOrgNumber = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber'))); \n $this->transaction->CustomerName = $_lib['sess']->get_companydef('CompanyName');\n $this->transaction->Database = $_SETUP['DB_NAME']['0'];\n \n $this->transaction->NumTransactions = 0;\n $this->transaction->TotalAmount = 0;\n $this->transaction->NumRecords = 0; \n\n if(!$InvoiceO->CustomerBankAccount) { #Sjekke lengde og modulus pŒ kontonummer ogsŒ\n $_lib['message']->Add(\"Betalerkonto mangler\");\n return;\n }\n if(!$this->transaction->CustomerOrgNumber) {\n $_lib['message']->Add(\"Orgnummer/personnummer mangler p&aring; betaler\");\n return;\n }\n }", "public function show(LicenseOfficer $licenceOfficer)\n {\n //\n }", "public function definition()\n {\n $types = ['price', 'percentage'];\n $type = $types[$this->faker->numberBetween(0, 1)];\n\n if ($type == 'price') {\n $value = $this->faker->numberBetween(1000, 4000);\n } else {\n $value = $this->faker->numberBetween(5, 20);\n }\n\n return [\n 'invoice_id' => Invoice::all()->random()->id,\n 'description' => $this->faker->sentence(3),\n 'value' => $value,\n 'type' => $type,\n 'rank' => $this->faker->numberBetween(1, 100),\n ];\n }", "function csc_related_organizations_info($subtype, $conf, $contexts) {\n if (!empty($conf)) {\n $block = new stdClass;\n $block->title = 'Related Organizational Units';\n $block->content = 'CSC Related Organizations widget';\n return $block;\n }\n}", "public function getDocumentSignatureType()\n {\n return DocumentSignature::TYPE_AUTO_INVEST_CONTRIBUTION;\n }", "function write_customer_trans($trans_type, $trans_no, $debtor_no, $BranchNo,\n $date_, $reference, $Total, $discount = 0, $Tax = 0, $Freight = 0, $FreightTax = 0,\n $sales_type = 0, $order_no = 0, $ship_via = 0, $due_date = \"\",\n $AllocAmt = 0, $rate = 0, $dimension_id = 0, $dimension2_id = 0,\n $payment_terms = null, $tax_included = 0, $prep_amount = 0,$inv_trans_total=0,$is_paper_edit=false)\n{\n\n $display_customer = $_SESSION['Items']->display_customer;\n $customer_trn = $_SESSION['Items']->customer_trn;\n $customer_mobile = $_SESSION['Items']->customer_mobile;\n $customer_email = $_SESSION['Items']->customer_email;\n $customer_ref = $_SESSION['Items']->customer_ref;\n $barcode = $_SESSION['Items']->barcode;\n\n $credit_card_charge = $_SESSION['credit_card_charge'];\n $payment_method = $_SESSION['payment_method'];\n unset($_SESSION['credit_card_charge']);\n unset($_SESSION['payment_method']);\n\n $created_by = $_SESSION['wa_current_user']->user;\n\n $new = $trans_no == 0;\n $curr = get_customer_currency($debtor_no);\n if ($rate == 0)\n $rate = get_exchange_rate_from_home_currency($curr, $date_);\n\n $SQLDate = date2sql($date_);\n if ($due_date == \"\")\n $SQLDueDate = \"0000-00-00\";\n else\n $SQLDueDate = date2sql($due_date);\n\n if ($trans_type == ST_BANKPAYMENT)\n $Total = -$Total;\n\n if ($new || !exists_customer_trans($trans_type, $trans_no)) {\n if ($new) {\n $trans_no = get_next_trans_no($trans_type);\n\n if($trans_type == 10 && !$is_paper_edit) {\n $reference = get_next_invoice_ref($dimension_id);\n $_SESSION['Items']->reference = $reference;\n }\n\n }\n\n $sql = \"INSERT INTO \" . TB_PREF . \"debtor_trans (\n\t\ttrans_no, type,\n\t\tdebtor_no, branch_code,\n\t\ttran_date, due_date,\n\t\treference, tpe,\n\t\torder_, ov_amount, ov_discount,\n\t\tov_gst, ov_freight, ov_freight_tax,\n\t\trate, ship_via, alloc,\n\t\tdimension_id, dimension2_id, payment_terms, tax_included, prep_amount,\n\t\tdisplay_customer,customer_trn,customer_mobile,customer_email,customer_ref,barcode,\n\t\tcredit_card_charge,payment_method,inv_total,created_by \n\t\t) VALUES (\" . db_escape($trans_no) . \", \" . db_escape($trans_type) . \",\n\t\t\" . db_escape($debtor_no) . \", \" . db_escape($BranchNo) . \",\n\t\t'$SQLDate', '$SQLDueDate', \" . db_escape($reference) . \",\n\t\t\" . db_escape($sales_type) . \", \" . db_escape($order_no) . \", $Total, \" . db_escape($discount) . \", $Tax,\n\t\t\" . db_escape($Freight) . \",\n\t\t$FreightTax, $rate, \" . db_escape($ship_via) . \", $AllocAmt,\n\t\t\" . db_escape($dimension_id) . \", \" . db_escape($dimension2_id) . \", \n\t\t\" . db_escape($payment_terms, true) . \", \n\t\t\" . db_escape($tax_included) . \", \n\t\t\" . db_escape($prep_amount) . \",\n\t\t\" . db_escape($display_customer) . \",\n\t\t\" . db_escape($customer_trn) . \",\n\t\t\" . db_escape($customer_mobile) . \",\n\t\t\" . db_escape($customer_email) . \",\n\t\t\" . db_escape($customer_ref) . \",\n\t\t\" . db_escape($barcode) . \",\n\t\t\" . db_escape($credit_card_charge) . \",\n\t\t\" . db_escape($payment_method) . \",\n\t\t$inv_trans_total,$created_by)\";\n } else { // may be optional argument should stay unchanged ?\n $sql = \"UPDATE \" . TB_PREF . \"debtor_trans SET\n\t\tdebtor_no=\" . db_escape($debtor_no) . \" , branch_code=\" . db_escape($BranchNo) . \",\n\t\ttran_date='$SQLDate', due_date='$SQLDueDate',\n\t\treference=\" . db_escape($reference) . \", tpe=\" . db_escape($sales_type) . \", order_=\" . db_escape($order_no) . \",\n\t\tov_amount=$Total, \n\t\tinv_total=$inv_trans_total, \n\t\tov_discount=\" . db_escape($discount) . \", ov_gst=$Tax,\n\t\tov_freight=\" . db_escape($Freight) . \", ov_freight_tax=$FreightTax, rate=$rate,\n\t\tship_via=\" . db_escape($ship_via) . \", alloc=$AllocAmt,\n\t\t\n\t\tdimension2_id=\" . db_escape($dimension2_id) . \",\n\t\tpayment_terms=\" . db_escape($payment_terms, true) . \",\n\t\ttax_included=\" . db_escape($tax_included) . \",\n\t\tprep_amount =\" . db_escape($prep_amount) . \",\n\t\tdisplay_customer =\" . db_escape($display_customer) . \",\n\t\tcustomer_trn =\" . db_escape($customer_trn) . \",\n\t\tcustomer_mobile =\" . db_escape($customer_mobile) . \",\n\t\tcustomer_email =\" . db_escape($customer_email) . \",\n\t\tcustomer_ref =\" . db_escape($customer_ref) . \" \n\t\tWHERE trans_no=\" . db_escape($trans_no) . \" AND type=\" . db_escape($trans_type);\n }\n db_query($sql, \"The debtor transaction record could not be inserted\");\n\n\n// display_error(print_r($display_customer ,true));\n\n\n if ($trans_type != ST_JOURNAL) // skip for journal entries\n add_audit_trail($trans_type, $trans_no, $date_, $new ? '' : trans(\"Updated.\"));\n\n return $trans_no;\n}", "function getAutoPolicyType($id)\n\t{\n\t\t$type=mysql_fetch_assoc(mysql_query(\"select coverage_type from \".AUTOPOLICY.\" where id=\".$id));\n\t\tif($type['coverage_type']=='tpl')\n\t\t\t$type='tpl';\n\t\tif($type['coverage_type']=='comp')\n\t\t\t$type='comprehensive';\n\t\treturn $type;\n\t}", "function receipt($param=0,$type='invoice')\n {\n $campaign = $this->Campaign_model->get_by_id($param)->row();\n \n $data['title'] = $this->properti['name'].' | Invoice '.ucwords($this->modul['title']).' | CMP-0'.$campaign->id;\n \n if ($campaign){\n \n // property\n $data['p_name'] = $this->properti['sitename'];\n $data['p_address'] = $this->properti['address'];\n $data['p_city'] = $this->properti['city'];\n $data['p_zip'] = $this->properti['zip'];\n $data['p_phone'] = $this->properti['phone1'];\n $data['p_email'] = $this->properti['email'];\n $data['p_logo'] = $this->properti['logo'];\n\n // campaign details\n $data['from'] = $campaign->email_from;\n $data['to'] = $campaign->email_to;\n $data['type'] = $campaign->type;\n $data['category'] = $campaign->category;\n $data['subject'] = $campaign->subject;\n $data['content'] = $campaign->content;\n $data['dates'] = tglin($campaign->dates).' - '. timein($campaign->dates);\n\n $this->load->view('campaign_invoice', $data);\n }\n }", "public function export_company_generate_invoice($id) \n {\n $tenant_id = $this->tenant_id;\n \n if (empty($id)) \n {\n return show_404();\n }\n// $result = $this->classtraineemodel->get_enroll_invoice($id);\n \n $result = $this->classtraineemodel->get_company_enroll_invoice($id);\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($result->invoice_id);\n \n //sk st\n $discount = $this->classtraineemodel->get_discount($result->pymnt_due_id);\n $result->discount_label = $discount->discount_type;\n $result->discount_rate = $discount->discount_rate;\n //sk ed\n \n //\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//skm1\n $result->company_person_name = $company_person[0]->first_name;//skm2\n \n }\n\n $result->total_inv_discnt = round($result->total_inv_discnt, 2);\n $result->total_unit_fees = round($result->total_unit_fees, 2);\n $result->total_inv_subsdy = round($result->total_inv_subsdy, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n\n $feesdue = $result->total_unit_fees - $result->total_inv_discnt;\n $result->payment_due_details = $this->classtraineemodel->get_company_payment_due_details($id);\n \n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach($result->payment_due_details as $key=>$val)\n {\n $received = empty($user_paid[$val->user_id]) ? 0 : $user_paid[$val->user_id];\n $refunded = empty($user_refund[$val->user_id]) ? 0 : $user_refund[$val->user_id];\n $inv_amt+=$val->total_amount_due;\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($val->total_amount_due + $refunded) - $received) <= 0)\n {\n $payment_label = 'PAID';\n }\n else\n { \n \n if($received > 0 && $val->payment_status == 'PARTPAID')\n {\n $payment_label = 'PART PAID';\n \n }else if($refunded > 0)\n { \n $payment_label = 'REFUNDED'; \n } \n else\n { \n if($received == 0)\n {\n $payment_label = 'NOT PAID';\n }\n else if($received > 0)\n {\n $payment_label = 'PART PAID';\n }\n }\n }\n $result->payment_due_details[$key]->payment_label = $payment_label;\n }\n \n $payable_amount=$inv_amt-$received_amt; \n $result->payble_amount=$inv_amt+$refunded_amt-$received_amt;\n\n $this->load->helper('pdf_reports_helper');\n if($tenant_id =='T17'){\n generate_company_pdf_invoice_everest($result);\n }else{\n generate_company_pdf_invoice_all($result);\n }\n \n }", "function dispatch_licenses(){\n\t\n//1get all unfinished orders which are paid\n//2fetch all available licences\n\n//if 1 > 0 \n\t//loop for (unfinished orders)\n \t\t//compare ordered product id with available licences\n\t\t//if available\n\t\t\t//fetch email of buyer + send email + add buyer to database\n\t\t//else \n\t\t\t//mail not available to admin\n\t//loop end\n\t\n}", "function BajajFinservPL($strnet_salary, $company, $category, $DOB, $clubbed_emi, $reqtenure, $reqloanamount) {\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n $bflloansmt = round($strnet_salary * 10);\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$bflloansmt)\n\t\t\t\t{\n\t\t\t\t\t$bflloansmt=$bflloansmt;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$bflloansmt=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$bflloansmt=$bflloansmt;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n $intr1 = 14.50;\n $intr2 = 15.50;\n $bflintr1 = $intr1;\n $bflintr2 = $intr2;\n $bflintrte = \"$intr1% - $intr2%\";\n $getemi1 = round($bflloansmt * ($bflintr1/1200) / (1 - (pow(1/(1 + ($bflintr1/1200)), $term))));//getController()->Common()->getEMI($bflloansmt, $bflintr1, $term);\n $getemi2 = round($bflloansmt * ($bflintr2/1200) / (1 - (pow(1/(1 + ($bflintr2/1200)), $term))));//getController()->Common()->getEMI($bflloansmt, $bflintr2, $term);\n $getemi = \"Rs. \" . $getemi1 . \" - Rs. \" . $getemi2;\n $getterm = $print_term;\n $proc_fee = \"Upto 2%\";\n\t\t$emiperlac = round(100000 * ($bflintrte/1200) / (1 - (pow(1/(1 + ($bflintrte/1200)), $term))));\n\n $details['bank_code'] = \"Bajaj Finserv\";\n $details['interest_rate'] = interestRateFormat($bflintrte);\n $details['emi'] = $getemi;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($bflloansmt);\n $details['processing_fee'] = $proc_fee;\n $details['category'] = $category;\n return($details);\n }", "function ras_invoice_view_invoice_item($invoice_item) {\n return 'This is an invoice item - ID: ' . $invoice_item->invoice_item_id;\n}", "function vojo_group_type_ctools_access_summary($conf, $context) {\n return $conf['type'];\n}", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "public function testReportsSkillv1reportscalibrationidskillsid2()\n {\n\n }", "public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }" ]
[ "0.6172688", "0.57638144", "0.5653124", "0.5529598", "0.5261354", "0.5257407", "0.52146375", "0.52100813", "0.5205265", "0.5180824", "0.51531523", "0.5083498", "0.50686806", "0.5045306", "0.5039432", "0.50230646", "0.49977124", "0.49970323", "0.49967203", "0.49882782", "0.49735823", "0.49701697", "0.49701697", "0.49701697", "0.49701697", "0.49701697", "0.49701697", "0.4963533", "0.49623993", "0.49587288", "0.49506947", "0.49351114", "0.49245107", "0.49109563", "0.49093023", "0.4902716", "0.48947385", "0.48871002", "0.4884226", "0.4880118", "0.4877966", "0.48763105", "0.4870816", "0.4864951", "0.48566285", "0.48487175", "0.48468843", "0.48465356", "0.48452362", "0.4843471", "0.4837277", "0.48346552", "0.483204", "0.48284766", "0.48275748", "0.4823951", "0.48059496", "0.4801207", "0.47976223", "0.47950745", "0.47926283", "0.4787006", "0.4785777", "0.47852984", "0.47708106", "0.47688994", "0.4764682", "0.4759571", "0.47547382", "0.475292", "0.4747769", "0.4747181", "0.47441113", "0.4741559", "0.47400063", "0.4739965", "0.47388563", "0.4735972", "0.47354168", "0.47347426", "0.47339398", "0.473359", "0.47330615", "0.47312874", "0.47287673", "0.4728386", "0.4726491", "0.47247496", "0.47213227", "0.47195005", "0.4719392", "0.47172722", "0.47122648", "0.470454", "0.4702754", "0.47023267", "0.47022584", "0.47021368", "0.4698862", "0.46957898" ]
0.5524575
4
//warranty_claim_type SECTION ENDS HERE warranty_claim_report SECTION
public function get_warranty_claim_status($claim_status, $warranty_claim_type_id, $from_date, $to_date) { $this->db->select('tbl_warranty_claim.*,tbl_item.item_name, tbl_item.part_no, tbl_item.unit , tbl_sales.customer_type, tbl_sales.customer_id, tbl_sales.customer_name, tbl_sales.dealer_id, tbl_sales.dealer_name, tbl_sales.sales_date'); $this->db->from('tbl_warranty_claim'); $this->db->join('tbl_item','tbl_warranty_claim.item_id = tbl_item.item_id'); $this->db->join('tbl_sales','tbl_warranty_claim.sales_id = tbl_sales.sales_id'); if($claim_status != ''){ switch ($claim_status) { case '1': $this->db->where('tbl_warranty_claim.approval_status >= 0 and tbl_warranty_claim.approval_status <= 2'); break; case '2': $this->db->where('tbl_warranty_claim.approval_status >= 2'); break; case '3': $this->db->where('tbl_warranty_claim.approval_status < 0'); break; default: break; } } if($warranty_claim_type_id != ''){ $this->db->where('tbl_warranty_claim.warranty_claim_type_id',$warranty_claim_type_id); } $this->db->where('tbl_warranty_claim.time_stamp >=',$from_date); $this->db->where('tbl_warranty_claim.time_stamp <=',$to_date); $result_query=$this->db->get(); $result=$result_query->result(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function determainclaimType()\r\n {\r\n // 9 digits\r\n if (preg_match($this->keycodeRegex, $this->keycode) == false)\r\n {\r\n $this->claimType = \"invaild-keycode\";\r\n }\r\n \r\n // if keycode is NOT null, then search in the database\r\n else if ($this->keycode != null)\r\n {\r\n $result = mysql_query(\"SELECT Keycode, Claimable, Repairable, WarrantyMonths\r\n FROM Product \r\n WHERE Product.Keycode = $this->keycode\");\r\n\r\n $array = mysql_fetch_array($result);\r\n\r\n // if keycode is null, item does not exist in the database\r\n //if ($array[\"Keycode\"] == false)\r\n if (empty($array))\r\n {\r\n $this->claimType = \"keycode-not-found\";\r\n }\r\n // if product is claimable and repairable\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 1)\r\n { \r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) \r\n {\r\n //// check warranty period\r\n $this->claimType = \"repair-warranty\";\r\n }\r\n else\r\n {\r\n // check warranty period\r\n $this->claimType = \"repair-no-warranty\";\r\n }\r\n }\r\n else // transactionResult number rows is zero, this means no transaction was founds\r\n { \r\n $this->claimType = \"repair-no-transaction\";\r\n }\r\n }\r\n // if product offers a finanical claim\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"finanical-warranty\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"finanical-outside-warranty\";\r\n }\r\n }\r\n else // transactionResult's rows was zero so no tranaction number was found\r\n {\r\n $this->claimType = \"finanical-no-transaction\";\r\n }\r\n }\r\n // if a product is NOT claimable with supplier\r\n else if ($array[\"Claimable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are above zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"not-claimable-refund\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"not-claimable-outside-warranty\";\r\n }\r\n }\r\n else // no vaild transaction number provided\r\n {\r\n $this->claimType = \"not-claimable-no-transaction\";\r\n }\r\n }\r\n }\r\n \r\n }", "function HdfcBankPL($net_salary, $clubbed_emi, $company, $category, $DOB, $Company_Type, $Primary_Acc, $reqtenure, $reqloanamount) {\n $exactnet_salary = $net_salary;\n $exactnet_salaryTO = $net_salary - $clubbed_emi;\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n $interestrate = '';\n $getemicalc = 0;\n $pro_fee = '';\n $getterm = 0;\n $getloanamout = 0;\n $crprecordcount = 0;\n\t\t$gtcropcomp=\"Select interest_rate_csa ,interest_rate_noncsa From pl_company_hdfc Where (company_name like '%\".$company.\"%' and status=1)\";\n\t\tlist($alreadyExist,$hdfcrowar)=Mainselectfunc($gtcropcomp,$array = array());\n\n if (count($hdfcrowar) > 0) {\n $icicirow = array(\"interest_rate_csa\" => $hdfcrowar[\"interest_rate_csa\"], \"interest_rate_noncsa\" => $hdfcrowar[\"interest_rate_noncsa\"]);\n $crprecordcount = $icicirow[\"interest_rate_csa\"];\n }\n\t\t\t\telse\n\t\t\t{\n\t\t\t\t\t$crprecordcount=0;\n\t\t\t}\n \n if ($crprecordcount > 0) {\n if ($Primary_Acc == \"HDFC\" || $Primary_Acc == \"HDFC Bank\" || $Primary_Acc == \"hdfc\") {\n list($main, $gen) = explode('.', $icicirow[\"interest_rate_csa\"]);\n if ($gen == 00) {\n $interestrate = $main . \" \";\n } else {\n $interestrate = $icicirow[\"interest_rate_csa\"] . \" \";\n }\n\n $intr = $icicirow[\"interest_rate_csa\"];\n } else {\n list($main, $gen) = explode('.', $icicirow[\"interest_rate_noncsa\"]);\n if ($gen == 00) {\n $interestrate = $main . \"\";\n } else {\n $interestrate = $icicirow[\"interest_rate_noncsa\"];\n }\n\n $intr = $icicirow[\"interest_rate_noncsa\"];\n }\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n $pro_fee = \"Rs. 1000 - 1.75%\";\n } else {\n $getloanamout = 0;\n if ($category == \"Super A\" || $category == \"SUPER A\") {\n if ($exactnet_salary <= 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 6;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 12;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 21;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 21;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 21;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n }//SUPER A\n elseif ($category == \"Cat A\" || $category == \"CAT A\" || $category == \"CSA A\") {\n if ($exactnet_salary <= 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 6;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 17;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n }//CAT A CSA A\n elseif ($category == \"CAT GB\" || $category == \"GOVT\" || $Company_Type == 4 || $Company_Type == 5 || $Company_Type == 6) {\n if ($exactnet_salary >= 75000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\")) {\n $interestrate = \"15.5\";\n $intr = 15.5;\n } else {\n $interestrate = \"15.5\";\n $intr = 15.5;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 17;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n if ($exactnet_salary >= 50000 && $exactnet_salary < 75000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\")) {\n $interestrate = \"15.5\";\n $intr = 15.5;\n } else {\n $interestrate = \"15.5\";\n $intr = 15.5;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 17;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary >= 35000 && $exactnet_salary < 50000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\")) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n } else {\n $interestrate = \"15.75\";\n $intr = 15.75;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary < 35000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\") && $exactnet_salary >= 20000) {\n $interestrate = \"17.75\";\n $intr = 17.75;\n } else {\n $interestrate = \"17.75\";\n $intr = 17.75;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n if ($Primary_Acc == 'HDFC') {\n $pro_fee = \"2%\";\n } else {\n $pro_fee = \"2.5%\";\n }\n } elseif ($category == \"CAT B\" || $category == \"CSA B\") {\n if ($exactnet_salary <= 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n } elseif ($category == \"CAT C\" || $category == \"CSA C\") {\n if ($exactnet_salary >= 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 6;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n }\n } elseif ($exactnet_salary >= 50000 && ($exactnet_salary < 75000)) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n }\n } elseif ($exactnet_salary >= 35000 && ($exactnet_salary < 50000)) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n }\n } elseif ($exactnet_salary >= 25000 && ($exactnet_salary < 35000)) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n }\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n }//CAT C\n elseif ($category == \"Cat D\" || $category == \"CAT D\" || $category == \"CSA D\") {\n if ($exactnet_salary < 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary >= 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n } else {\n if ($exactnet_salary >= 25000) {\n $interestrate = \"19.50\";\n $intr = 19.50;\n\n if ($term == 12) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term == 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term == 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n // ASK//\n if ($Primary_Acc == 'HDFC') {\n if ($Loan_Amount_Eli > 150000) {\n $getloanamout = 150000;\n } else {\n $getloanamout = $Loan_Amount_Eli;\n }\n $pro_fee = \"2%\";\n } else {\n if ($Loan_Amount_Eli > 75000) {\n $getloanamout = 75000;\n } else {\n $getloanamout = $Loan_Amount_Eli;\n }\n $pro_fee = \"2.5%\";\n }\n } else {\n $getloanamout = 0;\n $intr = 0;\n $interestrate = 0;\n }\n }\n } //special companies\n\t\t\t\n\t\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n\t\t\t\n //for clause above 10lacs\n if (($category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT C\" || $category == \"CAT D \" || $category == \"CAT GB\" || $category == \"CSA A\" || $category == \"CSA B\" || $category == \"CSA C\" || $category == \"CSA D\" || $category == \"GOVT\" || $category == \"Super A\" || $Company_Type == 4 || $Company_Type == 5 || $Company_Type == 6)) {\n if ($getloanamout >= 1000000 && $exactnet_salary >= 75000) {\n if ($getloanamout >= 2000000) {\n $interestrate = \"11.49\";\n $intr = 11.49;\n $pro_fee = \"Rs. 2999\";\n } elseif ($getloanamout >= 1500000 && $getloanamout < 2000000) {\n $interestrate = \"12.75\";\n $intr = 12.75;\n $pro_fee = \"Rs. 3999\";\n } elseif ($getloanamout >= 1000000 && $getloanamout < 1500000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $pro_fee = \"Rs. 4999\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n $spl_category = 1;\n } else {\n $chkclause = 14.5 / 1200;\n if ((($exactnet_salary >= 40000 && $exactnet_salary < 75000) && ($getloanamout >= 500000 && $getloanamout <= 1000000)) && ($category == \"CAT B\" || $category == \"CAT A\" || $category == \"Super A\" || $category == \"CSA A\" || $category == \"CSA B\" || $category == \"CAT C\" || $category == \"CSA C\") && $intr > $chkclause) {\n $interestrate = \"14.5\";\n $intr = 14.5;\n $pro_fee = \"0.8%\";\n } else {\n $getloanamout = $getloanamout;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n if ($Primary_Acc == 'HDFC') {\n $pro_fee = \"2%\";\n } else {\n $pro_fee = \"Rs. 999\";\n }\n }\n }\n }\n \n if (($category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT C\" || $category == \"CAT D \" || $category == \"CAT GB\" || $category == \"CSA A\" || $category == \"CSA B\" || $category == \"CSA C\" || $category == \"CSA D\" || $category == \"GOVT\" || $category == \"Super A\") && $spl_category = \"\") {\n if ($exactnet_salary >= 50000) {\n $pro_fee = \"0.80%\";\n } else {\n $pro_fee = \"Rs. 999\";\n }\n }\n\n $alac = 100000;\n $peremicalc = round($alac * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($alac, $intr, $term);\n $tilldate = Date('Y-m-d');\n if ($tilldate <= '2016-08-16') {\n $pro_fee = \"0% (Till 16th Aug*)\";\n }\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $term))));\n $details['bank_code'] = \"HDFC Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $pro_fee;\n $details['category'] = $category;\n return($details);\n\t\t}", "function ProcessRiskInformationNotification($dom_response_obj) {\n /*\n * +++ CHANGE ME +++\n * Risk information notifications provide financial information about\n * a transaction to help you ensure that an order is not fraudulent.\n * A <risk-information-notification> includes the customer's billing\n * address, a partial credit card number and other values to help you\n * verify that an order is not fraudulent. Google Checkout will send you a\n * <risk-information-notification> message after completing its\n * risk analysis on a new order.\n *\n * If you are implementing the Notification API, you need to\n * modify this function to relay the information in the\n * <risk-information-notification> to your internal systems that\n * process this order data.\n */\n /*\n Google AVS constants\n Y - Full AVS match (address and postal code)\n P - Partial AVS match (postal code only)\n A - Partial AVS match (address only)\n N - No AVS match\n U - AVS not supported by issuer\n Google CVN constants\n M - CVN match\n N - No CVN match\n U - CVN not available\n E - CVN error\n */\n $dom_data_root = $dom_response_obj->document_element();\n $google_order_number = $dom_data_root->get_elements_by_tagname(\"google-order-number\");\n $number = $google_order_number[0]->get_content();\n $avs_data = $dom_data_root->get_elements_by_tagname(\"avs-response\");\n $avs = $avs_data[0]->get_content();\n $cvn_data = $dom_data_root->get_elements_by_tagname(\"cvn-response\");\n $cvn = $cvn_data[0]->get_content();\n // decode risk information\n $avs_string = '';\n switch($avs)\n {\n case 'Y': $avs_string = 'Full AVS match (address and postal code)'; break;\n case 'P': $avs_string = 'Partial AVS match (postal code only)'; break;\n case 'A': $avs_string = 'Partial AVS match (address only)'; break;\n case 'N': $avs_string = 'No AVS match'; break;\n case 'U': $avs_string = 'AVS not supported by issuer'; break;\n }\n $cvn_string = '';\n switch($cvn)\n {\n case 'M': $cvn_string = 'CVN match'; break;\n case 'N': $cvn_string = 'No CVN match'; break;\n case 'U': $cvn_string = 'CVN not available'; break;\n case 'E': $cvn_string = 'CVN error'; break;\n }\n $message = \"Risk Information:\\n\" . $avs_string . \"\\n\" . $cvn_string;\n // put results to the order status history\n $order = tep_db_fetch_array(tep_db_query(\"select orders_id, orders_status from \" . TABLE_ORDERS . \" where google_orders_id='\" . $number . \"'\"));\n tep_db_query(\"insert into \" . TABLE_ORDERS_STATUS_HISTORY . \" (orders_id, orders_status_id, date_added, comments) values('\" . $order['orders_id'] . \"', '\" . $order['orders_status'] . \"', now(), '\" . $message . \"')\");\n SendNotificationAcknowledgment();\n}", "function TataCapitalPL($net_salary, $company, $category, $DOB, $Company_Type, $Primary_Acc, $reqtenure, $reqloanamount) {\n\t\t $exactnet_salary = $net_salary;\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"4\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n\n if ($category == \"TATA Group\" || $category == \"TATA GROUP\") {\n if ($net_salary >= 60000) {\n $interestrate = \"12.50\";\n $intr = 12.50;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"12.75\";\n $intr = 12.75;\n } else if ($net_salary >= 20000 && $net_salary < 30000) {\n $interestrate = \"12.75\";\n $intr = 12.75;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $proc_Fee = \"1.25%\";\n } else if ($category == \"Super Cat A\" || $category == \"Super CAT A\" || $category == \"SUPER CAT A\") {\n\t\t\t if ($net_salary >= 100000) {\n $interestrate = 12.50;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else if ($net_salary >= 60000 && $net_salary < 100000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_Fee = \"1.25%\";\n } else if ($net_salary <= 30000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_Fee = \"1.25%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else if ($category == \"CAT A\") {\n if ($net_salary >= 100000) {\n $interestrate = 13.90;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else if ($net_salary >= 60000 && $net_salary < 100000) {\n $interestrate = 14.35;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = 16.50;\n $intr = $interestrate;\n $proc_Fee = \"1.50%\";\n } else if ($net_salary <= 30000) {\n $interestrate = 17;\n $intr = $interestrate;\n $proc_Fee = \"1.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else if ($category == \"CAT B\") {\n if ($net_salary >= 100000) {\n $interestrate = 14.50;\n $intr = $interestrate;\n $proc_Fee = \"1%\";\n } else if ($net_salary >= 60000 && $net_salary < 100000) {\n $interestrate = 15;\n $intr = $interestrate / 1200;\n $proc_Fee = \"1%\";\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = 17;\n $intr = $interestrate;\n $proc_Fee = \"1.75%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else if ($category == \"CAT C\") {\n if ($net_salary >= 60000) {\n $interestrate = \"17\";\n $intr = 17;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"17\";\n $intr = 17;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $proc_Fee = \"2%\";\n } else if ($category == \"GOVT\") {\n if ($net_salary >= 60000) {\n $interestrate = \"16.50\";\n $intr = 16.5;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"17\";\n $intr = 17;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $proc_Fee = \"2%\";\n } else {\n if ($net_salary >= 60000) {\n $interestrate = \"19\";\n $intr = 19;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"19.50\";\n $intr = 19.50;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n }\n\t\t //special Clause \n /*if (($category == \"TATA Group\" || $category == \"TATA GROUP\" || $category == \"Super Cat A\" || $category == \"Super CAT A\" || $category == \"CAT A\" || $category == \"CAT B\") && $net_salary >= 100000) {\n $interestrate = \"14.99\";\n $intr = 14.99;\n $proc_Fee = \"1.25%\";\n } else {\n $interestrate = \"15.99\";\n $intr = 15.99;\n $proc_Fee = \"1.50%\";\n }*/\n\n //Calculate Tenure\n if ($category == \"TATA Group\" || $category == \"Super Cat A\" || $category == \"Super CAT A\") {\n if ($term > 72) {\n $calcterm = 66;\n $getterm = 5.5;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n } else if ($category == \"CAT A\" || $category == \"CAT B\" || $category == \"GOVT\") {\n if ($term > 48) {\n $calcterm = 48;\n $getterm = 4;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n } else {\n if ($term > 36) {\n $calcterm = 36;\n $getterm = 3;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n }\n\t\t\n // Multiplier\n if ($category == \"TATA Group\" || $category == \"Super Cat A\" || $category == \"Super CAT A\") {\n if ($calcterm >= 49 && $calcterm <= 66) {\n $loan_amt = $net_salary * 18;\n } else if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 15;\n } else if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 12;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 10;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"CAT A\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } else if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 14;\n } else if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"CAT B\" || $category == \"GOVT\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } else if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } else if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 8;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"CAT C\") {\n if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 8;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else {\n if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 8;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n } else {\n $loan_amt = 0;\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t{\n\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n\t\tif($loan_amt >= 600000)\n\t\t{\n if (($category == \"TATA Group\" || $category == \"TATA GROUP\" || $category == \"Super Cat A\" || $category == \"Super CAT A\") && $loan_amt >= 600000) {\n $interestrate = 12.50;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } elseif (($category == \"CAT A\" || $category == \"CAT B\") && $loan_amt >= 600000) {\n $interestrate = 13.90;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else {\n $interestrate = 17;\n $intr = 17;\n $proc_Fee = \"2%\";\n }\n\t\t}\n //MAx Loan Amount\n if ($intr > 0) {\n if ($category == \"TATA Group\" || $category == \"TATA GROUP\" || $category == \"Super Cat A\" || $category == \"Super CAT A\" || $category == \"CAT A\") {\n if ($loan_amt >= 1500000) {\n $loan_amount = 1500000;\n } else {\n $loan_amount = $loan_amt;\n }\n } else {\n if ($loan_amt >= 1500000) {\n $loan_amount = 1500000;\n } else {\n $loan_amount = $loan_amt;\n }\n }\n $getemicalc = round($loan_amount * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $calcterm))));//getController()->Common()->getEMI($loan_amount, $intr, $calcterm);\n $fterm = $calcterm / 12;\n }\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $calcterm))));\n $details['bank_code'] = \"Tata Capital\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($loan_amount);\n $details['processing_fee'] = $proc_Fee;\n $details['category'] = $category;\n return($details);\n }", "public function rolewise_payspec(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t\t\n\t\t$data['roleDebit'] = $this->ledger_model->roleDebit();\n\t\t$data['roleCredit'] = $this->ledger_model->roleCredit();\n\t\t\n\t\t\n\t\t\n\t\ttheme('rolewise_payspec',$data);\n\t}", "public function get_all_warranty_claim_types(){\n $this->db->select('*');\n $this->db->from('tbl_warranty_claim_type');\n $this->db->order_by('time_stamp','asc');\n $result_query=$this->db->get();\n $result=$result_query->result();\n return $result;\n }", "public function userwise_payspec(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t\t\n\t\t$data['userDebit'] = $this->ledger_model->userDebit();\n\t\t$data['userCredit'] = $this->ledger_model->userCredit();\n\t\t\n\t\t\t\n\t\t\n\t\ttheme('userwise_payspec',$data);\n\t}", "function ooffice_write_competence( $competence ) {\r\n global $odt;\r\n \t\t if ($competence){\r\n $code = $competence->code_competence;\r\n $description_competence = $competence->description_competence;\r\n $ref_domaine = $competence->ref_domaine;\r\n $num_competence = $competence->num_competence;\r\n\t\t\t $nb_item_competences = $competence->nb_item_competences;\r\n $odt->SetFont('Arial','B',10); \r\n\t \t $odt->Write(0,recode_utf8_vers_latin1(trim(get_string('competence','referentiel').\" : \".stripslashes($code))));\r\n $odt->Ln(1);\r\n $odt->SetFont('Arial','',10); \r\n $odt->Write(0, recode_utf8_vers_latin1(trim(stripslashes($description_competence))));\r\n\t \t \t$odt->Ln(1);\r\n\t\t\t $odt->Ln(1);\r\n\t\t\t // ITEM\r\n\t\t\t $records_items = referentiel_get_item_competences($competence->id);\r\n if ($records_items){\t\t\t\t \r\n \t $odt->SetFont('Arial','B',10); \r\n\t $odt->Write(0,recode_utf8_vers_latin1(trim(get_string('items','referentiel'))));\r\n $odt->Ln(1);\r\n\r\n\t\t\t\t foreach ($records_items as $record_i){\r\n\t\t\t\t\t\tooffice_write_item( $record_i );\r\n\t\t\t\t }\r\n\t\t\t\t $odt->Ln(1);\r\n\t\t\t }\r\n }\r\n}", "private function mtii_decline_registration($invoice_number_from_doc_title, $reg_id, $reg_catg)\n {\n $result = array();\n global $mtii_ngo_cbo_db_table;\n global $mtii_db_coop_main_form;\n\n\n $reg_catg_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 $reg_catg_info_in_db = $mtii_ngo_cbo_db_table->get_by('invoice_number_filled_against', $invoice_number_from_doc_title);\n\n if (!$reg_catg_info) {\n return null;\n exit;\n }\n if ($reg_catg_info->ID == $reg_id) {\n // $already_approved = $reg_catg==\"Cooperative\" ? get_post_meta($reg_id, 'admin_approved', true) :\n // get_post_meta($reg_id, 'is_admin_approved', true);\n $reg_catg==\"Cooperative\" ? delete_post_meta($reg_id, 'admin_approved') :\n delete_post_meta($reg_id, 'is_admin_approved');\n\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\"] = \"Declined\";\n $doc_id_from_db = $reg_catg_info[\"application_form_id\"];\n $updated_data = $mtii_db_coop_main_form->update($doc_id_from_db, $reg_catg_info);\n if ($updated_data && !$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 }\n }\n $meta_update = $reg_catg==\"Cooperative\" ? update_post_meta($reg_id, 'admin_approved', \"not approved\")\n : update_post_meta($reg_id, 'is_admin_approved', \"Declined\");\n if ($reg_catg==\"ngoAndCbo\") {\n $reg_catg_info_in_db->is_admin_approved = 'Declined';\n $update_approval_in_db = $mtii_ngo_cbo_db_table->update(\n $reg_catg_info_in_db->application_form_id, (array) $reg_catg_info_in_db\n );\n }\n if ($meta_update == false || ($reg_catg==\"ngoAndCbo\" && !$update_approval_in_db)) {\n $result['status'] = \"error\";\n $result['status4'] = $update_approval_in_db;\n $result['status5'] = $reg_catg_info_in_db;\n } else {\n $tasks_performer = new TasksPerformer;\n $doc_author = get_post_meta($reg_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 if ($reg_catg==\"Cooperative\") {\n $author_message = 'Hello '.$full_name.',<br /><br />'.\n 'Your signed documents for the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been declined by the site Administrator. <br /><br />'.\n '<strong>Reason for Declining: '.$_REQUEST[\"reason_for_decline\"].' </strong><br /><br />'.\n 'You can login to <a href=\"'.site_url().'\">our website</a> '.\n 'to upload a better signed document and re-submit for approval.'.\n 'Thank you!';\n } else {\n $author_message = 'Hello '.$full_name.',<br /><br />'.\n 'Your registration for the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been declined by the site Administrator.<br /><br />'.\n '<strong>Reason for Declining: '.$_REQUEST[\"reason_for_decline\"].'</strong><br /><br />'.\n 'You can login to <a href=\"'.site_url().'\">our website</a> '.\n 'to adjust registration records and resubmit for re-approval.'.\n 'Thank you!';\n }\n $declined_statement = $reg_catg==\"Cooperative\" ? 'Your Upload has been Declined!'\n : 'Your Registration has been Declined!';\n\n $mail_content = $tasks_performer->create_email_from_template($declined_statement, $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'MTII Declined Registration', $mail_content, $headers);\n $result['status'] = \"success\";\n $result['approved'] = false;\n }\n }\n // else {\n // $result['status'] = \"success\";\n // $result['approved'] = false;\n // $result['creapy'] = \"CREAAAAAPPPYYY\";\n // $result['reg_catg_info'] = $reg_catg_info;\n // $result['id'] = $reg_id;\n // }\n return $result;\n }", "private function mtii_decline_biz_premises_reg($invoice_number_from_doc_title, $doc_id)\n {\n $result = array();\n global $mtii_biz_prem_db_main;\n $doc_info = $mtii_biz_prem_db_main->get_by('invoice_number_filled_against', $invoice_number_from_doc_title);\n $doc_info_from_cp = get_page_by_title($invoice_number_from_doc_title, OBJECT, 'mtii_biz_prem_reg');\n\n $doc_id_from_db = $doc_info->application_form_id;\n if ($doc_info_from_cp->ID == $doc_id) {\n $already_approved = $doc_info->is_admin_approved;\n if ($already_approved==\"Declined\") {\n $result['status'] = \"Already Declined\";\n } else {\n delete_post_meta($doc_info_from_cp->ID, 'is_admin_approved');\n update_post_meta($doc_info_from_cp->ID, 'is_admin_approved', 'Declined');\n $doc_info_array = ( array ) $doc_info;\n $doc_info_array[\"is_admin_approved\"] = \"Declined\";\n $updated_biz_premise = $mtii_biz_prem_db_main->update($doc_id_from_db, $doc_info_array);\n if ($updated_biz_premise == false) {\n $result['status'] = \"error\";\n } else {\n $tasks_performer = new TasksPerformer;\n $doc_author = $doc_info->user_id;\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 $author_message = 'Hello '.$full_name.',<br /><br />'.\n 'Your registration with the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been declined by the site Administrator.<br /><br />'.\n '<strong>Reason for Declining: '.$_REQUEST[\"reason_for_decline\"].'</strong><br /><br />'.\n 'You can login to <a href=\"'.site_url().'\">our website</a> '.\n 'to adjust registration records and resubmit for re-approval.'.\n 'Thank you!';\n $mail_content = $tasks_performer->create_email_from_template('Business Premise Application Declined!', $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'Business Premises Application Declined', $mail_content, $headers);\n $result['status'] = \"success\";\n $result['approved'] = false;\n }\n }\n }\n return $result;\n }", "function ppt_resources_target_delivered_report($data)\n{\n global $user;\n $current_uid = $user->uid;\n // Varriables\n $date = [];\n if (isset($data['year'])) {\n $date = get_year_dates($data['year']);\n } else {\n $date = get_year_dates();\n }\n if (!isset($data['reps']) && !isset($data['accounts']) && !isset($data['therapeutic'])) {\n if (!isset($data['year'])) {\n $date = get_year_dates();\n } else {\n $date = get_year_dates($data['year']);\n }\n $user_products = get_products_for_current_user($current_uid);\n $user_accounts = get_accounts_for_current_user($current_uid);\n return get_target_delivered_report($current_uid, $user_accounts, $user_products, $date);\n }\n if (is_comm_lead($user)) {\n if (isset($data['team']) && !isset($data['reps'])) {\n if (is_array($data['team'])) {\n $data['team'] = $data['team'][0];\n }\n $data['reps'] = array_keys(ppt_resources_get_team_reps($data));\n }\n }\n if (!$data['reps']) {\n return \"please enter reps\";\n } elseif (!$data['accounts']) {\n return \"please enter accounts\";\n } elseif (!$data['therapeutic']) {\n return \"please enter thermatic area\";\n } else {\n if (!is_array($data['accounts'])) {\n $data['accounts'] = [$data['accounts']];\n }\n if (!is_array($data['therapeutic'])) {\n $data['therapeutic'] = [$data['therapeutic']];\n }\n $account_info = node_load_multiple($data['accounts']);\n $account_products_ids = [];\n foreach ($account_info as $info) {\n $account_products_array = $info->field_products['und'];\n foreach ($account_products_array as $product) {\n $account_products_ids[] = $product['target_id'];\n }\n }\n $thermatic_area_products_ids = get_thermatic_area_products_ids($data[\"therapeutic\"]);\n if (isset($account_products_ids)) {\n foreach ($account_products_ids as $product_id) {\n if (isset($thermatic_area_products_ids)) {\n if (in_array($product_id, $thermatic_area_products_ids)) {\n $data['products'][] = $product_id;\n }\n } else {\n $data['products'] = [];\n }\n }\n } else {\n $data['products'] = [];\n }\n if (isset($data['products']) && !empty($data['products'])) {\n return get_target_delivered_report($data['reps'], $data['accounts'], $data['products'], $date);\n } else {\n return \"there is no product match for that account with therapeutic area\";\n }\n }\n}", "function generateFinancialReport($accountType){\n\t\t$count = 0;\n\t\t$urlms = $this->urlms;\n\t\t$fundingAccount = $this->findFundingAccount($accountType);\n\t\t\n\t\t// echo a table with appropriate columns in it\n\t\techo \"\n\t\t<div class=\\\"container\\\">\n\t\t\t<h3>\".$accountType.\"</h3> \n\t\t<table class=\\\"table table-hover\\\" style=\\\"width: 100%;\\\">\n\t\t\n\t\t<thread>\n\t\t<tr>\n\t\t<th>Type</th>\n\t\t<th>Amount</th>\n\t\t<th>Date</th>\n\t\t\n\t\t</tr>\n\t\t</thread>\n\t\t<tbody>\";\n\t\t\n\t\t// get the account's expenses and generate a row in the table for each expense, with correct information\n\t\t$expenses = $fundingAccount->getExpenses();\n\t\tforeach ($expenses as $e){\n\t\t\t$count ++;\n\t\t\techo \"<tr>\n\t\t\t\t\t<td>\" .$e->getType().\"</td>\n\t\t\t\t\t<td>$\". number_format($e->getAmount(), 2, \".\" , \",\" ) .\"</td>\n\t\t\t\t\t<td>\" . $e->getDate() . \"</td>\n\t\t\t\t</tr>\";}\n\t\t\techo \"</tbody></table>\";\n\t\t\t$_SESSION['fundingAccount'] = $fundingAccount;\n\t\t\t$_SESSION['urlms'] = $urlms;\n\t\t\t?>\n\t\t\t<!-- Section for editing an expense -->\n\t\t\t<html>\n\t\t\t<div class=\"container\">\n\t\t\t\t<form action=\"../controller/InfoUpdater.php\" method=\"get\">\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<br>\n\t\t\t\t\t<h3>Edit Expense</h3>\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"editExpense\" />\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"ExpenseType\">Expense Type</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"expensename\" id=\"expenseName\" aria-describedby=\"nameHelp\" placeholder=\"Enter Expense Type\"> \n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter old type of expense.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"newExpenseType\">New Expense Type</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"newexpensename\" id=\"expenseName\" aria-describedby=\"nameHelp\" placeholder=\"Enter New Expense Type\"> \n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter new type of expense.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"newAmount\">New Amount</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"newexpenseamount\" id=\"expenseAmount\" aria-describedby=\"nameHelp\" placeholder=\"Enter New Expense Amount\"> \n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter new amount of expense.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"ExpenseType\">New Date</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"newexpensedate\" id=\"expenseName\" aria-describedby=\"nameHelp\" placeholder=\"Enter Expense Date\"> \n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter new date of expense.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<input class=\"btn btn-danger\" type=\"submit\" value=\"Edit expense!\" />\n\t\t\t\t</div>\n\t\t\t\t\t<br>\n\t\t\t\t</form>\n\t\t\t\t\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"col-sm-2\">\n\t\t\t\t\t\t<a href=\"../view/FundingView.php\" style=\"color: white; text-decoration: none;\">\n\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-danger\" data-toggle=\"tooltip\"\n\t\t\t\t\t\t\t\tdata-placement=\"bottom\" title=\"Go back to homepage\">Back</button>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</html><?php\n\t\treturn $count;\n\t}", "function write_customer_trans($trans_type, $trans_no, $debtor_no, $BranchNo,\n $date_, $reference, $Total, $discount = 0, $Tax = 0, $Freight = 0, $FreightTax = 0,\n $sales_type = 0, $order_no = 0, $ship_via = 0, $due_date = \"\",\n $AllocAmt = 0, $rate = 0, $dimension_id = 0, $dimension2_id = 0,\n $payment_terms = null, $tax_included = 0, $prep_amount = 0,$inv_trans_total=0,$is_paper_edit=false)\n{\n\n $display_customer = $_SESSION['Items']->display_customer;\n $customer_trn = $_SESSION['Items']->customer_trn;\n $customer_mobile = $_SESSION['Items']->customer_mobile;\n $customer_email = $_SESSION['Items']->customer_email;\n $customer_ref = $_SESSION['Items']->customer_ref;\n $barcode = $_SESSION['Items']->barcode;\n\n $credit_card_charge = $_SESSION['credit_card_charge'];\n $payment_method = $_SESSION['payment_method'];\n unset($_SESSION['credit_card_charge']);\n unset($_SESSION['payment_method']);\n\n $created_by = $_SESSION['wa_current_user']->user;\n\n $new = $trans_no == 0;\n $curr = get_customer_currency($debtor_no);\n if ($rate == 0)\n $rate = get_exchange_rate_from_home_currency($curr, $date_);\n\n $SQLDate = date2sql($date_);\n if ($due_date == \"\")\n $SQLDueDate = \"0000-00-00\";\n else\n $SQLDueDate = date2sql($due_date);\n\n if ($trans_type == ST_BANKPAYMENT)\n $Total = -$Total;\n\n if ($new || !exists_customer_trans($trans_type, $trans_no)) {\n if ($new) {\n $trans_no = get_next_trans_no($trans_type);\n\n if($trans_type == 10 && !$is_paper_edit) {\n $reference = get_next_invoice_ref($dimension_id);\n $_SESSION['Items']->reference = $reference;\n }\n\n }\n\n $sql = \"INSERT INTO \" . TB_PREF . \"debtor_trans (\n\t\ttrans_no, type,\n\t\tdebtor_no, branch_code,\n\t\ttran_date, due_date,\n\t\treference, tpe,\n\t\torder_, ov_amount, ov_discount,\n\t\tov_gst, ov_freight, ov_freight_tax,\n\t\trate, ship_via, alloc,\n\t\tdimension_id, dimension2_id, payment_terms, tax_included, prep_amount,\n\t\tdisplay_customer,customer_trn,customer_mobile,customer_email,customer_ref,barcode,\n\t\tcredit_card_charge,payment_method,inv_total,created_by \n\t\t) VALUES (\" . db_escape($trans_no) . \", \" . db_escape($trans_type) . \",\n\t\t\" . db_escape($debtor_no) . \", \" . db_escape($BranchNo) . \",\n\t\t'$SQLDate', '$SQLDueDate', \" . db_escape($reference) . \",\n\t\t\" . db_escape($sales_type) . \", \" . db_escape($order_no) . \", $Total, \" . db_escape($discount) . \", $Tax,\n\t\t\" . db_escape($Freight) . \",\n\t\t$FreightTax, $rate, \" . db_escape($ship_via) . \", $AllocAmt,\n\t\t\" . db_escape($dimension_id) . \", \" . db_escape($dimension2_id) . \", \n\t\t\" . db_escape($payment_terms, true) . \", \n\t\t\" . db_escape($tax_included) . \", \n\t\t\" . db_escape($prep_amount) . \",\n\t\t\" . db_escape($display_customer) . \",\n\t\t\" . db_escape($customer_trn) . \",\n\t\t\" . db_escape($customer_mobile) . \",\n\t\t\" . db_escape($customer_email) . \",\n\t\t\" . db_escape($customer_ref) . \",\n\t\t\" . db_escape($barcode) . \",\n\t\t\" . db_escape($credit_card_charge) . \",\n\t\t\" . db_escape($payment_method) . \",\n\t\t$inv_trans_total,$created_by)\";\n } else { // may be optional argument should stay unchanged ?\n $sql = \"UPDATE \" . TB_PREF . \"debtor_trans SET\n\t\tdebtor_no=\" . db_escape($debtor_no) . \" , branch_code=\" . db_escape($BranchNo) . \",\n\t\ttran_date='$SQLDate', due_date='$SQLDueDate',\n\t\treference=\" . db_escape($reference) . \", tpe=\" . db_escape($sales_type) . \", order_=\" . db_escape($order_no) . \",\n\t\tov_amount=$Total, \n\t\tinv_total=$inv_trans_total, \n\t\tov_discount=\" . db_escape($discount) . \", ov_gst=$Tax,\n\t\tov_freight=\" . db_escape($Freight) . \", ov_freight_tax=$FreightTax, rate=$rate,\n\t\tship_via=\" . db_escape($ship_via) . \", alloc=$AllocAmt,\n\t\t\n\t\tdimension2_id=\" . db_escape($dimension2_id) . \",\n\t\tpayment_terms=\" . db_escape($payment_terms, true) . \",\n\t\ttax_included=\" . db_escape($tax_included) . \",\n\t\tprep_amount =\" . db_escape($prep_amount) . \",\n\t\tdisplay_customer =\" . db_escape($display_customer) . \",\n\t\tcustomer_trn =\" . db_escape($customer_trn) . \",\n\t\tcustomer_mobile =\" . db_escape($customer_mobile) . \",\n\t\tcustomer_email =\" . db_escape($customer_email) . \",\n\t\tcustomer_ref =\" . db_escape($customer_ref) . \" \n\t\tWHERE trans_no=\" . db_escape($trans_no) . \" AND type=\" . db_escape($trans_type);\n }\n db_query($sql, \"The debtor transaction record could not be inserted\");\n\n\n// display_error(print_r($display_customer ,true));\n\n\n if ($trans_type != ST_JOURNAL) // skip for journal entries\n add_audit_trail($trans_type, $trans_no, $date_, $new ? '' : trans(\"Updated.\"));\n\n return $trans_no;\n}", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$arrBDAplicar = array('erpplacacentro','erpplacacentro_CAPA','erpplacacentro_DES' );\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode as moneda,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tIFNULL(paymentmethods.codesat,'') as paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans \n\t\t\t\tLEFT JOIN paymentmethods ON debtortrans.paymentname = paymentmethods.paymentname\n\t\t\t\tINNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON debtortrans.debtorno = custbranch.branchcode\n\t\t\t\tINNER JOIN currencies ON debtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON stockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON stockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n \n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= number_format($myrow['ovamount'], 2, '.', '');\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= number_format($myrow['ovamount']+$myrow['ovgst'], 2, '.', '');\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=number_format($myrow['ovamount']+$myrow['ovgst'],2,'.','');\n\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=number_format($myrow['ovgst'],'.','');\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento trae desde el stockmoves\n\t\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento) as descuento\n\t\t\t\t FROM stockmoves\n\t\t\t\t WHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}else{\n\t\t\t$sqldiscount = 'SELECT sum(totaldescuento+(IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)*totaldescuento)) as descuento\n\t\t\t \t\t\tFROM stockmoves inner join stockmaster on stockmaster.stockid=stockmoves.stockid\n\t\t\t\t\t\t\t-- LEFT JOIN taxauthrates ON stockmaster.taxcatid = taxauthrates.taxcatid\n\t\t\t\t\t\t\tLEFT JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\n\t\t\t\t\t \t\tWHERE stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\t$Result= DB_query($sqldiscount,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$descuento=0;\n\t\t\t}else{\n\t\t\t\t$myrowdis = DB_fetch_array($Result);\n\t\t\t\t$descuento=number_format($myrowdis['descuento'],2,'.','');\n\t\t\t}\n\t\t}\n\t\t//descuento\n\t\t$descuento=number_format($descuento,2,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n \n\t\t$moneda=$myrow['currcode'];\n \n\t\t// CANTIDAD CON LETRAS\n\t\t$amount = number_format($myrow['ovamount'],3);\n\t\t$ovgst = number_format($myrow['ovgst'],2);\n\t\t$rountotal = $amount + $ovgst ;\n\t\t$rountotal = number_format($rountotal,2);\n\t\t$totaletras=round($myrow['ovamount']+$myrow['ovgst'],2);\n\n\t\t$totalx=str_replace(',','',$total);\n\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\n\t\t$separa2=explode(\".\",$totalx,4);//\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra,'es');\n\t\t//$montocentavos=Numbers_Words::toWords($montoctvs2,'es');\n\t\tif ($moneda=='MXN'){\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\" /100 M.N.\";\n\t\t}//\n\t\telse\n\t\t{\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/100 USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=number_format($myrow['cambio'],6,'.','');\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"99\";\n\t\t}\n\t\t\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\t\t\n\t\t\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\t\t\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\t\t\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\n\t\tif (in_array($_SESSION['DatabaseName'], $arrBDAplicar)) {\n\t\t\t$charelectronic=$charelectronic.'|';\n\t\t}\n\t\telse{\n\t\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t}\n\t\t\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\n\t\tif ($imprimepublico==0 || in_array($_SESSION['DatabaseName'], $arrBDAplicar)){\n $colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t//$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\tif ($_SESSION['DecimalPlacesInvoice']==''){\n\t\t$_SESSION['DecimalPlacesInvoice']=6;\n\t}\n\t$decimalplaces=$_SESSION['DecimalPlacesInvoice'];\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],4,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=11\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n $descrnarrative = str_replace('|', '-', $descrnarrative);\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\t// consultar cantidad restante para tyqsa en remisones contra orden de trabajo\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";*/\n\t\t\t\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t\n\t\t\t//IF($_SESSION)\n\t\t\t//ECHO $charelectronicdetail;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],6,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description']; \n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,2,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal'] - $totalRowAnticipo),6,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\t\t\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\t\t\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=number_format($myrow2['quantity'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT DISTINCT p.InvoiceValue AS val,\n\t\t\t\t\t\t\t p.complemento,\n\t\t\t\t\t\t\t sp.label\n\t\t\t\t\t\t\tFROM salesstockproperties p,\n\t\t\t\t\t\t\t stockcatproperties sp,\n\t\t\t\t\t\t\t stockmaster sm\n\t\t\t\t\t\t\tWHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t\t\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t\t\t\t AND sp.reqatprint=1\n\t\t\t\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0) {\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t} else {\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\tswitch ($myrowprop['val']) {\n\t\t\t\t\tcase 'Interno':\n\t\t\t\t\t\t$sqlbomb = \"SELECT class FROM stockclass WHERE idclass = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['class'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Externo':\n\t\t\t\t\t\t$sqlbomb = \" SELECT suppname FROM suppliers WHERE supplierid = '\" . $myrowprop['complemento'] . \"'\";\n\t\t\t\t\t\t$rsqlbomb = DB_query($sqlbomb, $db);\n\t\t\t\t\t\t$rowbom = DB_fetch_array($rsqlbomb);\n\t\t\t\t\t\t$descrprop .= \" - Proveedor : \" . $rowbom['suppname'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\t\t\t\t\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t\t\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=number_format($myrow2['fxprice'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=number_format($myrow2['fxnet'],$decimalplaces,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=number_format($myrow2['discountpercent']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=number_format($myrow2['discountpercent1']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=number_format($myrow2['discountpercent2']*100,2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=number_format($myrow3['taxrate']*100,'.','');\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=number_format($myrow3['taxrate']*($myrow2['subtotal']),6,'.','');\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=number_format($myrow3['taxrate']*($myrow2['subtotal']),6);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque.$totalCantEmision;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t\n\t//echo '<pre><br>'.$cadenaenviada; \n\treturn $cadenaenviada;\n}", "public function gen_inv_pdf_basedon_forgeigner($invoice_id, $is_subsidy) {\n //$this->output->enable_profiler();\n $tenant_id = $this->tenant_id;\n \n if (empty($invoice_id)) {\n return show_404();\n }\n if (empty($is_subsidy)) {\n $res = $this->classtraineemodel->get_company_invoice_foreigner($invoice_id);\n $text = 'f';\n } \n \n $result = $res[0];\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($invoice_id);\n //\n $result->invoice_label = $text;\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n }\n //$result->discount_rate = round($result->discount_rate, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n $total_unitfees = 0;\n $total_discount = 0;\n $total_gst = 0;\n $total_subsidy = 0;\n $total_inv_amount = 0;\n// $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $company_received = $this->classtraineemodel->company_payment_recd_forgeiner($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n// $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $company_refunded = $this->classtraineemodel->company_payment_refund_foreigner($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach ($res as $k => $row) \n {\n $received = empty($user_paid[$row->user_id]) ? 0 : $user_paid[$row->user_id];\n $refunded = empty($user_refund[$row->user_id]) ? 0 : $user_refund[$row->user_id];\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($row->total_amount_due + $refunded) - $received) <= 0){\n $payment_label = 'PAID';\n }\n else{ \n if($refunded > 0){\n $payment_label = 'REFUNDED'; \n } else{ \n if($received == 0){\n $payment_label = 'NOT PAID';\n }else if($received > 0){\n $payment_label = 'PART PAID';\n }\n }\n }\n \n $res[$k]->payment_label = $payment_label;\n $total_unitfees +=$row->class_fees;\n $total_discount += ($row->class_fees * ($result->discount_rate / 100));\n $total_gst += $row->gst_amount;\n $total_subsidy += $row->subsidy_amount;\n $total_inv_amount += $row->total_amount_due;\n $result->total_inv_amount1 = $row->total_inv_amount;\n \n }\n $result->payble_amount=$total_inv_amount+$refunded_amt-$received_amt;\n $result->total_unit_fees = round($total_unitfees, 2);\n $result->total_inv_discnt = round($total_discount, 2);\n $result->total_inv_subsdy = round($total_subsidy, 2);\n $result->total_gst = round($total_gst, 2);\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n $result->total_inv_amount = round($total_inv_amount, 2);\n \n $result->payment_due_details = $res;\n\n $this->load->helper('pdf_reports_helper');\n generate_company_pdf_invoice($result);\n }", "function genrate_inspectorpaymenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name) {\n\t\n\t\t$columnwidtharrays = array(10,24,26,26,28,26,25,24);\n\t\t\n\t\t$heightdynamic = 12;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, $vc_customer_name,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 7);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_assessment_no = \t$val['AssessmentVehicleMaster']['vc_assessment_no'];\n\t\t $vc_customer_name=\t\t$val['AssessmentVehicleMaster']['vc_customer_name'];\n\t\t $dt_assessment_date=\tdate('d-M-y', strtotime($val['AssessmentVehicleMaster']['dt_assessment_date']));\n\t\t $nu_total_payable_amount= number_format($val['AssessmentVehicleMaster']['nu_total_payable_amount'],2,'.',',');\n\t\t $vc_mdc_paid=\t\t\tnumber_format($val['AssessmentVehicleMaster']['vc_mdc_paid'],2,'.',',');\n\t\t\t$dt_received_date = \tdate('d M Y', strtotime($val['AssessmentVehicleMaster']['dt_received_date']));\n\t\t $vc_prtype_name = \t\t$val['PaymentStatus']['vc_prtype_name'];\n\n\t\t\t$font_size = 7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_assessment_date, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $nu_total_payable_amount, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_mdc_paid, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_received_date, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t}", "function genrate_assessmenthistory_pdf($columnsValues,$data,$vehicletype,$allconstants,$profile,$toDate=null,$fromDate=null,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(9,15,15,14,15,14,13,12,13,27,12,17,13);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vehicletype) && !empty($vehicletype)) || \n\t\t(isset($vehiclelicno) && !empty($vehiclelicno))){\n\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+125);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Type :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vehicletype) && !empty($vehicletype))\n\t\t\t$this->MultiCell(39, 8, $allconstants[$vehicletype],0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t\t//vehiclelicno\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 || $c == 8 || $c == 10 || $c == 11 || $c == 12 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 6);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t foreach ($data as $val) {\n\t\t \n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $dt_created_date =\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no =\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no =\t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no = \t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_prtype_name =\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t\t$vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om =\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable = \t\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}", "function XSACreditNote($InvoiceNo, $orderno, $debtorno, $TypeInvoice,$tag,$serie,$folio, &$db)\n{\n\t$charelectronic='01';\n\t$charelectronic=$charelectronic.'|'.$serie;\n\t$serieelect=$serie;\n\t//$serieelect=$TypeInvoice.'-'.$_SESSION['Tagref'];\n\t$folioelect=$folio;//$InvoiceNoTAG;\n\t//$folioelect=$InvoiceNo;\n\t$charelectronic=$charelectronic.'|'.$serieelect;\n\t$charelectronic=$charelectronic.'|'.$folioelect;\n\t// consulto datos de la factura\n\t$imprimepublico=0;\n\t$InvoiceHeaderSQL = \"SELECT DISTINCT\n\t\t\t\treplace(debtortrans.trandate,'-','/') as trandate,\n\t\t\t\t(debtortrans.ovamount*-1) as ovamount,\n\t\t\t\t(debtortrans.ovdiscount*-1) as ovdiscount,\n\t\t\t\t(debtortrans.ovgst*-1) as ovgst,\n\t\t\t\tdebtorsmaster.name,\n\t\t\t\tdebtorsmaster.address1,debtorsmaster.address2,\n\t\t\t\tdebtorsmaster.address3,debtorsmaster.address4,debtorsmaster.address5,\n\t\t\t\tdebtorsmaster.address6,debtorsmaster.invaddrbranch,\n\t\t\t\tcustbranch.taxid as rfc,\n\t\t\t\tcustbranch.brname,\n\t\t\t\tcustbranch.braddress1,custbranch.braddress2,custbranch.braddress3,\n\t\t\t\tcustbranch.braddress4,custbranch.braddress5,custbranch.braddress6,\n\t\t\t\tcustbranch.brpostaddr1,custbranch.brpostaddr2,custbranch.brpostaddr3,\n\t\t\t\tcustbranch.brpostaddr4,custbranch.brpostaddr5,custbranch.brpostaddr6,\n\t\t\t\tdebtortrans.debtorno,debtortrans.branchcode,debtortrans.folio,\n\t\t\t\treplace(origtrandate,'-','/') as origtrandate,\n\t\t\t\tdebtortrans.currcode,\n\t\t\t\tcustbranch.branchcode,\n\t\t\t\tdebtortrans.tpe,\n\t\t\t\tdebtortrans.shipvia,\n\t\t\t\t(debtortrans.ovfreight*-1) as ovfreight,\n\t\t\t\tdebtortrans.rate AS cambio,\n\t\t\t\tdebtorsmaster.currcode,\n\t\t\t\tcustbranch.defaultlocation,\n\t\t\t\tcustbranch.brnumext,\n\t\t\t\tcustbranch.brnumint,\n\t\t\t\t\";\n\t$InvoiceHeaderSQL = $InvoiceHeaderSQL . \"\n\t\t\t\tlocations.taxprovinceid,\n\t\t\t\tdebtortrans.tagref,\n\t\t\t\tcustbranch.phoneno as telofi,\n\t\t\t\tdebtortrans.paymentname,\n\t\t\tdebtortrans.nocuenta\n\t\t\tFROM debtortrans INNER JOIN debtorsmaster ON\n\t\t\t\tdebtortrans.debtorno = debtorsmaster.debtorno\n\t\t\t\tINNER JOIN custbranch ON\n\t\t\t\tdebtortrans.branchcode = custbranch.branchcode\n\t\t\t\tAND debtortrans.debtorno = custbranch.debtorno\n\t\t\t\tINNER JOIN currencies ON\n\t\t\t\tdebtorsmaster.currcode = currencies.currabrev\n\t\t\t\tINNER JOIN stockmoves ON\n\t\t\t\tstockmoves.transno=debtortrans.transno\n\t\t\t\tINNER JOIN locations ON\n\t\t\t\tstockmoves.loccode = locations.loccode\n\t\t\tWHERE debtortrans.transno = \" . $InvoiceNo . \"\n\t\t\t\tAND debtortrans.type=11\n\t\t\t\tAND stockmoves.type=11\";\n\t$Result=DB_query($InvoiceHeaderSQL,$db);\n\tif (DB_num_rows($Result)>0) {\n\t\t$myrow = DB_fetch_array($Result);\n\t\t// fecha emision\n\t\t$fechainvoice=$myrow['origtrandate'];\n\t\t$UserRegister=$myrow['UserRegister'];\n\t\t$charelectronic=$charelectronic.'|'.$fechainvoice;\n\t\t// subtotal\n\t\t$rfccliente=str_replace(\"-\",\"\",$myrow['rfc']);\n\t\t$rfccliente=str_replace(\" \",\"\",$rfccliente);\n\t\t$nombre=$myrow['name'];\n\t\t$subtotal= FormatNumberERP($myrow['ovamount']);\n\t\tif (strlen($rfccliente)<12){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}elseif(strlen($rfccliente)>=14){\n\t\t\t$rfccliente=\"XAXX010101000\";\n\t\t\t$nombre=\"Publico en General\";\n\t\t\t$subtotal= FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t\t$imprimepublico=1;\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$subtotal;\n\t\t// total factura\n\t\t$total=FormatNumberERP($myrow['ovamount']+$myrow['ovgst']);\n\t\t$charelectronic=$charelectronic.'|'.$total;\n\t\t// total de iva\n\t\t$iva=FormatNumberERP($myrow['ovgst']);\n\t\t// transladado\n\t\t$charelectronic=$charelectronic.'|'.$iva;\n\t\t// retenido\n\t\t$ivaret=0;\n\t\t$charelectronic=$charelectronic.'|'.$ivaret;\n\t\t//descuento\n\t\t$descuento=FormatNumberERP($myrow['ovdiscount']);\n\t\t$charelectronic=$charelectronic.'|'.$descuento;\n\t\t//motivo descuento\n\t\t$charelectronic=$charelectronic.'|';\n\t\t// tipo de moneda\n\t\t$moneda=$myrow['currcode'];\n\t\t// CANTIDAD CON LETRAS\n\t\t$totaletras=$myrow['ovamount']+$myrow['ovgst'];\n\t\t$totalx=str_replace(',' ,'', FormatNumberERP($totaletras));\n\t\t$separa=explode(\".\",$totalx);\n\t\t$montoletra = $separa[0];\n\t\t$separa2=explode(\".\", FormatNumberERP($total));\n\t\t$montoctvs2 = $separa2[1];\n\t\t$montoletra=Numbers_Words::toWords($montoletra, 'es');\n\t\t\n\t\t$zeroPad = \"\";\n\t\tif (empty($_SESSION['Decimals'])) {\n\t\t\t$zeroPad = str_pad($zeroPad, 4, 0, STR_PAD_RIGHT);\n\t\t} else {\n\t\t\t$zeroPad = str_pad($zeroPad, $_SESSION['Decimals'], 0, STR_PAD_RIGHT);\n\t\t}\n\t\t\n\t\tif ($moneda == 'MXN') {\n\t\t\t$montoletra=ucwords($montoletra) . \" Pesos \". $montoctvs2 .\"/1$zeroPad M.N.\";\n\t\t} else {\n\t\t\t$montoletra=ucwords($montoletra) . \" Dolares \". $montoctvs2 .\"/1$zeroPad USD\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$montoletra;\n\t\t// tipo moneda\n\t\t$charelectronic=$charelectronic.'|'.$moneda;\n\t\t// tipo de cambio\n\t\t$rate=FormatRateNumberERP($myrow['cambio']);\n\t\t$charelectronic=$charelectronic.'|'.$rate;\n\t\t// numero de orden para referencia\n\t\t$ordenref=$myrow['orderno'];\n\t\t$charelectronic=$charelectronic.'|'.$ordenref;\n\t\t// observaciones 1: vendedores\n\t\t$vendedor=\"\";\n\t\t$SQL=\" SELECT *\n\t\t FROM salesman\n\t\t WHERE salesmancode='\".$myrow['salesman'].\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowsales = DB_fetch_array($Result);\n\t\t\t$vendedor=$myrowsales['salesmanname'];\n\t\t}\n\t\t$observaciones1='Vendedor: '.$myrow['salesman'].' '.$vendedor;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones1;\n\t\t// observaciones 2\n\t\t$SQL=\" SELECT l.telephone,l.comments,t.tagdescription\n\t\t FROM legalbusinessunit l, tags t\n\t\t WHERE l.legalid=t.legalid AND tagref='\".$tag.\"'\";\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==1) {\n\t\t\t$myrowtags = DB_fetch_array($Result);\n\t\t\t$telephone=trim($myrowtags['telephone']);\n\t\t\t$comments=trim($myrowtags['comments']);\n\t\t}\n\t\t$observaciones2=\" Atencion a clientes \" .$telephone;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones2;\n\t\t$metodopago = $myrow['paymentname'];\n\t\tif ($metodopago==\"\") {\n\t\t\t$metodopago = \"No Identificado\";\n\t\t}\n\n\t\t$nocuenta = $myrow['nocuenta'];\n\t\tif ($nocuenta==\"\") {\n\t\t\t$nocuenta = \"No Identificado\";\n\t\t}\n\n\n\t\t// observaciones 3\n\t\t$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones3;\n\n\t\t//$observaciones3='Id Nota de Credito:'.$InvoiceNo.' '.$comments .' usr:'.$UserRegister;\n\t\t$charelectronic=$charelectronic.'|'.$nocuenta;\n\t\t// datos de la forma de pago\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'02';\n\n\t\t$terminospago=$myrow['terms'];\n\t\t$SQL=\" SELECT *\n\t\t FROM debtortrans\n\t\t WHERE debtortrans.type=70\n\t\t\tAND debtortrans.order_=\" . $InvoiceNo ;\n\t\t$Result= DB_query($SQL,$db);\n\t\tif (DB_num_rows($Result)==0) {\n\t\t\t$Tipopago=\"Pago en una sola exhibicion\";\n\t\t}else{\n\t\t\t$Tipopago=\"Parcialidades\";\n\t\t}\n\t\t$Tipopago=$Tipopago.' '.$terminospago;\n\t\t//$Tipopago=$terminospago;\n\t\t$charelectronic=$charelectronic.'|'.$Tipopago;\n\t\t// condiciones de pago\n\t\t$charelectronic=$charelectronic.'|Genera Interes Moratorio 3 % mensual/credito';\n\t\t// metodo de pago\n\t\t//\t$metodopago='varios';\n\t\t$charelectronic=$charelectronic.'|'.$metodopago;\n\t\t// fecha vencimiento\n\t\t$fechavence=$myrow['trandate'];\n\t\t$charelectronic=$charelectronic.'|'.$fechavence;\n\t\t// observaciones 4\n\t\t$observaciones4=$observaciones3;\n\t\t$charelectronic=$charelectronic.'|'.$observaciones4;\n\t\t// datos del cliente\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'03';\n\t\t$branch=$myrow['debtorno'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0){\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$calle=$myrow['address1'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$colonia=$myrow['address2'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$municipio=$myrow['address3'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$edo=$myrow['address4'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=\"\";\n\t\tif ($imprimepublico==0){\n\t\t\t$cp=$myrow['address5'];\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\t\t// datos del custbranch\n\t\t$charelectronic=$charelectronic.'|'.chr(13).chr(10).'04';\n\t\t$branch=$myrow['branchcode'];\n\t\t$charelectronic=$charelectronic.'|'.$branch;\n\t\t//$rfc=$myrow['rfc'];\n\t\t//$charelectronic=$charelectronic.'|'.$rfccliente;\n\t\t$nombre=$myrow['name'];\n\t\t$charelectronic=$charelectronic.'|'.$nombre;\n\t\t\n\t\tif (strlen(str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi']))))))>0) {\n\t\t\t$pais=str_replace('|','',str_replace('-','',str_replace(' ','',str_replace('\\r','',str_replace('\\n','',$myrow['telofi'])))));//\"Mexico\";//$myrow['name'];\n\t\t}else{\n\t\t\t$pais=\"Mexico\";\n\t\t}\n\t\t$charelectronic=$charelectronic.'|'.$pais;\n\t\t$calle=$myrow['braddress1'];\n\t\t$charelectronic=$charelectronic.'|'.$calle;\n\t\t$noext=$myrow['brnumext'];\n\t\t$charelectronic=$charelectronic.'|'.$noext;\n\t\t$noint=$myrow['brnumint'];\n\t\t$charelectronic=$charelectronic.'|'.$noint;\n\t\t$colonia=$myrow['braddress6'];\n\t\t$charelectronic=$charelectronic.'|'.$colonia;\n\t\t$localidad=$myrow['braddress2'];\n\t\t$charelectronic=$charelectronic.'|'.$localidad;\n\t\t$referenciacalle=\"\";\n\t\t$charelectronic=$charelectronic.'|'.$referenciacalle;\n\t\t$municipio=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$municipio;\n\t\t$edo=$myrow['braddress3'];\n\t\t$charelectronic=$charelectronic.'|'.$edo;\n\t\t$cp=$myrow['braddress4'];\n\t\t$charelectronic=$charelectronic.'|'.$cp;\n\n\t}\n\t// cadena para datos de los productos\n\t// productos vendidos\n\t$charelectronicdetail='';\n\t$charelectronicinidet='|'.chr(13).chr(10).'05';\n\t// datos de ivas\n\t$charelectronictaxs='';\n\t$charelectronictaxsini='|'.chr(13).chr(10).'07';\n\t\n\tif ($rfccliente!=\"XAXX010101000\"){\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))- totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\t$nolinea=0;\n\t\t$descrprop=\"\";\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=11\n\t\t\t\t \tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\n\t\t\t$descrnarrative=\"\";\n\t\t\t$sqlnarrative=\"SELECT narrative\n\t\t\t\tFROM notesorderdetails p\n\t\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrownarrative['narrative']));\n\t\t\t}\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescrip.$descrprop.$descrnarrative;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$nameaduana='';\n\t\t\t$numberaduana='';\n\t\t\t$fechaaduana='';\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$nolinea=$nolinea+1;\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,\n\t\t\t\t\t\ttaxcalculationorder,taxontax,\n\t\t\t\t\t\ttaxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\n\t\t}\n\t}else{\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\tstockmaster.description,\n\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t(stockmoves.qty) as quantity ,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price)) AS fxnet,\n\t\t\t\t\t((stockmoves.qty)*(stockmoves.price))-totaldescuento AS subtotal,\n\t\t\t\t\t(stockmoves.price) AS fxprice,\n\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\tstockmaster.units,\n\t\t\t\t\tstockmaster.categoryid\n\t\t\tFROM stockmoves,stockmaster\n\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\tAND stockmoves.show_on_inv_crds=1';\n\n\t\t$sqldetails = 'SELECT stockmoves.stkmoveno,\n\t\t\t\t\t\tstockmoves.stockid,\n\t\t\t\t\t\tstockmoves.warranty,\n\t\t\t\t\t\tstockmaster.description,\n\t\t\t\t\t\tstockmaster.serialised,\n\t\t\t\t\t\tstockmaster.controlled,\n\t\t\t\t\t\t(case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end) as quantity ,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.decimalplaces,\n\t\t\t\t\t\tstockmoves.discountpercent,\n\t\t\t\t\t\tstockmoves.discountpercent1,\n\t\t\t\t\t\tstockmoves.discountpercent2,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate)))) AS fxnet,\n\t\t\t\t\t\t((case when stockmoves.type not in (11,65) then stockmoves.qty*-1 else qty end)*(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))))-totaldescuento as subtotal,\n\t\t\t\t\t\t(stockmoves.price + (stockmoves.price * IF(stockmovestaxes.taxrate IS NULL, 0, stockmovestaxes.taxrate))) AS fxprice,\n\t\t\t\t\t\tstockmoves.narrative,\n\t\t\t\t\t\tstockmaster.units,\n\t\t\t\t\t\tstockmaster.categoryid,\n\t\t\t\t\t\tstockmoves.loccode as almacen,\n\t\t\t\t\t\tstockmoves.showdescription,\n\t\t\t\t\t stockcategory.MensajePV\n\t\t\t\t\tFROM stockmoves inner join stockmaster ON stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\t\t\t\tinner join stockcategory on stockcategory.categoryid = stockmaster.categoryid\n\t\t\t\t\t\t\t\tleft JOIN stockmovestaxes ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno\n\t\t\t\tWHERE stockmoves.stockid = stockmaster.stockid\n\t\t\t\t\tAND stockmoves.type='.$TypeInvoice.'\n\t\t\t\t\tAND stockmoves.transno=' . $InvoiceNo . '\n\t\t\t\t\tAND stockmoves.tagref=' . $tag . '\n\t\t\t\t\tAND stockmoves.show_on_inv_crds=1\n\t\t\t\t\tAND stockcategory.categoryid = stockmaster.categoryid';\n\n\t\t$resultdetails=DB_query($sqldetails,$db);\n\t\twhile ($myrow2=DB_fetch_array($resultdetails)){\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.$charelectronicinidet.'|'.$stockid;\n\t\t\t$stockid=$myrow2['stockid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockid;\n\t\t\t$stockcantidad=FormatNumberERP($myrow2['quantity']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcantidad;\n\t\t\t$stockdescrip=$myrow2['description'].' '.$myrow['ordertype'];\n\t\t\t// valores de los vendedorfees por linea\n\t\t\t$descrprop=\" (\";\n\t\t\t$sqlpropertyes=\"SELECT distinct p.InvoiceValue as val,sp.label\n\t\t\t FROM salesstockproperties p, stockcatproperties sp, stockmaster sm\n\t\t\t WHERE p.stkcatpropid=sp.stkcatpropid\n\t\t\t AND sp.categoryid=sm.categoryid\n\t\t\t\t AND p.orderno=\" . $orderno . \"\n\t\t\t\t AND p.typedocument=\" . $TypeInvoice . \"\n\t\t\t\t \t\tAND sp.reqatprint=1\n\t\t\t\t AND sm.stockid='\" . $stockid . \"'\";\n\t\t\t$resultpropertyes=DB_query($sqlpropertyes,$db);\n\t\t\t$xt=0;\n\t\t\twhile ($myrowprop=DB_fetch_array($resultpropertyes)){\n\t\t\t\t$traba=explode(\" \",$myrowprop['val']);\n\t\t\t\t$trab=$traba[0];\n\t\t\t\tif ($xt==0){\n\t\t\t\t\t\t\n\t\t\t\t\t$descrprop=$descrprop.' '.$myrowprop['label'].':'.$trab;\n\t\t\t\t}else{\n\t\t\t\t\t$descrprop=$descrprop.\" , \".$myrowprop['label'].':'.$trab;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$xt=$xt+1;\n\t\t\t}\n\t\t\t$descrprop=$descrprop.\" )\";\n\t\t\tif ($xt==0){//\n\t\t\t\t$descrprop=\"\";\n\t\t\t}\n\t\t\tif($myrow2['MensajePV'] <> \"\"){\n\t\t\t\t$descrprop = $descrprop.$myrow2['MensajePV'];\n\t\t\t}\n\t\t\t$descrnarrative=\"\";\n\t\t\t/*$sqlnarrative=\"SELECT narrative\n\t\t\t FROM salesorderdetails p\n\t\t\tWHERE p.orderno=\" . $orderno . \"\n\t\t\tAND p.stkcode='\" . $stockid . \"'\";\n\t\t\t$resultnarrative=DB_query($sqlnarrative,$db);\n\t\t\twhile ($myrownarrative=DB_fetch_array($resultnarrative)){\n\t\t\t$descrnarrative=$myrownarrative['narrative'];\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\t\t\t}*/\n\n\t\t\t$descrnarrative=str_replace('\\r','',str_replace('\\n','',$myrow2['narrative']));\n\t\t\t$descrnarrative=str_replace('|', '', $descrnarrative);\n\n\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t$descrnarrative=\"\";\n\t\t\t}\n\t\t\tif($myrow2['showdescription']==1){\n\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t}else{\n\t\t\t\tif (strlen($descrnarrative)==0){\n\t\t\t\t\t$stockdescripuno=$stockdescrip.$descrprop.$descrnarrative.$numberserie;\n\t\t\t\t}else{\n\t\t\t\t\t$stockdescripuno=$descrnarrative;\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockdescripuno;\n\t\t\t$stockprecio=FormatNumberERP($myrow2['fxprice']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockprecio;\n\t\t\t$stockneto=FormatNumberERP($myrow2['fxnet']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockneto;\n\t\t\t$stockunits=$myrow2['units'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockunits;\n\t\t\t$stockcat=$myrow2['categoryid'];\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$stockcat;\n\t\t\t$ordencompra=\"\";\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$ordencompra;\n\t\t\t// descuentos\n\t\t\t$discount1=FormatNumberERP($myrow2['discountpercent']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount1;\n\t\t\t$discount2=FormatNumberERP($myrow2['discountpercent1']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount2;\n\t\t\t$discount3=FormatNumberERP($myrow2['discountpercent2']*100);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$discount3;\n\t\t\t//subtotal\n\t\t\t//$subtotal=number_format($myrow2['subtotal'],2,'.','');\n\t\t\t//$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t// consulta de aduana\n\t\t\t$stkmoveno=$myrow2['stkmoveno'];\n\t\t\t$almacen=$myrow2['almacen'];\n\t\t\t\t\n\t\t\t$sqlstockmovestaxes=\"SELECT stkmoveno,taxauthid,taxrate,taxcalculationorder,taxontax,taxauthorities.description\n\t\t\t\t\t FROM stockmovestaxes,taxauthorities\n\t\t\t\t\t WHERE taxauthorities.taxid=stockmovestaxes.taxauthid\n\t\t\t\t\t\t AND stkmoveno=\".$stkmoveno;\n\t\t\t$resultstockmovestaxes=DB_query($sqlstockmovestaxes,$db);\n\t\t\twhile ($myrow3=DB_fetch_array($resultstockmovestaxes)){\n\t\t\t\t$impuesto=$myrow3['description'];\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.$charelectronictaxsini.'|'.$impuesto;\n\t\t\t\t$taxrate=FormatNumberERP($myrow3['taxrate']*100);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxrate;\n\t\t\t\t$taxratetotal=FormatNumberERP($myrow3['taxrate']*($myrow2['subtotal']));\n\t\t\t\t//$taxtotalratex=$myrow3['taxrate']*($myrow2['fxnet']*$myrow2['fxprice']);\n\t\t\t\t$taxtotalratex=$myrow3['taxrate']*($myrow2['subtotal']);\n\t\t\t\t$charelectronictaxs=$charelectronictaxs.'|'.$taxratetotal;\n\t\t\t}\n\t\t\t\t\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t$subtotal=FormatNumberERP($myrow2['subtotal']);\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$subtotal;\n\t\t\t\t\n\t\t\t\t\n\t\t\t$sqladuana=\"SELECT stockserialitems.customs as aduana,customs_number as noaduana,\n\t\t\t\t\tpedimento, DATE_FORMAT(customs_date,'%Y-%m-%d') as fechaaduana\n\t\t\t\t FROM stockserialmoves , stockmoves , stockserialitems\n\t\t\t\t WHERE stockmoves.stkmoveno=stockserialmoves.stockmoveno\n\t\t\t\t\tAND stockserialmoves.stockid=stockserialitems.stockid\n\t\t\t\t\tAND stockserialmoves.serialno=stockserialitems.serialno\n\t\t\t\t\tAND stockserialitems.loccode='\".$almacen.\"'\n\t\t\t\t\tAND stockmoves.stkmoveno=\".$stkmoveno.\"\n\t\t\t\t\tAND stockmoves.stockid='\".$stockid.\"'\";\n\t\t\t$Result= DB_query($sqladuana,$db);\n\t\t\tif (DB_num_rows($Result)==0) {\n\t\t\t\t$nameaduana=\"\";\n\t\t\t\t$numberaduana=\"\";\n\t\t\t\t$fechaaduana=\"\";\n\t\t\t}else{\n\t\t\t\t$myrowaduana = DB_fetch_array($Result);\n\t\t\t\t$aduana=$myrowaduana['aduana'];\n\t\t\t\t$separaaduana=explode(\"|\",$aduana);\n\t\t\t\t$nameaduana = $separaaduana[0];\n\t\t\t\t$numberaduana= $separaaduana[1];\n\t\t\t\t$fechaaduana= $separaaduana[2];\n\t\t\t\tif (strlen($nameaduana)==0 or strlen($numberaduana)==0 /*or !Is_Date($fechaaduana)*/){\n\t\t\t\t\t$nameaduana=\"\";\n\t\t\t\t\t$numberaduana=\"\";\n\t\t\t\t\t$fechaaduana=\"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$nameaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$numberaduana;\n\t\t\t$charelectronicdetail=$charelectronicdetail.'|'.$fechaaduana;\n\t\t}\n\t}\n\t// ivas retenidos\n\t$charelectronictaxsret='|'.chr(13).chr(10);//.'07|ISR|0.00';\n\tif ($rfccliente==\"XAXX010101000\"){\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\t}else{\n\t\t$cadenaenvio=$charelectronic.$charelectronicdetail.$charelectronictaxs.$charelectronictaxsret.$charelectronicEmbarque;\n\t\t$cadenaenviada=retornarString($cadenaenvio);\n\n\t}\n\t//echo '<pre><br>'.$cadenaenviada;\n\treturn $cadenaenviada;\n}", "public function inquire_bill_get(){\r\n// if (!$this->pronet_model->inquire_bill(1, '002', '0000000',0, null, 'E004', 3)) {\r\n if (!$this->pronet_model->inquire_bill(1, '101', '999999999999',0, null, 'E007', 10)) {//test for financial services using genesis\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "public function postProcess()\n {\n $grandTotal = 0;\n //CRM_Utils_System::flushCache();\n $values = $this->controller->exportValues();\n $grantThresholds = CRM_Core_OptionGroup::values('grant_thresholds', TRUE);\n $maxLimit = $grantThresholds['Maximum number of checks per pdf file'];\n $programID = implode(',',$values['grant_program']);\n\n // Get payment status ID\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'name' => 'grant_payment_status',\n );\n $result = civicrm_api('OptionGroup', 'get', $params);\n if ($result['is_error'] || empty($result['values'])) {\n CRM_Core_Error::fatal(ts('No \"grant_payment_status\" option group. Please refer to extension installation instructions.'));\n }\n $optionID = $result['values'][0]['id'];\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'option_group_id' => $optionID,\n 'name' => 'Printed',\n );\n $result = civicrm_api('OptionValue', 'get', $params);\n if ($result['is_error'] || empty($result['values'])) {\n CRM_Core_Error::fatal(ts('No \"Printed\" grant payment status option. Please refer to extension installation instructions.'));\n }\n $paidStatus[] = $result['values'][0]['value'];\n\n // Reprinted payment status\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'option_group_id' => $optionID,\n 'name' => 'Reprinted',\n );\n $result = civicrm_api('OptionValue', 'get', $params);\n if (!empty($result['values'])) {\n $paidStatus[] = $result['values'][0]['value'];\n }\n\n $paid = implode(',', $paidStatus); // payment status to include\n $minAmount = $values['t4a_min_payment'];\n\n // Get dates\n if ($values['start_date']['d'] != '' && $values['start_date']['M'] != '' && $values['start_date']['Y'] != '' &&\n $values['end_date']['d'] != '' && $values['end_date']['M'] != '' && $values['end_date']['Y'] != '') {\n $startDate = $values['start_date']['Y'] . '-' . $values['start_date']['M'] . '-' . $values['start_date']['d'];\n $endDate = $values['end_date']['Y'] . '-' . $values['end_date']['M'] . '-' . $values['end_date']['d'];\n }\n\n $select = \"select * from \";\n $count = \"select count(1) from \";\n $query = \"(select a.contact_id as id, a.currency, sum(a.amount) as total_amount from\n (select distinct p.id, p.contact_id, p.currency, p.payment_created_date, p.amount from civicrm_payment p\n inner join civicrm_entity_payment ep on p.id = ep.payment_id and ep.entity_table = 'civicrm_grant'\n inner join civicrm_grant g on ep.entity_id = g.id\n where g.grant_program_id in ($programID) and p.payment_status_id in ($paid) \";\n\n if (isset($startDate)) {\n $query .= \"and p.payment_date >= '\" . $startDate . \"' and p.payment_date <= '\" . $endDate . \"' \";\n }\n\n // Filter by contact\n if (isset($values['t4a_contact_id']) && $values['t4a_contact_id'] != '') {\n $query .= \"AND p.contact_id in (\" . $values['t4a_contact_id'] . ') ';\n }\n\n $query .= \") a\n group by a.contact_id) b\n WHERE b.total_amount > $minAmount\";\n\n $daoCount = CRM_Grant_DAO_Grant::singleValueQuery($count . $query); // Surely there's a better way of doing this?\n\n if ($daoCount > 0) {\n for ($i=0; $i<$daoCount; $i=$i+$maxLimit) {\n $dao = CRM_Grant_DAO_Grant::executeQuery($select . $query.\" LIMIT $i, $maxLimit\");\n $grantPayment = $payment_details = $amountsTotal = $details = array();\n while($dao->fetch()) {\n if (isset($amountsTotal[$dao->id])) {\n $amountsTotal[$dao->id] += $dao->total_amount;\n }\n else {\n $amountsTotal[$dao->id] = $dao->total_amount;\n }\n\n // Aggregate payments per contact id\n if (!empty($details[$dao->id]['total_amount'])) {\n $details[$dao->id]['total_amount'] += $dao->total_amount;\n } else {\n $details[$dao->id]['total_amount'] = $dao->total_amount;\n }\n $details[$dao->id]['currency'] = $dao->currency;\n\n }\n $totalAmount = 0;\n foreach ($details as $id => $value) {\n $grantPayment[$id]['contact_id'] = $id;\n $grantPayment[$id]['t4a_year'] = $values['t4a_year'];\n $grantPayment[$id]['first_name'] = $this->getFirstName($id);\n $grantPayment[$id]['last_name'] = $this->getLastName($id);\n $grantPayment[$id]['payable_to_address'] =\n CRM_Utils_Array::value('address', CRM_Grant_BAO_GrantProgram::getAddress($id, NULL, true));\n $grantPayment[$id]['amount'] = $details[$id]['total_amount'];\n $grantPayment[$id]['payer'] = wordwrap($values['t4a_payer'], 20, '<br />');\n $grantPayment[$id]['box'] = $values['t4a_box'];\n\n // Get contact's SIN\n $sinID = CRM_T4Ageneration_Form_GenerateXML::returnCustomFieldID();\n $params = array('entityID' => $id, 'custom_' . $sinID => 1);\n $sinResult = CRM_Core_BAO_CustomValueTable::getValues($params);\n // Insert spaces in SIN\n $sinArray = str_split($sinResult['custom_' . $sinID], 3);\n $grantPayment[$id]['sin'] = implode(' ', $sinArray);\n\n $totalAmount += $details[$id]['total_amount'];\n }\n\n $grandTotal += $totalAmount;\n $downloadNamePDF = check_plain('T4');\n $downloadNamePDF .= '_'.date('Ymdhis');\n $this->assign('grantPayment', $grantPayment);\n $downloadNamePDF .= '.pdf';\n $fileName = CRM_Utils_File::makeFileName($downloadNamePDF);\n $files[] = $fileName = $this->makePDF($fileName, $grantPayment, 'Grant Payment T4');\n }\n $config = CRM_Core_Config::singleton();\n\n $fileDAO = new CRM_Core_DAO_File();\n $fileDAO->uri = $fileName;\n $fileDAO->mime_type = 'application/zip';\n $fileDAO->upload_date = date('Ymdhis');\n $fileDAO->save();\n $grantPaymentFile = $fileDAO->id;\n\n $entityFileDAO = new CRM_Core_DAO_EntityFile();\n $entityFileDAO->entity_table = 'civicrm_contact';\n $entityFileDAO->entity_id = $_SESSION[ 'CiviCRM' ][ 'userID' ];\n $entityFileDAO->file_id = $grantPaymentFile;\n $entityFileDAO->save();\n\n //make Zip\n $zipFile = check_plain('T4').'_'.date('Ymdhis').'.zip';\n foreach($files as $file) {\n $source[] = $config->customFileUploadDir.$file;\n }\n $exportFormat = new CRM_Financial_BAO_ExportFormat_CSV();\n $zip = $exportFormat->createZip($source, $config->customFileUploadDir.$zipFile);\n\n foreach($source as $sourceFile) {\n unlink($sourceFile);\n }\n\n CRM_Core_Session::setStatus(ts('T4s have been generated.'), NULL, 'no-popup');\n\n $directory = strstr($config->customFileUploadDir, 'sites');\n global $base_url;\n $filePath = $base_url . '/' . $directory . $zipFile;\n $this->assign('download', $filePath);\n\n // Redirect to XML file generation. Maybe redirecting back to the grant search page would be best,\n // but we'd need a way to trigger the download ideally without overloading any templates\n CRM_Utils_System::redirect(CRM_Utils_System::url( 'civicrm/grant/t4adownload', 'reset=1&download='.$zipFile));\n } else {\n CRM_Core_Session::setStatus(ts('No payments exist for the given time period, program and contacts.'), NULL, 'no-popup');\n }\n\n parent::postProcess();\n }", "function IIFLbankPL($net_salary,$clubbed_emi,$company,$category,$DOB,$Company_Type, $reqtenure, $reqloanamount)\n\t{\n\t\t $net_salary= $net_salary - $clubbed_emi;\n\t\tlist($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"60\");\n\n\tif($category==\"SUPER CAT A\")\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 0;\n\t\t\t\t\t$intr=0;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1%\";\n\n\t\t\t}\n\t\telseif($category==\"CAT A\" || $category==\"CAT B\")\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 0;\n\t\t\t\t\t$intr=0;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1%\";\n\t\t\t\t//tenure\n\t\t\t\tif($category==\"CAT A\")\n\t\t\t\t{\n\t\t\t\t\tif($calterm>48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=48;\n\t\t\t\t\t\t$calprint_term=4;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($category==\"CAT B\")\n\t\t\t\t{\n\t\t\t\t\tif($calterm>36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=36;\n\t\t\t\t\t\t$calprint_term=3;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}//CAT B\n\t\telse\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1.50%\";\n\t\t\t\tif($calterm>36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=36;\n\t\t\t\t\t\t$calprint_term=3;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t}\n\t\t//non cat company\n\t\t$term=$calterm;\n\t\t$print_term=$calprint_term;\n\t\t\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//foir\n\t\t$princ=100000;\n\t\t$perlacemi=round($princ * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\n\t\tif($category==\"SUPER CAT A\" || $category==\"CAT A\")\n\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (60/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}elseif($category==\"CAT B\")\n\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (55/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$firstnet_salary=($net_salary* (50/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}//foir end\n\t\t\n\t\tif($category==\"SUPER CAT A\")\n\t\t{\n\t\t\tif($finalloanamount_dbr>2500000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 2500000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\t\telseif($category==\"CAT A\")\n\t\t{\n\t\t\tif($finalloanamount_dbr>2000000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 2000000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($finalloanamount_dbr>1500000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 1500000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\n\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\n\t\t$getterm=$print_term;\n\t\t$getemicalc=round($getloanamout * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\t\t\t\n\t\t\t$details['bank_code'] = \"IIFL\";\n\t\t\t$details['interest_rate'] = interestRateFormat($interestrate);\n\t\t\t$details['emi'] = $getemicalc;\n\t\t\t$details['emiperlac'] = $emiperlac;\n\t\t\t$details['tenure'] = $getterm;\n\t\t\t$details['loan_amount'] = round($getloanamout);\n\t\t\t$details['processing_fee'] = $proc_Fee;\n\t\t\t$details['category'] = $category;\n\t\t\treturn($details);\n\t}", "function CanvassNotInterestedReport($iFYID)\n{\n $pdf = new PDF_CanvassBriefingReport();\n\n $pdf->SetMargins(20, 20);\n\n $curY = 10;\n\n $pdf->SetFont('Times', '', 24);\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, gettext('Canvass Not Interested Report').' '.date(SystemConfig::getValue(\"sDateFormatLong\")));\n $pdf->SetFont('Times', '', 14);\n\n $curY += 10;\n\n $pdf->SetFont('Times', '', 12);\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchName'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchAddress'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchCity').', '.SystemConfig::getValue('sChurchState').' '.SystemConfig::getValue('sChurchZip'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchPhone').' '.SystemConfig::getValue('sChurchEmail'));\n $curY += 10;\n $pdf->SetFont('Times', '', 14);\n\n $pdf->SetAutoPageBreak(1);\n\n $pdf->Write(5, \"\\n\\n\");\n\n $sSQL = 'SELECT *,a.fam_Name FROM canvassdata_can LEFT JOIN family_fam a ON fam_ID=can_famID WHERE can_FYID='.$iFYID.' AND can_NotInterested=1';\n $rsCanvassData = RunQuery($sSQL);\n\n $pdf->SetFont('Times', '', 12);\n while ($aDatum = mysqli_fetch_array($rsCanvassData)) {\n $str = sprintf(\"%s : %s\\n\", $aDatum['fam_Name'], $aDatum['can_WhyNotInterested']);\n $pdf->Write(4, $str.\"\\n\\n\");\n }\n\n header('Pragma: public'); // Needed for IE when using a shared SSL certificate\n $pdf->Output('CanvassNotInterested'.date(SystemConfig::getValue(\"sDateFilenameFormat\")).'.pdf', 'D');\n}", "function feature_license_regulatory_approval_add() {\n\n// feature_license_add_exclusions_form_validate(&$form_stats);\n\n feature_license_add_exclusions_form_submit();\n return drupal_get_form('feature_license_add_exclusions_form');\n}", "function CanvassSummaryReport($iFYID)\n{\n $pdf = new PDF_CanvassBriefingReport();\n\n $pdf->SetMargins(20, 20);\n\n $curY = 10;\n\n $pdf->SetFont('Times', '', 24);\n\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, gettext('Canvass Summary Report').' '.date(SystemConfig::getValue(\"sDateFormatLong\")));\n\n $pdf->SetFont('Times', '', 14);\n\n $curY += 10;\n\n $pdf->SetFont('Times', '', 12);\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchName'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchAddress'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchCity').', '.SystemConfig::getValue('sChurchState').' '.SystemConfig::getValue('sChurchZip'));\n $curY += SystemConfig::getValue('incrementY');\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, SystemConfig::getValue('sChurchPhone').' '.SystemConfig::getValue('sChurchEmail'));\n $curY += 10;\n $pdf->SetFont('Times', '', 14);\n\n $pdf->SetAutoPageBreak(1);\n\n $pdf->Write(5, \"\\n\\n\");\n\n $sSQL = 'SELECT * FROM canvassdata_can WHERE can_FYID='.$iFYID;\n $rsCanvassData = RunQuery($sSQL);\n\n foreach ([gettext('Positive'), gettext('Critical'), gettext('Insightful'), gettext('Financial'), gettext('Suggestion'), gettext('WhyNotInterested')] as $colName) {\n $pdf->SetFont('Times', 'B', 14);\n\n $pdf->Write(5, $colName.' '.gettext('Comments').\"\\n\");\n //\t\t$pdf->WriteAt (SystemConfig::getValue(\"leftX\"), $curY, $colName . \" Comments\");\n $pdf->SetFont('Times', '', 12);\n while ($aDatum = mysqli_fetch_array($rsCanvassData)) {\n $str = $aDatum['can_'.$colName];\n if ($str != '') {\n $pdf->Write(4, $str.\"\\n\\n\");\n //\t\t\t\t$pdf->WriteAt (SystemConfig::getValue(\"leftX\"), $curY, $str);\n //\t\t\t\t$curY += SystemConfig::getValue(\"incrementY\");\n }\n }\n mysqli_data_seek($rsCanvassData, 0);\n }\n\n $pdf->Output('CanvassSummary'.date(SystemConfig::getValue(\"sDateFormatLong\")).'.pdf', 'D');\n}", "function CanvassBriefingSheets($iFYID)\n{\n $pdf = new PDF_CanvassBriefingReport();\n\n $aQuestions = file('CanvassQuestions.txt');\n $iNumQuestions = count($aQuestions);\n\n // Get all the families which need canvassing\n $sSQL = 'SELECT *, a.per_FirstName AS CanvasserFirstName, a.per_LastName AS CanvasserLastName FROM family_fam \n\t LEFT JOIN person_per a ON fam_Canvasser = a.per_ID\n\t\t\t WHERE fam_OkToCanvass=\"TRUE\" AND fam_Canvasser>0 ORDER BY fam_Canvasser, fam_Name';\n $rsFamilies = RunQuery($sSQL);\n\n $topPledgeLevel = TopPledgersLevel($iFYID, 20); // mjw fix this- percentage should be a config option\n $canvasserX = 160;\n\n $topY = 20;\n $memberNameX = SystemConfig::getValue('leftX');\n $memberGenderX = $memberNameX + 30;\n $memberRoleX = $memberGenderX + 15;\n $memberAgeX = $memberRoleX + 30;\n $memberClassX = $memberAgeX + 20;\n $memberCellX = $memberClassX + 20;\n $memberEmailX = $memberCellX + 25;\n\n while ($aFamily = mysqli_fetch_array($rsFamilies)) {\n $curY = $topY;\n\n $pdf->SetFont('Times', '', 24);\n\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, $aFamily['fam_Name']);\n\n $pdf->SetFont('Times', '', 16);\n $pdf->PrintRightJustified($canvasserX, $curY, gettext('Canvasser').': '.$aFamily['CanvasserFirstName'].' '.$aFamily['CanvasserLastName']);\n\n $curY += 8;\n\n $pdf->SetFont('Times', '', 14);\n\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, $pdf->MakeSalutation($aFamily['fam_ID']));\n $curY += 5;\n if ($aFamily['fam_Address1'] != '') {\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, $aFamily['fam_Address1']);\n $curY += 5;\n }\n if ($aFamily['fam_Address2'] != '') {\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, $aFamily['fam_Address2']);\n $curY += 5;\n }\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, $aFamily['fam_City'].', '.$aFamily['fam_State'].' '.$aFamily['fam_Zip']);\n $curY += 5;\n if ($aFamily['fam_Country'] != '' && $aFamily['fam_Country'] != 'United States' && $aFamily['fam_Country'] != 'USA') {\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, $aFamily['fam_Country']);\n $curY += 5;\n }\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, $pdf->StripPhone($aFamily['fam_HomePhone']));\n $curY += 5;\n\n // Get pledges for this fiscal year, this family\n $sSQL = 'SELECT plg_Amount FROM pledge_plg \n\t\t\t\t WHERE plg_FYID = '.$iFYID.' AND plg_PledgeOrPayment=\"Pledge\" AND plg_FamID = '.$aFamily['fam_ID'].' ORDER BY plg_Amount DESC';\n $rsPledges = RunQuery($sSQL);\n\n $pledgeCount = mysqli_num_rows($rsPledges);\n\n $sPledgeStatus = '';\n if ($pledgeCount == 0) {\n $sPledgeStatus .= gettext('Did not pledge');\n } else {\n $aPledge = mysqli_fetch_array($rsPledges);\n if ($aPledge['plg_Amount'] >= $topPledgeLevel) {\n $sPledgeStatus .= gettext('Top pledger');\n } else {\n $sPledgeStatus .= gettext('Pledged');\n }\n }\n\n $curY += SystemConfig::getValue('incrementY');\n\n $pdf->SetFont('Times', '', 12);\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, gettext('Pledge status').': ');\n $pdf->SetFont('Times', 'B', 12);\n $pdf->WriteAt(SystemConfig::getValue('leftX') + 25, $curY, $sPledgeStatus);\n $pdf->SetFont('Times', '', 12);\n\n $curY += 2 * SystemConfig::getValue('incrementY');\n\n //Get the family members for this family\n $sSQL = 'SELECT per_ID, per_Title, per_FirstName, per_LastName, per_Suffix, per_Gender,\n\t\t\t\tper_BirthMonth, per_BirthDay, per_BirthYear, per_Flags, \n\t\t\t\tper_HomePhone, per_WorkPhone, per_CellPhone, per_Email, per_WorkEmail,\n\t\t\t\tcls.lst_OptionName AS sClassName, fmr.lst_OptionName AS sFamRole\n\t\t\t\tFROM person_per\n\t\t\t\tLEFT JOIN list_lst cls ON per_cls_ID = cls.lst_OptionID AND cls.lst_ID = 1\n\t\t\t\tLEFT JOIN list_lst fmr ON per_fmr_ID = fmr.lst_OptionID AND fmr.lst_ID = 2\n\t\t\t\tWHERE per_fam_ID = '.$aFamily['fam_ID'].' ORDER BY fmr.lst_OptionSequence';\n $rsFamilyMembers = RunQuery($sSQL);\n\n $pdf->SetFont('Times', 'B', 10);\n\n $pdf->WriteAt($memberNameX, $curY, gettext('Name'));\n $pdf->WriteAt($memberGenderX, $curY, gettext('M/F'));\n $pdf->WriteAt($memberRoleX, $curY, gettext('Role'));\n $pdf->WriteAt($memberAgeX, $curY, gettext('Age'));\n $pdf->WriteAt($memberClassX, $curY, gettext('Member'));\n $pdf->WriteAt($memberCellX, $curY, gettext('Cell Phone'));\n $pdf->WriteAt($memberEmailX, $curY, gettext('Email'));\n $curY += SystemConfig::getValue('incrementY');\n\n $pdf->SetFont('Times', '', 10);\n\n while ($aFamilyMember = mysqli_fetch_array($rsFamilyMembers)) {\n if ($aFamilyMember['per_Gender'] == 1) {\n $sGender = 'M';\n } else {\n $sGender = 'F';\n }\n $sAge = MiscUtils::FormatAge($aFamilyMember['per_BirthMonth'], $aFamilyMember['per_BirthDay'], $aFamilyMember['per_BirthYear'], $aFamilyMember['per_Flags']);\n $pdf->WriteAt($memberNameX, $curY, $aFamilyMember['per_FirstName'].' '.$aFamilyMember['per_LastName']);\n $pdf->WriteAt($memberGenderX, $curY, $sGender);\n $pdf->WriteAt($memberRoleX, $curY, $aFamilyMember['sFamRole']);\n $pdf->WriteAt($memberAgeX, $curY, $sAge);\n $pdf->WriteAt($memberClassX, $curY, $aFamilyMember['sClassName']);\n $pdf->WriteAt($memberCellX, $curY, $pdf->StripPhone($aFamilyMember['per_CellPhone']));\n $pdf->WriteAt($memberEmailX, $curY, $aFamilyMember['per_Email']);\n $curY += SystemConfig::getValue('incrementY');\n }\n\n // Go back around to get group affiliations\n if (mysqli_num_rows($rsFamilyMembers) > 0) {\n mysqli_data_seek($rsFamilyMembers, 0);\n while ($aMember = mysqli_fetch_array($rsFamilyMembers)) {\n // Get the Groups this Person is assigned to\n $sSQL = 'SELECT grp_Name, role.lst_OptionName AS roleName\n\t\t\t\t\t\tFROM group_grp\n\t\t\t\t\t\tLEFT JOIN person2group2role_p2g2r ON p2g2r_grp_ID = grp_ID\n\t\t\t\t\t\tLEFT JOIN list_lst role ON lst_OptionID = p2g2r_rle_ID AND lst_ID = grp_RoleListID\n\t\t\t\t\t\tWHERE person2group2role_p2g2r.p2g2r_per_ID = '.$aMember['per_ID'].'\n\t\t\t\t\t\tORDER BY grp_Name';\n $rsAssignedGroups = RunQuery($sSQL);\n if (mysqli_num_rows($rsAssignedGroups) > 0) {\n $groupStr = 'Assigned groups for '.$aMember['per_FirstName'].' '.$aMember['per_LastName'].': ';\n\n $countGroups = 0;\n while ($aGroup = mysqli_fetch_array($rsAssignedGroups)) {\n $groupStr .= $aGroup['grp_Name'].' ('.$aGroup['roleName'].') ';\n if ($countGroups == 0) {\n $curY += SystemConfig::getValue('incrementY');\n }\n\n if (++$countGroups >= 2) {\n $countGroups = 0;\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, $groupStr);\n $groupStr = ' ';\n }\n }\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, $groupStr);\n }\n }\n }\n $curY += 2 * SystemConfig::getValue('incrementY');\n $spaceLeft = 275 - $curY;\n $spacePerQuestion = $spaceLeft / $iNumQuestions;\n for ($i = 0; $i < $iNumQuestions; $i++) {\n $pdf->WriteAt(SystemConfig::getValue('leftX'), $curY, ($i + 1).'. '.$aQuestions[$i]);\n $curY += $spacePerQuestion;\n }\n\n $pdf->AddPage();\n }\n\n $pdf->Output('CanvassBriefing'.date(SystemConfig::getValue(\"sDateFormatLong\")).'.pdf', 'D');\n}", "public function testReportsSkillv1reportscalibrationidskillsid2()\n {\n\n }", "function getReport() ;", "function quantizer_expenses_general_report($start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerGeneralExpenses($start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "function ooffice_write_certificat( $record, $referentiel_instance, $referentiel_referentiel, $liste_empreintes, $liste_poids, $param) {\r\nglobal $CFG;\r\nglobal $odt;\r\n \t// add comment and div tags\r\n\t\t\r\n\t\tif ($record){\r\n\t\t\t// DEBUG\r\n\t\t\t// echo \"DEBUG LIGNE 1021\";\r\n\t\t\t// print_r($referentiel_instance);\r\n\t\t\t$id = trim( $record->id );\r\n $commentaire_certificat = recode_utf8_vers_latin1(trim($record->commentaire_certificat));\r\n $synthese_certificat = recode_utf8_vers_latin1(trim($record->synthese_certificat));\r\n\t\t\t$competences_activite = recode_utf8_vers_latin1(trim($record->competences_activite)) ;\r\n $competences_certificat = recode_utf8_vers_latin1(trim($record->competences_certificat)) ;\r\n $decision_jury = recode_utf8_vers_latin1(trim($record->decision_jury));\r\n\t\t\tif ($record->date_decision){\r\n $date_decision = userdate(trim($record->date_decision));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$date_decision =\"\";\r\n\t\t\t}\r\n $userid = trim( $record->userid);\r\n $teacherid = trim( $record->teacherid);\r\n\t\t\tif ($teacherid!=0){\r\n\t\t\t\t$nom_prenom_teacher=recode_utf8_vers_latin1(referentiel_get_user_info($teacherid));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$nom_prenom_teacher=\"\";\r\n\t\t\t}\r\n \r\n $ref_referentiel = trim( $record->ref_referentiel);\r\n\t\t\t// $ref_referentiel=$referentiel_id;\r\n\t\t\t$verrou = trim( $record->verrou );\r\n\t\t\t$valide = trim( $record->valide );\r\n\t\t\t$evaluation = trim( $record->evaluation );\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// USER\r\n\t\t\tif (isset($record->userid) && ($record->userid>0)){\r\n\t\t\t\t$record_etudiant = referentiel_get_etudiant_user($record->userid);\r\n\t\t \tif ($record_etudiant){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$odt->SetLeftMargin(15);\r\n\t\t\t\t\t\r\n\t\t\t\t\tooffice_write_referentiel($referentiel_instance, $referentiel_referentiel, $param);\r\n\t\t\t\t\t\r\n\t\t\t\t\tooffice_write_etudiant( $record_etudiant, $param);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$odt->SetFont('Arial','',12);\r\n\t\t\t\t\tif ($param->certificat_sel_decision_jury){\r\n\t\t\t\t\t\tif (($date_decision!=\"\") && ($decision_jury!=\"\")){\r\n\t\t\t\t\t\t\t$odt->Write(1,$decision_jury);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// $odt->SetFont('Arial','B',10); \r\n\t\t\t\t\t// $odt->Write(1,\"ID : \");\r\n\t\t\t\t\t// $odt->SetFont('Arial','',10);\r\n\t\t\t\t\t// $odt->Write(1,\"$id\");\r\n\t\t\t\t\t// $odt->Ln(1);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$odt->SetFont('Arial','B',12); \r\n \t$odt->Write(1,recode_utf8_vers_latin1(get_string('competences','referentiel')).\": \");\r\n\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\tif ($param->certificat_sel_activite_competences){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',9); \r\n\t \t$odt->Write(1,recode_utf8_vers_latin1(get_string('competences_activite','referentiel')).\": \");\r\n\t\t\t\t\t\t$odt->Ln(1); \r\n \t \tooffice_liste_competences_certificat($ref_referentiel, '/',':', $competences_activite, $liste_empreintes, 0, 9, 8);\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($param->certificat_sel_certificat_competences){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10); \r\n\t \t$odt->Write(1,recode_utf8_vers_latin1(get_string('competences_certificat','referentiel')).\": \");\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n \t \tooffice_liste_competences_certificat($ref_referentiel, '/',':', $competences_certificat, $liste_empreintes,0,10,9);\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (($param->certificat_sel_certificat_competences) \r\n && ($param->certificat_sel_certificat_detail)){\r\n\t\t\t\t\t\tooffice_referentiel_affiche_detail_competences('/',':',$competences_certificat, $liste_empreintes, $liste_poids);\r\n }\t\t\t\t\t\r\n\t\t\t\t\tif ($param->certificat_sel_certificat_pourcent){\r\n // $odt->SetFont('Arial','B',10);\r\n \t \t// $odt->Write(1,recode_utf8_vers_latin1(get_string('pourcentage','referentiel')).\" :\");\r\n\t\t\t\t\t // $odt->Ln(1);\r\n\t\t\t\t\t ooffice_referentiel_affiche_certificat_consolide($ref_referentiel, '/',':', $competences_certificat, 10,9,8);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($param->certificat_sel_commentaire){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10);\r\n \t \t$odt->Write(1,recode_utf8_vers_latin1(get_string('commentaire','referentiel')).\": \");\r\n\t\t\t\t\t\t$odt->SetFont('Arial','',10);\r\n \t \t$odt->Write(1,\"$commentaire_certificat \");\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10);\r\n \t \t$odt->Write(1,recode_utf8_vers_latin1(get_string('synthese_certificat','referentiel')).\": \");\r\n\t\t\t\t\t\t$odt->SetFont('Arial','',10);\r\n \t \t$odt->Write(1,\"$synthese_certificat \");\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($param->certificat_sel_decision_jury){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10);\r\n\t\t\t $odt->Write(1, recode_utf8_vers_latin1(get_string('decision','referentiel')).\" : \");\r\n\t\t\t\t\t\t$odt->SetFont('Arial','',10);\r\n\t\t \t $odt->Write(1,\"$decision_jury\");\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($param->certificat_sel_certificat_referents){\r\n\t\t\t\t\t\t$odt->SetFont('Arial','B',10);\r\n\t\t\t\t\t\t$odt->Write(1,recode_utf8_vers_latin1(get_string('enseignant','referentiel')).\" : \");\r\n\t\t\t\t\t\t$odt->SetFont('Arial','',10);\r\n\t\t\t\t\t\t$odt->Write(1,$nom_prenom_teacher);\r\n\t\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t$odt->Write(1,\" R�f�rentiel : $ref_referentiel\");\r\n\t\t\t\t\t$odt->Ln(1);\r\n\t\t $odt->Write(1,\" Verrou : $verrou, Valide : $valide, Evaluation : $evaluation\");\r\n\t\t\t\t\t$odt->Ln(1);\r\n\t\t\t\t\t*/\r\n\t\t\t\t\t$odt->Ln(20);\r\n\t\t\t\t\t$odt->Writeparagraphe(1, get_string('date_signature','referentiel', date(\"d/m/Y\")));\r\n\t\t\t\t\t$odt->AddPage();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n}", "public function getPraposalFinsummary( $param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n\n\n $loan = null;\n $loanType = null;\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $groupType = Config::get('constants.CONST_FIN_GROUP_TYPE_RATIO');\n $financialGroups = FinancialGroup::with('financialEntries')->where('type', '=', $groupType)->where('status', '=', 1)->orderBy('sortOrder')->get();\n $helper = new ExpressionHelper($loanId);\n $financialDataRecords = BalanceSheet::where('loan_id', '=', $loanId)->get();\n\n\n $financialDataExpressionsMap = $helper->calculateRatios();\n //dd($bl_year, $groupType, $financialGroups, $financialDataExpressionsMap);\n $financialDataMap = new Collection();\n $showFormulaText = true;\n $financialProfitLoss = ProfitLoss::where('loan_id', '=', $loanId)->get();\n $test = Cashflow::where('loan_id', '=', $loanId)->get();\n $fromCashflowTable = Cashflow::periodsCashflowIdMap($loanId);\n //echo $existingPeriodsCashsasflowIdMap[76]->value;\n /* echo \"<pre>\";\n print_r($fromCashflowTable['FY 2017-18(Prov)'][79]->value);\n echo \"</pre>\";*/\n\n \n $ratios = Ratio::where('loan_id', '=', $loanId)->get();\n /* echo \"<pre>\";\n print_r($ratios);\n echo \"</pre>\";\n */ \n $subViewType = 'loans._finsummary';\n $formaction = 'Loans\\LoansController@postPraposalFinsummary';\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n return view('loans.praposalCreditEdit', compact(\n 'subViewType',\n 'loan',\n 'loanId',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'formaction',\n 'bl_year',\n 'financialGroups',\n 'groupType',\n 'financialDataExpressionsMap',\n 'showFormulaText',\n 'financialDataMap',\n 'fromCashflowTable',\n 'validLoanHelper',\n 'userProfileFirm',\n 'loanUserProfile',\n 'companySharePledged',\n 'bscNscCode',\n 'financialProfitLoss',\n 'ratios',\n 'financialDataRecords'\n ));\n }", "public function setClaimType($claimType)\r\n {\r\n if ($claimType == \"repair-warranty\" || $claimType == \"repair-no-warranty\" ||\r\n $claimType == \"repair-no-transaction\")\r\n {\r\n $this->claimType = $claimType;\r\n }\r\n else\r\n {\r\n die(\"<h2> Error - Invaild Claim Type provided for setClaimType() method. Must be ethier repair-warranty, repair-no-warranty or repair-no-transaction.</h2>\");\r\n }\r\n }", "public function export_company_generate_invoice($id) \n {\n $tenant_id = $this->tenant_id;\n \n if (empty($id)) \n {\n return show_404();\n }\n// $result = $this->classtraineemodel->get_enroll_invoice($id);\n \n $result = $this->classtraineemodel->get_company_enroll_invoice($id);\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($result->invoice_id);\n \n //sk st\n $discount = $this->classtraineemodel->get_discount($result->pymnt_due_id);\n $result->discount_label = $discount->discount_type;\n $result->discount_rate = $discount->discount_rate;\n //sk ed\n \n //\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($this->tenant_id, $result->company_id);//skm1\n $result->company_person_name = $company_person[0]->first_name;//skm2\n \n }\n\n $result->total_inv_discnt = round($result->total_inv_discnt, 2);\n $result->total_unit_fees = round($result->total_unit_fees, 2);\n $result->total_inv_subsdy = round($result->total_inv_subsdy, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n\n $feesdue = $result->total_unit_fees - $result->total_inv_discnt;\n $result->payment_due_details = $this->classtraineemodel->get_company_payment_due_details($id);\n \n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach($result->payment_due_details as $key=>$val)\n {\n $received = empty($user_paid[$val->user_id]) ? 0 : $user_paid[$val->user_id];\n $refunded = empty($user_refund[$val->user_id]) ? 0 : $user_refund[$val->user_id];\n $inv_amt+=$val->total_amount_due;\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($val->total_amount_due + $refunded) - $received) <= 0)\n {\n $payment_label = 'PAID';\n }\n else\n { \n \n if($received > 0 && $val->payment_status == 'PARTPAID')\n {\n $payment_label = 'PART PAID';\n \n }else if($refunded > 0)\n { \n $payment_label = 'REFUNDED'; \n } \n else\n { \n if($received == 0)\n {\n $payment_label = 'NOT PAID';\n }\n else if($received > 0)\n {\n $payment_label = 'PART PAID';\n }\n }\n }\n $result->payment_due_details[$key]->payment_label = $payment_label;\n }\n \n $payable_amount=$inv_amt-$received_amt; \n $result->payble_amount=$inv_amt+$refunded_amt-$received_amt;\n\n $this->load->helper('pdf_reports_helper');\n if($tenant_id =='T17'){\n generate_company_pdf_invoice_everest($result);\n }else{\n generate_company_pdf_invoice_all($result);\n }\n \n }", "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 }", "function Generate($objInvoice, $objAccount)\n \t{\n \t\t\n \t}", "function genrate_inspectorassessmenthistory_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(7,15,15,15,14,16,\n\t\t 12,13,12,12,21,11,\n\t\t\t\t\t\t\t\t 15,12);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x = $this->GetX();\t\t\t\n\t\t\t$y = $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No.: ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(164, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(164, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t//$vehiclelicno\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t}\n\t}\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t\tif($c==10){\n\t\t\t\n\t\t\t\t$this->SetFont('Arial', 'B', 5);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif( $c == 9 || $c == 11 || $c == 13 || $c == 12){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n \t\t if($c==$length)\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t else\n\t\t\t \n\t\t\t $this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\t\t\t \n\t\t\t $this->SetY($y); //Reset the write point\n \n\t\t\t $this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\t\t\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $vc_customer_name = \tucfirst($val['AssessmentVehicleMaster']['vc_customer_name']);\n\t\t $dt_created_date=\t\tdate('d M Y', strtotime($val['AssessmentVehicleDetail']['dt_created_date']));\n\t\t $vc_assessment_no=\t\t$val['AssessmentVehicleDetail']['vc_assessment_no'];\n\t\t $vc_vehicle_lic_no= \t$val['AssessmentVehicleDetail']['vc_vehicle_lic_no'];\n\t\t $vc_vehicle_reg_no=\t\t$val['AssessmentVehicleDetail']['vc_vehicle_reg_no'];\n\t\t\t$vc_prtype_name = \t\t$val['VehicleDetail']['VEHICLETYPE']['vc_prtype_name'];\n\t\t $vc_pay_frequency = \t$val['AssessmentVehicleDetail']['vc_pay_frequency'];\n\t\t $vc_prev_end_om = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_prev_end_om']);\n\t\t $vc_end_om = \t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_end_om']);\n\t\t $vc_km_travelled = \t\tnumber_format($val['AssessmentVehicleDetail']['vc_km_travelled']);\n\t\t $vc_rate =\t\t\t \tnumber_format($val['AssessmentVehicleDetail']['vc_rate'],2,'.',',');\n\t\t $vc_payable =\t\t\tnumber_format($val['AssessmentVehicleDetail']['vc_payable'],2,'.',',');\n\t\t $vc_status =\t\t\t$allconstants[$val['AssessmentVehicleMaster']['vc_status']];\n\n\t\t\t$font_size = 6;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$alignvalue='C';\n\t\t\t\n\t\t\t$col[] = array('text' => $i+1, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $dt_created_date, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_assessment_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prtype_name, 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_pay_frequency, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'R';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_prev_end_om, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_end_om, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_km_travelled, 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' => $vc_rate, 'width' =>$columnwidtharrays[11], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_payable, 'width' =>$columnwidtharrays[12], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue = 'L';\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_status, 'width' =>$columnwidtharrays[13], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t}\n\t\n\t}", "public function reportForDuty()\n {\n //Do stuff ...\n }", "public function getWarranty()\n {\n return $this->warranty;\n }", "public function gen_inv_pdf_basedon_subsidy($invoice_id, $is_subsidy) {\n $tenant_id = $this->tenant_id;\n if (empty($invoice_id)) {\n return show_404();\n }\n if (empty($is_subsidy)) {\n $res = $this->classtraineemodel->get_company_invoice_no_subsidy($invoice_id);\n $text = 'b';\n } else {\n $res = $this->classtraineemodel->get_company_invoice_subsidy($invoice_id);\n $text = 'a';\n }\n \n $result = $res[0];\n //added by pritam to generate previous invoice number\n $result->previous_inv_id = $this->classtraineemodel->get_enroll_prev_invoice($invoice_id);\n //\n $result->invoice_label = $text;\n $result->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_state), ', ');\n $result->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($result->tenant_country), ', ');\n\n $result->inv_year = date('Y', strtotime($result->inv_date));\n $result->inv_date = date('d/m/Y', strtotime($result->inv_date));\n $result->discount_label = rtrim($this->course->get_metadata_on_parameter_id($result->discount_type), ', ');\n if ($result->total_gst) {\n $result->gst_label = 'GST ON, ' . rtrim($this->course->get_metadata_on_parameter_id($result->gst_rule), ', ');\n } else {\n $result->gst_label = 'GST OFF';\n }\n $course_manager = $this->course->get_managers($courses->crse_manager);\n $length = stripos($course_manager, ', ');\n $result->course_manager = (!empty($length)) ? substr($course_manager, 0, $length) : $course_manager;\n\n if ($result->company_id[0] == 'T') {\n $result->company_name = $result->tenant_name;\n $result->company_details->comp_state = $result->tenant_state;\n $result->company_details->comp_cntry = $result->tenant_country;\n $result->company_details->comp_phone = $result->tenant_contact_num;\n $result->company_details->comp_address = $result->tenant_address;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $result->company_id);\n $result->company_details = $company_details[0];\n $result->company_details->comp_state = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_state), ', ');\n $result->company_details->comp_cntry = rtrim($this->course->get_metadata_on_parameter_id($result->company_details->comp_cntry), ', ');\n $result->company_name = $company_details[0]->company_name;\n \n $company_person = $this->company->get_company_user($result->tenant_id, $result->company_id);//sk1\n $result->company_person_name = $company_person[0]->first_name;//sk2\n \n }\n //$result->discount_rate = round($result->discount_rate, 2);\n $result->gst_rate = round($result->gst_rate, 2);\n $total_unitfees = 0;\n $total_discount = 0;\n $total_gst = 0;\n $total_subsidy = 0;\n $total_inv_amount = 0;\n $company_received = $this->classtraineemodel->company_payment_recd($result->invoice_id);\n $user_paid = array();\n foreach ($company_received as $k => $v) {\n $user_paid[$v->user_id] = round($v->amount_recd,2);\n }\n $company_refunded = $this->classtraineemodel->company_payment_refund($result->invoice_id);\n $user_refund = array();\n foreach ($company_refunded as $k => $v) {\n $user_refund[$v->user_id] = round($v->refund_amount,2);\n }\n foreach ($res as $k => $row) {\n $received = empty($user_paid[$row->user_id]) ? 0 : $user_paid[$row->user_id];\n $refunded = empty($user_refund[$row->user_id]) ? 0 : $user_refund[$row->user_id];\n $received_amt+=$received;\n $refunded_amt+=$refunded;\n if((($row->total_amount_due + $refunded) - $received) <= 0){\n $payment_label = 'PAID';\n }else{ \n if($refunded > 0){\n $payment_label = 'REFUNDED'; \n } else{ \n if($received == 0){\n $payment_label = 'NOT PAID';\n }else if($received > 0){\n $payment_label = 'PART PAID';\n }\n }\n }\n $res[$k]->payment_label = $payment_label;\n $total_unitfees +=$row->class_fees;\n $total_discount += ($row->class_fees * ($result->discount_rate / 100));\n $total_gst += $row->gst_amount;\n $total_subsidy += $row->subsidy_amount;\n $total_inv_amount += $row->total_amount_due;\n $result->total_inv_amount1 = $row->total_inv_amount;\n }\n $result->payble_amount=$total_inv_amount+$refunded_amt-$received_amt;\n $result->total_unit_fees = round($total_unitfees, 2);\n $result->total_inv_discnt = round($total_discount, 2);\n $result->total_inv_subsdy = round($total_subsidy, 2);\n $result->total_gst = round($total_gst, 2);\n $result->indi_disc_total = ($result->class_fees * ($result->discount_rate / 100));\n $result->total_inv_amount = round($total_inv_amount, 2);\n $result->payment_due_details = $res;\n\n $this->load->helper('pdf_reports_helper');\n generate_company_pdf_invoice($result);\n }", "function getEmployeeMedicalQuota($db, $strIDEmployee = \"\", $strEmployeeCompany = \"\", $strYear = \"\", $strClaimID = \"\")\n{\n $arrResult = [];\n if ($strIDEmployee === \"\") {\n return $arrResult;\n }\n if ($strYear == \"\") {\n $strYear = date(\"Y\");\n }\n // cari data master medical type untuk generate header tabel plafon\n $strSQL = \"SELECT id, \\\"type\\\", code FROM hrd_medical_type\";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n $arrMedicalType[$rowDb['type']][$rowDb['id']] = $rowDb['code'];\n }\n // cari data plafon outpatient\n $arrPlatform = [];\n $strSQL = \"SELECT amount + amount1 + amount2 AS amount FROM hrd_medical_quota_primary\n WHERE id_employee = '\" . $strIDEmployee . \"' AND quota_year = $strYear \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n $fltQuota = $rowDb['amount'];\n }\n // cari data plafon lainnya\n $strSQL = \"SELECT t1.amount, t2.\\\"type\\\", t2.code\n FROM hrd_medical_quota_secondary AS t1 LEFT JOIN hrd_medical_type AS t2 ON t1.id_medical_type = t2.id \n WHERE id_employee = '\" . $strIDEmployee . \"' AND quota_year = $strYear \";\n $resDb = $db->execute($strSQL);\n //echo $strSQL;\n while ($rowDb = $db->fetchrow($resDb)) {\n $arrQuota[$rowDb['type']][$rowDb['code']] = $rowDb['amount'];\n }\n // baca pemakaian obat semua karyawan dalam tahun yang bersangkutan\n // baca data claim rawat jalan yang udah dilakukkan karyawan\n $arrMedicalClaim = [];\n $strSQL = \"SELECT \\\"type\\\", medical_code as code, SUM(t1.approved_cost) AS total, t2.id_employee FROM hrd_medical_claim AS t1, \";\n $strSQL .= \"hrd_medical_claim_master AS t2 WHERE t1.id_master = t2.id \";\n $strSQL .= \"AND t2.status <> '\" . REQUEST_STATUS_DENIED . \"' \";\n if ($strClaimID != \"\") {\n $strSQL .= \"AND t1.id_master <> '$strClaimID' \";\n }\n if (isset($strIDEmployee) && $strIDEmployee != \"\") {\n $strSQL .= \"AND t2.id_employee = \" . $strIDEmployee . \" \";\n }\n $strSQL .= \"AND EXTRACT(year FROM claim_date) = '$strYear' \";\n $strSQL .= \"GROUP BY \\\"type\\\", medical_code, t2.id_employee \";\n $resT = $db->execute($strSQL);\n while ($rowT = $db->fetchrow($resT)) {\n if ($rowT['type'] == MEDICAL_TYPE_OUTPATIENT) {\n $fltClaim = (isset($fltClaim)) ? $fltClaim += $rowT['total'] : $fltClaim = $rowT['total'];\n } else {\n $arrMedicalClaim[$rowT['type']][$rowT['code']] = (isset($arrMedicalClaim[$rowT['type']][$rowT['code']])) ? $arrMedicalClaim[$rowT['type']][$rowT['code']] += $rowT['total'] : $rowT['total'];\n }\n }\n if (!isset($fltClaim)) {\n $fltClaim = 0;\n }\n if (!isset($fltQuota)) {\n $fltQuota = 0;\n }\n $arrResult[MEDICAL_TYPE_OUTPATIENT] = $fltQuota - $fltClaim;\n foreach ($arrMedicalType AS $strType => $arrDetail) {\n foreach ($arrDetail AS $strIDMedicalType => $strCode) {\n if (!isset($arrMedicalClaim[$strType][$strCode])) {\n $arrMedicalClaim[$strType][$strCode] = 0;\n }\n $arrResult[$strType][$strCode] = $arrQuota[$strType][$strCode] - $arrMedicalClaim[$strType][$strCode];\n }\n }\n return $arrResult;\n}", "private function __print_receipt()\n {\n\t//Assuming range\n\t$ret = $this->__view_receipt();\n\t$receipthead = $this->__receipt_head_html();\n\t$receiptfoot = $this->__receipt_foot_html();\n\t\n\t$receipts = $receipthead. sprintf(\"\n\t<div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t\n\t\", $ret, $ret, $ret, $ret, $ret, $ret).$receiptfoot;\n\t\n\techo $receipts;\n }", "function kprojectreports_billable($start, $end, $report) {\n $output = '';\n $exclude_clients = array('Koumbit'); // HARDCODE XXX FIXME\n\n if (isset($_REQUEST['daterun'])) {\n $date_end = strtotime(check_plain($_REQUEST['daterun']));\n drupal_set_message('End date: ' . check_plain($_REQUEST['daterun']));\n } else {\n $date_end = time();\n }\n\n $report_lines = kprojectreports_billable_get_summary_global($date_end);\n\n $output .= '<table>';\n $output .= '<tr>'\n . '<th>' . t('Client') . '</th>'\n . '<th>' . t('Contract') . '</th>'\n . '<th>' . t('Lead') . '</th>'\n . '<th><span title=\"' . t('Number of hours that have not yet been billed.') . '\">' . t('Billable'). '</span></th>'\n . '<th><span title=\"' . t('Total number of hours worked on the contract.') . '\">' . t('Total work') . '</span></th>'\n . '<th><span title=\"' . t('Initial contract estimate (hours).') . '\">' . t('Estimate') . '</span></th>'\n . '<th><span title=\"' . t('Percentage of hours that should be billed (billable / total * 100)') . '\">' . t('% Billable') . '</span></th>'\n . '<th><span title=\"' . t('Percentage of hours worked on the project, compared to the initial contract estimate.') . '\">' . t('% Worked') . '</span></th>'\n . '</tr>';\n\n foreach ($report_lines as $client_name => $tmp) {\n foreach ($tmp as $key => $val) {\n if (! in_array($val['client_title'], $exclude_clients)) {\n if ($val['estimate'] > 0) {\n $pct_billable = $val['hours_period'] / $val['estimate'] * 100;\n $pct_total = $val['hours_total'] / $val['estimate'] * 100;\n } else {\n $pct_billable = 0;\n $pct_total = 0;\n }\n\n $output .= '<tr>'\n . '<td>' . $val['client_title'] . '</td>'\n . '<td>' . $val['contract_title'] . '</td>'\n . '<td>' . $val['contract_lead'] . '</td>'\n . '<td style=\"text-align: right;\">' . sprintf('%.2f', $val['hours_period']) . '</td>'\n . '<td style=\"text-align: right;\">' . sprintf('%.2f', $val['hours_total']) . '</td>'\n . '<td style=\"text-align: right;\" ' . ($val['estimate'] ? '' : 'style=\"color: red;\"') . '>' . sprintf('%.2f', $val['estimate']) . '</td>'\n . '<td style=\"text-align: right;\" ' . ($pct_total > 100 ? 'style=\"color: red;\"' : ($pct_total > 80 ? 'style=\"color: #AAAA00;\"' : '')) . '>'\n . sprintf('%.2f', $pct_billable) . '%'\n . '</td>'\n . '<td style=\"text-align: right;\" ' . ($pct_total > 100 ? 'style=\"color: red;\"' : ($pct_total > 80 ? 'style=\"color: #AAAA00;\"' : '')) . '>'\n . sprintf('%.2f', $pct_total) . '%' \n . '</td>'\n . '</tr>';\n\n $totalbillable += $val['hours_period'];\n }\n }\n }\n\n $output .= '<tr>'\n . '<td colspan=\"3\"><strong>' . t('Total billable') . '</strong></td>'\n . '<td style=\"text-align: right;\"><strong>' . sprintf('%.2f', $totalbillable) . '</strong></td>'\n . '</tr>';\n\n $output .= '</table>';\n\n return $output;\n}", "public function requirements()\n\t{\n\t\t$data['title'] = 'Requirements';\n\t\t$data['requirementsdata'] = $this->getrequirement();\n\t\t$data['facilityall'] = $this->getallfacility();\n\t\t$data['unittype'] = $this->getunit();\n\t\t$data['ratereferrence'] = $this->getratereferrence();\n\t\t$this->template\n\t\t\t->set_layout('student_template')\n\t\t\t->build('requirements',$data);\n\t}", "function receipt_header($x, $y)\n{\n\tglobal $receipt, $pdf;\n\n\t$font_size = 12;\n\t$yy = $y;\n\t$xmax = $x + 420;\n\t$pdf->line($x, $y, $xmax, $y);\n\t$y -= $font_size;\n\n//\ttext_align_left($x + 2,$y + 2,$font_size - 4, iconv(\"UTF-8\", \"ISO-8859-2\", trans('Stamp:')));\n\t$y = text_wrap($x + 2, $y, 170, $font_size - 2, '<b>'.iconv(\"UTF-8\", \"ISO-8859-2\", $receipt['d_name']).'</b>', NULL);\n\t$y = text_wrap($x + 2, $y, 170, $font_size - 2, '<b>'.iconv(\"UTF-8\", \"ISO-8859-2\", $receipt['d_address']).'</b>', NULL);\n\ttext_wrap($x + 2, $y, 170, $font_size - 2,'<b>'.iconv(\"UTF-8\", \"ISO-8859-2\", $receipt['d_zip'].' '.$receipt['d_city']).'</b>', NULL);\n\t$y = $yy - $font_size;\n\n\tif($receipt['type'] == 'out')\n\t\ttext_align_center($xmax - 70, $y - 10, $font_size + 4, '<b>'.iconv(\"UTF-8\", \"ISO-8859-2\", trans('CR-out')).'</b>');\n\telse\n\t\ttext_align_center($xmax - 70, $y - 10, $font_size + 4, '<b>'.iconv(\"UTF-8\", \"ISO-8859-2\", trans('CR-in')).'</b>');\n\ttext_align_center($xmax - 70, $y - 30, $font_size, '<b>'.iconv(\"UTF-8\", \"ISO-8859-2\", trans('No. $a',$receipt['number'])).'</b>');\n\n\tif($receipt['type'] == 'out')\n\t\t$y -= text_align_center($x + 210, $y, $font_size, '<b>'.iconv(\"UTF-8\", \"ISO-8859-2\", trans('Proof of Pay-out')).'</b>');\n\telse\n\t\t$y -= text_align_center($x + 210, $y, $font_size, '<b>'.iconv(\"UTF-8\", \"ISO-8859-2\", trans('Proof of Payment')).'</b>');\n\t$y -= text_align_center($x + 210, $y, $font_size + 4,'<b>'.iconv(\"UTF-8\", \"ISO-8859-2\", trans('Receipt')).'</b>');\n\t$y -= text_align_center($x + 210, $y, $font_size, iconv(\"UTF-8\", \"ISO-8859-2\", trans('Date:')).' '.date(\"Y/m/d\", $receipt['cdate']));\n\n\t$y += $font_size / 2;\n\t$pdf->line($x, $yy, $x, $y);\n\t$pdf->line($x + 140, $yy, $x + 140, $y);\n\t$pdf->line($x + 280, $yy, $x + 280, $y);\n\t$pdf->line($xmax, $yy, $xmax, $y);\n\t$pdf->line($x, $y, $xmax, $y);\n\n\treturn $y;\n}", "function wcfm_wc_warranty_products_manage_meta_save( $new_product_id, $wcfm_products_manage_form_data ) {\r\n\t\tglobal $WCFM;\r\n\t\t\r\n\t\tif ( !empty( $_POST['product_warranty_default'] ) && $_POST['product_warranty_default'] == 'yes' ) {\r\n\t\t\tdelete_post_meta( $new_product_id, '_warranty' );\r\n\t\t} elseif ( isset($wcfm_products_manage_form_data['product_warranty_type']) ) {\r\n\t\t\t$product_warranty = array();\r\n\r\n\t\t\tif ( $wcfm_products_manage_form_data['product_warranty_type'] == 'no_warranty' ) {\r\n\t\t\t\t$product_warranty = array('type' => 'no_warranty');\r\n\t\t\t\tupdate_post_meta( $new_product_id, '_warranty', $product_warranty );\r\n\t\t\t} elseif ( $wcfm_products_manage_form_data['product_warranty_type'] == 'included_warranty' ) {\r\n\t\t\t\t$product_warranty = array(\r\n\t\t\t\t\t\t'type' => 'included_warranty',\r\n\t\t\t\t\t\t'length' => $wcfm_products_manage_form_data['included_warranty_length'],\r\n\t\t\t\t\t\t'value' => $wcfm_products_manage_form_data['limited_warranty_length_value'],\r\n\t\t\t\t\t\t'duration' => $wcfm_products_manage_form_data['limited_warranty_length_duration']\r\n\t\t\t\t);\r\n\t\t\t\tupdate_post_meta( $new_product_id, '_warranty', $product_warranty );\r\n\t\t\t} elseif ( $wcfm_products_manage_form_data['product_warranty_type'] == 'addon_warranty' ) {\r\n\t\t\t\t$no_warranty= (isset($wcfm_products_manage_form_data['addon_no_warranty'])) ? $wcfm_products_manage_form_data['addon_no_warranty'] : 'no';\r\n\t\t\t\t$amounts = $wcfm_products_manage_form_data['addon_warranty_amount'];\r\n\t\t\t\t$values = $wcfm_products_manage_form_data['addon_warranty_length_value'];\r\n\t\t\t\t$durations = $wcfm_products_manage_form_data['addon_warranty_length_duration'];\r\n\t\t\t\t$addons = array();\r\n\r\n\t\t\t\tfor ($x = 0; $x < count($amounts); $x++) {\r\n\t\t\t\t\tif (!isset($amounts[$x]) || !isset($values[$x]) || !isset($durations[$x])) continue;\r\n\r\n\t\t\t\t\t$addons[] = array(\r\n\t\t\t\t\t\t\t'amount' => $amounts[$x],\r\n\t\t\t\t\t\t\t'value' => $values[$x],\r\n\t\t\t\t\t\t\t'duration' => $durations[$x]\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$product_warranty = array(\r\n\t\t\t\t\t\t'type' => 'addon_warranty',\r\n\t\t\t\t\t\t'addons' => $addons,\r\n\t\t\t\t\t\t'no_warranty_option' => $no_warranty\r\n\t\t\t\t);\r\n\t\t\t\tupdate_post_meta( $new_product_id, '_warranty', $product_warranty );\r\n\t\t\t}\r\n\r\n\t\t\tif ( isset($wcfm_products_manage_form_data['warranty_label']) ) {\r\n\t\t\t\tupdate_post_meta( $new_product_id, '_warranty_label', stripslashes($wcfm_products_manage_form_data['warranty_label']) );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function generate_subject_code_remarks_report(){\n $this->crud->credibilityAuth(array('Administrator','Registrar','Faculty'));\n // get inputs\n $con = array('subject_code'=>$this->input->post('subject_code'),'batch_year'=> $this->input->post('batch_year_id'));\n $range1 = $this->input->post('date_range1');\n $range2 = $this->input->post('date_range2');\n // get necessary report data\n $students = $this->admin_model->getStudentsBasicInfo($con,'a');\n $attendance = $this->admin_model->getStudentAttendanceBySubjectCode($range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_record = $this->admin_model->getStudentSubjectCodeAttendanceRecord($students,$range1,$range2,$con['subject_code'],$con['batch_year']);\n $att_dates = $this->crud->getDistinctValueOnAssociativeArray($attendance,'attendance_date');\n // generate report data in pdf or csv format from admin_report_model\n if((!empty($con['subject_code']) && !empty($range1) && !empty($range2)) && ($range1 <= $range2)){\n if(!empty($attendance) && !empty($att_record)){\n if($this->input->post('export_csv')){\n $this->admin_report_model->generateStudentRemarksReportBySubjectCodeCsv($attendance,$att_record,$att_dates,$con,$range1,$range2);\n exit;\n }else if($this->input->post('export_pdf')){\n $this->admin_report_model->generateSubjectCodeAttendanceReportPdf($attendance,$con,$range1,$range2);\n }\n }\n $this->session->set_flashdata('warning', 'No reports found!.');\n }else{\n $this->session->set_flashdata('danger', 'Invalid input.');\n }\n redirect('attendance_report');\n }", "function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}", "public function generate_pdf(Request $request) {\n\n if(isset($request->oid) && isset($request->changeid)){\n \n $user = User::where('email', $request->input('email'))->first();\n $people = People::where('id', $user->people_id)->first();\n\n $comId = $request->input('comId');\n\n $company = Company::where('id',$comId)->first();\n\n $company1 = Company::leftJoin('company_certificate','company_certificate.company_id','=','companies.id')\n ->where('companies.id',$comId)\n ->get(['companies.id','companies.name','companies.address_id','company_certificate.registration_no as registration_no']);\n \n $regNo = $company1[0]['registration_no'];\n $otheraddid = $request->oid;\n\n $otheradd = OtherAddress::where('id',$otheraddid)->first();\n $address = Address::where('id',$otheradd->address_id)->first();\n\n $changeRequest = CompanyChangeRequestItem::where('id',$request->requestID)->first();\n\n if($changeRequest->signed_by_table_type == $this->settings('COMPANY_MEMBERS','key')->id){\n\n $member = CompanyMember::leftJoin('settings','company_members.designation_type','=','settings.id')\n ->where('company_members.id',$changeRequest->signed_by)\n ->get(['company_members.id','company_members.first_name','company_members.last_name','settings.value as designation']);\n\n $date = array();\n \n $date[] = [\n \"id\" => $member[0]['id'],\n \"type\" => 0,\n \"title\" => '',\n \"first_name\" => $member[0]['first_name'],\n \"last_name\" => $member[0]['last_name'],\n \"designation\" => $member[0]['designation'],\n ];\n \n\n }\n else{\n $member = CompanyFirms::leftJoin('settings','company_member_firms.type_id','=','settings.id')\n ->where('company_member_firms.id',$changeRequest->signed_by)\n ->get(['company_member_firms.id','company_member_firms.name','settings.value as designation']);\n\n $date = array();\n \n $date[] = [\n \"id\" => $member[0]['id'],\n \"type\" => 1,\n \"title\" => '',\n \"first_name\" => $member[0]['name'],\n \"last_name\" => '',\n \"designation\" => $member[0]['designation'],\n ];\n\n }\n\n $o_date = $otheradd->records_kept_from;\n\n $day = date('d', strtotime($o_date));\n $month = date('m', strtotime($o_date));\n $year = date('Y', strtotime($o_date));\n\n $todayDate = date(\"Y-m-d\");\n\n $day1 = date('d', strtotime($todayDate));\n $month1 = date('m', strtotime($todayDate));\n $year1 = date('Y', strtotime($todayDate));\n \n \n $fieldset = array(\n 'comName' => $company->name,\n 'comPostfix' => $company->postfix, \n 'comReg' => $company->registration_no,\n 'member' => $date,\n 'address1' => $address->address1,\n 'address2' => $address->address2, \n 'province' => $address->province, \n 'district' => $address->district,\n 'city' => $address->city,\n 'country' => $address->country,\n 'gn_division' => $address->gn_division, \n 'postcode' => $address->postcode,\n 'day' => $day, \n 'month' => $month, \n 'year' => $year,\n 'day1' => $day1, \n 'month1' => $month1, \n 'year1' => $year1, \n 'first_name' => $people->first_name,\n 'last_name' => $people->last_name,\n 'telephone' => $people->telephone,\n 'mobile' => $people->mobile,\n 'email' => $people->email,\n 'regNo' => $regNo,\n \n \n );\n\n $otheraddchange = CompanyItemChange::leftJoin('settings','company_item_changes.changes_type','=','settings.id')\n ->where('company_item_changes.item_id', $otheraddid)->get(['company_item_changes.id','company_item_changes.item_id','settings.key as type']);\n \n if(($otheraddchange[0]['type'])=='ADD'){\n $pdf = PDF::loadView('accountingaddresschange-forms/form16',$fieldset);\n $pdf->stream('form-16.pdf');\n }\n else{\n $pdf = PDF::loadView('accountingaddresschange-forms/formRem16',$fieldset);\n $pdf->stream('form-16.pdf');\n }\n \n \n \n \n \n\n \n \n }\n else{ \n return response()->json([\n 'message' => 'We can \\'t find a otheraddress.',\n 'status' =>false,\n ], 200);\n } \n \n }", "public function disclaimer() {\n// $data = ['terms' => $terms];\n $data = '';\n\n $viewname = Config('constants.frontendView') . '.disclaimer';\n return Helper::returnView($viewname);\n }", "function getFieldMedicLicence(){\n\t\t$set_upmsg = get_option('axceleratelink_srms_upmsg'); \n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_medicarelicence');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_medicarelicence');\n\t\t$tooltip = setToolTipNotification(\"medicarelicence\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('medical') === 'medical' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label></br>\";\n\t\t\t//$form_ret .= '<div id=\"fileMedicLiscence_con\"></div><br>';\n\t\t\t$form_ret .= '<input name=\"fileMedicLiscence\" id=\"fileMedicLiscence\" type=\"file\" multiple=\"false\" data-value=\"\" class=\"srms-field '.(get_axl_req_fields('medical') === 'medical' ? 'input-file-required' : '').'\">';\n\t\t\t$form_ret .= '<br><i>'.$set_upmsg[2].'</i>';\n\t\t\t$form_ret .= wp_nonce_field( 'fileMedicLiscence', 'fileMedicLiscence_upload_nonce' );\n\t\t\t$form_ret .= '<br>';\n\t\t}\n\t\treturn $form_ret;\n\t}", "function AccountsBody()\n\t{\t$this->DiscountBody();\n\t}", "public function generate_acknowledgement() {\n \n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $usrid = $this->input->post('usr');\n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $usrid);\n\n $tanant = $this->courses_model->get_tenant_details();\n \n //sankar code starts here\n //resetting classroom location parameter id with category name\n $ack_data[classroom_location] = $this->meta_data[$ack_data[classroom_location]];\n $ack_data[cert_level] = $this->meta_data[$ack_data[certi_level]];\n //sankar code ends here\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n $Url = base_url() . 'payments/print_ack';\n\n $date = date('M d Y');\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date('h:i A', strtotime($ack_data[class_start_datetime]));\n \n /* skm code start for remark.\n reporting time skm start bcoz of sam request for AOP(67) on 18-may-17*/\n $time = strtotime($ack_data[class_start_datetime]);\n $reporting_time = date(\"H:i A\", strtotime('-30 minutes', $time));\n if($crsid == 67 || $crsid == 121)\n {\n $li = \"Report at center at $reporting_time to register for class\";\n }else{\n $li = \"Report at center at 8:30 AM to register for class\";\n }\n /* end */\n $tenant_id = TENANT_ID;\n if($tenant_id == 'T12')\n { \n $name = $tanant->contact_name;\n }else{\n\n $name = $gender. $ack_data[crse_manager][first_name] . ' ' . $ack_data[crse_manager][last_name];\n }\n \n $message3 = '\n <ol>\n <li>All participants please bring along their photo ID card with either their Nric/Fin number stated upon class date.</li>\n <li>Your NRIC, work permit or will be photocopied on the class date</li>\n <li>Trim finger nails and remove nail polish</li>\n <li>'.$li.'</li>\n </ol>';\n /* skm end */\n \n echo '<form action=\"' . $Url . '\" method=\"post\"><p> \n <a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n\t\t\t <h2 class=\"panel_heading_style\">Booking Acknowledgment</h2>\t\t\t \n\t\t\n\t\t\t Your seat has been temporarily booked. Please pay the class fees on or before the class start date.\n\t\t\tTemporary booking for <b>' . $ack_data[first_name] . ' ' . $ack_data[last_name] . ' </b> for <b> Course:\"' . $ack_data[crse_name] . ',Class:' . $ack_data[class_name] . ',Certificate Code:' . $ack_data[cert_level] . ' </b>\".</i><br>\n\t\t\t </br><strong>Class start date:</strong> ' . $startdate . '<br>\n\t\t\t </br><strong>Location:</strong> ' . $ack_data[classroom_location] . '<br>\n\t\t\t</br><strong>Contact Details:</strong> ' . $name . ',(Phone: ' . $tanant->tenant_contact_num . ',Email Id: ' . $tanant->tenant_email_id . ')\n </br><strong>Remark:</strong> ' . $message3 . '<br>\n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/>\n <input type=\"hidden\" value=\"' . $usrid . '\" name=\"userId\"/> \n <input type=\"hidden\" value=\"' . $ack_data . '\" name=\"ackdata\"/>\n <div style=\"clear:both;\"></div><br>\t\t\t \n\t\t\t <span style=\"float:right;\">\n\t\t\t<button class=\"btn btn-primary\" type=\"submit\">Print</button>\n\t\t\t </p></form> ';\n }", "function addHdr(){\r\n\t\tlog_message('debug', \"[START] Controller capital_transaction:addHdr\");\r\n\t\tlog_message('debug', \"capcon param exist?:\".array_key_exists('capcon',$_REQUEST));\r\n\r\n\t\tif (array_key_exists('capcon',$_REQUEST)){\r\n\t\t\t\t\r\n\t\t\t$transaction_code = $_REQUEST['capcon']['transaction_code'];\r\n\t\t\t$employee_id = $_REQUEST['capcon']['employee_id'];\r\n\t\t\t$transaction_amount = $_REQUEST['capcon']['transaction_amount'];\r\n\t\t\t\t\r\n\t\t\t$acctgPeriod = date(\"Ymd\", strtotime($this->parameter_model->getParam('ACCPERIOD')));\r\n\t\t\t$str_return = \"\";\r\n\t\t\t$negativeEffectCapconTrans = $this->getNegativeEffectCapconTrans();\t\r\n\t\t\t\t\r\n\t\t\tif($this->checkEmployee($employee_id)){\r\n\t\t\t\t$str_return = \"{'success':false,'msg':'Employee does not exist','error_code':'22'}\";\r\n\t\t\t}\r\n\t\t\telse if($this->member_model->employeeIsInactive($employee_id)){\r\n\t\t\t\t$str_return = \"{'success':false,'msg':'Employee is inactive','error_code':'55'}\";\r\n\t\t\t}\r\n\t\t\telse if(!$this->transactioncode_model->transactionCodeExists($transaction_code, 'CC')){\r\n\t\t\t\t$str_return = \"{'success':false,'msg':'Transaction code does not exist','error_code':'47'}\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif($this->checkCapconEntry($employee_id, $acctgPeriod))\r\n\t\t\t\t$this->addCapconEntry($employee_id, $acctgPeriod);\r\n\r\n\t\t\t\tif($transaction_code==\"CLSE\" && //check if closing\r\n\t\t\t\t$this->countRemainingLoans($employee_id)>0){\r\n\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee still has remaining loans','error_code':'7'}\";\r\n\t\t\t\t}\r\n\t\t\t\telse if($transaction_code==\"MISL\" &&\r\n\t\t\t\t$this->checkInitDeposit($transaction_amount)){\r\n\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee\\'s initial deposit should be a value greater than or equal to the capital contribution minimum balance.','error_code':'12'}\";\r\n\t\t\t\t}\r\n\t\t\t\telse if($transaction_code==\"DDEP\" &&\r\n\t\t\t\t$this->depositGreaterThanTenMillion($transaction_amount, $employee_id, $acctgPeriod)){\r\n\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee cannot have more than 10 million.','error_code':'54'}\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif(in_array($transaction_code, $negativeEffectCapconTrans)) {\r\n\t\t\t\t\t\tif($transaction_code==\"CLSE\"){\r\n\t\t\t\t\t\t\t//closing is exempted, should allow this transaction to exceed the employee's maximum withdrawable amount and does not need to maintain the required balance.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Withdrawal \r\n\t\t\t\t\t\telse if($transaction_code==\"WDWL\"){\r\n\t\t\t\t\t\t\tif($this->hasValidGuarantors($employee_id)){\r\n\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has invalid co-makers','error_code':'8'}\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($this->checkSuspensionDate($employee_id)){\r\n\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee is still on suspension','error_code':'9'}\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($this->compareRemainingBalance($employee_id, $transaction_amount, $acctgPeriod)){\r\n\t\t\t\t\t\t\t\t//[START] 8th Enhancement MODIFIED by VINCENT SY 20130814\r\n\t\t\t\t\t\t\t\tif($this->showCompCode($employee_id)=='920')\r\n\t\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has exceeded the withdrawal amount for a retiree','error_code':'11'}\";\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has exceeded the withdrawal amount','error_code':'10'}\";\r\n\t\t\t\t\t\t\t\t//[END] 8th Enhancement MODIFIED by VINCENT SY 20130814\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//All transactions who's Capcon Effect is \"Deducted From Capital Contribution\" must not be allowed to exceed the maximum withdrawable amount and must maintain the required balance listed on their individual ledger. It does NOT require a valid co-maker and must NOT be suspended.\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tif($this->compareRemainingBalance($employee_id, $transaction_amount, $acctgPeriod)){\r\n\t\t\t\t\t\t\t\t//[START] 8th Enhancement MODIFIED by VINCENT SY 20130814\r\n\t\t\t\t\t\t\t\tif($this->showCompCode($employee_id)=='920')\r\n\t\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has exceeded the withdrawal amount for a retiree','error_code':'11'}\";\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has exceeded the withdrawal amount','error_code':'10'}\";\r\n\t\t\t\t\t\t\t\t//[END] 8th Enhancement MODIFIED by VINCENT SY 20130814\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\r\n\t\t\t}\r\n\t\t\tif ($str_return == \"\"){\r\n\t\t\t\tunset($_REQUEST['capcon']['or_no']);\r\n\t\t\t\tunset($_REQUEST['capcon']['or_date']);\r\n\t\t\t\t$this->capitaltransactionheader_model->populate($_REQUEST['capcon']);\r\n\t\t\t\t$trans_no = $this->parameter_model->incParam('LASTTRANNO');\r\n\t\t\t\t\r\n\t\t\t\t$this->capitaltransactionheader_model->setValue('transaction_no', $trans_no);\r\n\t\t\t\t\r\n\t\t\t\t$this->capitaltransactionheader_model->setValue('status_flag', '1');\r\n\t\t\t\t$this->capitaltransactionheader_model->setValue('created_by', $_REQUEST['user']);\r\n\t\t\t\t\r\n\t\t\t\t/*if($this->withOR($transaction_code)){\r\n\t\t\t\t\t$or_no = $this->parameter_model->incParam('LASTORNO');\r\n\t\t\t\t\t$curr_date = $this->parameter_model->getParam('CURRDATE');\r\n\t\t\t\t\t$this->capitaltransactionheader_model->setValue('or_no', $or_no);\r\n\t\t\t\t\t$this->capitaltransactionheader_model->setValue('or_date', $curr_date);\r\n\t\t\t\t\t$success_message = \"{'success':true,'msg':'Data successfully saved.','transaction_no':'$trans_no'\r\n\t\t\t\t\t\t,'or_no':'$or_no'\r\n\t\t\t\t\t\t,'or_date':'$curr_date'}\";\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$success_message = \"{'success':true,'msg':'Data successfully saved.','transaction_no':'$trans_no'}\";\r\n\t\t\t\t}*/\r\n\r\n\t\t\t\t$checkDuplicate = $this->capitaltransactionheader_model->checkDuplicateKeyEntry();\r\n\r\n\t\t\t\tif($checkDuplicate['error_code'] == 1){\r\n\t\t\t\t\t$result['error_code'] = 1;\r\n\t\t\t\t\t$result['error_message'] = $checkDuplicate['error_message'];\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$this->db->trans_start();\r\n\t\t\t\t\t$this->capitaltransactionheader_model->insert();\r\n\t\t\t\t\t$this->addDtl($trans_no, $transaction_amount);\r\n\t\t\t\t\t$this->db->trans_complete();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($this->db->trans_status() === FALSE){\r\n\t\t\t\t\t\t$result['error_code'] = 1;\r\n\t\t\t\t\t\t$result['error_message'] = \"Data was NOT successfully saved.\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$result['error_code'] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif($result['error_code'] == 0){\r\n\t\t\t\t\techo \"{'success':true,'msg':'Data successfully saved.','transaction_no':'$trans_no'}\";\r\n\t\t\t\t} else\r\n\t\t\t\techo '{\"success\":false,\"msg\":\"'.$result['error_message'].'\",\"error_code\":\"'.$result['error_code'].'\"}';\r\n\t\t\t} else {\r\n\t\t\t\techo $str_return;\r\n\t\t\t}\r\n\r\n\t\t} else\r\n\t\techo \"{'success':false,'msg':'Data was NOT successfully saved.','error_code':'2'}\";\r\n\r\n\t\tlog_message('debug', \"[END] Controller capital_transaction:addHdr\");\r\n\t}", "function dprv_entitlements($dprv_subscription_type, &$dprv_max_file_count, &$dprv_back_digiprove_allowance)\r\n {\r\n \t // Declare and initialise subscription plan permissions:\r\n\t $dprv_daily_limits = array (5,20,100,500,-1); // Maximum Digiproves per day (-1 = unlimited)\r\n $dprv_max_file_counts = array (0,10,40,100,999); // Maximum number of media files in a post\r\n $dprv_back_digiprove_allowances = array(20,100,-1,-1,-1); // Maximum number of back-Digiproves (batch Digiproving of older posts)\r\n\r\n $dprv_today_limit = $dprv_daily_limits[0];\r\n\t $dprv_max_file_count = $dprv_max_file_counts[0];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[0];\r\n\t switch ($dprv_subscription_type)\r\n\t {\r\n\t\t case \"Personal\":\r\n\t\t {\r\n\t\t\t //$dprv_today_limit = 20;\r\n\t\t\t //$dprv_max_file_count = 10;\r\n //$dprv_back_digiprove_allowance = 100;\r\n \t $dprv_today_limit = $dprv_daily_limits[1];\r\n\t\t\t $dprv_max_file_count = $dprv_max_file_counts[1];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[1];\r\n\t\t\t break;\r\n\t\t }\r\n\t\t case \"Professional\":\r\n\t\t {\r\n\t\t\t //$dprv_today_limit = 100;\r\n\t\t\t //$dprv_max_file_count = 40;\r\n //$dprv_back_digiprove_allowance = -1; // Unlimited\r\n \t $dprv_today_limit = $dprv_daily_limits[2];\r\n\t\t\t $dprv_max_file_count = $dprv_max_file_counts[2];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[2];\r\n\t\t\t break;\r\n\t\t }\r\n\t\t case \"Corporate Light\":\r\n\t\t {\r\n\t\t\t //$dprv_today_limit = 500;\r\n\t\t\t //$dprv_max_file_count = 100;\r\n //$dprv_back_digiprove_allowance = -1; // Unlimited\r\n \t $dprv_today_limit = $dprv_daily_limits[3];\r\n\t\t\t $dprv_max_file_count = $dprv_max_file_counts[3];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[3];\r\n\t\t\t break;\r\n\t\t }\r\n\t\t case \"Corporate\":\r\n\t\t {\r\n\t\t\t //$dprv_today_limit = -1;\r\n\t\t\t //$dprv_max_file_count = 999;\r\n //$dprv_back_digiprove_allowance = -1; // Unlimited\r\n \t $dprv_today_limit = $dprv_daily_limits[4];\r\n\t\t\t $dprv_max_file_count = $dprv_max_file_counts[4];\r\n $dprv_back_digiprove_allowance = $dprv_back_digiprove_allowances[4];\r\n\t\t\t break;\r\n\t\t }\r\n\t\t default:\r\n\t\t {\r\n\t\t\t break;\r\n\t\t }\r\n\t }\r\n\t return $dprv_today_limit;\r\n }", "public function testReportsSkillv1reportscalibrationid()\n {\n\n }", "function dispatch_licenses(){\n\t\n//1get all unfinished orders which are paid\n//2fetch all available licences\n\n//if 1 > 0 \n\t//loop for (unfinished orders)\n \t\t//compare ordered product id with available licences\n\t\t//if available\n\t\t\t//fetch email of buyer + send email + add buyer to database\n\t\t//else \n\t\t\t//mail not available to admin\n\t//loop end\n\t\n}", "public function makeReport()\n {\n }", "function massageFacsPaymentData(){\r\n\t$accountsSkipped = 0; //this is a flag for accounts that don't have a principal\r\n\t$accountsProcessed = 0; //this is a flag to track the records we have processed on the file\r\n\t$dp = 0;\r\n\t$dpTotal = 0; //flag to track total amount collected(?)\r\n\t$totalAccountsNotListed = 0; //number of accounts not listed\r\n\t$detailRecordNum = 0;\r\n\t$paidAgencyPrinc = 0; //this is the amount the collection agency has collected\r\n\t$totalPaidClient = 0;\r\n\t$totalPaidAgency = 0;\r\n\t$totalDueAgency = 0;\r\n\t$totalPayments = 0;\r\n\t$maxlines = count($this->exportData); \r\n\t$date = date(\"Ymd\");\r\n\t$paymentFileName = \"/home/nobody/Y9650/GuarPmt_EFS_\".$date.\".txt\";\r\n\t$exportDataReplace = \"\"; //this is a string we will use to build the text for the export file\r\n\t\r\n\tforeach($this->exportData['accountData'] as $k=>$v){\r\n\t\t$this->addDecimalForPaymentFile($k, $this->exportData['accountData'][$k]['AppliedPrincipal'], 'AppliedPrincipal');\r\n\t\tif($this->exportData['accountData'][$k]['DueAgency'] > 0){ $this->addDecimalForPaymentFile($k, $this->exportData[$k]['DueAgency'], 'DueAgency'); }\t\r\n\t\tif($this->exportData['accountData'][$k]['PaidAgency'] > 0){ $this->addDecimalForPaymentFile($k, $this->exportData[$k]['PaidAgency'], 'PaidAgency'); }\t\r\n\t\tif($this->exportData['accountData'][$k]['Balance'] > 0){ $this->addDecimalForPaymentFile($k, $this->exportData[$k]['Balance'], 'Balance'); }\t\r\n\r\n\t\t$vals = explode(\"_\", $this->exportData['accountData'][$k]['ReferenceNumber']);\r\n\t\t$this->exportData['accountData'][$k]['ReceivableGroupID']\t=\t$vals[0];\r\n\t\t$this->exportData['accountData'][$k]['BillingPeriodSequence']\t=\t$vals[1];\r\n\t\t$this->exportData['accountData'][$k]['ResponsibleParty']\t\t=\ttrim($vals[2]);\r\n\t\t$this->exportData['accountData'][$k]['ClientDebtorNumber'] = $this->exportData[$k]['ReceivableGroupID'];\r\n\t}\r\n}", "public function generate_invoice() {\n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $userid = $this->input->post('usr');\n $invoice_id = $this->input->post('invoice');\n $status = $this->input->post('status');\n $this->load->helper('common_helper');\n \n $paid_details = $this->payments_model->get_invoice_paid_details($invoice_id);\n $paid_arr = array();\n $paid_rcd_till_date = 0;\n foreach ($paid_details as $row) \n {\n $paid_rcd_till_date = $row->amount_recd + $paid_rcd_till_date;\n }\n $total_paid = $paid_rcd_till_date;\n $refund_details = $this->payments_model->get_refund_paid_details($invoice_id);\n $refund_amount = 0;\n foreach ($refund_details as $k => $row) \n {\n $refund_amount = $refund_amount + $row->amount_refund;\n }\n $paid_paid_till_date = $paid_rcd_till_date - $refund_amount;\n \n \n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $userid);\n $invoice = $this->payments_model->get_invoice_details($clsid, $crsid, $userid);\n $user_org = $this->payments_model->get_user_org_details($userid);\n $invoice_amount=$invoice['total_inv_amount'];\n $invoice_amount_temp=$invoice['total_inv_amount'];\n if($status==\"PAID\"){\n \n $sfc_amount= $this->payments_model->get_sfc_details($invoice_id);\n $invoice_amount=$sfc_amount['amount_recd'];\n $invoice_amount1=$sfc_amount['amount_recd'];\n $invoice_amount=$invoice['total_inv_amount']-$sfc_amount['sfc_claimed'];\n if($sfc_amount['sfc_claimed']>0){\n $mop=explode('_',$sfc_amount['mode_of_pymnt']);\n \n }\n \n }\n //$outstanding_amount=$invoice_amount_temp-$invoice_amount1;\n $outstanding_amount=$invoice_amount_temp-$paid_paid_till_date;\n $tanant = $this->payments_model->get_tanant();\n $date = date('M d Y', strtotime($invoice['inv_date']));\n $logourl = base_url() . 'logos/' . $this->session->userdata(public_tenant_details)->Logo;\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date(''\n . 'h:i A', strtotime($ack_data[class_start_datetime]));\n $after_discount = $invoice['class_fees'] - $invoice['total_inv_discnt'];\n $after_gst = $after_discount + $invoice['total_gst'];\n $Url = base_url() . 'payments/print_invoice';\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n //added by sankar\n $gst_label = 'GST Not Applicable';\n $gst_prelabel = 'GST OFF';\n if (!empty($invoice['gst_rule'])) {\n $gst_label = 'GST ON, ' . $this->meta_data[$invoice['gst_rule']];\n $gst_prelabel = 'GST (' . number_format($invoice['gst_rate'], 2, '.', '') . '%)';\n }\n \n //code ends here\n\n echo ' <form action=\"' . $Url . '\" method=\"post\"><p><a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n <h2 class=\"sub_panel_heading_style\">Invoice \n <!-- commended by sankar <span class=\"label label-default push_right\"><a href=\"#export\" rel=\"modal:open\" class=\"small_text1\">Print/ Export to PDF</a></span>-->\n </h2>\n <div class=\"col-lg-6\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td align=\"left\"><img src=\"' . $logourl . '\" border=\"0\" /></td>\n </tr>\n <tr>\n <td class=\"td_heading\" align=\"left\">' . $tanant[tenant_address] . ' </br>' .\n $tanant[tenant_city] . ' ' . get_catname_by_parm($tanant[tenant_state]) . ' ' . get_catname_by_parm($tanant[tenant_country]) . '</br>\n Tel:' . $tanant[tenant_contact_num] . ' <br>\n ' . $tanant[tenant_email_id] . ' </td>\n </tr>\n\n </table>\n\n </div>\n <div class=\"col-lg-6\">\n <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n <td colspan=\"2\"><font style=\"font-size:18px; font-weight:bold;\">' . $tanant['invoice_name'] . '</font></td>\n </tr>\n <tr>\n <td colspan=\"2\"><strong>' . $tanant['invoice_name'] . ' No. </strong> ' . date('Y') . '' . $invoice['invoice_id'] . '<br><strong>' . $tanant['invoice_name'] . ' Date</strong>: ' . $date . '<br><br></td>\n </tr>\n <tr>\n <td colspan=\"2\"><strong><u>Individual Details:</u></strong></td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Address:</td>\n <td>' . $user_org[personal_address_bldg] . '</br>\n ' . $user_org[personal_address_city] . ' '\n . $this->meta_data[$user_org[personal_address_state]] . ' '\n . $this->meta_data[$user_org[personal_address_country]] . '</td>\n </tr>\n <tr>\n <td class=\"td_heading\">Contact No:</td>\n <td>' . $user_org[contact_number] . '</td>\n </tr>\n <tr>\n <td class=\"td_heading\">Attention:</td>\n <td>' .$gender. $user_org[first_name] . ' ' . $user_org[last_name] . '</td>\n </tr>\n </table>\n\n </div>\n\n <div style=\"clear:both;\"></div>\n <br>\n <div class=\"table-responsive\">\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th class=\"th_header\">Description</th>\n <th class=\"th_header\">Unit Price</th>\n <th class=\"th_header\">Total</th>\n \n </tr>\n </thead>\n <tbody>\n <tr>\n <td>' . $ack_data['crse_name'] . ', ' . $invoice['class_name'] . '</td>\n <td>$' . number_format($invoice['class_fees'], 2, '.', '') . '</td>\n <td>$' . number_format($invoice['class_fees'], 2, '.', '') . '</td>\n \n </tr>\n \n <tr>\n <td>' . $this->meta_data[$invoice['discount_type']] . ' Discount @ ' . number_format($invoice['discount_rate'], 2, '.', '') . '%</td>\n <td>$' . number_format($invoice['total_inv_discnt'], 2, '.', '') . '</td>\n <td>$' . number_format($invoice['total_inv_discnt'], 2, '.', '') . '</td>\n \n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">After Discounts</td>\n <td>$' . number_format($after_discount, 2, '.', '') . '</td>\n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">' . $gst_prelabel . '</td>\n <td>$' . number_format($invoice['total_gst'], 2, '.', '') . '</td>\n \n </tr>\n\n <tr>\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">' . $gst_label . '</td>\n <td>$' . number_format($after_gst, 2, '.', '') . '</td>\n \n </tr>\n <tr>\n <td>Subsidy :</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n \n </tr>\n <tr>\n <td>Skills Future Credit :</td>\n <td></td>\n <td>$' .number_format($sfc_amount['sfc_claimed'],2,'.','').'</td>\n </tr>\n \n <tr class=\"info\">\n <td colspan=\"2\" align=\"right\" class=\"td_heading\">Invoice Amount</td>\n <td>$' . number_format($invoice_amount, 2, '.', '') . '</td>\n \n </tr>\n </tbody>\n </table>\n </div>\n <br>\n <div class=\"table-responsive\">\n <div>\n <table class=\"table table-striped\">\n <thead>\n <tr>\n <th colspan=\"9\">Particulars of Participants</th>\n </tr>\n <tr>\n <th width=\"16%\" class=\"th_header\">Name</th>\n <th width=\"13%\" class=\"th_header\">Tax Code</th>\n <th width=\"9%\" class=\"th_header\">TG# </th>\n <th width=\"10%\" class=\"th_header\">Subsidy</th>\n <th width=\"12%\" class=\"th_header\">Discount</th>\n <th width=\"13%\" class=\"th_header\">GST Amount</th>\n <th width=\"13%\" class=\"th_header\">SFC('.$mop[1].') Amount</th>\n <th width=\"16%\" class=\"th_header\">Unit Fee(GST Applicable)</th>\n <th width=\"11%\" class=\"th_header\">Remarks </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>' .$gender. $user_org[first_name] . ' ' . $user_org[last_name] . '</td>\n <td>' . $user_org[tax_code] . '</td>\n <td>' . $invoice[tg_number] . '</td>\n <td>$' . number_format($invoice[total_inv_subsdy], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_inv_discnt], 2, '.', '') . '</td>\n <td>$' . number_format($invoice[total_gst], 2, '.', '') . '</td>\n <td>$' . number_format($sfc_amount['sfc_claimed'],2,'.','').'</td>\n <td>$' . number_format($invoice_amount, 2, '.', '') . '</td>\n <td>'. $invoice['payment_status'].'</td> \n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/> \n <input type=\"hidden\" value=\"' . $userid . '\" name=\"userId\"/>\n </tr>\n <tr>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n <td></td>\n \n <td colspan=\"2\">OUT STANDING AMOUNT</td>\n <td>$' . number_format($outstanding_amount, 2, '.', '') . '</td>\n <td></td> \n \n </tr>\n </tbody>\n </table>\n </div>\n </div>\n <div style=\"clear:both;\"></div>\n <br>\n <p class=\"red\">This is a computer generated invoice. No signature is required- ' . $tanant['tenant_name'] . ' Administrator.</p>\n <div style=\"color:red;\">' . html_entity_decode($tanant['invoice_footer_text']) . '</div>\n <div style=\"clear:both;\"></div><br>\n <span style=\"float:right;\">\n<!-- <button class=\"btn btn-primary\" type=\"submit\">Print</button></form><br><br>-->\n ';\n }", "private function addDescriptiveRecord()\n {\n // Record Type\n $line = self::DESCRIPTIVE_TYPE;\n\n if ($this->includeAccountNumberInDescriptiveRecord) {\n // BSB\n $line .= $this->bsb;\n\n // Account Number\n $line .= str_pad($this->accountNumber, 9, ' ', STR_PAD_LEFT);\n\n // Reserved - must be a single blank space\n $line .= ' ';\n } else {\n // Reserved - must be 17 blank spaces\n $line .= str_repeat(' ', 17);\n }\n\n // Sequence Number\n $line .= '01';\n\n // Bank Name\n $line .= $this->bankName;\n\n // Reserved - must be seven blank spaces\n $line .= str_repeat(' ', 7);\n\n // User Name\n $line .= str_pad($this->userName, 26, ' ', STR_PAD_RIGHT);\n\n // User ID\n $line .= $this->directEntryUserId;\n\n // File Description\n $line .= str_pad($this->description, 12, ' ', STR_PAD_RIGHT);\n\n // Processing Date\n $line .= date('dmy', is_numeric($this->processingDate) ? $this->processingDate : strtotime($this->processingDate));\n\n // Reserved - 40 blank spaces\n $line .= str_repeat(' ', 40);\n\n $this->addLine($line);\n }", "public function display_billing_invoice()\n\t{\n\t\t$table_contact_select = '\n\t\t\t<tr>\n\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t<td>'.$this->ml_client_contact_select($this->account->client_id).'</td>\n\t\t\t</tr>\n\t\t';\n\n\t\t?>\n\t\t<h2>Invoice PDF</h2>\n\n\t\t<div id=\"invoice_data\">\n\t\t\t<?php $this->print_payment_form('none', $table_contact_select);?>\n\t\t</div>\n\n\t\t<div id=\"invoice_edit\">\n\t\t\t<div>\n\t\t\t\t<label>Client:</label><input type=\"text\" name=\"pdf_client\" value=\"<?= $this->account->name ?>\"><br/>\n\t\t\t\t<label>Contact Name:</label><input type=\"text\" name=\"pdf_contact\"><br/>\n\t\t\t\t<label>Inv Date:</label><input type=\"text\" name=\"pdf_date\" class=\"date_input\" value=\"<?php echo date(util::DATE);?>\"><br/>\n\t\t\t\t<label>Inv Number:</label><input type=\"text\" name=\"pdf_invoice_num\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div>\n\t\t\t\t<label>Address 1:</label><input type=\"text\" name=\"pdf_address_1\"><br/>\n\t\t\t\t<label>Address 2:</label><input type=\"text\" name=\"pdf_address_2\"><br/>\n\t\t\t\t<label>Address 3:</label><input type=\"text\" name=\"pdf_address_3\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<?= $this->print_pdf_wpro_phone() ?>\n\n\t\t\t<div id=\"pdf_charges\" ejo>\n\t\t\t\t<label>Charges</label>\n\t\t\t\t<table>\n\t\t\t\t\t<tr><th>Amount</th><th>Description</th></tr>\n\t\t\t\t</table>\n\t\t\t\t<input type=\"button\" id=\"pdf_add_charge\" value=\"Add Charge\">\n\t\t\t</div>\n\n\t\t\t<div>\n\t\t\t\t<label>Notes</label><br/>\n\t\t\t\t<input type=\"text\" name=\"pdf_notes\">\n\t\t\t</div>\n\n\t\t\t<input type=\"hidden\" name=\"pdf_type\" value=\"invoice\">\n\t\t\t<input type=\"submit\" a0=\"action_gen_pdf\" value=\"Generate Invoice\">\n\t\t</div>\n\t\t\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "public function testReportsSkillv1reportscalibration()\n {\n\n }", "function GETPRD()\n{\n $CYMMD1 = $billpay->BPPDAT; /* #664 */\n $PERIOD = 0; /* #666 */\n $acctgper_rows = db::fetchRows($sql, 'DTSDATA.ATGREC'); /* #669 */\n while ($acctgper === $true\n ) {\n if ($CYMMD1 >= $acctgper->ATGSTR\n && $CYMMD1 <= $acctgper->ATGEND\n ) {\n $PERIOD = $acctgper->ATGPER; /* #675 */\n $acctgper = $false; /* #676 */\n } else {\n $acctgper_rows = db::fetchRows($sql, 'DTSDATA.ATGREC'); /* #679 */\n } /* #680 end if */\n } /* #682 end while */\n}", "function commissionComputation($type,$totalContract,$requestCommission,$vat){\n $finalCommission = 0;\n $formula = '0';\n $note = 0;\n $legend = '';\n if($type == 'MARKUP'){\n if($vat == true){\n $formula = $requestCommission.' - ( ('.$requestCommission.'/ 1.12 x .12 ) + ( '.$requestCommission.' / 1.12 x .05 ) )';\n $lessVat = $requestCommission / 1.12;\n $lessVat = $lessVat * .12;\n $lessVat = round($lessVat,6);\n $incomeTax = $requestCommission / 1.12;\n $incomeTax = $incomeTax * .05;\n $incomeTax = round($incomeTax,6);\n $totalDeduction = $lessVat + $incomeTax;\n $legend = 'Request Commission Amount : '.$requestCommission.'| VAT :12% | Income Tax : 5%';\n $finalCommission = $requestCommission - $totalDeduction;\n }\n else{\n //false\n $formula = $requestCommission.' - ( '.$requestCommission.' x .05 )';\n $incomeTax = $requestCommission * .05;\n $totalDeduction = $incomeTax;\n $legend = 'Request Commission Amount : '.$requestCommission.' | Income Tax : 5%';\n $finalCommission = $requestCommission - $totalDeduction;\n }\n }elseif($type == 'REGULAR'){\n if($vat == true){\n $formula = $requestCommission.\"-((\".$requestCommission.\"/ 1.12) X 0.12)\";\n $lessVat = $requestCommission / 1.12;\n $lessVat = $lessVat * .12;\n $lessVat = round($lessVat,6);\n $totalDeduction = $lessVat;\n $legend = 'Request Commission Amount : '.$requestCommission.'| VAT :12% | Income Tax : 5%';\n $finalCommission = $requestCommission - $totalDeduction;\n }else{\n $formula = $requestCommission.' [No Formula]';\n $finalCommission = $requestCommission;\n }\n }\n elseif($type == 'CTD'){\n if($vat == true){\n $formula = $requestCommission.' - ( ('.$requestCommission.'/ 1.12 x .12 ) + ( '.$requestCommission.' / 1.12 x .05 ) )';\n $lessVat = $requestCommission / 1.12;\n $lessVat = $lessVat * .12;\n $lessVat = round($lessVat,6);\n $incomeTax = $requestCommission / 1.12;\n $incomeTax = $incomeTax * .05;\n $incomeTax = round($incomeTax,6);\n $totalDeduction = $lessVat + $incomeTax;\n $finalCommission = $requestCommission - $totalDeduction;\n $legend = 'Request Commission Amount : '.$requestCommission.'<br> VAT :12% | Income Tax : 5%';\n }\n else{\n //false\n $formula = $requestCommission.' - ( '.$requestCommission.' x .05 )';\n $incomeTax = $requestCommission * .05;\n $totalDeduction = $incomeTax;\n $legend = 'Request Commission Amount : '.$requestCommission.' | Income Tax : 5%';\n $finalCommission = $requestCommission - $totalDeduction;\n }\n }\n else{\n $formulationDetails = array(\n 'success' => false,\n 'type' => $type,\n 'formula' => $formula,\n 'note' => $legend,\n 'final_commission' => $finalCommission,\n 'vat'=>$vat\n );\n }\n $formulationDetails = array(\n 'success' => false,\n 'type' => $type,\n 'formula' => $formula,\n 'note' => $legend,\n 'final_commission' => $finalCommission,\n 'vat'=>$vat\n );\n return $formulationDetails;\n}", "function BajajFinservPL($strnet_salary, $company, $category, $DOB, $clubbed_emi, $reqtenure, $reqloanamount) {\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n $bflloansmt = round($strnet_salary * 10);\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$bflloansmt)\n\t\t\t\t{\n\t\t\t\t\t$bflloansmt=$bflloansmt;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$bflloansmt=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$bflloansmt=$bflloansmt;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n $intr1 = 14.50;\n $intr2 = 15.50;\n $bflintr1 = $intr1;\n $bflintr2 = $intr2;\n $bflintrte = \"$intr1% - $intr2%\";\n $getemi1 = round($bflloansmt * ($bflintr1/1200) / (1 - (pow(1/(1 + ($bflintr1/1200)), $term))));//getController()->Common()->getEMI($bflloansmt, $bflintr1, $term);\n $getemi2 = round($bflloansmt * ($bflintr2/1200) / (1 - (pow(1/(1 + ($bflintr2/1200)), $term))));//getController()->Common()->getEMI($bflloansmt, $bflintr2, $term);\n $getemi = \"Rs. \" . $getemi1 . \" - Rs. \" . $getemi2;\n $getterm = $print_term;\n $proc_fee = \"Upto 2%\";\n\t\t$emiperlac = round(100000 * ($bflintrte/1200) / (1 - (pow(1/(1 + ($bflintrte/1200)), $term))));\n\n $details['bank_code'] = \"Bajaj Finserv\";\n $details['interest_rate'] = interestRateFormat($bflintrte);\n $details['emi'] = $getemi;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($bflloansmt);\n $details['processing_fee'] = $proc_fee;\n $details['category'] = $category;\n return($details);\n }", "public function disclosure_statement_step3() {\n\t\t$this->loadAllModel(array('Loan','User','ShortApplication','ProcessorDocument'));\n\t\t$brokerDetail = '';\n\t\t$loanID = $this->Session->read('GFE_Loan_id');\n\t\tif($this->request->data){\n\t\t\t$this->Session->write('GFE.GFEStep3', $this->request->data);\n\t\t\t$data = $this->Session->read('GFE');\n\t\t\t$saveData['gfe'] = json_encode($data);\n\t\t\t$saveData['processor_id'] = $this->Session->read('userInfo.id');\n\t\t\t$saveData['loan_id'] = $loanID;\n\t\t\t$this->ProcessorDocument->save($saveData);\n\t\t\t$this->set('data',$data);\n\t\t\t$this->layout = '/pdf/default';\n\t\t\t$this->render('/Pdf/gfe');\n\t\t\t$this->Session->setFlash('Disclosure statement submit successfully.','default',array('class'=>'alert alert-success'));\n\t\t\t$this->redirect(array('controller'=>'processors', 'action'=>'generateTil/',base64_encode($loanID)));\n\t\t}else{\n\t\t\t$this->request->data = $this->Session->read('GFE.GFEStep3');\n\t\t}\n\t\t$loanDetail = $this->Loan->findById($loanID);\n\t\n\t\t//$shortApplication = $this->ShortApplication->find('first',array('conditions'=>array('ShortApplication.id'=>$loanDetail['Loan']['short_app_id']),'recursive'=>-1));\n\t\t$shortApplication = $this->ShortApplication->find('first',array('conditions'=>array('ShortApplication.id'=>$loanDetail['Loan']['short_app_id']),'fields' =>array('ShortApplication.broker_ID','ShortApplication.broker_ID','SoftQuote.id','ShortApplication.loan_amount','SoftQuote.interest_rate')));\n\t\t\n\t\tif(!empty($shortApplication['ShortApplication']['broker_ID'])){\n\t\t\tif($shortApplication['ShortApplication']['broker_ID'] == 'Rockland'){\n\t\t\t\t$brokerDetail['User']['name'] = 'Rockland';\n\t\t\t}else{\n\t\t\t\t$brokerDetail = $this->User->findById($shortApplication['ShortApplication']['broker_ID']);\n\t\t\t}\n\t\t}\n\t\t$this->set(compact(array('loanDetail','brokerDetail','shortApplication')));\n }", "public function freeDocCreditMemoOrCancellation($type, $amountGross, $taxCode, $invoiceFieldsArr, tx_ptgsauserreg_customer $customerObj, $note='', $date= '') {\n trace('[METHOD] '.__METHOD__);\n \n $gsaShopTransactionAccessorObj = tx_ptgsashop_gsaTransactionAccessor::getInstance();\n $gsaAccountingTransactionAccessorObj = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance();\n // Freie Gutschrift\n $docFieldsArr = array(); // prepare documentFieldsArray\n $docFieldsArr['NUMMER'] = 0; // will be overwritten/set by insertTransactionDocument(): database ID of the record\n\n trace($taxCode,0,'$taxCode');\n $schriftNr = $gsaAccountingTransactionAccessorObj->getNextSchriftNr();\n trace($schriftNr,0,'$shriftnr');\n if ($date == '') {\n \t$date = date('Y-m-d');\n }\n if($amountGross != $invoiceFieldsArr['ENDPRB']) {\n $taxRate = tx_pttools_finance::getTaxRate($invoiceFieldsArr['ENDPRB'], $invoiceFieldsArr['ENDPRN']);\n trace($taxRate,0,'$taxRate');\n trace($amountGross,0,'$amountGross');\n $amountNet = round(tx_pttools_finance::getNetPriceFromGross($amountGross, $taxRate),2);\n } else {\n $amountNet = $invoiceFieldsArr['ENDPRN'];\n }\n if ($type == 'creditMemo') {\n $erfart = 'GU';\n $docFieldsArr['ERFART'] = '05GU';\n $docFieldsArr['NEUGU'] = 1;\n $docFieldsArr['BEZSUMME'] = 0.000; \n $tmpDataArr['comment'] = 'Automatisch generierte freie Gutschrift ';\n } else if ($type == 'cancellation') {\n \t$erfart = 'ST';\n \t$docFieldsArr['ERFART'] = '06ST';\n $docFieldsArr['BEZSUMME'] = - $amountGross; \n $docFieldsArr['SKONTOBETRAG'] = 0.000; \n $tmpDataArr['comment'] = 'Automatisch generiertes freies Storno ';\n } else {\n throw new tx_pttools_exception('Wrong type', 3, 'Type :'.$type);\n }\n \n $docFieldsArr['NUMMER'] = 0; // ### TODO: ERP GUI writes a different number based on file OPNR.INI (not multi-user safe!) // will be overwritten/set by insertTransactionDocument(): outstanding items numbers of invoices (ERP: \"Offene Posten\")\n $docFieldsArr['SCHRIFTNR'] = $schriftNr; \n # $insertFieldsArr['FSCHRIFT.SCHRIFTNR'] = $this->getNextNumber('VORGANG'); // DO NOT UNCOMMENT (see todo note below)! // continued transaction document number (\"fortlaufende Vorgangsnummer\")\n $docFieldsArr['GEBUCHT'] = 1; \n $docFieldsArr['GEDRUCKT'] = 1; \n $docFieldsArr['AUFTRAGOK'] = 1; \n $docFieldsArr['RESTOK'] = 1; \n $docFieldsArr['GEMAILT'] = 0; \n $docFieldsArr['DATUM'] = $date;\n $docFieldsArr['AUFNR'] = ''; // will be overwritten/set by insertTransactionDocument(): transaction document number (ERP: \"Vorgangsnummer\")\n $docFieldsArr['ADRINR'] = $customerObj->get_gsauid(); // Adress number from Customer\n $docFieldsArr['LIEFERINR'] = 0; // Nothing to deliver\n $docFieldsArr['ENDPRB'] = $amountGross;\n $docFieldsArr['ENDPRN'] = $amountNet;\n $docFieldsArr['PRBRUTTO'] = $customerObj->get_gsa_prbrutto(); //Gross Flag od customer \n\n //$docFieldsArr['BEZSUMME'] = 0.0000; see above\n $docFieldsArr['GUTSUMME'] = 0.0000;\n $docFieldsArr['LTERMIN'] = date('d.m.Y');\n $docFieldsArr['SKONTO1'] = 0.0000;\n $docFieldsArr['SKTAGE1'] = 0.0000;\n $docFieldsArr['SKONTO2'] = 0.0000;\n $docFieldsArr['SKTAGE2'] = 0.0000;\n $docFieldsArr['TAGNETTO'] = $customerObj->get_gsa_tagnetto();\n $docFieldsArr['VERSART'] = $invoiceFieldsArr['VERSART']; // Type of dispatch\n $docFieldsArr['ZAHLART'] = $customerObj->get_paymentMethod();\n $docFieldsArr['GESRAB'] = 0.0000;;\n $docFieldsArr['GESRABTYPE'] = 0;\n $docFieldsArr['RABATTGR'] = 0.0000;\n $docFieldsArr['PREISGR'] = $customerObj->get_priceGroup();\n $docFieldsArr['AUSLAND'] = $customerObj->get_isForeigner();\n $docFieldsArr['EGAUSLAND'] = $customerObj->get_isEUForeigner();\n $docFieldsArr['FLDC02'] = $invoiceFieldsArr['FLDC02']; // Invoice Number when overpament (starts with RE-)or coupon code (CO-) if coupon or partnerlink code (PL-) \n $docFieldsArr['FLDN01'] = $invoiceFieldsArr['FLDN01']; // dispatchcost \n $docFieldsArr['FLDN02'] = $invoiceFieldsArr['FLDN02']; // \n $docFieldsArr['FLDN03'] = $invoiceFieldsArr['FLDN03']; // \n $docFieldsArr['FLDN04'] = $invoiceFieldsArr['FLDN04']; // \n $docFieldsArr['INKOPF'] = '';\n $docFieldsArr['INFUSS'] = '';\n $docFieldsArr['BEMERKUNG'] = $tmpDataArr['comment'];\n //$docFieldsArr['FIBUBELEG'] = ''; //TODO don't know where ist is set in GSAUFTRAG \n $docFieldsArr['EURO'] = 1;\n $docFieldsArr['IVERTNR'] = 0;\n $docFieldsArr['KUNDGR'] = $customerObj->get_gsa_kundgr();\n $docFieldsArr['AUSKASSE'] = 0;\n $docFieldsArr['NAME'] = ($customerObj->get_company() == '' ? $customerObj->get_lastname() : \n $customerObj->get_company()); \n $docFieldsArr['GESGEWICHT'] = 0.0000; # TODO: find out where this comes from and what it is needed for \n $docFieldsArr['P13B'] = 0;\n $docFieldsArr['RMNEU'] = 1;\n $docFieldsArr['UHRZEIT'] = date('Y-m-d H:i:s'); # TODO: ERP GUI writes nonsense here (e.g. '1899-12-30 13:10:27')\n $docFieldsArr['EGIDENTNR'] = $customerObj->get_euVatId(); \n\n\n // not set in GSAUFTRAG would be nice to set it \n $docFieldsArr['LETZTERUSER'] = $note; // data type: varchar(30)\n $docFieldsArr['LETZTERUSERDATE'] = date('Y-m-d H:i:s');\n trace($docFieldsArr,0,'$docFieldsArr');\n if (self::TEST_MODE == false) {\n // write record if not TEST_MODE\n $docRecordId = $gsaShopTransactionAccessorObj->insertTransactionDocument($docFieldsArr, $erfart);\n } \n \n $this->freePosCreditMemoOrCancellation($type,$amountNet, $taxCode, $docRecordId, $customerObj);\n\n if ($type == 'cancellation') {\n //decrease accounting balance \n $customerObj->registerTransactionPayment(-$amountGross, 0); \n // insert in table ZAHLUNg with negative amount\n $paymentUpdateFieldsArr['NUMMER'] = 0; // will be overwritten/set by insertPayment()\n $paymentUpdateFieldsArr['OPNUMMER'] = -1; // will be overwritten/set by insertPayment()\n $paymentUpdateFieldsArr['BETRAG'] = (double)-$amountGross;\n $paymentUpdateFieldsArr['DATUM'] = $date;\n $paymentUpdateFieldsArr['AUFINR'] = $docRecordId;\n $paymentUpdateFieldsArr['BEMERKUNG'] = $note;\n $paymentUpdateFieldsArr['BANK'] = $this->classConfigArr['shopOperatorBankName'];\n $paymentUpdateFieldsArr['EURO'] = '1';\n $paymentUpdateFieldsArr['AUSGUTSCHRIFTEN'] = '0.000';\n if ($this->classConfigArr['shopOperatorFinanceAccount']) {\n $paymentUpdateFieldsArr['FIBUKTO'] = $this->classConfigArr['shopOperatorFinanceAccount'];\n }\n trace($paymentUpdateFieldsArr,0,'$paymentUpdateFieldsArr'); //TODO: whats that\n $gsaAccountingTransactionAccessorObj->insertPayment($paymentUpdateFieldsArr);\n }\n return $docRecordId;\n }", "public function payments_due_report_pdf() {\n $tenant_id = $this->tenant_id;\n $executive = array('' => 'Select');\n foreach ($this->reportsModel->get_sales_executive($tenant_id)->result() as $item) {\n $executive[$item->user_id] = $item->user_name;\n }\n $salesexec = $this->input->get('salesexec');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_payment_due($tenant_id, NULL, NULL, $field, $order_by, $salesexec, $start_date, $end_date);\n $tabledata_count = count($tabledata);\n $invs = array();\n for ($i = 0; $i < $tabledata_count; $i++) {\n $invs[] = $tabledata[$i]->invoice_id;\n }\n $tb_recd = $this->reportsModel->get_payment_recd_sum($invs);\n $tabledatarecd = array();\n for ($i = 0; $i < count($tb_recd); $i++) {\n $tabledatarecd[$tb_recd[$i]->invoice_id] = $tb_recd[$i]->amount_recd;\n }\n $tb_refund = $this->reportsModel->get_payment_refund_sum($invs);\n $tabledatarefund = array();\n for ($i = 0; $i < count($tb_refund); $i++) {\n $tabledatarefund[$tb_refund[$i]->invoice_id] = $tb_refund[$i]->amount_refund;\n }\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $this->load->helper('pdf_reports_helper');\n return payments_due_report_pdf($tabledatarefund, $tabledatarecd, $tabledata, $tenant_details, $executive);\n }", "function genrate_inspectorvehiclelogsheet_pdf($columnsValues,$data,$allconstants,$profile,$toDate=null,$fromDate=null,$vc_customer_name,$vehiclelicno=null) {\n\t\n\t\t$columnwidtharrays = array(17,20,15,15,18,14,13,13,15,25,25);\n\t\t\n\t\t$heightdynamic = 8;\n \n\t\t$this->AddPage();\n\t\t\n\t\tif($this->PageNo()==1){\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\tif((isset($fromDate) && !empty($fromDate)) || (isset($toDate) && !empty($toDate)) || \n\t\t(isset($vc_customer_name) && !empty($vc_customer_name)) ){\n\n\t\t\t$x= $this->GetX();\n\t\t\t\n\t\t\t$y= $this->GetY();\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(25, 8, 'From Date : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n\t\t\t\n\t\t\t$this->SetX($x+25);\t\t\n\t\t\tif(isset($fromDate) && !empty($fromDate))\n\t\t\t$this->MultiCell(50, 8, date('d M Y', strtotime($fromDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(50, 8, '',0,'','L',true);\n\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+75);\n\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, 'To Date :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+100);\t\n\t\t\t\n\t\t\tif(isset($toDate) && !empty($toDate))\n\t\t\t$this->MultiCell(25, 8, date('d M Y', strtotime($toDate)),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8,'',0,'','L',true);\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+125);\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(25, 8, 'Customer Name :',0,'','R',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','R',true);\n\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+150);\t\n\t\t\t\n\t\t\tif(isset($vc_customer_name) && !empty($vc_customer_name))\n\t\t\t$this->MultiCell(39, 8, ucfirst($vc_customer_name),0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(39, 8,'',0,'','L',true);\n\t\t\t\n\t\t\t$this->Ln(2);\n\t\t\t\n\t\t\t$x= $this->GetX();\t\t\t\n\t\t\t$y= $this->GetY();\t\t\t\n\t\t\t$this->SetFont('Arial', 'B', 6);\t\t\n\t\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(25, 8, 'Vehicle Register No. : ',0,'','L',true);\n\t\t\telse\n\t\t\t$this->MultiCell(25, 8, '',0,'','L',true);\n\t\t\t\n\t\t\t$this->SetFont('Arial','', 6);\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\t\t\t\n\t\t\t$this->SetX($x+25);\n\t\t\t\n\t\t\tif(isset($vehiclelicno) && !empty($vehiclelicno))\n\t\t\t$this->MultiCell(165, 8, $vehiclelicno,0,'','L',true);\t\n\t\t\telse\n\t\t\t$this->MultiCell(165, 8, '',0,'','L',true);\n\t\t\t$this->Ln(2);\n\t\t}\n\t}\n\t\n\t\t\t$c=0;\n\t\t\n\t\t$this->SetFillColor(191,191,191);\n\t\t\n\t\t$length = count($columnsValues)-1;\n\t\t\n\t\t$this->SetFont('Arial', 'B', 6);\n\t\t\n foreach($columnsValues as $val) {\n\t\t\t\n\t\t\t$x= $this->GetX();\n\t\t \n\t\t\t$y= $this->GetY();\n\n\t\t if( $c == 0 ){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif($c == 4 || $c == 7 || $c == 8 || $c == 1|| $c == 9){\n\t\t\t\n\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\t\t\t\n\t\t\t$this->SetY($y); //Reset the write point\n \n\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\n\t\t\t}\n\t\t else\n\t\t {\n\t\t\t\tif($c==$length ){\n\n\t\t\t\t\t$this->MultiCell($columnwidtharrays[$c], 16, $val , 1,'C',true);\n\n\t\t\t\t\t$this->SetY($y); //Reset the write point\n\n\t\t\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\n\t\t\t\t\t$this->MultiCell($columnwidtharrays[$c], 8, $val , 1,'C',true);\n\n\t\t\t\t\t$this->SetY($y); //Reset the write point\n\n\t\t\t\t\t$this->SetX($x +$columnwidtharrays[$c]); //Move X to $x + width of last cell\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t\t$c++;\n\t\t\n\t\t}\n\t\t\n\t\t$this->SetFont('Arial', '', 5);\n\t\t\n\t\t$i=0;\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\tforeach ($data as $val) {\n\t\t\n\t\t\t$x = $this->GetX();\n\t\t $y = $this->GetY();\n\t\t\t$alignvalue = 'L';\n\t\t\t$columns = array();\n\t\t\t$col = array();\n\n\t\t $LogDate = !empty ($val['VehicleLogDetail']['dt_log_date']) ? \n date('d M Y', strtotime($val['VehicleLogDetail']['dt_log_date'])):\n '';\n\t\t $vc_customer_name=\t\tucfirst($val['VehicleLogMaster']['vc_customer_name']);\n\t\t $vc_vehicle_reg_no=\t\t$val['VehicleDetail']['vc_vehicle_reg_no'];\n\t\t $vc_vehicle_lic_no=\t\t$val['VehicleLogDetail']['vc_vehicle_lic_no'];\n\t\t $vc_driver_name=\t\t$val['VehicleLogDetail']['vc_driver_name'];\n\t\t\t$StartOMet = \t\t\tisset($val['VehicleLogDetail']['nu_start_ometer']) ?$val['VehicleLogDetail']['nu_start_ometer']:'';\n\t\t $EndOMet = \t\t\t\tisset($val['VehicleLogDetail']['nu_end_ometer']) ?$val['VehicleLogDetail']['nu_end_ometer']:'';\n\t\t\t\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1){\n\t\t\t\n\t\t\t$origin = $val['VehicleLogDetail']['vc_other_road_orign_name'];\n\t\t\t$destination = $val['VehicleLogDetail']['vc_other_road_destination_name'];\n\t\t\t//$kmtravldnamroad = number_format($val['VehicleLogDetail']['nu_km_traveled']);\n\t\t\t$KmTraV = $val['VehicleLogDetail']['nu_other_road_km_traveled'];\n\t\t\t\n\t\t\t}else{\n\t\t\t\n\t\t\t$origin = $val['VehicleLogDetail']['vc_orign_name'];\n\t\t\t$destination = $val['VehicleLogDetail']['vc_destination_name'];\n\t\t\t$KmTraV = $val['VehicleLogDetail']['nu_km_traveled'];\n\t\t\t//$kmtrvldotheroad = number_format($val['VehicleLogDetail']['nu_other_road_km_traveled']);\n\t\t\t\n\t\t\t}\n\t\t\tif($val['VehicleLogDetail']['ch_road_type']==1)\n\t\t\t$ch_road_type= 'Other Road';\n\t\t\telse\n\t\t\t$ch_road_type= 'Namibian Road';\n\t\t\t\t\t\t\t\n\t\t\t\n//\t\t\t$vc_orign_name =\t\t$val['VehicleLogDetail']['vc_orign_name'];\n\t//\t $vc_destination_name=\t$val['VehicleLogDetail']['vc_destination_name'];\n\t\t//\t$KmTraV = \t\t\t\tisset($val['VehicleLogDetail']['nu_km_traveled']) ?$val['VehicleLogDetail']['nu_km_traveled']:'';\n\t\t // $KmTravOth = \t\t\tisset($val['VehicleLogDetail']['nu_other_road_km_traveled']) ?$val['VehicleLogDetail']['nu_other_road_km_traveled']:'';\n\n\t\t\t$font_size = 7;\n\t\t\t\n\t\t\t$fillcolor= '255,250,250';\n\t\t\t\n\t\t\t$col[] = array('text' => $LogDate, 'width' => $columnwidtharrays[0], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' =>$fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_customer_name, 'width' =>$columnwidtharrays[1], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_reg_no, 'width' =>$columnwidtharrays[2], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_vehicle_lic_no, 'width' =>$columnwidtharrays[3], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => $vc_driver_name, 'width' =>$columnwidtharrays[4], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', 'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' => number_format($StartOMet), 'width' =>$columnwidtharrays[5], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$col[] = array('text' => number_format($EndOMet), 'width' =>$columnwidtharrays[6], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\t\t\n\t\t\t$col[] = array('text' => $ch_road_type, 'width' =>$columnwidtharrays[7], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t$col[] = array('text' => $origin, 'width' =>$columnwidtharrays[8], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\n\t\t\t$col[] = array('text' =>$destination, 'width' =>$columnwidtharrays[9], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t$alignvalue='R';\n\t\t\t\n\t\t\t$col[] = array('text' =>number_format($KmTraV), 'width' =>$columnwidtharrays[10], 'height' => $heightdynamic, 'align' => $alignvalue, 'font_name' => 'Arial', 'font_size' => $font_size, 'font_style' => '', 'fillcolor' => $fillcolor, 'textcolor' => '0,0,0', 'drawcolor' => '0,0,0', \n\t\t\t'linewidth' => '0', 'linearea' => 'LTBR');\n\t\t\t\n\t\t\t\n\n\t\t\t$columns[]=$col;\n\t\t\t\n\t\t\t$this->WriteTable($columns); \n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t$alignvalue='L';\n\t\n\t\t}\n\t\n\t}", "protected function set_necessary_invoice_data($payment_category)\n {\n if ('cooperative'===$this->_category) {\n $this->revenue_head_id = 112;\n $this->set_invoice_data_for_coop_and_ngo($payment_category);\n } else if ('ngo'===$this->_category) {\n $this->revenue_head_id = 129;\n $this->set_invoice_data_for_coop_and_ngo($payment_category);\n } else if ('biz_prem'===$this->_category) {\n $this->revenue_head_id = 106;\n $this->set_invoice_data_for_biz_prem($payment_category);\n } else if ('fertilizer_plants'===$this->_category) {\n if (!isset($_POST['plant_location']) || $_POST['plant_location']=='') {\n return;\n }\n $this->other_info[\"plant_location\"] = $_POST[\"plant_location\"];\n $this->other_info[\"payee_organization\"] = $_POST[\"payee_organization\"];\n $this->amount_to_pay = $_POST[\"payment_fee_user_typed\"];\n if ('fert_lafia'===$_POST['plant_location']) {\n $this->revenue_head_id = 503;\n $this->set_invoice_data_for_fert_lafia($payment_category);\n } else if ('fert_akwanga'===$_POST['plant_location']) {\n $this->revenue_head_id = 504;\n $this->set_invoice_data_for_fert_akwanga($payment_category);\n } else if ('fert_keffi'===$_POST['plant_location']) {\n $this->revenue_head_id = 505;\n $this->set_invoice_data_for_fert_keffi($payment_category);\n }\n } else if ('packaging'===$this->_category) {\n $this->revenue_head_id = 111;\n $this->set_invoice_data_for_sacks_and_packaging($payment_category);\n } else if ('haulage'===$this->_category) {\n $this->revenue_head_id = 138;\n $this->set_invoice_data_for_haulage_fee($payment_category);\n } else if ('others'===$this->_category) {\n $this->revenue_head_id = 1308;\n $this->set_invoice_data_for_others($payment_category);\n }\n\n // else if ('fert_lafia'===$this->_category) {\n // $this->revenue_head_id = 503;\n // $this->set_invoice_data_for_fert_lafia($payment_category);\n // } else if ('fert_akwanga'===$this->_category) {\n // $this->revenue_head_id = 504;\n // $this->set_invoice_data_for_fert_akwanga($payment_category);\n // } else if ('fert_keffi'===$this->_category) {\n // $this->revenue_head_id = 505;\n // $this->set_invoice_data_for_fert_keffi($payment_category);\n // }\n }", "public function booking_acknowledge_company_pdf($trainee_ids, $class_id, $company) \n {\n $tenant_id = $this->tenant_id;\n $trainee_allid = explode('-', $trainee_ids);\n $tr_count = 0;\n foreach ($trainee_allid as $row) {\n $trainee_id = $row;\n $trainee_name = $this->classtraineemodel->get_trainee_name('', '', $row, $tenant_id);\n $name = $trainee_name->first . ' ' . $trainee_name->last;\n $trainee_names = ($trainee_name->gender == 'MALE') ? 'Mr.' . $name : 'Ms.' . $name;\n $trainee .=$trainee_names . ', ';\n $tr_count++;\n }\n $trainee = rtrim($trainee, ', ');\n\n $company_details = $this->company->get_company_details($tenant_id, $company);\n $classes = $this->class->get_class_details($tenant_id, $class_id);\n $ClassLoc = $this->get_classroom_location($classes->classroom_location, $classes->classroom_venue_oth);\n $courses = $this->course->get_course_detailse($classes->course_id);\n $tenant_details = $this->classtraineemodel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->course->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $courseLevel = rtrim($this->course->get_metadata_on_parameter_id($courses->certi_level), ', ');\n $data = ''; \n if ($tr_count > 0) {\n $contact_details = '';\n if($tenant_details->tenant_id =='T12')\n {\n if (!empty($tenant_details->contact_name))\n {\n $contact_details .=$tenant_details->contact_name . ' ';\n }\n }\n\nif (!empty($tenant_details->tenant_contact_num)) {\n $contact_details .='(Phone: ' . $tenant_details->tenant_contact_num . ', ';\n }\n if (!empty($tenant_details->tenant_email_id)) {\n $contact_details .='Email Id: ' . $tenant_details->tenant_email_id . ')';\n }\n $contact_details = rtrim($contact_details, ', ');\n if ($company[0] == 'T') {\n $company_details->company_name = $tenant_details->tenant_name;\n }\n \n /* skm code start for remark. reporting time skm start bcoz of sam request for AOP(67) on 18-may-17*/\n $time = strtotime($classes->class_start_datetime);\n $reporting_time = date(\"H:i A\", strtotime('-30 minutes', $time));\n if($classes->course_id == 67 || $classes->course_id == 121)\n {\n $li = \"Report at center at $reporting_time to register for class\";\n }else{\n $li = \"Report at center at 8:30 AM to register for class\";\n }\n /* end */\n if($tenant_details->tenant_id == 'T02')\n {\n $li2 = \"<li>In the event of unforeseen circumstances (example: SkillsFuture Credit website is down for maintenance, etc), Cash payment has to be collected from Candidate and Xprienz Pte Ltd will assist in making the appeal for them.</li>\";\n } else {\n $li2 = '';\n } \n ///// added by shubhranshu for wablab points\n if($tenant_details->tenant_id == 'T20' || $tenant_details->tenant_id == 'T17'){\n $li_first = \"<li>Your NRIC, work permit or will be photocopied on the class date</li>\";\n }else{\n $li_first =\"<li>All participants please bring along their photo ID card with either their Nric/Fin number stated upon class date.</li>\";\n }\n $message3 = '\n <ol style=\"font-size:13px;color:#4f4b4b\">\n '.$li_first.'\n \n <li>Trim finger nails and remove nail polish</li>\n <li>'.$li.'</li>\n '.$li2.'\n </ol>';\n \n /* skm end */\n \n $data = '<br><br>\n <table style=\"font-size:15px\">\n <tr>\n <td>'.$tr_count . ' Seats for your company ' . $company_details->company_name . ' has been booked. Booking details for your employees: \n ' . $trainee . ' for \\'Course: <b>' . $courses->crse_name . '</b>, Class: <b>' . $classes->class_name . '</b>, Certificate Code: ' . $courseLevel . '\\'<br><br>\n <strong>Class start date:</strong>\n ' . date('M d, Y h:i A', strtotime($classes->class_start_datetime)) . '\n <br>\n <br>\n <strong>Class end date:</strong>\n ' . date('M d, Y h:i A', strtotime($classes->class_end_datetime)) . '\n <br>\n <br>\n \n <strong>Location: </strong>\n ' . $ClassLoc . '<br><br>\n <strong>Contact Details: </strong>\n ' . $contact_details. '<br><br>\n <strong>Remark: </strong>\n ' . $message3.'</td>\n </tr>\n </table>';\n }\n $booking_details = $this->classtraineemodel->get_paydue_invoice($trainee_id, $class_id);\n if ($booking_details) {\n $booking_no = date('Y', strtotime($booking_details->inv_date)) . ' ' . $booking_details->invoice_id;\n $booking_date = date('d/m/Y', strtotime($booking_details->inv_date));\n } else {\n $booking_no = date('Y') . ' ' . $trainee_id;\n $booking_date = date('d/m/Y');\n }\n $this->load->helper('pdf_reports_helper');\n generate_booking_acknowledge_pdf($data, $tenant_details, $booking_no, $booking_date);\n }", "function IciciBankPL($net_salary, $company, $category, $DOB, $Company_Type, $Primary_Acc, $reqtenure, $reqloanamount) {\n $exactnet_salary = $net_salary;\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n $calcterm = $term;\n $getterm = $print_term;\n\t\t$gtcropcomp=\"Select interest_rate,\tprocessing_fee From pl_company_icici Where (company_name like '%\".$company.\"%' and interest_rate>0)\";\n\t\tlist($alreadyExist,$icicirowar)=Mainselectfunc($gtcropcomp,$array = array());\n\t\n\t\tif (count($icicirowar) > 0) {\n $icicirow = array(\"interest_rate\" => $icicirowar[\"interest_rate\"], \"processing_fee\" => $icicirowar[\"processing_fee\"]);\n } else {\n $icicirow = array(\"interest_rate\" => 0, \"processing_fee\" => 0);\n }\n\n if ($icicirow[\"interest_rate\"] > 0) {\n $crprecordcount = $icicirow[\"interest_rate\"];\n } else {\n $crprecordcount = 0;\n }\n if ($crprecordcount > 0) {\n list($main, $gen) = explode('.', $icicirow[\"interest_rate\"]);\n if ($gen == 00) {\n $interestrate = $main;\n } else {\n $interestrate = $icicirow[\"interest_rate\"];\n }\n $intr = $icicirow[\"interest_rate\"];\n $proc_Fee = $icicirow[\"processing_fee\"];\n } else {\n if (strlen($category) > 1) {\n if ($net_salary >= 75000) {\n $interestrate = 15.35;\n $intr = $interestrate;\n } else if ($net_salary >= 50000 && $net_salary < 75000) {\n $interestrate = 15.40;\n $intr = $interestrate;\n } else if ($net_salary >= 35000 && $net_salary < 50000) {\n $interestrate = 15.45;\n $intr = $interestrate;\n } else if ($net_salary >= 20000 && $net_salary <= 35000) {\n $interestrate = 16.75;\n $intr = $interestrate;\n } elseif ($net_salary <= 20000) {\n $interestrate = 16.99;\n $intr = $interestrate;\n } else {\n $interestrate = 16.99;\n $intr = $interestrate;\n }\n if ((strncmp(\"ICICI\", $Primary_Acc, 5)) == 0) {\n $proc_Fee = \"2%\";\n } else {\n $proc_Fee = \"2.25%\";\n }\n } else {\n /*if ($Company_Type == 4 || $Company_Type == 6) {\n if ($net_salary >= 50000) {\n $interestrate = 15.49;\n $intr = $interestrate;\n $proc_Fee = \"1.49%\";\n } else if ($net_salary >= 35000 && $net_salary < 50000) {\n $interestrate = 15.75;\n $intr = $interestrate;\n $proc_Fee = \"1.70%\";\n } else if ($net_salary >= 20000 && $net_salary < 35000) {\n $interestrate = 16.99;\n $intr = $interestrate;\n $proc_Fee = \"1.70%\";\n } elseif ($net_salary < 20000) {\n $interestrate = 17.99;\n $intr = $interestrate;\n $proc_Fee = \"1.99%\";\n } else {\n $interestrate = 17.99;\n $intr = $interestrate;\n $proc_Fee = \"1.99%\";\n }\n } else { */\n if ($net_salary >= 75000) {\n $interestrate = 16.99;\n $intr = $interestrate;\n if ((strncmp(\"ICICI\", $Primary_Acc, 5)) == 0) {\n\t\t\t\t\t\t\t$proc_Fee = \"2%\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$proc_Fee = \"2.25%\";\n\t\t\t\t\t\t}\n } else if ($net_salary >= 50000 && $net_salary < 75000) {\n $interestrate = 17.49;\n $intr = $interestrate;\n if ((strncmp(\"ICICI\", $Primary_Acc, 5)) == 0) {\n\t\t\t\t\t\t\t$proc_Fee = \"2%\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$proc_Fee = \"2.25%\";\n\t\t\t\t\t\t}\n } else if ($net_salary >= 35000 && $net_salary < 50000) {\n $interestrate = 17.99;\n $intr = $interestrate;\n $proc_Fee = \"2.25%\";\n } else if ($net_salary >= 20000 && $net_salary < 35000) {\n $interestrate = 17.99;\n $intr = $interestrate;\n $proc_Fee = \"2.25%\";\n } elseif ($net_salary < 20000) {\n $interestrate = 18.49;\n $intr = $interestrate;\n $proc_Fee = \"2.25%\";\n } else {\n $interestrate = 18.49;\n $intr = $interestrate;\n $proc_Fee = \"2.25%\";\n }\n //}//else\n }\n }\n\n $princ = 100000;\n $perlacemi = round($princ * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($princ, $intr, $calcterm);\n\n //Calculate Loan Amount \n if ($net_salary >= 50000) {\n $firstnet_salary = ($net_salary * (65 / 100));\n $loan_amt1 = ($perlacemi > 0) ? ($firstnet_salary / $perlacemi * 100000) : 0;\n } else if ($net_salary < 50000) {\n $firstnet_salary = ($net_salary * (55 / 100));\n $loan_amt1 = ($perlacemi > 0) ? ($firstnet_salary / $perlacemi * 100000) : 0;\n } else {\n \n }\n\n // other method\n if ($category == \"Elite\" || $category == \"SuperPrime\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = $net_salary * 18;\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 15;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"Preferred\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = \"\";\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 7;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n } else {\n $loan_amt = 0;\n }\n }\n if ($loan_amt > 0 && $loan_amt1 > 0) {\n if ($loan_amt >= $loan_amt1) {\n $finalloanamount = $loan_amt1;\n } else {\n $finalloanamount = $loan_amt;\n }\n } else {\n if ($loan_amt > 0) {\n $finalloanamount = $loan_amt;\n }\n if ($loan_amt1 > 0) {\n $finalloanamount = $loan_amt1;\n }\n }\n\n //Exact Loan Amount\n if ($category == \"Elite\" || ($category == \"SuperPrime\" && (strncmp(\"ICICI\", $Primary_Acc, 5)) == 0)) {\n if ($finalloanamount >= 2000000) {\n $loan_amount = 2000000;\n } else {\n $loan_amount = $finalloanamount;\n }\n } else if (($category == \"SuperPrime\" && (strncmp(\"ICICI\", $Primary_Acc, 5)) != 0) || ($category == \"Preferred\" && (strncmp(\"ICICI\", $Primary_Acc, 5)) == 0)) {\n if ($finalloanamount >= 2000000) {\n $loan_amount = 2000000;\n } else {\n $loan_amount = $finalloanamount;\n }\n } else {\n if ((strncmp(\"ICICI\", $Primary_Acc, 5)) == 0) {\n if ($finalloanamount >= 2000000) {\n $loan_amount = 2000000;\n } else {\n $loan_amount = $finalloanamount;\n }\n } else {\n if ($finalloanamount >= 2000000) {\n $loan_amount = 2000000;\n } else {\n $loan_amount = $finalloanamount;\n }\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$loan_amount)\n\t\t\t\t{\n\t\t\t\t\t$loan_amount=$loan_amount;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loan_amount=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$loan_amount=$loan_amount;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n // Special Clause\n if (strlen($category) > 0) {\n if ($loan_amount >= 2000000 && (strlen($category) > 0)) {\n $interestrate = 11.59;\n $intr = $interestrate;\n $proc_Fee = \"4999\";\n \n } elseif (($loan_amount >= 1500000 && $loan_amount < 2000000) && (strlen($category) > 0)) {\n \n $interestrate = 11.99;\n $intr = $interestrate;\n $proc_Fee = \"3999\";\n \n } elseif (($loan_amount >= 1000000 && $loan_amount < 1500000) && (strlen($category) > 0)) {\n \n $interestrate = 12.49;\n $intr = $interestrate;\n $proc_Fee = \"3999\";\n \n } elseif (($loan_amount >= 500000 && $loan_amount < 1000000) && (strlen($category) > 0)) {\n \n $interestrate = 14.49;\n $intr = $interestrate;\n $proc_Fee = \"0.99%\";\n }\n } else {\n if ($loan_amount >= 2000000) {\n $interestrate = 14.99;\n $intr = $interestrate;\n $proc_Fee = \"1%\";\n } elseif (($loan_amount >= 1500000 && $loan_amount < 2000000)) {\n $interestrate = 15.99;\n $intr = $interestrate;\n $proc_Fee = \"1%\";\n } elseif (($loan_amount >= 1000000 && $loan_amount < 1500000)) {\n $interestrate = 16.49;\n $intr = $interestrate;\n $proc_Fee = \"1%\";\n } elseif (($loan_amount >= 500000 && $loan_amount < 1000000)) {\n $interestrate = 16.99;\n $intr = $interestrate;\n $proc_Fee = \"1.49%\";\n }\n }\n\n $getemicalc = round($loan_amount * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $calcterm))));//getController()->Common()->getEMI($loan_amount, $intr, $calcterm);\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $calcterm))));\n \n $details['bank_code'] = \"ICICI Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($loan_amount);\n $details['processing_fee'] = $proc_Fee;\n $details['category'] = $category;\n return($details);\n }", "public function claimPageAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET LOGGED IN USER INFORMATION \n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET LEVEL ID\n if (!empty($viewer_id)) {\n $level_id = $viewer->level_id;\n } else {\n $authorizationTable = Engine_Api::_()->getItemTable('authorization_level');\n $authorization = $authorizationTable->fetchRow(array('type = ?' => 'public', 'flag = ?' => 'public'));\n if (!empty($authorization))\n $level_id = $authorization->level_id;\n }\n\n $getPackageClaim = Engine_Api::_()->sitepage()->getPackageAuthInfo('sitepage');\n $this->_helper->layout->setLayout('default-simple');\n\n //GET PAGE ID\n $page_id = $this->_getParam('page_id', null);\n\n //SET PARAMS\n $paramss = array();\n $paramss['page_id'] = $page_id;\n $paramss['viewer_id'] = $viewer_id;\n $inforow = Engine_Api::_()->getDbtable('claims', 'sitepage')->getClaimStatus($paramss);\n\n $this->view->status = 0;\n if (!empty($inforow)) {\n $this->view->status = $inforow->status;\n }\n\n\t\t//GET ADMIN EMAIL\n\t\t$coreApiSettings = Engine_Api::_()->getApi('settings', 'core');\n\t\t$adminEmail = $coreApiSettings->getSetting('core.mail.contact', $coreApiSettings->getSetting('core.mail.from', \"[email protected]\"));\n\t\tif(!$adminEmail) $adminEmail = $coreApiSettings->getSetting('core.mail.from', \"[email protected]\");\n \n //CHECK STATUS\n if ($this->view->status == 2) {\n echo '<div class=\"global_form\" style=\"margin:15px 0 0 15px;\"><div><div><h3>' . $this->view->translate(\"Alert!\") . '</h3>';\n echo '<div class=\"form-elements\" style=\"margin-top:10px;\"><div class=\"form-wrapper\" style=\"margin-bottom:10px;\">' . $this->view->translate(\"You have already send a request to claim for this page which has been declined by the site admin.\") . '</div>';\n echo '<div class=\"form-wrapper\"><button onclick=\"parent.Smoothbox.close()\">' . $this->view->translate(\"Close\") . '</button></div></div></div></div></div>';\n }\n\n $this->view->claimoption = $claimoption = Engine_Api::_()->authorization()->getPermission($level_id, 'sitepage_page', 'claim');\n\n //FETCH\n $paramss = array();\n $this->view->userclaim = $userclaim = 0;\n $paramss['page_id'] = $page_id;\n $paramss['limit'] = 1;\n $pageclaiminfo = Engine_Api::_()->getDbtable('pages', 'sitepage')->getSuggestClaimPage($paramss);\n\n if (!$claimoption || !$pageclaiminfo[0]['userclaim'] || !Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.claimlink', 1)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (isset($pageclaiminfo[0]['userclaim'])) {\n $this->view->userclaim = $userclaim = $pageclaiminfo[0]['userclaim'];\n }\n\n if ($inforow['status'] == 3 || $inforow['status'] == 4) {\n echo '<div class=\"global_form\" style=\"margin:15px 0 0 15px;\"><div><div><h3>' . $this->view->translate(\"Alert!\") . '</h3>';\n echo '<div class=\"form-elements\" style=\"margin-top:10px;\"><div class=\"form-wrapper\" style=\"margin-bottom:10px;\">' . $this->view->translate(\"You have already filed a claim for this page: \\\"%s\\\", which is either on hold or is awaiting action by administration.\", Engine_Api::_()->getItem('sitepage_page', $page_id)->title) . '</div>';\n echo '<div class=\"form-wrapper\"><button onclick=\"parent.Smoothbox.close()\">' . $this->view->translate(\"Close\") . '</button></div></div></div></div></div>';\n }\n\n if (!$inforow['status'] && $claimoption && $userclaim) {\n //GET FORM \n $this->view->form = $form = new Sitepage_Form_Claimpage();\n\n //POPULATE FORM\n if (!empty($viewer_id)) {\n $value['email'] = $viewer->email;\n $value['nickname'] = $viewer->displayname;\n $form->populate($value);\n }\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n\n //GET EMAIL\n $email = $values['email'];\n\n //CHECK EMAIL VALIDATION\n $validator = new Zend_Validate_EmailAddress();\n if (!$validator->isValid($email)) {\n $form->addError(Zend_Registry::get('Zend_Translate')->_('Please enter a valid email address.'));\n return;\n }\n\n //GET CLAIM TABLE\n $tableClaim = Engine_Api::_()->getDbTable('claims', 'sitepage');\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n //SAVE VALUES\n if (!empty($getPackageClaim)) {\n\n //GET SITEPAGE ITEM\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n\n //GET PAGE URL\n $page_url = Engine_Api::_()->sitepage()->getPageUrl($page_id);\n\n //SEND SITEPAGE TITLE TO THE TPL\n $page_title = $sitepage->title;\n\n //SEND CHANGE OWNER EMAIL\n\t\t\t\t\t\tif(Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.claim.email', 1) && Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepage.claimlink', 1)) {\n\t\t\t\t\t\t\tEngine_Api::_()->getApi('mail', 'core')->sendSystem($adminEmail, 'SITEPAGE_CLAIMOWNER_EMAIL', array(\n\t\t\t\t\t\t\t\t\t'page_title' => $page_title,\n\t\t\t\t\t\t\t\t\t'page_title_with_link' => '<a href=\"' . 'http://' . $_SERVER['HTTP_HOST'] .\n\t\t\t\t\t\t\t\t\tZend_Controller_Front::getInstance()->getRouter()->assemble(array('page_url' => $page_url), 'sitepage_entry_view', true) . '\" >' . $page_title . ' </a>',\n\t\t\t\t\t\t\t\t\t'object_link' => 'http://' . $_SERVER['HTTP_HOST'] .\n\t\t\t\t\t\t\t\t\tZend_Controller_Front::getInstance()->getRouter()->assemble(array('page_url' => $page_url), 'sitepage_entry_view', true),\n\t\t\t\t\t\t\t\t\t'email' => $coreApiSettings->getSetting('core.mail.from', \"[email protected]\"),\n\t\t\t\t\t\t\t\t\t'queue' => true\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\n $row = $tableClaim->createRow();\n $row->page_id = $page_id;\n $row->user_id = $viewer_id;\n $row->about = $values['about'];\n $row->nickname = $values['nickname'];\n $row->email = $email;\n $row->contactno = $values['contactno'];\n $row->usercomments = $values['usercomments'];\n $row->status = 3;\n $row->save();\n }\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => true,\n 'parentRefreshTime' => '60',\n 'parentRefresh' => 'true',\n 'format' => 'smoothbox',\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your request has been send successfully. You will now receive an email confirming Admin approval of your request.'))\n ));\n }\n }\n }", "public function printInvoice(){\r\n \t$data['table'] = $table = $this -> uri -> segment(4);\r\n\t\t$data['table2'] = $this -> uri -> segment(5);\r\n\t\t$data['table3'] = $this -> uri -> segment(6);\r\n\t\t\r\n\t\t//Status Method Parameters\r\n\t\t$main_table = 'request';\r\n\t\t$ref = 'request_id';\r\n\t\t$status = 'invoice_print_status';\r\n\r\n /*DOMpdf initialization\r\n require_once(\"application/helpers/dompdf/dompdf_config.inc.php\");\r\n $this->load->helper('dompdf', 'file');\r\n $this->load->helper('file');\r\n\r\n //DOMpdf configuration\r\n $dompdf = new DOMPDF();\r\n $dompdf->set_paper('A4');\r\n */\r\n\r\n //\r\n \t$data['reqid'] = $reqid = $this -> uri -> segment(3);\t\r\n \t$saveTo = './invoices';\r\n \t$invoicename = \"Invoice_\" . $data['reqid'] . \".pdf\";\r\n\t\t\t\r\n\t\t$data['test_data'] = Invoice_billing::getChargesPerClient($data['reqid']);\r\n\t\t$data['invoice_data'] = $invoice_data = Request::getInvoiceDetails($data['reqid']);\r\n\r\n\t\t//Get client info from main array\r\n\t\t$client_info = $invoice_data[0]['Clients'];\r\n\r\n\t\t//Get Invoice Number\r\n\t\t$coa_nos = Coa_number::getCoaNo($data['reqid']);\r\n\t\t$year = date('Y');\r\n\t\t$data['invoice_number'] = \"/\".$coa_nos[0]['number'];\r\n\t\t\r\n\t\t//Get client id\r\n\t\t$data['client_id'] = $this -> uri -> segment(7);\r\n\r\n\t\t//Get Total\r\n\t\t$data['total'] = Invoice_billing::getTotal($data['reqid']);\r\n\t\t$total_cost = $data['total'][0]['sum'];\t\r\n\r\n\t\t//Get Discount Data\r\n\t\t$client_discount_percentage = Clients::getDiscountPercentage($data['client_id']);\r\n\t\t$discount_percentage = $client_discount_percentage[0]['discount_percentage'];\r\n\t\t$discount_title = 'DISCOUNT '. $discount_percentage.'%';\r\n\t\r\n\t\t//Compute Discounts\r\n\t\t$discount = $discount_percentage/100 * $total_cost;\r\n\t\t$amount_payable = $total_cost - $discount;\r\n\r\n\t\t//Push amounts into array that generates totals footer depending on client eligible for discount/not\r\n\t\tif($discount_percentage != 0){\r\n\t\t\t$data['tr_array'] = array('TOTAL COST'=>$total_cost, $discount_title => $discount , 'AMOUNT PAYABLE' => $amount_payable);\r\n\t\t\t$data['discount_cols'] = 6;\r\n\t\t\t$data['discount_csp']= 2;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$data['tr_array'] = array('TOTAL COST'=>$total_cost, 'AMOUNT PAYABLE' => $amount_payable);\r\n\t\t\t$data['discount_cols'] = 5;\r\n\t\t\t$data['discount_csp'] = 1;\r\n\t\t}\r\n\r\n\t\t//Get method \r\n\t\t$data['method'] = $this -> router -> fetch_method();\r\n\r\n\t\t//Get Signatory Details\r\n\r\n\t\t$signatory = $this -> uri -> segment(8);\r\n\t\t$signatory_title = $this -> uri -> segment(9);\r\n\r\n\t\t//Replace special characters in signatory details\r\n\t\t$data['signatory'] = str_replace(\"%20\", \" \", $signatory_title);\r\n\t\t$data['signatory_title'] = str_replace(\"%20\", \" \", $signatory);\r\n\r\n\t\t/*Push to view\r\n $html = \r\n\t\t$this->load->view('invoice_pdf_v', $data, TRUE);\r\n \r\n\t\t$html = $this -> load -> view('invoice_pdf_v', $data, TRUE);\t\r\n\t\t$dompdf->load_html($html);\r\n $dompdf->render();\r\n write_file($saveTo . \"/\" . $invoicename, $dompdf->output());\r\n */\r\n\t\t\r\n //Excel Initialization\r\n $ei = new PHPExcel();\r\n\r\n //Get excel sheet metadata\r\n $creator = $this -> session -> userdata('full_name');\r\n $general_title = 'Invoice';\r\n $title = 'Invoice'.\" \".$data['reqid'];\r\n $description = 'Invoice for'.\" \".$data['reqid'];\r\n $subject = 'Final Invoice';\r\n $keywords = 'invoice, quotation, finance, pro forma';\r\n $category = 'Finance';\r\n\r\n //Set File Name\r\n $file_name = 'Invoice_'.$data['reqid'].'.xlsx';\r\n\r\n //Set excel sheet metadata\r\n $ei -> getProperties()\r\n \t-> setCreator($creator)\r\n \t-> setTitle($title)\r\n \t-> setLastModifiedBy($creator)\r\n \t-> setSubject($subject)\r\n \t-> setKeywords($keywords)\r\n \t-> setCategory($category)\r\n \t;\r\n\r\n //Set reference to worksheet\r\n $inv = $ei->getSheet(0);\r\n $inv -> setTitle($title);\r\n\r\n\t\t//Set descriptive items data\r\n\t\t$inv -> setCellValue('c1', $general_title); \r\n\r\n\t\t//var_dump(base_url().\"invoices/\".$title.\"/\".$file_name);\r\n\r\n\t\t//Fill Client Address Info\r\n\t\t$inv->fromArray($client_info, '', 'A4');\r\n\r\n\t\t//Define the invoices folder\r\n\t\t$inv_dir = \"invoices\";\r\n\r\n\t\t//Condition to find out if the folder exists/not\r\n\t\tif(!file_exists($inv_dir)){\r\n\t\t\tmkdir($inv_dir, 0744);\r\n\t\t}\r\n\r\n\t\t//Save excel sheet\r\n\t\t$writer = \\PHPExcel_IOFactory::createWriter($ei,'Excel2007');\r\n\t\t$writer->setOffice2003Compatibility(true); \r\n\t\t$writer->save($inv_dir.\"/\".$file_name);\r\n\r\n //Set invoice print status\r\n //$this -> setInvoicePrintStatus($reqid, $saveTo, $invoicename, $main_table, $ref, $status);\r\n\t}", "public function generateBill(){\n \t// $arr = json_encode($arr);\n \t// $arr = base64_encode($arr);\n\n \t// echo \"<pre>\";\n \t// print_r($arr);\n \t// die;\n\t\t$this->load->helper('pdfhelper');//loading pdf helper\n\t\tif(1){\t\n\t\t\t$customer_id = $this->uri->segment(3);\n\t\t\t$card_id = $this->uri->segment(4);\n\t\t\t$card_id = base64_decode($card_id);\t\t\t\t\t\t\n\t\t\t// print_r($service_id_arr);\n\t\t\t// die;\n\t\t\tif(isset($customer_id)){\n\t\t\t\t//Check whether customer belongs to the logged cashier's shop and business admin\n\t\t\t\t$where = array(\t\t\t\t\t\n\t\t\t\t\t'customer_id' => $customer_id\n\t\t\t\t);\n\n\t\t\t\t$check = $this->CashierModel->VerifyOfflineCustomer($where);\t\t\t\t\n\n\t\t\t\tif($check['success'] == 'true'){\t\n\t\t\t\t\t$data['title'] = \"Invoice\";\n\n\t\t\t\t\t$data['individual_customer'] = [];\n\t\t\t\t\t$data1 = $this->CashierModel->DetailsById($customer_id,'mss_customers','customer_id');\n\t\t\t\t\t\tif($data1['success'] == 'true'){\t\n\t\t\t\t\t\t\t $data['individual_customer'] = $data1['res_arr'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\n//\t\t\t\t\t$data['experts'] = $this->GetExperts();\n\t\t\t\t\t$where = array(\n\t\t\t\t\t\t'employee_business_admin' => $data['individual_customer']['customer_business_admin_id'],\n\t\t\t\t\t\t'employee_business_outlet'=> $data['individual_customer']['customer_business_outlet_id'],\n\t\t\t\t\t\t'employee_is_active' => TRUE\n\t\t\t\t\t);\n\n\t\t\t\t\t$data1 = $this->CashierModel->MultiWhereSelect('mss_employees',$where);\n\t\t\t\t\tif($data1['success'] == 'true'){\t\n\t\t\t\t\t\t$data['experts'] = $data1['res_arr'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$where = array(\n\t\t\t\t\t\t'business_outlet_business_admin' => $data['individual_customer']['customer_business_admin_id'],\n\t\t\t\t\t\t'business_outlet_id'=> $data['individual_customer']['customer_business_outlet_id'],\n\t\t\t\t\t);\n\n\t\t\t\t\t/*$data1 = $this->CashierModel->DetailsById($where['business_outlet_id'],'mss_business_outlets','business_outlet_id');\n\t\t\t\t\tif($data1['success'] == 'true'){\t\n\t\t\t\t\t\t$data['shop_details'] = $data1['res_arr'];\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\terror_log(print_r($data['shop_details'],1),0);*/\n\t\t\t\t\t\n//\t\t\t\t\t$data['shop_details'] = $this->ShopDetails();\n\t\t\t\t\t//$data['individual_customer'] = $this->GetCustomerBilling($customer_id);\n\t\t\t\t\t\n\t\t\t\t\t// echo \"<pre>\";\n\t\t\t\t\t// print_r($data);\n\t\t\t\t\t// die;\n\t\t\t\t\t//for Bill No\n\t\t\t\t\t$outlet_counter = $this->db->select('*')->from('mss_business_outlets')->where('business_outlet_id',$data['individual_customer']['customer_business_outlet_id'])->get()->row_array();\n\n\t\t\t\t\t// $data['bill_no']=strval(\"A\".strval(100+$data['individual_customer']['customer_business_admin_id']) . \"O\" . strval( $data['individual_customer']['customer_business_outlet_id']) . \"-\" . strval($outlet_counter['business_outlet_bill_counter']));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$sql =\"SELECT * from mss_transaction_cart where id=\".$card_id;\n\n\t\t\t\t\t$query = $this->db->query($sql);\n\t\t\t\t\t$result = $query->result_array();\n\t\t\t\t\t$cart = json_decode($result[0]['cart_data'],true);\n\t\t\t\t\t\n\t\t\t\t\t$data['cart'] = $cart; \n\t\t\t\t\t$outlet_admin_id = $result[0]['outlet_admin_id'];\n\n\t\t\t\t\t\n\t\t\t\t\t$data1 = $this->CashierModel->DetailsById($outlet_admin_id,'mss_business_outlets','business_outlet_id');\n\t\t\t\t\tif($data1['success'] == 'true'){\t\n\t\t\t\t\t\t$data['shop_details'] = $data1['res_arr'];\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t/*error_log($this->db->last_query());\n\t\t\t\t\terror_log(print_r($data['shop_details'],1),0);*/\n\n\n\t\t\t\t\t$sql =\"SELECT * FROM `mss_transactions` WHERE `txn_id` = \".$result[0]['transaction_id'];\n\n\t\t\t\t\t$query = $this->db->query($sql);\n\t\t\t\t\t$result = $query->result_array();\n\t\t\t\t\t$data['bill_no']= $result[0]['txn_unique_serial_id'];\n\t\t\t\t\t\n\t\t\t\t\t// echo \"<pre>\";\t\t\t\t\t\n\t\t\t\t\t//print_r($result[0]['outlet_admin_id']);die;\n\t\t\t\t\t// print_r($data['cart']);\n\t\t\t\t\t$sql =\"SELECT config_value from mss_config where config_key='salon_logo' and outlet_admin_id = $outlet_admin_id\";\n\n\t\t\t\t\t$query = $this->db->query($sql);\n\t\t\t\t\t$result = $query->result_array();\n\t\t\t\t\tif(empty($result)){\n\t\t\t\t\t\t$sql =\"SELECT config_value from mss_config where config_key='salon_logo' and outlet_admin_id = 1\";\n\n\t\t\t\t\t\t$query = $this->db->query($sql);\n\t\t\t\t\t\t$result = $query->result_array();\n\t\t\t\t\t}\n\t\t\t\t\t$data['logo'] = $result[0]['config_value'];\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// if(isset($this->session->userdata['payment'])){\n\t\t\t\t\t// \t$data['payment'] = $this->session->userdata['payment'][$customer_id];\n\t\t\t\t\t// }\n\t\t\t\t\t// print_r($data['payment']);\n\t\t\t\t\t// die;\n\t\t\t\t\t$this->load->view('cashier/cashier_print_bill',$data);\n\t\t\t\t}\n\t\t\t\telseif ($check['error'] == 'true'){\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'heading' => \"Illegal Access!\",\n\t\t\t\t\t\t'message' => $check['message']\n\t\t\t\t\t);\n\t\t\t\t\t$this->load->view('errors/html/error_general',$data);\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$data = array(\n\t\t\t\t\t'heading' => \"Illegal Access!\",\n\t\t\t\t\t'message' => \"Customer details/ID missing. Please do not change url!\"\n\t\t\t\t);\n\t\t\t\t$this->load->view('errors/html/error_general',$data);\n\t\t\t}\t\n\t\t}\n\t\telse{\n\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t} \t\n\t\t}", "function RBLBankPL($net_salary,$clubbed_emi,$company,$rblcategory,$DOB,$Company_Type,$Primary_Acc, $reqtenure, $reqloanamount)\n\t{\n\t\t $net_salary= $net_salary - $clubbed_emi;\n\t\t list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t if(strlen($rblcategory)>1)\n\t\t{\n\t\t\t $category=$rblcategory;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$category=RBLcompanyCategorize($company);\n\t\t}\n\t\t \n\t\t//foir for all\n\t\t//multiplier for pvt ltd\n\t\t//compay catgory wise rates\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\tif($term>0)\n\t\t{\n\t\t\tif($net_salary>35000)\n\t\t\t{\n\t\t\t\tif($print_term>60)\n\t\t\t\t{\n\t\t\t\t\t$term=60*12;\n\t\t\t\t\t$print_term=60;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$term=$print_term*12;\n\t\t\t\t\t$print_term=$print_term;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($print_term>48)\n\t\t\t\t{\n\t\t\t\t\t$term=48*12;\n\t\t\t\t\t$print_term=48;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$term=$print_term*12;\n\t\t\t\t\t$print_term=$print_term;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\t$calterm=$term;\n\t\t\t$calprint_term=$print_term;\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//end\n\n\t\tif($category==\"CAT A\")\n\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t}\n\t\telseif($category==\"CAT B\")\n\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t}//CAT B\n\t\telseif($category==\"CAT C\")\n\t\t{\n\t\t\t$Loan_Amount=$reqloanamount;\n\t\t\tif($Loan_Amount>=300000)\n\t\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 17;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 17.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t}//CAT C\n\t\telseif($category==\"CAT D\")\n\t\t{\n\t\t\t$Loan_Amount=$reqloanamount;\n\t\t\tif($Loan_Amount>=300000)\n\t\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 19;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 20;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 17.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 20;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$Loan_Amount=$reqloanamount;\n\t\t\tif($Loan_Amount>=300000)\n\t\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 19;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 20;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 17.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 20;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//CAT D//rates\n\n\t\t//foir\n\t\t$princ=100000;\n\t\t$perlacemi=round($princ * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\t\t\t\tif($net_salary>=100000)\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (70/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t}\n\t\telse if($net_salary>=50000 && $net_salary<100000)\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (65/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t}\n\t\telse if($net_salary>35000 && $net_salary<50000)\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (60/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t}\n\t\t\telse if($net_salary<=35000)\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (55/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (55/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t} //foir end\n\n\t\t\t//multiplier for pvt. ltd companies only\n\t\t\tif($Company_Type==1)\n\t\t\t{\n\t\t\t\tif($net_salary>=100000)\n\t\t\t\t{\n\t\t\t\t\tif($term>=12 && $term<24)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 6;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=24 && $term<36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 12;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=36 && $term<48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 15;\n\t\t\t\t\t}\n\t\t\t\t\telseif(($term>=48 && $term<60))\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 18;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term==60)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 18;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 18;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<100000)\n\t\t\t\t{\n\t\t\t\t\tif($term>=12 && $term<24)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 4;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=24 && $term<36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 11;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=36 && $term<48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 14;\n\t\t\t\t\t}\n\t\t\t\t\telseif(($term>=48 && $term<60))\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 15;\n\n\t\t\t\t\t}\n\t\t\t\t\telseif($term==60)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 15;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 15;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($net_salary<50000)\n\t\t\t\t{\n\t\t\t\t\tif($term>=12 && $term<24)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 3;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=24 && $term<36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 8;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=36 && $term<48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 11;\n\t\t\t\t\t}\n\t\t\t\t\telseif(($term>=48 && $term<60))\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 13;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term==60)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 13;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 13;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\tif($finalloanamount_dbr>1 && $Loan_Amount_Eli>1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($finalloanamount_dbr>$Loan_Amount_Eli)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$getloanamout = $Loan_Amount_Eli;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\n\t\t\t\t}\n\t\t\t\t\n\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t\t}\n\t\t\t\n\t\tif ($getloanamout > 0 && $intr > 0) {\n $getemicalc = round($getloanamout * ($intr) / (1 - (pow(1/(1 + ($intr)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $getemicalc = 0;\n $interestrate = 0;\n $proc_Fee = 0;\n }\n$getterm=$print_term;\n\t$pro_fee=\"2%\";\n\t\t\t $details['bank_code'] = \"RBL Bank\";\n\t\t\t$details['interest_rate'] = interestRateFormat($interestrate);\n\t\t\t$details['emi'] = $getemicalc;\n\t\t\t$details['emiperlac'] = $emiperlac;\n\t\t\t$details['tenure'] = $getterm;\n\t\t\t$details['loan_amount'] = round($getloanamout);\n\t\t\t$details['processing_fee'] = $pro_fee;\n\t\t\t$details['category'] = $category;\n\t\t\treturn($details);\n\t}", "function ciniki_ags_unpaidSalesPDF($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'start_date'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'date', 'name'=>'Start'),\n 'end_date'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'date', 'name'=>'End'),\n 'exhibit_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Exhibit'),\n 'exhibitor_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Exhibit'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n // \n // Check access to tnid as owner, or sys admin. \n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'ags', 'private', 'checkAccess');\n $rc = ciniki_ags_checkAccess($ciniki, $args['tnid'], 'ciniki.ags.unpaidSalesPDF');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Load the tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_ags_settings', 'tnid', $args['tnid'], 'ciniki.ags', 'settings', '');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.ags.225', 'msg'=>'Unable to load settings', 'err'=>$rc['err']));\n }\n $settings = isset($rc['settings']) ? $rc['settings'] : array();\n \n //\n // Load the tenant intl settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki, 'php');\n $mysql_date_format = ciniki_users_dateFormat($ciniki, 'mysql');\n\n if( (!isset($args['exhibit_id']) || $args['exhibit_id'] == 0 || $args['exhibit_id'] == '')\n && (!isset($args['exhibitor_id']) || $args['exhibitor_id'] == 0 || $args['exhibitor_id'] == '') \n && (!isset($args['start_date']) || $args['start_date'] == '') \n ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.ags.140', 'msg'=>'An exhibit or exhibitor must be specified'));\n }\n\n //\n // Load tenant details\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'tenantDetails');\n $rc = ciniki_tenants_tenantDetails($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['details']) && is_array($rc['details']) ) {\n $tenant_details = $rc['details'];\n } else {\n $tenant_details = array();\n }\n\n //\n // Get the exhibit name\n //\n $report_title = 'Unpaid Sales';\n if( isset($args['exhibit_id']) && $args['exhibit_id'] > 0 ) {\n $strsql = \"SELECT name \"\n . \"FROM ciniki_ags_exhibits \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $args['exhibit_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.ags', 'exhibit');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.ags.142', 'msg'=>'Unable to load exhibit', 'err'=>$rc['err']));\n }\n if( !isset($rc['exhibit']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.ags.143', 'msg'=>'Unable to find requested exhibit'));\n }\n $exhibit = $rc['exhibit'];\n $report_title = $exhibit['name'] . ' - Unpaid Sales';\n }\n if( isset($args['start_date']) && $args['start_date'] != '' ) {\n $dt = new DateTime($args['start_date'], new DateTimezone($intl_timezone));\n if( !isset($args['end_date']) ) {\n $edt = new DateTime('now', new DateTimezone($intl_timezone));\n $args['end_date'] = $dt->format('Y-m-d');\n } else {\n $edt = new DateTime($args['end_date'], new DateTimezone($intl_timezone));\n }\n $report_title .= ' from ' . $dt->format($date_format) . ' to ' . $edt->format($date_format);\n }\n\n $strsql = \"SELECT sales.id AS sales_id, \"\n . \"exhibitors.display_name, \"\n . \"items.exhibitor_id, \"\n . \"items.code, \"\n . \"items.exhibitor_code, \"\n . \"items.name, \"\n . \"sales.quantity, \"\n . \"DATE_FORMAT(sales.sell_date, '%b %e, %Y') AS sell_date, \"\n . \"sales.tenant_amount, \"\n . \"sales.exhibitor_amount, \"\n . \"sales.total_amount, \"\n . \"IFNULL(invoices.billing_name, '') AS billing_name \"\n . \"FROM ciniki_ags_item_sales AS sales \"\n . \"INNER JOIN ciniki_ags_items AS items ON (\"\n . \"sales.item_id = items.id \"\n . (isset($args['exhibitor_id']) && $args['exhibitor_id'] > 0 ? \"AND items.exhibitor_id = '\" . ciniki_core_dbQuote($ciniki, $args['exhibitor_id']) . \"' \" : '')\n . \"AND items.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"INNER JOIN ciniki_ags_exhibitors AS exhibitors ON (\"\n . \"items.exhibitor_id = exhibitors.id \"\n . \"AND exhibitors.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"LEFT JOIN ciniki_sapos_invoices AS invoices ON (\"\n . \"sales.invoice_id = invoices.id \"\n . \"AND invoices.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \") \"\n . \"WHERE sales.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND (sales.flags&0x02) = 0 \";\n if( isset($args['exhibit_id']) && $args['exhibit_id'] > 0 ) {\n $strsql .= \"AND sales.exhibit_id = '\" . ciniki_core_dbQuote($ciniki, $args['exhibit_id']) . \"' \";\n }\n if( isset($args['start_date']) && $args['start_date'] != '' ) {\n $strsql .= \"AND sales.sell_date >= '\" . ciniki_core_dbQuote($ciniki, $args['start_date']) . \"' \";\n }\n if( isset($args['end_date']) && $args['end_date'] != '' ) {\n $strsql .= \"AND sales.sell_date <= '\" . ciniki_core_dbQuote($ciniki, $args['end_date']) . \"' \";\n }\n $strsql .= \"ORDER by exhibitors.display_name, items.code, items.name \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.ags', array(\n array('container'=>'exhibitors', 'fname'=>'exhibitor_id', \n 'fields'=>array('display_name')),\n array('container'=>'items', 'fname'=>'sales_id', \n 'fields'=>array('code', 'exhibitor_code', 'name', 'quantity', 'sell_date', 'tenant_amount', 'exhibitor_amount', 'total_amount', 'billing_name')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.ags.141', 'msg'=>'Unable to load exhibitors', 'err'=>$rc['err']));\n }\n if( isset($rc['exhibitors']) ) {\n $exhibitors = $rc['exhibitors'];\n } else {\n $exhibitors = array();\n }\n \n $today = new DateTime('now', new DateTimezone($intl_timezone));\n\n if( isset($settings['sales-pdf-customer-name']) && $settings['sales-pdf-customer-name'] == 'yes' ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'ags', 'templates', 'salesReportWithCustomer');\n $rc = ciniki_ags_templates_salesReportWithCustomer($ciniki, $args['tnid'], array(\n 'title'=>$report_title,\n 'author'=>$tenant_details['name'],\n 'footer'=>$today->format('M d, Y'),\n 'exhibitors'=>$exhibitors,\n ));\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n $pdf = $rc['pdf'];\n } else {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'ags', 'templates', 'salesReport');\n $rc = ciniki_ags_templates_salesReport($ciniki, $args['tnid'], array(\n 'title'=>$report_title,\n 'author'=>$tenant_details['name'],\n 'footer'=>$today->format('M d, Y'),\n 'exhibitors'=>$exhibitors,\n ));\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n }\n $pdf = $rc['pdf'];\n }\n\n //\n // Output the pdf\n //\n $filename = $report_title . ' - ' . $today->format('M d, Y');\n $filename = preg_replace('/[^A-Za-z0-9\\-]/', '', $filename) . '.pdf';\n $pdf->Output($filename, 'D');\n\n return array('stat'=>'exit');\n}", "abstract public function buildReport();", "public function payments_received_reports_pdf() {\n ini_set('memory_limit', '256M');\n $tenant_id = $this->tenant_id;\n $company = $this->classTraineeModel->get_company_for_paidinvoice($tenant_id);\n $companies = array();\n foreach ($company as $row) {\n $companies[$row->company_id] = $row->company_name;\n }\n $company = $this->input->get('company');\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'ei.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_payment_recd($records_per_page, NULL, NULL, $order_by, $company, $invoice_id, $start_date, $end_date);\n $tabledata_count = count($tabledata);\n $pids = array();\n for ($i = 0; $i < $tabledata_count; $i++) {\n $pids[] = $tabledata[$i]->pymnt_due_id;\n }\n $tb_extra = $this->reportsModel->get_payment_recd_trainee_company($pids);\n $tabledataextra = array();\n for ($i = 0; $i < count($tb_extra); $i++) {\n $tabledataextra[$tb_extra[$i]->pymnt_due_id] = $tb_extra[$i];\n }\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $this->load->helper('pdf_reports_helper');\n return payments_recd_report_pdf($tabledataextra, $tabledata, $tenant_details, $companies);\n }", "function head() {\n global $_lib;\n\n $query = \"select max(RemittanceDaySequence) from invoicein where RemittanceSendtDateTime='\" . $_lib['sess']->get_session('Date') . \"' and Active=1\";\n #print \"Finn h¿yeste dag sekvens: $query\";\n $daysequence = $_lib['storage']->get_row(array('query' => $query));\n\n $query = \"select max(RemittanceSequence) from invoicein where Active=1\";\n #print \"Finn h¿yeste sekvens: $query\";\n $sequence = $_lib['storage']->get_row(array('query' => $query));\n \n #print \"<h2>Her kommer remitteringsfila p&aring; TelePay 2.0.1 formatet</h2>\";\n $transaction = new stdClass();\n $this->transaction->RemittanceSequence = $daysequence->RemittanceSequence + 1; #MŒ kalkuleres og settes\n $this->transaction->RemittanceDaySequence = $daysequence->RemittanceDaySequence; #MŒ kalkuleres og settes\n\n #$this->transaction->BatchID = 99; #MŒ kalkuleres og settes\n $this->transaction->Date = $_lib['sess']->get_session('Date');\n $this->transaction->Datetime = $_lib['sess']->get_session('Datetime');\n $this->transaction->VersionSoftware = '00001.00 LODO';\n \n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $this->transaction->CustomerOrgNumber = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber'))); \n $this->transaction->CustomerName = $_lib['sess']->get_companydef('CompanyName');\n $this->transaction->Database = $_SETUP['DB_NAME']['0'];\n \n $this->transaction->NumTransactions = 0;\n $this->transaction->TotalAmount = 0;\n $this->transaction->NumRecords = 0; \n\n if(!$InvoiceO->CustomerBankAccount) { #Sjekke lengde og modulus pŒ kontonummer ogsŒ\n $_lib['message']->Add(\"Betalerkonto mangler\");\n return;\n }\n if(!$this->transaction->CustomerOrgNumber) {\n $_lib['message']->Add(\"Orgnummer/personnummer mangler p&aring; betaler\");\n return;\n }\n }", "function generate_vendor_report_pdf($data = null){\n\t\tApp::import('Vendor','tcpdf/tcpdf');\n $tcpdf = new TCPDF();\n $textfont = 'helvetica';\n $tcpdf->SetAutoPageBreak(true);\n \n $tcpdf->setPrintHeader(false);\n $tcpdf->setPrintFooter(false);\n \n $tcpdf->SetTextColor(0, 0, 0);\n $tcpdf->SetFont($textfont,'',10);\n \n $tcpdf->AddPage();\n \n // session details\n $htmlcontent=\"<html><body>\";\n $htmlcontent.=\"<strong><h2>Vendor Report</h2></strong>\";\n \n $htmlcontent.=\"<br/>\";\n // table start\n $htmlcontent.=\"<table border=\\\".5\\\" >\n <tr>\n <td align='left' valign='top'><strong>Vendor Name</strong></td>\n <td align='left' valign='top'><strong>Status</strong></td>\n\t\t\t<td align='left' valign='top'><strong>Total Sale(DKK)</strong></td>\n <td align='left' valign='top'><strong>Modified</strong></td>\n \n </tr>\";\n $charges=\"No\";\n if(count($data)>0){ \n $status = array('Deactive','Active');\n \n foreach($data as $result){\n $total_sale = $result[0]['total_price'];\n $htmlcontent.=\"<tr><td align='left' valign='top'>\";\n $htmlcontent.= ucfirst($result['Vendor']['name']); \n $htmlcontent.=\"</td><td align='left' valign='top'>\";\n $htmlcontent.=$status[$result['Vendor']['is_active']];\n $htmlcontent.=\"</td><td align='right' valign='top'>\";\n $htmlcontent.=sprintf(\"%0.2f\",$total_sale);\n $htmlcontent.=\"</td><td align='left' valign='top'>\";\n $htmlcontent.=$result['Vendor']['modified'];\n $htmlcontent.=\"</td></tr>\";\n }\n }\n else {\n $htmlcontent.=\"<tr><td colspan='4' style='border-bottom:0px' class='tc'>No records found</td></tr>\";\n }\n \n \n $htmlcontent.=\"</table></body></html>\";\t \n \n // output the HTML content\t \n $tcpdf->writeHTML($htmlcontent, true, 0, true, 0);\n \n $tcpdf->Output('vendor_report.pdf', 'D');\n exit();\n\t}", "public function test()\r\n {\r\n $formData = $this->extractFormDataFromPdf('LP3');\r\n \r\n $autoIncrementNo = 0;\r\n $notifiedPersonId = 0;\r\n $prefix = \"\";\r\n foreach($this->lpa->document->peopleToNotify as $notifiedPerson) {\r\n \r\n ################### page 1 #############\r\n if($notifiedPersonId > 0) {\r\n $autoIncrementNo++;\r\n $prefix = $autoIncrementNo.'.';\r\n }\r\n \r\n // test footer\r\n $this->assertEquals(Config::getInstance()['footer']['lp3'], $formData[$prefix.'footer-right-page-one']);\r\n \r\n $this->assertEquals($notifiedPerson->name->first, $formData[$prefix.'lpa-document-peopleToNotify-name-first']);\r\n $this->assertEquals($notifiedPerson->name->last, $formData[$prefix.'lpa-document-peopleToNotify-name-last']);\r\n $this->assertEquals($notifiedPerson->name->title, $formData[$prefix.'lpa-document-peopleToNotify-name-title']);\r\n \r\n $this->assertEquals($notifiedPerson->address->address1, $formData[$prefix.'lpa-document-peopleToNotify-address-address1']);\r\n $this->assertEquals($notifiedPerson->address->address2, $formData[$prefix.'lpa-document-peopleToNotify-address-address2']);\r\n $this->assertEquals($notifiedPerson->address->address3, $formData[$prefix.'lpa-document-peopleToNotify-address-address3']);\r\n $this->assertEquals($notifiedPerson->address->postcode, $formData[$prefix.'lpa-document-peopleToNotify-address-postcode']);\r\n \r\n \r\n ################### page 2 ##############\r\n \r\n if($notifiedPersonId > 0) {\r\n $autoIncrementNo++;\r\n $prefix = $autoIncrementNo.'.';\r\n }\r\n \r\n $this->assertEquals(Config::getInstance()['footer']['lp3'], $formData[$prefix.'footer-right-page-two']);\r\n \r\n $this->assertEquals($this->lpa->document->donor->name->first, $formData[$prefix.'lpa-document-donor-name-first']);\r\n $this->assertEquals($this->lpa->document->donor->name->last, $formData[$prefix.'lpa-document-donor-name-last']);\r\n $this->assertEquals($this->lpa->document->donor->name->title, $formData[$prefix.'lpa-document-donor-name-title']);\r\n $this->assertEquals($this->lpa->document->donor->address->address1, $formData[$prefix.'lpa-document-donor-address-address1']);\r\n $this->assertEquals($this->lpa->document->donor->address->address2, $formData[$prefix.'lpa-document-donor-address-address2']);\r\n $this->assertEquals($this->lpa->document->donor->address->address3, $formData[$prefix.'lpa-document-donor-address-address3']);\r\n $this->assertEquals($this->lpa->document->donor->address->postcode, $formData[$prefix.'lpa-document-donor-address-postcode']);\r\n \r\n if($this->lpa->document->whoIsRegistering == 'donor') {\r\n $this->assertEquals('donor', $formData[$prefix.'who-is-applicant']);\r\n }\r\n else {\r\n $this->assertEquals('attorney', $formData[$prefix.'who-is-applicant']);\r\n }\r\n \r\n if($this->lpa->document->type == Document::LPA_TYPE_PF) {\r\n $this->assertEquals('property-and-financial-affairs', $formData['lpa-type']);\r\n }\r\n elseif($this->lpa->document->type == Document::LPA_TYPE_HW) {\r\n $this->assertEquals('health-and-welfare', $formData['lpa-type']);\r\n }\r\n \r\n ################### page 3 #############\r\n \r\n if($notifiedPersonId > 0) {\r\n $autoIncrementNo++;\r\n $prefix = $autoIncrementNo.'.';\r\n }\r\n \r\n $this->assertEquals(Config::getInstance()['footer']['lp3'], $formData[$prefix.'footer-right-page-three']);\r\n \r\n if(count($this->lpa->document->primaryAttorneys) == 1) {\r\n $this->assertEquals('only-one-attorney-appointed', $formData[$prefix.'how-attorneys-act']);\r\n }\r\n else {\r\n $this->assertEquals($this->lpa->document->primaryAttorneyDecisions->how, $formData[$prefix.'how-attorneys-act']);\r\n }\r\n \r\n $personNumber=0;\r\n foreach($this->lpa->document->primaryAttorneys as $attorney) {\r\n \r\n $personIdx = ($personNumber % Lp3::MAX_ATTORNEYS_ON_STANDARD_FORM);\r\n \r\n if(($personNumber>0) && (($personNumber % Lp3::MAX_ATTORNEYS_ON_STANDARD_FORM) == 0)) {\r\n $autoIncrementNo++;\r\n $prefix = $autoIncrementNo.'.';\r\n $this->assertEquals(Config::getInstance()['footer']['lp3'], $formData[$prefix.'footer-right-page-three']);\r\n }\r\n \r\n if($attorney instanceof Human) {\r\n $this->assertEquals($attorney->name->first, $formData[$prefix.'lpa-document-primaryAttorneys-'.$personIdx.'-name-first']);\r\n $this->assertEquals($attorney->name->last, $formData[$prefix.'lpa-document-primaryAttorneys-'.$personIdx.'-name-last']);\r\n $this->assertEquals($attorney->name->title, $formData[$prefix.'lpa-document-primaryAttorneys-'.$personIdx.'-name-title']);\r\n $this->assertEquals($attorney->address->address1, $formData[$prefix.'lpa-document-primaryAttorneys-'.$personIdx.'-address-address1']);\r\n $this->assertEquals($attorney->address->address2, $formData[$prefix.'lpa-document-primaryAttorneys-'.$personIdx.'-address-address2']);\r\n $this->assertEquals($attorney->address->address3, $formData[$prefix.'lpa-document-primaryAttorneys-'.$personIdx.'-address-address3']);\r\n $this->assertEquals($attorney->address->postcode, $formData[$prefix.'lpa-document-primaryAttorneys-'.$personIdx.'-address-postcode']);\r\n }\r\n else {\r\n $this->assertEquals($attorney->name, $formData[$prefix.'lpa-document-primaryAttorneys-'.$personIdx.'-name-last']);\r\n }\r\n \r\n $personNumber++;\r\n }\r\n \r\n ################### page 4 #############\r\n \r\n if($notifiedPersonId > 0) {\r\n $autoIncrementNo++;\r\n $prefix = $autoIncrementNo.'.';\r\n }\r\n else {\r\n $prefix = '';\r\n }\r\n \r\n $this->assertEquals(Config::getInstance()['footer']['lp3'], $formData[$prefix.'footer-right-page-four']);\r\n \r\n $notifiedPersonId++;\r\n }\r\n }", "function vistaportal_malpractice_insurance_form($form, &$form_state){\n\t$form = array();\n\t//liability carrier history\n\t$form['liability']['desc_1'] = '<p>Application for Malpractice Insurance Coverage\n\t\tPart I<br />Professional Liability Carrier History<br />\n\t\tHCP MUST CONDUCT CLAIMS-HISTORY VERIFICATIONS FROM ALL PROFESSIONAL LIABILITY CARRIERS<br />\n\t\tList ALL carriers for the last five (5) years if you are seeking locum tenens opportunities \n\t\tin commercial facilities<br />If you are seeking locum tenens work in government facilities, \n\t\tcarrier history covering ten (10) years is to be added on the “Application Addendum”<br />\n\t\t(You may submit copies of policy declaration pages for each carrier covering all periods \n\t\tof time)<br /></p>';\n\t$ins_fields['company_name'] = textfield('Company Name');\n\t$ins_fields['policy_num'] = textfield('Policy Number');\n\t$ins_fields['limits'] = textfield('Limits of Liability');\t\n\t$ins_fields['covered_from'] = date_popup('Covered From');\n\t$ins_fields['covered_to'] = date_popup('Covered To');\n\t$ins_fields['claims'] = textfield('Claims-Made Policy?');\n\t$ins_fields['retro'] = date_popup('Retro Exclusion Date for Prior Acts');\n\t$form['liability']['carrier'] = '<p>IF YOUR COVERAGE WAS/IS THROUGH AN EMPLOYER’S OR LOCUM \n\t\tTENENS ORGANIZATION’S CARRIER, BUT YOU DO NOT KNOW THE CARRIER INFORMATION, LIST EMPLOYER \n\t\tOR LOCUM TENENS COMPANY NAME AND THE PERIODS YOU WERE/ARE COVERED.</p>';\n\t$coverage_fields['name'] = textfield('Employer or Company Name');\n\t$coverage_fields['date'] = date_popup('Dates you were covered');\t\n\t$form['liability'][0]['ins_counter']['#type'] = \"hidden\";\n\t$form['liability'][0]['ins_counter']['#default_value'] = -1;\n\t$form['liability'][0]['add_ins'] = vistaportal_set($ins_fields, \n\t\t'Add another carrier', 'Remove another carrier', 3);\n\t$form['liability'][0]['coverage_counter']['#type'] = \"hidden\";\n\t$form['liability'][0]['coverage_counter']['#default_value'] = -1;\n\t$form['liability'][0]['add_cov'] = vistaportal_set($coverage_fields, \n\t\t'Add another employer', 'Remove another employer', 3);\n\t$form['liability'][0]['history'] = radios_yesno('Have there ever been, or are there currently pending\n\t\tany malpractice claims, suits, settlements or arbitration proceedings involving your \n\t\tprofessional practice? If “yes”, complete a Supplemental Claim History for each claim or suit.\n\t\t(If you have history of more than three claims or suits you may print additional Supplemental \n\t\tClaim History forms to complete.)');\n\t$form['liability'][0]['suit'] = radios_yesno('Are you aware of any acts, errors, omissions or \n\tcircumstances which may result in a malpractice claim or suit being made or brought against you?\n\tIf “yes”, complete a Supplemental Claim History sheet for each occurrence.');\t\n\t\n\t$form['liability'][0]['application_terms'] = terms_1($terms_desc); //@TODO\n\t$form['liability'][0]['application_terms']['#attributes']['class'] .= \n\t\t'edit-liability-application-terms required';\n\t$form['liability'][0]['application_terms']['#title'] = 'I Accept Terms';\n\t$form['liability'][0]['application_terms']['#rules'] = array( \n\t\tarray('rule' => 'chars[1]', 'error' => 'You must accept the Terms to continue.'));\n\t\n\t$form['liability']['desc_2'] = '<p>Application for Malpractice Insurance Coverage\n\t\tPart II<br />Supplemental Claims History<br />Please provide the following regarding \n\t\tany incident, claim, or suit or incident which may give rise to a claim whether dismissed,\n\t\tsettled out of court, judgment or pending. Answer all questions completely.This form should \n\t\tbe photocopied for use with each claim. Please type or print clearly.<br /></p>';\n\t\t\n\t$form['liability'][1]['defendant'] = textfield(\"Defendant's Name\");\n\t$form['liability'][1]['plaintiff'] = textfield(\"Claimant (Plaintiff’s) ID:\");\n\t$form['liability'][1]['location'] = textfield(\"Where did incident/alleged error occur?\");\n\t$form['liability'][1]['filed'] = checkbox('Claim Filed');\n\t$form['liability'][1]['reported'] = checkbox('Incident that has been reported to insurer');\n\t$form['liability'][1]['suit'] = textfield('If Suit Filed, County/State where case filed:');\n\t$form['liability'][1]['suit']['case_num'] = textfield('Case Number');\n\t$form['liability'][1]['attorney'] = textfield('Defendant Attorney Name/Address/Phone:');\t\n\t$form['liability'][1]['judgement'] = '<p>Please upload copies of final judgment, \n\t\tsettlement & release or other final disposition.<p>';\n\t$form['liability'][1]['status'] = fieldset('STATUS OF COMPLAINT');\n\t$form['liability'][1]['if_closed'] = checkboxes('If CLOSED:', array(\n\t\t'Court Judgement', 'Finding For You', 'Finding For Plaintiff', 'Determined By Judge',\n\t\t'Determined By Jury', 'Out OF Court Settlement', 'Case Dismissed', 'Against You',\n\t\t'Against All Defendants'));\n\t$form['liability'][1]['defendant_amount'] = textfield('Amount paid on your behalf:');\n\t$form['liability'][1]['total_amount'] = textfield('Total Settlement against all parties:');\n\t$form['liability'][1]['date_closed'] = date_popup('Date of closure, settlement, or dismissal');\n\t$form['liability'][1]['if_open'] = radios_yesno('Claim in suit');\n\t$form['liability'][1]['description'] = '<p><u>DESCRIPTION OF CLAIM</u> Provide enough information \n\t\tto allow evaluation:</p>';\n\t$form['liability'][1]['description']['error'] = textfield('Alleged act, error or omission \n\t\tupon which Claimant bases claim:');\n\t$form['liability'][1]['description']['extent'] = textfield('Description of type and \n\t\textent of injury or damage allegedly sustained:');\n\t$form['liability'][1]['description']['condition_start'] = textfield('Patient’s Condition \n\t\tat point of your involvement:');\n\t$form['liability'][1]['description']['condition_end'] = textfield('Patient’s Condition at \n\t\tend of your treatment?');\n\t$form['liability'][1]['description']['narration'] = textarea('Provide a narration of the case, \n\t\trelating events in chronological order emphasizing the dates of service and stating in \n\t\tdetail what was done each time the patient was seen professionally. You may use a separate \n\t\tsheet to complete, sign and date.');\n\t$form['liability'][1]['application_terms_supplemental'] = terms_1($terms_desc);//@TODO\n\t$form['liability'][1]['application_terms_supplemental']['#attributes']['class'] .= \n\t\t'edit-liability-application-terms_supplemental required';\n\t$form['liability'][1]['application_terms_supplemental']['#title'] = 'I Accept Terms';\n\t$form['liability'][1]['application_terms_supplemental']['#rules'] = array( \n\t\tarray('rule' => 'chars[1]', 'error' => 'You must accept the Terms to continue.'));\n\t\n\t$form['liability']['desc_3'] = '<p>Please provide the following regarding any incident, \n\t\tclaim, or suit or incident which may give rise to a claim whether dismissed, settled \n\t\tout of court, judgment or pending. Answer all questions completely. This form should \n\t\tbe photocopied for use with each claim. Please type or print clearly.</p>';\n\t$form['liability'][2]['defendant_name'] = textfield(\"Defendant's Name\");\n\t$form['liability'][2]['plaintiff_id'] = textfield('Claimant (Plaintiff’s) ID:');\n\t$form['liability'][2]['error_date'] = date_popup('Date of alleged error:');\n\t$form['liability'][2]['location'] = textfield('Where did incident/alleged error occur?');\n\t$form['liability'][2]['filed'] = checkbox('Claim Filed');\n\t$form['liability'][2]['reported'] = checkbox('Incident that has been reported to insurer');\n\t$form['liability'][2]['company_name'] = textfield('Name of Insurer');\n\t$form['liability'][2]['suit'] = textfield('If Suit Filed, County/State where case filed:');\n\t$form['liability'][2]['suit']['case_num'] = textfield('Case Number');\n\t$form['liability'][2]['attorney'] = textfield('Defendant Attorney Name/Address/Phone:');\n\t$form['liability'][2]['judgement'] = '<p>Please upload copies of final judgment, \n\t\tsettlement & release or other final disposition.<p>';\n\t$form['liability'][2]['status'] = fieldset('STATUS OF COMPLAINT');\t\n\t$form['liability'][2]['if_closed'] = checkboxes('If CLOSED:', array(\n\t\t'Court Judgement', 'Finding For You', 'Finding For Plaintiff', 'Determined By Judge',\n\t\t'Determined By Jury', 'Out OF Court Settlement', 'Case Dismissed', 'Against You',\n\t\t'Against All Defendants'));\n\t$form['liability'][2]['if_open'] = radios_yesno('Claim in suit');\n\t$form['liability'][2]['description'] = '<p><u>DESCRIPTION OF CLAIM</u> Provide enough information \n\t\tto allow evaluation:</p>';\n\t$form['liability'][2]['description']['error'] = textfield('Alleged act, error or omission \n\t\tupon which Claimant bases claim:');\n\t$form['liability'][2]['description']['extent'] = textfield('Description of type and \n\t\textent of injury or damage allegedly sustained:');\n\t$form['liability'][2]['description']['condition_start'] = textfield('Patient’s Condition \n\t\tat point of your involvement:');\n\t$form['liability'][2]['description']['condition_end'] = textfield('Patient’s Condition at \n\t\tend of your treatment?');\n\t$form['liability'][2]['description']['narration'] = textarea('Provide a narration of the case, \n\t\trelating events in chronological order emphasizing the dates of service and stating in \n\t\tdetail what was done each time the patient was seen professionally. You may use a separate \n\t\tsheet to complete, sign and date.');\n\t$form['liability'][2]['application_terms_supplemental'] = terms_1($terms_desc);//@TODO\n\t$form['liability'][2]['application_terms_supplemental']['#attributes']['class'] .= \n\t\t'edit-liability-application-terms_supplemental required';\n\t$form['liability'][2]['application_terms_supplemental']['#title'] = 'I Accept Terms';\n\t$form['liability'][2]['application_terms_supplemental']['#rules'] = array( \n\t\tarray('rule' => 'chars[1]', 'error' => 'You must accept the Terms to continue.'));\t\n\t\t\t\t\t\t\t\t\t\nreturn $form;\n\t\n}", "function quantizer_expenses_management_report($cost_center = null, $management = null, $start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerExpenses($cost_center, $management, $start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\t\t\t\r\n\t\t\t/*echo \"<pre>\";\r\n\t\t\tprint_r($resultado);\r\n\t\t\techo \"</pre>\";*/\r\n\t\t\t\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "function write_competence( $competence ) {\r\n global $CFG;\r\n // initial string;\r\n $expout = \"\";\r\n // add comment\r\n // $expout .= \"\\n\\n<!-- competence: $competence->id -->\\n\";\r\n\t\t//\r\n\t\tif ($competence){\r\n\t\t\t$id = $this->writeraw( $competence->id );\r\n $code = $this->writeraw( trim($competence->code_competence));\r\n $description_competence = $this->writetext(trim($competence->description_competence));\r\n $ref_domaine = $this->writeraw( $competence->ref_domaine);\r\n\t\t\t$num_competence = $this->writeraw( $competence->num_competence);\r\n\t\t\t$nb_item_competences = $this->writeraw( $competence->nb_item_competences);\r\n\r\n\t\t\t$type_competence = $this->writeraw( trim($competence->type_competence));\r\n\t\t\t$seuil_competence = $this->writeraw( trim($competence->seuil_competence));\r\n\r\n\t\t\t$minima_competence = $this->writeraw( trim($competence->minima_competence));\r\n\r\n $expout .= \" <competence>\\n\";\r\n\t\t\t// $expout .= \"<id>$id</id>\\n\";\r\n\t\t\t$expout .= \" <code_competence>$code</code_competence>\\n\";\r\n $expout .= \" <description_competence>\\n$description_competence</description_competence>\\n\";\r\n\r\n $expout .= \" <type_competence>$type_competence</type_competence>\\n\";\r\n $expout .= \" <seuil_competence>$seuil_competence</seuil_competence>\\n\";\r\n\r\n $expout .= \" <minima_competence>$minima_competence</minima_competence>\\n\";\r\n\r\n // $expout .= \" <ref_domaine>$ref_domaine</ref_domaine>\\n\";\r\n $expout .= \" <num_competence>$num_competence</num_competence>\\n\";\r\n $expout .= \" <nb_item_competences>$nb_item_competences</nb_item_competences>\\n\\n\";\r\n\r\n\t\t\t// ITEM\r\n\t\t\t$compteur_item=0;\r\n\t\t\t$records_items = referentiel_get_item_competences($competence->id);\r\n\r\n\t\t\tif ($records_items){\r\n\t\t\t\t// DEBUG\r\n\t\t\t\t// echo \"<br/>DEBUG :: ITEMS <br />\\n\";\r\n\t\t\t\t// print_r($records_items);\r\n\t\t\t\tforeach ($records_items as $record_i){\r\n\t\t\t\t\t// DEBUG\r\n\t\t\t\t\t// echo \"<br/>DEBUG :: ITEM <br />\\n\";\r\n\t\t\t\t\t// print_r($record_i);\r\n\t\t\t\t\t$expout .= $this->write_item( $record_i );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$expout .= \" </competence>\\n\\n\";\r\n }\r\n return $expout;\r\n }", "public function setWarranty($warranty): self\n {\n $this->warranty = $warranty;\n\n return $this;\n }", "function display_bank_header(&$order)\n{\n\tglobal $Ajax, $Refs;\n\t$payment = $order->trans_type == ST_BANKPAYMENT;\n\n\t$customer_error = false;\n\tdiv_start('pmt_header');\n\n\tstart_outer_table(TABLESTYLE2, \"width=90%\"); // outer table\n\n\ttable_section(1);\n\t\n date_row(_(\"Date:\"), 'date_', '', true, 0, 0, 0, null, true);\n\n\tref_row(_(\"Reference:\"), 'ref', '');\n\n\ttable_section(2, \"33%\");\n\n\tif (!isset($_POST['PayType']))\n\t{\n\t\tif (isset($_GET['PayType']))\n\t\t\t$_POST['PayType'] = $_GET['PayType'];\n\t\telse\n\t\t\t$_POST['PayType'] = \"\";\n\t}\n\tif (!isset($_POST['person_id']))\n\t{\n\t\tif (isset($_GET['PayPerson']))\n\t\t\t$_POST['person_id'] = $_GET['PayPerson'];\n\t\telse\n\t\t\t$_POST['person_id'] = \"\";\n\t}\n\tif (isset($_POST['_PayType_update'])) {\n\t\t$_POST['person_id'] = '';\n\t\t$Ajax->activate('pmt_header');\n\t\t$Ajax->activate('code_id');\n\t\t$Ajax->activate('pagehelp');\n\t\t$Ajax->activate('editors');\n\t\t$Ajax->activate('footer');\n\t}\n payment_person_types_list_row( $payment ? _(\"Pay To:\"):_(\"From:\"),\n\t\t 'PayType', $_POST['PayType'], true);\n switch ($_POST['PayType'])\n {\n\t\tcase PT_MISC :\n \t\ttext_row_ex($payment ?_(\"To the Order of:\"):_(\"Name:\"),\n\t\t\t\t 'person_id', 40, 50);\n \t\tbreak;\n\t\t//case PT_WORKORDER :\n \t//\tworkorders_list_row(_(\"Work Order:\"), 'person_id', null);\n \t//\tbreak;\n\t\tcase PT_SUPPLIER :\n \t\tsupplier_list_row(_(\"Supplier:\"), 'person_id', null, false, true, false, true);\n \t\tbreak;\n\t\tcase PT_CUSTOMER :\n \t\tcustomer_list_row(_(\"Customer:\"), 'person_id', null, false, true, false, true);\n\n \tif (db_customer_has_branches($_POST['person_id']))\n \t{\n \t\tcustomer_branches_list_row(_(\"Branch:\"), $_POST['person_id'], \n\t\t\t\t\t'PersonDetailID', null, false, true, true, true);\n \t}\n \telse\n \t{\n\t\t\t\t$_POST['PersonDetailID'] = ANY_NUMERIC;\n \t\thidden('PersonDetailID');\n \t}\n \t$trans = get_customer_habit($_POST['person_id']); // take care of customers on hold\n \tif ($trans['dissallow_invoices'] != 0)\n \t{\n \t\tif ($payment)\n \t\t{\n \t\t\t$customer_error = true;\n\t\t\t\t\tdisplay_error(_(\"This customer account is on hold.\"));\n \t\t}\n \t\telse\t\t\t\n\t\t\t\t\tdisplay_warning(_(\"This customer account is on hold.\"));\n \t}\t\t\n \t\tbreak;\n\n\t\tcase PT_QUICKENTRY :\n\t\t\tquick_entries_list_row(_(\"Type\").\":\", 'person_id', null, ($payment ? QE_PAYMENT : QE_DEPOSIT), true);\n\t\t\t$qid = get_quick_entry(get_post('person_id'));\n\t\t\tif (list_updated('person_id')) {\n\t\t\t\tunset($_POST['totamount']); // enable default\n\t\t\t\t$Ajax->activate('footer');\n\t\t\t\t$Ajax->activate('totamount');\n\t\t\t}\n\t\t\tamount_row($qid['base_desc'].\":\", 'totamount', price_format($qid['base_amount']),\n\t\t\t\t null, \"&nbsp;&nbsp;\".submit('go', _(\"Go\"), false, false, true));\n\t\t\tbreak;\t\n\t\t//case payment_person_types::Project() :\n \t//\tdimensions_list_row(_(\"Dimension:\"), 'person_id', $_POST['person_id'], false, null, true);\n \t//\tbreak;\n }\n\n\ttable_section(3, \"33%\");\n\n\tif (!$order->order_id && !get_post('bank_account'))\n\t{\n\t\tif ($_POST['PayType'] == PT_CUSTOMER)\n\t\t\t$_POST['bank_account'] = get_default_customer_bank_account($_POST['person_id']);\n\t\telseif ($_POST['PayType'] == PT_SUPPLIER)\t\n\t\t\t$_POST['bank_account'] = get_default_supplier_bank_account($_POST['person_id']);\n\t\telse\n\t\t\tunset($_POST['bank_account']);\n\t}\t\t\n \n bank_accounts_list_row( $payment ? _(\"From:\") : _(\"Into:\"), 'bank_account', null, true);\n if ($payment)\n\t\tbank_balance_row($_POST['bank_account']);\n\n\t$bank_currency = get_bank_account_currency($_POST['bank_account']);\n\n\texchange_rate_display(get_company_currency(), $bank_currency, $_POST['date_']);\n\n\tend_outer_table(1); // outer table\n\n\tdiv_end();\n\tif ($customer_error)\n\t{\n\t\tend_form();\n\t\tend_page();\n\t\texit;\n\t}\n}", "function generate_coupon_report_pdf($data = null,$b_data=array(),$p_data=array()){\n\t\tApp::import('Vendor','tcpdf/tcpdf');\n $tcpdf = new TCPDF();\n $textfont = 'helvetica';\n $tcpdf->SetAutoPageBreak(true);\n \n $tcpdf->setPrintHeader(false);\n $tcpdf->setPrintFooter(false);\n \n $tcpdf->SetTextColor(0, 0, 0);\n $tcpdf->SetFont($textfont,'',10);\n \n $tcpdf->AddPage();\n \n // session details\n $htmlcontent=\"<html><body>\";\n $htmlcontent.=\"<strong><h2>Coupon Report</h2></strong>\";\n \n $htmlcontent.=\"<br/>\";\n // table start\n $htmlcontent.=\"<table border=\\\".5\\\" >\n <tr>\n\t\t\t<td align='left' valign='top'><strong>Products</strong></td>\n <td align='left' valign='top'><strong>Product Code</strong></td>\n\t\t\t<td align='left' valign='top'><strong>Batch</strong></td>\n\t\t\t<td align='left' valign='top'><strong>Coupon Id</strong></td>\n\t\t\t<td align='left' valign='top'><strong>Sold</strong></td>\n\t\t\t<td align='left' valign='top'><strong>Sale Time</strong></td>\n </tr>\";\n $charges=\"No\";\n if(count($data)>0){ \n $status = array('Deactive','Active');\n $status_sold = array(1=>\"Yes\",0=>\"No\");\n\t\t\t\n\t\t\tforeach($data as $result){\n\t\t\t\t$sale_time = ($result['Coupon']['is_sold'] == \"1\")?$result['Coupon']['modified']:\"Not yet\";\n\t\t\t\t$htmlcontent.=\"<tr><td align='left' valign='top'>\";\n $htmlcontent.= preg_replace(\"/&#?[a-z0-9]+;/i\",\"\",$p_data[$result['Coupon']['product_code']]);\n $htmlcontent.=\"</td><td align='left' valign='top'>\";\n $htmlcontent.= $result['Coupon']['product_code'];\n\t\t\t\t$htmlcontent.=\"</td><td align='left' valign='top'>\";\n $htmlcontent.= $b_data[$result['Coupon']['batch_id']]; \n\t\t\t\t$htmlcontent.=\"</td><td align='left' valign='top'>\";\n $htmlcontent.= $result['Coupon']['coupon_id']; \n \n\t\t\t\t$htmlcontent.=\"</td><td align='left' valign='top'>\";\n $htmlcontent.=$status_sold[$result['Coupon']['is_sold']];\n \n $htmlcontent.=\"</td><td align='left' valign='top'>\";\n $htmlcontent.=$sale_time;\n $htmlcontent.=\"</td></tr>\";\n }\n }\n else {\n $htmlcontent.=\"<tr><td colspan='5' style='border-bottom:0px' class='tc'>No records found</td></tr>\";\n }\n \n \n $htmlcontent.=\"</table></body></html>\";\t \n \n // output the HTML content\t \n $tcpdf->writeHTML($htmlcontent, true, 0, true, 0);\n \n $tcpdf->Output('coupon_report.pdf', 'D');\n exit();\n\t}", "function IndusIndPL($strnet_salary, $company, $category, $DOB, $clubbed_emi, $city, $reqtenure, $reqloanamount) {\n $net_salary = $strnet_salary;\n\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n\n if ($category == \"A+\" || $category == \"CAT A\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = \"12.99\";\n $intr = $interestrate;\n $proc_fee = \"0.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"13.75\";\n $intr = $interestrate ;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"14.75\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"13.50\";\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.25\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } elseif ($term == 60) {\n $getterm = 5;\n } else {\n $getterm = 5;\n }\n } else if ($category == \"CAT B\" || $category == \"CAT G\" || $category == \"C1000\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 14.00;\n $intr = $interestrate;\n $proc_fee = \"1%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 15.00;\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 16.00;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"1.50%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"14.50\";\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"15.25\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else if ($category == \"CAT C\") {\n if ($city == \"Delhi\" || $city == \"Noida\" || $city == \"Faridabad\" || $city == \"Gurgaon\" || $city == \"Gaziabad\" || $city == \"Navi Mumbai\" || $city == \"Mumbai\" || $city == \"Thane\" || $city == \"Bangalore\" || $city == \"Chennai\") {\n if ($net_salary > 100000) {\n $interestrate = 17.50;\n $intr = $interestrate;\n $proc_fee = \"1.25%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = 18;\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = 19;\n $intr = $interestrate;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n } else {\n if ($net_salary > 100000) {\n $interestrate = \"18.50\";\n $intr = $interestrate;\n $proc_fee = \"1.75%\";\n } else if ($net_salary > 50000 && $net_salary <= 100000) {\n $interestrate = \"19\";\n $intr = $interestrate;\n $proc_fee = \"2.25%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"20\";\n $intr = $interestrate;\n $proc_fee = \"2.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }\n } else {\n /* if ($net_salary >= 100000) {\n $interestrate = \"17\";\n $intr = 17;\n $proc_fee = \"1.25%\";\n } else if ($net_salary >= 50000 && $net_salary < 100000) {\n $interestrate = \"17.5\";\n $intr = 17.5;\n $proc_fee = \"1.75%\";\n } else if ($net_salary >= 25000 && $net_salary <= 50000) {\n $interestrate = \"18\";\n $intr = 18;\n $proc_fee = \"2%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n $proc_fee = 0;\n }\n if ($term == 12) {\n $getterm = 1;\n } elseif ($term == 24) {\n $getterm = 2;\n } elseif ($term == 36) {\n $getterm = 3;\n } elseif ($term == 48) {\n $getterm = 4;\n } else {\n $getterm = 4;\n }*/\n }\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $princ = 100000;\n if ($intr > 0) {\n $perlacemi = round($princ * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($princ, $intr, $term);\n //Calculate Loan Amount\n if ($net_salary >= 50000) {\n $firstnet_salary = ($net_salary * (70 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else if ($net_salary >= 25000 && $net_salary < 50000) {\n $firstnet_salary = ($net_salary * (50 / 100));\n $newnet_salary = $firstnet_salary - $clubbed_emi;\n $finalloanamount_dbr = ($perlacemi > 0) ? ($newnet_salary / $perlacemi * 100000) : 0;\n } else {\n $finalloanamount_dbr = 0;\n }\n } else {\n $finalloanamount_dbr = 0;\n }\n //other eiligibility\n if ($net_salary >= 50000) {\n $finalloanamount_other = $net_salary * 18;\n } else {\n $finalloanamount_other = $net_salary * 18;\n }\n $finalloanamount = 0;\n if ($finalloanamount_other < $finalloanamount_dbr) {\n $finalloanamount = $finalloanamount_other;\n } else {\n $finalloanamount = $finalloanamount_dbr;\n }\n if ($finalloanamount > 2500000) {\n if (strlen($category) > 1) {\n $getloanamout = 2500000;\n } else {\n $getloanamout = 700000;\n }\n } else {\n if (strlen($category) > 1) {\n $getloanamout = $finalloanamount;\n } else {\n if ($finalloanamount > 700000) {\n $getloanamout = 700000;\n } else {\n $getloanamout = $finalloanamount;\n }\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n if ($intr > 0) {\n if (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 700000 && $getloanamout < 1500000 && $net_salary >= 75000) {\n $interestrate = \"13.49\";\n $intr = 13.49;\n $proc_fee = \"0.49%\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif (($category == \"A+\" || $category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT G\") && $getloanamout >= 1500000 && $net_salary >= 100000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_fee = \"Rs. 4999\";\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n }\n } else {\n $getemicalc = 0;\n }\n\t\t\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $term))));\n $details['bank_code'] = \"Indus Ind Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $proc_fee;\n $details['category'] = $category;\n return($details);\n }", "function documentdetails($data,$type,$client_brand){ \n\t\ttry{\n\t\t\tif($type == 'email'){\n\t\t\t\t$uri = \"https://rightsignature.com/api/documents.json?recipient_email=\".$data;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$uri = \"https://rightsignature.com/api/documents/\".$data.\".json\";\n\t\t\t}\n\t\t\t\n\t\t\t// get the secure token from db\n\t\t\t$secure_token = TblAcaBrands::find()->where(['brand_id'=>$client_brand])->One();\n\t\t/*\tif(!empty($secure_token->secure_token)){\n\t\t\t\t$token = $secure_token->secure_token;\n\t\t\t\t\n\t\t\t}\n\t\t\telse{*/\n\t\t\t\t\n\t\t\t\t$token='nNVOqQXgEziK6AhOJ1QmV3CNvBDDs5IC2V133rQM';\n\t\t\t/*}*/\n\t\t\t\n\t\t\t//$headers = array(\"Content-type: application/json\", \"api-token: tPHIJhDqqcXz8yRhcYvFmclj11DyJta4RmIbXYD5\");\n\t\t\t$headers = array(\"Content-type: application/json\", \"api-token: \".$token);\n\t\t\t\t\t \n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 300);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t\t\t \n\t\t\t$curl_response = curl_exec ($ch);\n\t\t\t\n\t\t\treturn json_decode($curl_response);\n\t\t\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn '';\n\t\t}\n\t}", "function demo_report_doc($NPI) {\n\n $conn = sql_connect();\n\n $sql_pid = mysqli_query($conn, \"SELECT * FROM Doctor_patient WHERE NPI=\".$NPI.\";\") or die(mysqli_error($conn));\n\n $sql_doc = mysqli_query($conn, \"SELECT * FROM Doctors WHERE NPI=\".$NPI.\";\") or die(mysqli_error($conn));\n $doc = mysqli_fetch_assoc($sql_doc);\n\n $insurance_Y = 0;\n $insurance_N = 0;\n $age = 0;\n $sex_M = 0;\n $sex_F = 0;\n $sex_Other = 0;\n\n $ethn_api = 0;\n $ethn_afam = 0;\n $ethn_natam = 0;\n $ethn_white = 0;\n $ethn_hisp = 0;\n $ethn_other = 0;\n\n $marital_sing = 0;\n $marital_marr = 0;\n $marital_widow = 0;\n $marital_divor = 0;\n $marital_separ = 0;\n\n $total = 0;\n\n if($sql_pid) {\n\n while($pid = mysqli_fetch_assoc($sql_pid)) {\n\n $total++;\n\n $sql_patient = mysqli_query($conn, \"SELECT * FROM Patients WHERE PID=\".$pid['PID'].\";\") or die(mysqli_error($conn));\n $patient = mysqli_fetch_assoc($sql_patient);\n\n $sql_demo = mysqli_query($conn, \"SELECT * FROM Demographics WHERE Demo_ID=\".$patient['Demographics_ID'].\";\") or die(mysqli_error($conn));\n $demo = mysqli_fetch_assoc($sql_demo);\n\n if(strcmp($demo['Has_insurance'],'Yes') == 0) {\n $insurance_Y++;\n } else {\n $insurance_N++;\n }\n\n $age += $demo['Age'];\n\n if(strcmp($demo['Sex'],'M') == 0) {\n $sex_M++;\n } elseif (strcmp($demo['Sex'],'F') == 0) {\n $sex_F++;\n } else {\n $sex_Other++;\n }\n\n if (strcmp($demo['Ethnicity'], 'Asian/Pacific Islander') == 0) {\n $ethn_api++;\n } elseif (strcmp($demo['Ethnicity'], 'African-American') == 0) {\n $ethn_afam++;\n } elseif (strcmp($demo['Ethnicity'], 'Native American') == 0) {\n $ethn_natam++;\n } elseif (strcmp($demo['Ethnicity'], 'White') == 0) {\n $ethn_white++;\n } elseif (strcmp($demo['Ethnicity'], 'Hispanic') == 0) {\n $ethn_hisp++;\n } else {\n $ethn_other++;\n }\n\n if(strcmp($demo['Marital_status'], 'Single') == 0) {\n $marital_sing++;\n } elseif (strcmp($demo['Marital_status'], 'Married') == 0) {\n $marital_marr++;\n } elseif (strcmp($demo['Marital_status'], 'Widowed') == 0) {\n $marital_widow++;\n } elseif (strcmp($demo['Marital_status'], 'Divorced') == 0) {\n $marital_divor++;\n } else {\n $marital_separ++;\n }\n\n }\n\n if($total > 0) {\n $insurance_Y = number_format($insurance_Y/(float)$total, 3);\n $insurance_N = number_format($insurance_N/(float)$total, 3);\n $sex_M = number_format($sex_M/(float)$total, 3);\n $sex_F = number_format($sex_F/(float)$total, 3);\n $sex_Other = number_format($sex_Other/(float)$total, 3);\n $age = number_format($age/(float)$total, 1);\n $marital_sing = number_format($marital_sing/(float)$total, 3);\n $marital_marr = number_format($marital_marr/(float)$total, 3);\n $marital_widow = number_format($marital_widow/(float)$total, 3);\n $marital_divor = number_format($marital_divor/(float)$total, 3);\n $marital_separ = number_format($marital_separ, 3);\n $ethn_api = number_format($ethn_api/(float)$total, 3);\n $ethn_afam = number_format($ethn_afam/(float)$total, 3);\n $ethn_natam = number_format($ethn_natam/(float)$total, 3);\n $ethn_white = number_format($ethn_white/(float)$total, 3);\n $ethn_hisp = number_format($ethn_hisp/(float)$total, 3);\n $ethn_other = number_format($ethn_other/(float)$total, 3);\n\n echo \"<h3> Patient Demographics for \".$doc['Name'].\"</h3><br>\";\n echo \"<table><tr><th>[Has Insurance]</th><th></th><th>[Gender]</th><th></th><th></th></tr>\";\n echo \"<tr><th>Yes</th><th>No</th><th>Male</th><th>Female</th><th>Other</th></tr>\";\n echo \"<tr><td><center>\".($insurance_Y*100).\"%</center></td><td><center>\".($insurance_N*100).\"%</center></td><td><center>\".($sex_M*100).\"%</center></td><td><center>\".($sex_F*100).\"%</center></td><td><center>\".($sex_Other*100).\"%</center></td></tr>\";\n echo \"<tr><th>[Average Age]</th><th></th><th></th><th>[Marital Status]</th><th></th><th></th><th></th></tr>\";\n echo \"<tr><th></th><th>Single</th><th>Married</th><th>Widowed</th><th>Divorced</th><th>Separated</th></tr>\";\n echo \"<tr><td><center>\".$age.\"</center></td><td><center>\".($marital_sing*100).\"%</center></td><td><center>\".($marital_marr*100).\"%</center></td><td><center>\".($marital_widow*100).\"%</center></td><td><center>\".($marital_divor*100).\"%</center></td><td><center>\".($marital_separ*100).\"%</center></td></tr>\";\n echo \"<tr><th></th><th></th><th>[Ethnicity]</th><th></th><th></th><th></th></tr>\";\n echo \"<tr><th>Asian/Pacific Islander</th><th>Africa-American</th><th>Native American</th><th>White</th><th>Hispanic</th><th>Other</th></tr>\";\n echo \"<tr><td><center>\".($ethn_api*100).\"%</center></td><td><center>\".($ethn_afam*100).\"%</center></td><td><center>\".($ethn_natam*100).\"%</center></td><td><center>\".($ethn_white*100).\"%</center></td><td><center>\".($ethn_hisp*100).\"%</center></td><td><center>\".($ethn_other*100).\"%</center></td></tr></table>\";\n\n } else {\n\n echo \"<h3> Patient Demographics for \".$doc['Name'].\"</h3><br>\";\n echo \"No patients found for this doctor\";\n\n }\n \n\n } else {\n\n echo \"No patients found\";\n\n }\n\n }", "function healthCareWorksheetForm(){\nglobal $base_url;\n\t//Have to use the heredoc style\npdf_generator();\n\n\t$chronic_conditions=array('high blood pressure','high cholestrol','obesity','diabetes (type1 or 2)','health condition or previous heart attack','asthma','COPD','HIV/AIDS','cancer','Kidney disease','liver disease','peptic ulcer disease','irritable bowel disease (IBD)','multiple sclerosis','epilepsy','Parkinson\\'s disease','rheumatoid arthritis','glaucoma','alcoholism','tabacco use(any form)','other drug use','schizophrenia','bipolar mood disorder');\n\n\t$checkboxes=\"\";\n\tforeach($chronic_conditions as $value):\n\t\t$checkboxes.=\"<input type='checkbox' value='$value' name='chronic_conditions[]'> \".ucwords($value).\"<br>\";\n endforeach;\n\n\t$form_html=<<<xyz\n\t<div style='color:black;width:740px;margin:auto'>\n\t<form method='post' action='' id='health_care_worksheet_form'>\n\t<h1 style='color:#FF9200'>WHO'S ON YOUR PLAN</h1>\n\t<p>How many people will be covered by your plan? Count yourseld, along with any of your family members (including children) who will be on your insurance plan.</p>\n\t<div class='whos_on_your_plan' id='whos_on_your_plan' style='margin-left:10px;width:82%;display:inline-block'></div><input type='text' value='1' name='whos_on_your_plan' class='value_box'><br>\n\t<div class='show_people_pics'><img src='$base_url/sites/all/modules/healthcareworksheet/images/greenman.png' class='green_man'></div>\n\t<h1 style='color:#FF9200'>My Health Care Needs</h1>\n\t<p># of regular doctor's office visits in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='regular_office_visits' id='regular_office_visits' style='width:68%;display:inline-block'>\n\t</div><input type='text' value='1' name='regular_office_visits' class='value_box'><br>\n\n\t<p># of specialist office visits in the next year? <br> EXAMPLES : Cardiologists, Endocrinologist</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='specialist_office_visits' id='specialist_office_visits' style='width:68%;display:inline-block'></div><input type='text' value='1' name='specialist_office_visits' class='value_box'><br>\n\n\t<p># of lab visits Blood /Draws.</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='lab_visits' id='lab_visits' style='width:68%;display:inline-block'></div><input type='text' value='1' name='lab_visits' class='value_box'><br>\n\n <p># of overnight hospitalizations with surgery.</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='overnight_hospitalization_with_surgery_visits' id='overnight_hospitalization_with_surgery_visits' style='width:68%;display:inline-block'></div><input type='text' value='1' name='overnight_hospitalization_with_surgery_visits' class='value_box'><br>\n\n\t<p># of overnight hospitalizations without surgery.</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='overnight_hospitalization_without_surgery_visits' id='overnight_hospitalization_without_surgery_visits' style='width:68%;display:inline-block'></div><input type='text' value='1' name='overnight_hospitalization_without_surgery_visits' class='value_box'><br>\n\n\t<p># of out patient procedures /Draws.</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='patient_procedures' id='patient_procedures' style='width:68%;display:inline-block'></div><input type='text' value='1' name='patient_procedures' class='value_box'><br>\n\n <p># of emergency room visits.</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='emergency_visits' id='emergency_visits' style='width:68%;display:inline-block'></div><input type='text' value='1' name='emergency_visits' class='value_box'><br>\n\n\t<p># of pregnancies in the next year.</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='pregnencies' id='pregnencies' style='width:68%;display:inline-block'></div><input type='text' value='1' name='pregnencies' class='value_box'><br>\n <p>List of any other medical expenses in the next year? <br>\n EXAMPLES : insulin pump, physical rehab, cancer treatment.\n </p>\n <textarea class='textarea' name='notes_whos_on_your_plan'></textarea>\n\n\t<h1 style='color:#FF9200'>MENTAL HEALTH CARE</h1>\n\t<p># of mental health care or counselling visits in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='conselling_visits' id='conselling_visits' style='width:68%;display:inline-block'></div><input type='text' value='1' name='conselling_visits' class='value_box'><br>\n\n\t<p># of alcohol or drug rehab in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='drug_rehab' id='drug_rehab' style='width:68%;display:inline-block'></div><input type='text' value='1' name='drug_rehab' class='value_box'><br>\n\n\t<p># of overnight psychiatric hospitalizations</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='overnight_psychiatric_hospitalizations' id='overnight_psychiatric_hospitalizations' style='width:68%;display:inline-block'></div><input type='text' value='1' name='overnight_psychiatric_hospitalizations' class='value_box'><br>\n\n\t<p>List of any other medical expenses in the next year?</p>\n <textarea class='textarea' name='notes_mental_health_care'></textarea>\n\n\n <h1 style='color:#FF9200'>MEDICATION AND SUPPLIES</h1>\n\t<p># of generic prescription medications filled every month?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='generic_prescription_medications' id='generic_prescription_medications' style='width:68%;display:inline-block'></div><input type='text' value='1' name='generic_prescription_medications' class='value_box'><br>\n\n\t<p># of brand-name prescription medications filled every month?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='brand_name_prescription_medications' id='brand_name_prescription_medications' style='width:68%;display:inline-block'></div><input type='text' value='1' name='brand_name_prescription_medications' class='value_box'><br>\n\n\t<p># of medical supplies purchased every month? EXAMPLES :syringes, diabetic test strips</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='medical_supplies_purchased' id='medical_supplies_purchased' style='width:68%;display:inline-block'></div><input type='text' value='1' name='medical_supplies_purchased' class='value_box'><br>\n\n\t<p>List of any other medical expenses in the next year?<br>EXAMPLES : oxygen, oxygen equipment.</p>\n <textarea class='textarea' name='notes_medication_and_supplies'></textarea>\n\n <h1 style='color:#FF9200'>VISION & HEARING CARE</h1>\n\t<p># of eye exams in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='eye_exams' id='eye_exams' style='width:68%;display:inline-block'></div><input type='text' value='1' name='eye_exams' class='value_box'><br>\n\n\t<p># of eye glasses purchased in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='eye_glasses' id='eye_glasses' style='width:68%;display:inline-block'></div><input type='text' value='1' name='eye_glasses' class='value_box'><br>\n\n\t<p># of contact lenses purchased in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='contact_lenses' id='contact_lenses' style='width:68%;display:inline-block'></div><input type='text' value='1' name='contact_lenses' class='value_box'><br>\n\n <p># of eye surgeries in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='eye_surgeries' id='eye_surgeries' style='width:68%;display:inline-block'></div><input type='text' value='1' name='eye_surgeries' class='value_box'><br>\n\n\t<p># of hearing exams in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='hearing_exams' id='hearing_exams' style='width:68%;display:inline-block'></div><input type='text' value='1' name='hearing_exams' class='value_box'><br>\n\n\t<p># of hearing aids or batteries in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='hearing_aids' id='hearing_aids' style='width:68%;display:inline-block'></div><input type='text' value='1' name='hearing_aids' class='value_box'><br><br>\n <p>List any other vision or hearing expenses in the next year: </p>\n <textarea class='textarea' name='notes_vision_hearing_care'></textarea>\n\n <h1 style='color:#FF9200'>DENTAL CARE </h1>\n <p># of the dental exams in the next year? </p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='dental_exams' id='dental_exams' style='width:68%;display:inline-block'></div><input type='text' value='1' name='dental_exams' class='value_box'><br>\n\n\t<p># of teeth cleanings in the next year? </p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='teeth_cleanings' id='teeth_cleanings' style='width:68%;display:inline-block'></div><input type='text' value='1' name='teeth_cleanings' class='value_box'><br>\n\n\t<p># of cavity fillings in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='cavity_fillings' id='cavity_fillings' style='width:68%;display:inline-block'></div><input type='text' value='1' name='cavity_fillings' class='value_box'><br>\n\n\t<p># of root canals in the next year? </p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='root_canals' id='root_canals' style='width:68%;display:inline-block'></div><input type='text' value='1' name='root_canals' class='value_box'><br>\n\n\t<p># of crown, bridges or dentures in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='crown_bridges_dentures' id='crown_bridges_dentures' style='width:68%;display:inline-block'></div><input type='text' value='1' name='crown_bridges_dentures' class='value_box'><br>\n\n\t<p># of oral surgeries in the next year?</p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='oral_surgeries' id='oral_surgeries' style='width:68%;display:inline-block'></div><input type='text' value='1' name='oral_surgeries' class='value_box'><br>\n\n\t<p># of braces or orthodontia in the next year? </p>\n\t<div class='dont_know'>Don't<br>Know</div><div class='braces_orthodontia' id='braces_orthodontia' style='width:68%;display:inline-block'></div><input type='text' value='1' name='braces_orthodontia' class='value_box'><br>\n <br>\n <p>List any other dental expenses next year:</p>\n\t<textarea class='textarea' name='notes_dental_care'></textarea>\n\n\n <h1 style='color:#FF9200'>CHRONIC CONDITIONS</h1>\n <p>Does anyone who will be covered on your health insurance plan have :</p>\n\n $checkboxes\n <br>\n <p>OTHERS: </p>\n <textarea class='textarea' name='notes_chronic_conditions'></textarea>\n <div style='padding:45px;width:85%'>\n<a href='javascript:void(0)' style='color:#FF9200;margin-right:150px;' class='submit_email'><img src='$base_url/sites/all/modules/healthcareworksheet/images/mail' class='green_man'> <span class='submit_Text'>Email as .PDF file </span></a>\n<a href='javascript:void(0)' style='color:#FF9200' class='submit_print'><img src='$base_url/sites/all/modules/healthcareworksheet/images/mail' class='green_man'> <span class='submit_Text'>Print</span></a>\n</div>\n<input type='hidden' name='send_email'>\n </form>\n\n</div>\n\n<div class='fetch_email_popup'>\n <span class=\"modal_close\" style='float:right;background: steelblue;color: white;padding: 5px 10px;border-radius: 50%;bottom: 14px;position: relative;left: 14px;'>X</span>\n <h4 style='color:steelblue;text-align:center;padding:5px;margin:5px;border-bottom:1px solid lightgrey'>Send Email To</h4><br>\n <form method='post' action='' onsubmit='return false;'>\n <div style='text-align:center'>\n <br>\n <input type=\"email\" id='report_email' required='required'><br><br><br>\n <input type='submit' class='app_info_disclaimer send_report_button' value=\"SEND REPORT\">\n </div>\n </form>\n</div>\n\n<div class='black_mobile_overlay'></div>\n\n\n <link rel=\"stylesheet\" href=\"//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css\">\n <script src=\"//code.jquery.com/jquery-1.10.2.js\"></script>\n <script src=\"//code.jquery.com/ui/1.11.4/jquery-ui.js\"></script>\n\n <script>\n var people=\"<img src='$base_url/sites/all/modules/healthcareworksheet/images/greenman.png' class='green_man'>\";\n $( \".teeth_cleanings,.braces_orthodontia,.oral_surgeries,.crown_bridges_dentures,.root_canals,.cavity_fillings,.dental_exams,.hearing_aids,.hearing_exams,.eye_surgeries,.contact_lenses,.eye_exams,.eye_glasses,.generic_prescription_medications,.brand_name_prescription_medications,.medical_supplies_purchased,.conselling_visits,.drug_rehab,.overnight_psychiatric_hospitalizations,.emergency_visits,.pregnencies,.patient_procedures,.whos_on_your_plan,.specialist_office_visits,.regular_office_visits,.lab_visits,.overnight_hospitalization_with_surgery_visits,.overnight_hospitalization_without_surgery_visits\" ).slider({\n \tmin:1,\n \tmax:10,\n \tstart:function(event,ui){\n // Nothing to be added here as of now.\t\t\n \t},\n \tslide:function(event,ui){\n \t\tpeople_html=\"\";\n \t\tthis_id=$(this).attr('id');\n $(\"[name='\"+this_id+\"']\").val(ui.value);\n\n //Special case\n\n if(this_id=='whos_on_your_plan')\n \t\t{\n \t\t\tfor(i=1;i<=ui.value;i++){\n \t\t\t\tpeople_html=people_html+people;\n \t\t\t}\n\n $('.show_people_pics').html(people_html);\n\n \t\t}\n\n \t}\n });\n\n$('.submit_print').click(function(){\n\t$('#health_care_worksheet_form').submit();\n});\n\n\n$('.submit_Text').click(function(){\n\t$('.fetch_email_popup,.black_mobile_overlay').fadeIn();\n\t$(\"html, body\").animate({ scrollTop: 0 }, 600);\n\n});\n\n$('.modal_close').click(function(){\n\t$('.fetch_email_popup,.black_mobile_overlay').fadeOut();\n});\n\n$('.send_report_button').click(function(){\n\tif($('#report_email').val()){\n $(\"[name='send_email']\").val($('#report_email').val());\n $('#health_care_worksheet_form').submit();\n }\n});\n\n</script>\n<style>\n.value_box{\n\twidth:30px;\n\tdisplay:inline-block;\n\tmargin-left:20px;\n\tborder:1px solid #9BD5C7;\n\ttext-align:center;\n\tbottom:2px;\n\tposition:relative;\n}\n\n.dont_know{\n\tdisplay:inline-block;\n\twidth: 12%;\n\tborder: 2px solid lightgrey;\n\ttext-align: center;\n\tmargin-right: 20px;\n\tfont-size: 13px;\n\tline-height: 17px;\n\tposition: relative;\n\ttop: 5px;\n\tcolor: grey;\n}\n\np,h1{\n\tmargin-top:10px;\n\tmargin-bottom:10px;\n}\n\n.textarea{\n\tbox-shadow:0 0 10px #9BD5C7;\n\twidth:82%;\n\theight:100px;\n\tdisplay:block;\n\tborder-radius:4px;\n\tpadding:5px;\n\tfont-family:trebuchet ms;\n}\n\n.green_man{\n\tmargin-right:25px;\n}\n\n.submit_Text{\n\tbottom: 15px;\n position: relative;\n font-size: 20px;\n}\n\n.black_mobile_overlay{\n background: black;\n opacity: 0.7;\n height:100%;\n width:100%;\n position: fixed;\n z-index: 500;\n top:0;\n left:0;\n display: none;\n}\n\n.fetch_email_popup{\n//border:10px solid black;\nbackground: white;\npadding:0px;\nheight:250px;\nwidth: 350px;\nposition: absolute;\ntop:30%;\nleft:36%;\ndisplay: none;\nz-index: 501;\nborder-radius: 10px;\n\n}\n</style>\nxyz;\n\n\treturn $form_html;\n}", "public function generate_ack_receipt() {\n $clsid = $this->input->post('cls');\n $crsid = $this->input->post('crs');\n $userid = $this->input->post('usr');\n $invoice_id = $this->input->post('invoice');\n $ack_data = $this->payments_model->get_acknowledgement_data($clsid, $crsid, $userid);\n\n $sfc_amount= $this->payments_model->get_sfc_details($invoice_id);\n if(!empty($sfc_amount['othr_mode_of_payment'])){ \n $other_mod_of_payment= \" & Other Mode Of Payment : ($ \".number_format($sfc_amount['other_amount_recd'],2,'.','').\")\";}\n else{\n $other_mod_of_payment=\"\";\n }\n if(($sfc_amount['sfc_claimed']>0))\n { \n $mod = 'Mode of payment: '.$sfc_amount['mode_of_pymnt'].'($ '.number_format($sfc_amount['sfc_claimed'],2,'.','').')'.''.$other_mod_of_payment;\n }else\n {\n $mod = 'Mode of payment: '.$sfc_amount['mode_of_pymnt'].'($ '.number_format($sfc_amount['amount_recd'],2,'.','').')'.''.$other_mod_of_payment;\n }\n //resetting classroom location parameter id with category name\n $ack_data[classroom_location] = $this->meta_data[$ack_data[classroom_location]];\n\n $ack_data[cert_level] = $this->meta_data[$ack_data[certi_level]];\n\n $tanant = $this->courses_model->get_tenant_details();\n $gender = ($ack_data['gender'] == 'MALE') ? 'Mr. ' : 'Ms. ';\n $date = date('M d Y', strtotime($ack_data['inv_date']));\n $logourl = base_url() . 'logos/' . $this->session->userdata(public_tenant_details)->Logo;\n $startdate = date('M d Y, l', strtotime($ack_data[class_start_datetime])) . ' @ ' . date('h:i A', strtotime($ack_data[class_start_datetime]));\n $Url = base_url() . 'payments/print_receipt';\n echo ' <form action=\"' . $Url . '\" method=\"post\"><p>\n \n <h2 class=\"panel_heading_style\">Payment Receipt</h2><br><a class=\"close-modal \" rel=\"modal:close\" href=\"#close-modal\">Close</a>\n <table width=\"100%\"> \n <tbody>\n <tr>\n <td rowspan=\"4\"><img src=\"' . $logourl . '\" border=\"0\" /></td>\n <td colspan=\"2\">' . $tanant->tenant_name . '</td>\n <td class=\"td_heading\">Receipt No.:</td>\n <td>' . date('Y') . '' . $ack_data['invoice_id'] . '</td>\n </tr>\n <tr>\n <td colspan=\"2\">' . $tanant->tenant_address, $tanant->tenant_city . '</td>\n <td class=\"td_heading\">Receipt Date:</td>\n <td>' . $date . '</td>\n </tr>\n <tr>\n <td colspan=\"4\"></td>\n </tr>\n <tr>\n <td colspan=\"4\">' . $tanant->tenant_contact_num . '</td>\n </tr>\n \n </tbody>\n </table><br>\n \n <p><font style=\"font-size:14px; font-weight:bold;\">Received</font> with thanks SGD ' . $ack_data[total_inv_amount] . ' from <b>' \n . $ack_data[first_name] . ' ' . $ack_data[last_name] . ' </b> for <b> Course: \"' . $ack_data[crse_name] . ' ,Class: '\n . $ack_data[class_name] . ' Certificate Code:' . $ack_data[cert_level] . '</b>\". '.$mod.'</p>\n\n <table class=\"table table-bordered\">\n \n <tbody>\n <tr>\n <td class=\"td_heading\">Class Start Date:</td>\n <td>' . $startdate . '</td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Location:</td>\n <td>' . $ack_data[classroom_location] . '</td>\n </tr>\n \n <tr>\n <td class=\"td_heading\">Contact Details:</td>\n <td>' . $gender . $ack_data[crse_manager][first_name] . ' ' . $ack_data[crse_manager][last_name] . '(Phone:' . $tanant->tenant_contact_num . ',Email Id: ' . $tanant->tenant_email_id . ')\n <input type=\"hidden\" value=\"' . $clsid . '\" name=\"classId\"/>\n <input type=\"hidden\" value=\"' . $crsid . '\" name=\"courseId\"/> \n <input type=\"hidden\" value=\"' . $userid . '\" name=\"userId\"/>\n </tr>\n </tbody>\n </table>\n \n <p>\n\n</br><p class=\"red\"><i>This is a computer generated receipt and does not require a seal or signature.</i></p>\n\n<div style=\"clear:both;\"></div><br>\n<span style=\"float:right;\">\n<button id=\"print_ack_receipt\" class=\"btn btn-primary\" type=\"submit\">Print</button>\n</p> </form> ';\n }", "function CapitalFirstPL($net_salary, $company, $category, $DOB, $Company_Type, $Employment_Status, $reqtenure, $reqloanamount) {\n\t\t list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n if ($Employment_Status == 1) {\n /* if ($term > 60) {\n $calcterm = 60;\n $print_term = 5;\n } else {\n $calcterm = $term;\n $print_term = $print_term;\n } */\n //for term\n if ($category == \"CAT SA\" || $category == \"CAT A\") {\n if ($term > 60) {\n $calcterm = 60;\n $getterm = 5;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n } else {\n if ($term > 48) {\n $calcterm = 48;\n $getterm = 4;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n }\n //for term end\n //multiplier for loan amount\n if ($category == \"CAT SA\") {\n if ($net_salary > 75000) {//salary\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = $net_salary * 28;\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 26;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 23;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 16;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 9;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"13\";\n $intr = 13;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"13.25\";\n $intr = 13.25;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"14\";\n $intr = 14;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary >= 50000 && $net_salary <= 75000) {//salary\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = $net_salary * 26;\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 23;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 20;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 15;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 9;\n } else {\n $loan_amt = 0;\n }\n\t\t\t\t\t\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"13.50\";\n $intr = 13.50;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"13.75\";\n $intr = 13.75;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"14.25\";\n $intr = 14.25;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary < 50000) {//salary\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = $net_salary * 24;\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 21;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 20;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 8;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"14\";\n $intr = 14;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"14.50\";\n $intr = 14.50;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"15\";\n $intr = 15;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else {\n \n }\n }//CAT SA\n elseif ($category == \"CAT A\") {\n if ($net_salary > 75000) {//salary\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = $net_salary * 28;\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 23;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 20;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 14;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 9;\n } else {\n $loan_amt = 0;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"13\";\n $intr = 13;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"13.25\";\n $intr = 13.25;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"14\";\n $intr = 14;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary >= 50000 && $net_salary <= 75000) {//salary\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = $net_salary * 25;\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 22;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 19;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 14;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 8;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"13.50\";\n $intr = 13.50;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"13.75\";\n $intr = 13.75;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"14.25\";\n $intr = 14.25;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary < 50000) {//salary\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = $net_salary * 24;\n } elseif ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 21;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 18;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 8;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"14\";\n $intr = 14;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"14.50\";\n $intr = 14.50;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"15\";\n $intr = 15;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else {\n \n }\n }//CAT A\n elseif ($category == \"CAT B\") {\n if ($net_salary > 75000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 19;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 17;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 12;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 7;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"14\";\n $intr = 14;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"14.50\";\n $intr = 14.50;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"15\";\n $intr = 15;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary >= 50000 && $net_salary <= 75000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 19;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 16;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 12;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 6;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"14.50\";\n $intr = 14.50;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"14.75\";\n $intr = 14.75;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"15.25\";\n $intr = 15.25;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary < 50000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 18;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 16;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 6;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"15.25\";\n $intr = 15.25;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"16.25\";\n $intr = 16.25;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else {\n \n }\n } elseif ($category == \"CAT C\") {\n if ($net_salary > 75000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"15\";\n $intr = 15;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"15.50\";\n $intr = 15.50;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"16\";\n $intr = 16;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary >= 50000 && $net_salary <= 75000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"15.25\";\n $intr = 15.25;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"16.25\";\n $intr = 16.25;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary < 50000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 7;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"16.25\";\n $intr = 16.25;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"16.75\";\n $intr = 16.75;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"17\";\n $intr = 17;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($category == \"CAT D\") {\n if ($net_salary > 75000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"17\";\n $intr = 17;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"17.50\";\n $intr = 17.50;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"18\";\n $intr = 18;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary >= 50000 && $net_salary <= 75000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"17.50\";\n $intr = 17.50;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"18\";\n $intr = 18;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"19\";\n $intr = 19;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary < 50000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 7;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"17.75\";\n $intr = 17.75;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"19\";\n $intr = 19;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"20\";\n $intr = 20;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else {\n if ($net_salary > 75000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n } else {\n $loan_amt = 0;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"17\";\n $intr = 17;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"17.50\";\n $intr = 17.50;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"18\";\n $intr = 18;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } elseif ($net_salary >= 50000 && $net_salary <= 75000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n if ($loan_amt > 0) {\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"17.50\";\n $intr = 17.50;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"18\";\n $intr = 18;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"19\";\n $intr = 19;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n }\n } elseif ($net_salary < 50000) {//salary\n if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 11;\n } elseif ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 9;\n } elseif ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 7;\n } elseif ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n\t\t\t\t\t////////////////////////////////////////////////////////\n\t\t\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\t///////////////////////////////////////////////////////\n //rategrid //\n if ($loan_amt > 400000) {\n $interestrate = \"17.75\";\n $intr = 17.75;\n } elseif ($loan_amt >= 200000 && $loan_amt <= 400000) {\n $interestrate = \"19\";\n $intr = 19;\n } elseif ($loan_amt >= 100000 && $loan_amt <= 200000) {\n $interestrate = \"20\";\n $intr = 20;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else {\n $loan_amt = 0;\n $interestrate = 0;\n $intr = 0;\n }\n }\n\n //rate calculation\n if ($loan_amt > 1500000) {\n $getloanamout = 1500000;\n } else {\n $getloanamout = $loan_amt;\n }\n\n $proc_Fee = \"2%\";\n } else { //self employed\n if ($term > 48) {\n $calcterm = 48;\n $getterm = 4;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n // as per foir\n $applicableFOIR = $net_salary * (.60);\n // $intrcalc = 18;\n $princ = 100000;\n $emicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $calcterm))));//getController()->Common()->getEMI($princ, $intrcalc, $calcterm);\n $loanPossible = ($emicalc > 0) ? ($applicableFOIR / $emicalc) : 0;\n $viewLoanAmt = round($loanPossible * 100000);\n $loan_amt_asfoir = $viewLoanAmt;\n //as per multiplier\n $loan_amt_asmultiplier = $net_salary * 2;\n if ($loan_amt_asmultiplier > $loan_amt_asfoir) {\n $loan_amt = $loan_amt_asfoir;\n } else {\n $loan_amt = $loan_amt_asmultiplier;\n }\n\n if ($loan_amt > 1000000) {\n $getloanamout = 1000000;\n } else {\n $getloanamout = $loan_amt;\n }\n\t\t\t////////////////////////////////////////////////////////\n\t\t\t\tif($reqloanamount>0)\n\t\t\t\t{\n\t\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n if ($loan_amt > 700000) {\n $interestrate = \"22\";\n $intr = 22;\n } elseif ($loan_amt >= 300000 && $loan_amt <= 700000) {\n $interestrate = \"23\";\n $intr = 23;\n } elseif ($loan_amt < 300000) {\n $interestrate = \"25\";\n $intr = 25;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $print_term = $getterm;\n $proc_Fee = \"3%\";\n }\n\n //emi\n if ($getloanamout > 0 && $intr > 0) {\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $calcterm))));//getController()->Common()->getEMI($getloanamout, $intr, $calcterm);\n } else {\n $getemicalc = 0;\n $interestrate = 0;\n }\n \n $emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $calcterm))));\n $details['bank_code'] = \"CapitalFirst\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $proc_Fee;\n $details['category'] = $category;\n\n return($details);\n }", "public function pdf($quotation_id) {\n\n $this->load->model('enquiries/outbound_quotation_model');\n $this->load->model('country_model');\n $this->load->helper('date');\n\n $quotation_data = $this->outbound_quotation_model->get_values($quotation_id);\n $quotation_data['quotation_creation_date'] = unix_to_human($quotation_data['quotation_creation_date']);\n $countryname = ($country = $this->country_model->get($quotation_data['quotation_country_id'])) ? $country->country : null;\n $enquiry_countryname = ($country = $this->country_model->get($quotation_data['address_country_id'])) ? $country->country : null;\n\n // Replace constant values\n $quotation_data['quotation_currency'] = get_lang_for_constant_value(\"CURRENCY\", $quotation_data[\"quotation_currency\"]);\n $quotation_data['quotation_freight'] = get_lang_for_constant_value(\"ENQUIRIES_SHIPPING\", $quotation_data[\"quotation_freight\"]);\n $quotation_data['quotation_delivery_terms'] = get_lang_for_constant_value(\"ENQUIRIES_ENQUIRY_DELIVERY\", $quotation_data[\"quotation_delivery_terms\"]);\n $quotation_data['quotation_payment_terms'] = get_lang_for_constant_value(\"ENQUIRIES_OUTBOUND_PAYMENT_TERMS\", $quotation_data[\"quotation_payment_terms\"]);\n $quotation_data['quotation_tool_cost_payment_terms'] = get_lang_for_constant_value(\"ENQUIRIES_TOOL_PAYMENT_TERMS\", $quotation_data[\"quotation_tool_cost_payment_terms\"]);\n\n $this->load->library('pdf', array('header_title' => \"Outbound Quotation $quotation_id\", 'header_font_size' => 14));\n $this->pdf->SetSubject(\"Outbound Quotation $quotation_id\");\n\n $company_info = \"{$quotation_data['company_name']}\n {$quotation_data['address_address1']}\n {$quotation_data['address_address2']}\n {$quotation_data['address_city']}, {$quotation_data['address_state']} {$quotation_data['address_postcode']},\n $enquiry_countryname\";\n\n if ($quotation_data['quotation_tool_cost'] == 0) {\n $quotation_data['quotation_tool_cost'] = '<strong style=\"color: red\">Please refer to attached document for tool cost quote information.</strong>';\n }\n if ($quotation_data['quotation_price'] == '0.00') {\n $quotation_data['quotation_price'] = '<strong style=\"color: red\">Please refer to attached document for price quote information.</strong>';\n }\n\n $quotation_info = array('Product' => $quotation_data['enquiry_product_title'],\n 'Description' => $quotation_data['enquiry_product_description'],\n 'Materials' => $quotation_data['enquiry_product_materials'],\n 'Manufacturing Process' => $quotation_data['enquiry_product_man_process'],\n 'Size' => $quotation_data['enquiry_product_size'],\n 'Weight' => $quotation_data['enquiry_product_weight'],\n 'Colour' => $quotation_data['enquiry_product_colour'],\n 'Packaging' => $quotation_data['enquiry_product_packaging'],\n 'Currency' => $quotation_data['quotation_currency'],\n 'Tool Cost' => $quotation_data['quotation_tool_cost'],\n 'Tool Lead Time' => $quotation_data['quotation_tool_lead_time'],\n 'Sample Cost' => $quotation_data['quotation_sample_cost'],\n 'Sample Lead Time' => $quotation_data['quotation_sample_time'],\n 'Product Unit' => $quotation_data['quotation_unit'],\n 'Product Minimum Order' => $quotation_data['quotation_min_qty'],\n 'Product Lead Time' => $quotation_data['quotation_product_lead_time'],\n 'Freight Type' => $quotation_data['quotation_freight'],\n 'Delivery Terms' => $quotation_data['quotation_delivery_terms'],\n 'Delivery Country' => $countryname,\n 'Delivery Point' => $quotation_data['quotation_delivery_point'],\n 'Product Payment Terms' => $quotation_data['quotation_payment_terms'],\n 'Tool Payment Terms' => $quotation_data['quotation_tool_cost_payment_terms'],\n 'Sample Payment Terms' => $quotation_data['quotation_sample_payment_terms'],\n 'Notes' => $quotation_data['quotation_notes'] . \"<br /><br />\"\n . \"Quotation subject to our Standard Terms of Business<br />Quotation valid 15 days<br />Samples shipped by courier at customer's expense\"\n . \"<br /><br />Shipping costs, where applicable, can change from week to week with higher rates between July to October. Adjustments will \"\n . \"be advised at time of receipt of order\");\n\n $output = $this->load->view(\"enquiries/outbound/export_pdf\", array('quotation_data' => $quotation_data, 'company_info' => nl2br($company_info), 'quotation_info' => $quotation_info), true);\n\n $this->pdf->setY(60);\n $this->pdf->writeHTML($output, false, false, false, false, '');\n\n // Save file to disk for easy attachment to emails\n $directory = $this->config->item('files_path').\"enquiries/outbound/$quotation_id/\";\n if (!file_exists($directory)) {\n mkdir($directory);\n }\n\n $save_only = $this->session->flashdata('save_only');\n $this->pdf->output($directory . \"outbound_quotation_$quotation_id.pdf\", ($save_only) ? 'F' : 'FD');\n if ($save_only) {\n redirect($this->session->flashdata('redirect_url'));\n }\n }", "public function refund_report_pdf() {\n $tenant_id = $this->tenant_id;\n $company = $this->classTraineeModel->get_company_for_paidinvoice($tenant_id);\n $companies = array();\n foreach ($company as $row) {\n $companies[$row->company_id] = $row->company_name;\n }\n $company = $this->input->get('company');\n $invoice_id = $this->input->get('invoice_id');\n $start_date = $this->input->get('start_date');\n $end_date = $this->input->get('end_date');\n $field = ($this->input->get('f')) ? $this->input->get('f') : 'inv.invoice_id';\n $order_by = ($this->input->get('o')) ? $this->input->get('o') : 'DESC';\n $tabledata = $this->reportsModel->get_refund_paid($tenant_id, NULL, NULL, $field, $order_by, $company, $invoice_id, $start_date, $end_date);\n $invs = array();\n foreach ($tabledata as $k => $row) {\n if ($row->refnd_reason == 'OTHERS') {\n $tabledata[$k]->refnd_reason = \"Others (\" . $row->refnd_reason_ot . \")\";\n } else {\n $tabledata[$k]->refnd_reason = $this->courseModel->get_metadata_on_parameter_id($row->refnd_reason);\n }\n if ($row->refund_type == 'INDV') {\n $invs[$row->invoice_id] = $row->invoice_id;\n }\n }\n $tb_user = $this->reportsModel->get_refund_paid_user($invs);\n $tableuser = array();\n foreach ($tb_user as $row) {\n $tableuser[$row->invoice_id]['name'] = $row->first_name . ' ' . $row->last_name;\n $tableuser[$row->invoice_id]['taxcode'] = $this->mask_format($row->tax_code);\n }\n $tenant_details = $this->classTraineeModel->get_tenant_masters($tenant_id);\n $tenant_details->tenant_state = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_state), ', ');\n $tenant_details->tenant_country = rtrim($this->courseModel->get_metadata_on_parameter_id($tenant_details->tenant_country), ', ');\n $this->load->helper('pdf_reports_helper');\n return refunds_report_pdf($tabledata, $tableuser, $tenant_details, $companies);\n }", "public function format_for_xlwebpro_htl ($doc_nos, $doc_srno, $idate, $ccode, $scode, $hotel_name, $ticketno, $pax, $check_in_date, $check_out_date, $city_code, $basic_c, $basic_s, $nos_pax_a, $nos_pax_c, $room_sgl_nos=0, $room_sgl_pax=0, $room_sgl_rate=0, $room_trp_nos=0, $room_trp_pax=0, $room_trp_rate=0, $room_qad_nos=0, $room_qad_pax=0, $room_qad_rate=0, $room_twn_nos=0, $room_twn_pax=0, $room_twn_rate=0, $room_dbl_nos=0, $room_dbl_pax=0, $room_dbl_rate=0, $roomtype='000', $srv_chrg1c=0, $serv_educ=0, $serv_taxc=0, $hcode='H00000',$gcode='GI03HT', $doc_prf = 'HW', $roomview='000', $mealplan='000', $tarifftype='R') \r\n\t{\r\n\t\t$result['doc_prf'] = $doc_prf;\r\n\t\t$result['doc_nos'] = $doc_nos;\r\n\t\t$result['doc_srno'] = $doc_srno;\r\n\t\t$result['idm_flag'] = 'H';\r\n\t\t$result['il_ref'] = '';\r\n\t\t$result['vd_ref'] = '';\r\n\t\t$result['idate'] = $idate;\r\n\t\t$result['ccode'] = $ccode;\r\n\t\t$result['dcode'] = '';\r\n\t\t$result['ecode'] = '';\r\n\t\t$result['bcode'] = '';\r\n\t\t$result['narration'] = '';\r\n\t\t$result['xo_ref'] = 'H';\r\n\t\t$result['loc_code'] = '000';\r\n\t\t$result['cst_code'] = '000';\r\n\t\t$result['curcode_c'] = 'INR';\r\n\t\t$result['curcode_s'] = 'INR';\r\n\t\t$result['refr_key'] = '';\r\n\t\t$result['gcode'] = $gcode;\r\n\t\t$result['hcode'] = $hcode;\r\n\t\t$result['scode'] = $scode;\r\n\t\t$result['hotel_name'] = $hotel_name;\r\n\t\t$result['xo_nos'] = '';\r\n\t\t$result['ticketno'] = $ticketno; // concatenate first 3 columns\r\n\t\t$result['pax'] = $pax;\r\n\t\t$result['check_in_date'] = $check_in_date;\r\n\t\t$result['check_out_date'] = $check_in_date;\r\n\t\t$result['roomview'] = $roomview;\r\n\t\t$result['mealplan'] = $mealplan;\r\n\t\t$result['roomtype'] = $roomtype;\r\n\t\t$result['tarifftype'] = $tarifftype;\r\n\t\t$result['pkg_code'] = '';\r\n\t\t$result['city'] = $city_code;\r\n\t\t$result['room_sgl_nos'] = $room_sgl_nos;\r\n\t\t$result['room_sgl_pax'] = $room_sgl_pax;\r\n\t\t$result['room_sgl_rate'] = $room_sgl_rate;\r\n\t\t$result['room_sgl_purmth'] = 'RB';\r\n\t\t$result['room_sgl_purval'] = 0;\r\n\t\t$result['room_dbl_nos'] = $room_dbl_nos;\r\n\t\t$result['room_dbl_pax'] = $room_dbl_pax;\r\n\t\t$result['room_dbl_rate'] = $room_dbl_rate;\r\n\t\t$result['room_dbl_purmth'] = 'RB';\r\n\t\t$result['room_dbl_purval'] = 0;\r\n\t\t$result['room_twn_nos'] = $room_twn_nos;\r\n\t\t$result['room_twn_pax'] = $room_twn_pax;\r\n\t\t$result['room_twn_rate'] = $room_twn_rate;\r\n\t\t$result['room_twn_purmth'] = 'RB';\r\n\t\t$result['room_twn_purval'] = 0;\r\n\t\t$result['room_trp_nos'] = $room_trp_nos;\r\n\t\t$result['room_trp_pax'] = $room_trp_pax;\r\n\t\t$result['room_trp_rate'] = $room_trp_rate;\r\n\t\t$result['room_trp_purmth'] = 'RB';\r\n\t\t$result['room_trp_purval'] = 0;\r\n\t\t$result['room_qad_nos'] = $room_qad_nos;\r\n\t\t$result['room_qad_pax'] = $room_qad_pax;\r\n\t\t$result['room_qad_rate'] = $room_qad_rate;\r\n\t\t$result['room_qad_purmth'] = 'RB';\r\n\t\t$result['room_qad_purval'] = 0;\r\n\t\t$result['room_adt_nos'] = 0;\r\n\t\t$result['room_adt_pax'] = 0;\r\n\t\t$result['room_adt_rate'] = 0;\r\n\t\t$result['room_adt_purmth'] = 'RB';\r\n\t\t$result['room_adt_purval'] = 0;\r\n\t\t$result['room_chd_nos'] = 0;\r\n\t\t$result['room_chd_pax'] = 0;\r\n\t\t$result['room_chd_rate'] = 0;\r\n\t\t$result['room_chd_purmth'] = 'RB';\r\n\t\t$result['room_chd_purval'] = 0;\r\n\t\t$result['room_cwb_nos'] = 0;\r\n\t\t$result['room_cwb_pax'] = 0;\r\n\t\t$result['room_cwb_rate'] = 0;\r\n\t\t$result['room_cwb_purmth'] = 'RB';\r\n\t\t$result['room_cwb_purval'] = 0;\r\n\t\t$result['room_foc_nos'] = 0;\r\n\t\t$result['room_foc_pax'] = 0;\r\n\t\t$result['room_foc_rate'] = 0;\r\n\t\t$result['room_foc_purmth'] = 'RB';\r\n\t\t$result['room_foc_purval'] = 0;\r\n\t\t$result['stx_cenvat'] = 'C';\r\n\t\t$result['stx_method'] = 'S';\r\n\t\t$result['nos_pax_a'] = $nos_pax_a;\r\n\t\t$result['nos_pax_c'] = $nos_pax_c;\r\n\t\t$result['nos_pax_i'] = 0;\r\n\t\t$result['narr_1'] = '';\r\n\t\t$result['narr_2'] = '';\r\n\t\t$result['narr_3'] = '';\r\n\t\t$result['narr_4'] = '';\r\n\t\t$result['narr_5'] = '';\r\n\t\t$result['narr_6'] = '';\r\n\t\t$result['r_o_e_c'] = 0;\r\n\t\t$result['r_o_e_s'] = 0;\r\n\t\t$result['basic_c'] = $basic_c;\r\n\t\t$result['basic_s'] = $basic_s;\r\n\t\t$result['tax_c'] = 0;\r\n\t\t$result['tax_s'] = 0;\r\n\t\t$result['disc_paidm1'] = 'RB';\r\n\t\t$result['disc_paidm2'] = 'N';\r\n\t\t$result['disc_recdm1'] = 'RB';\r\n\t\t$result['brok_paidm1'] = 'RB';\r\n\t\t$result['disc_paidv1'] = 0;\r\n\t\t$result['disc_recdv1'] = 0;\r\n\t\t$result['brok_paidv1'] = 0;\r\n\t\t$result['disc_paid1'] = 0;\r\n\t\t$result['disc_recd1'] = 0;\r\n\t\t$result['brok_paid1'] = 0;\r\n\t\t$result['srv_paidm2'] = 'N';\r\n\t\t$result['srv_chrg1c'] = $srv_chrg1c;\r\n\t\t$result['srv_chrg2c'] = 0;\r\n\t\t$result['srv_chrg3c'] = 0;\r\n\t\t$result['raf_c'] = 0;\r\n\t\t$result['srv_chrg1p'] = 0;\r\n\t\t$result['srv_chrg2p'] = 0;\r\n\t\t$result['srv_chrg3p'] = 0;\r\n\t\t$result['raf_p'] = 0;\r\n\t\t$result['serv_taxc'] = $serv_taxc;\r\n\t\t$result['serv_educ'] = $serv_educ;\r\n\t\t$result['tdc_paidv1'] = 0;\r\n\t\t$result['tds_c'] = 0;\r\n\t\t$result['serv_taxp'] = 0;\r\n\t\t$result['serv_edup'] = 0;\r\n\t\t$result['tds_paidv1'] = 0;\r\n\t\t$result['tds_p'] = 0;\r\n\t\t$result['tdb_paidv1'] = 0;\r\n\t\t$result['tds_b'] = 0;\r\n\t\t$result['created_by'] = '';\r\n\t\t$result['created_on'] = '';\r\n\r\n\t\treturn $result;\r\n\t}", "abstract function has_paid_plan();", "function receipt($param=0,$type='invoice')\n {\n $campaign = $this->Campaign_model->get_by_id($param)->row();\n \n $data['title'] = $this->properti['name'].' | Invoice '.ucwords($this->modul['title']).' | CMP-0'.$campaign->id;\n \n if ($campaign){\n \n // property\n $data['p_name'] = $this->properti['sitename'];\n $data['p_address'] = $this->properti['address'];\n $data['p_city'] = $this->properti['city'];\n $data['p_zip'] = $this->properti['zip'];\n $data['p_phone'] = $this->properti['phone1'];\n $data['p_email'] = $this->properti['email'];\n $data['p_logo'] = $this->properti['logo'];\n\n // campaign details\n $data['from'] = $campaign->email_from;\n $data['to'] = $campaign->email_to;\n $data['type'] = $campaign->type;\n $data['category'] = $campaign->category;\n $data['subject'] = $campaign->subject;\n $data['content'] = $campaign->content;\n $data['dates'] = tglin($campaign->dates).' - '. timein($campaign->dates);\n\n $this->load->view('campaign_invoice', $data);\n }\n }", "function createReportFault()\n {\n\n\t# form variables\n\t$faultCounty=null;\n\t$faultAddress=null;\n\t$faultMsisdn=null;\n\t$faultType=null;\n\t$faultFrequency=null;\n\t$faultDateFrom=null;\n\t\n\t\t# format the date to be YYYY-MM-DD h:i:s\n\t\t$date_format='Y-m-d H:i:s';\n\t\t$dateTimeObject = new DateTime($faultDateFrom);\n\t\t\n\t\t$faultDateFrom= $dateTimeObject->format($date_format);\n\n\t$faultDateTo=null;\n\t$faultLatitiude=null;\n\t$faultLongitude=null;\n\t$faultDescription=null;\n\t$faultStatus=null;\n\t$faultUpdate=null;\n\t$faultReportEmail=null;\n\t\n\t# check variables\n\t$validMsisdn=false;\n\t$faultReportArr=array();\n\t$faultReportCreated=false; # has the fault report been created\n\t$newFaultReportId=null;\n\t\n\t//print_r($_POST);exit;\n\n\t# check that the button was pressed to report the fault\n\tif(isset($_POST['submitFaultReport']))\n\t{\n\n\t\tif(isset($_POST['faultCounty']))\n\t\t{\n\t\t\t$faultCounty=filter_input(INPUT_POST,'faultCounty',FILTER_SANITIZE_STRING);\n\t\t}\n\t\tif(isset($_POST['faultAddress']))\n\t\t{\n\t\t\t$faultAddress=filter_input(INPUT_POST,'faultAddress',FILTER_SANITIZE_STRING);\n\t\t}\n\t\t# MSISDN is a mandatory field and must be in 353 format. This is check on the front end in Chrome\n\t\tif(isset($_POST['faultMsisdn']))\n\t\t{\n\t\t\t$faultMsisdn=filter_input(INPUT_POST,'faultMsisdn',FILTER_SANITIZE_NUMBER_INT);\n\t\t\t\n\t\t\t# convert the msisdn to a STRING value\n\t\t\t$faultMsisdnStr=strval($faultMsisdn);\n\n\t\t\t# check that the length of a string matches a proper mobile number for Ireland\n\t\t\t# 3538xxxxxxxx = 12 characters in length\n\t\t\t$faultMsisdnStrLen=strlen($faultMsisdnStr);\n\n\t\t\t# check MSISDN is long enough\n\t\t\tif(12==$faultMsisdnStrLen)\n\t\t\t{\n\t\t\t\t# check that the string starts in 353\n\t\t\t\tif(0==strPos($faultMsisdnStr,'3538'))\n\t\t\t\t{\n\t\t\t\t\t# convert string back to a float value\n\t\t\t\t\t$faultMsisdn=(float)$faultMsisdnStr;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t# if invalid MSISDN entered error message will be displayed\n\t\t\t\theader('Location: ./messageAlert?messageId=6&forwardTo=mapReportFault');\n\t\t\t\texit;\n\t\t\t}\n\t\t}\t\t\n\t\tif(isset($_POST['faultType']))\n\t\t{\n\t\t\t$faultType=filter_input(INPUT_POST,'faultType',FILTER_SANITIZE_STRING);\n\t\t}\n\t\tif(isset($_POST['faultFrequency']))\n\t\t{\n\t\t\t$faultFrequency=filter_input(INPUT_POST,'faultFrequency',FILTER_SANITIZE_STRING);\n\t\t}\n\t\tif(isset($_POST['faultDateFrom']))\n\t\t{\n\t\t\t$faultDateFrom=filter_input(INPUT_POST,'faultDateFrom',FILTER_SANITIZE_STRING);\n\t\t}\n\t\tif(isset($_POST['faultDateTo']))\n\t\t{\n\t\t\t$faultDateTo=filter_input(INPUT_POST,'faultDateTo',FILTER_SANITIZE_STRING);\n\t\t}\n\t\tif(isset($_POST['faultLatitude']))\n\t\t{\n\t\t\t$faultLatitude=filter_input(INPUT_POST,'faultLatitude',FILTER_SANITIZE_STRING);\n\t\t}\n\t\tif(isset($_POST['faultLongitude']))\n\t\t{\n\t\t\t$faultLongitude=filter_input(INPUT_POST,'faultLongitude',FILTER_SANITIZE_STRING);\n\t\t}\n\t\tif(isset($_POST['faultDescription']))\n\t\t{\n\t\t\t$faultDescription=filter_input(INPUT_POST,'faultDescription',FILTER_SANITIZE_STRING);\n\t\t}\n\t\tif(isset($_POST['faultStatus']))\n\t\t{\n\t\t\t$faultStatus=filter_input(INPUT_POST,'faultStatus',FILTER_SANITIZE_STRING);\n\t\t}\n\t\tif(isset($_POST['faultUpdate']))\n\t\t{\n\t\t\t$faultUpdate=filter_input(INPUT_POST,'faultUpdate',FILTER_SANITIZE_STRING);\n\t\t}\t\n\t\tif(isset($_POST['faultReportEmail']))\n\t\t{\n\t\t\t$faultReportEmail=filter_input(INPUT_POST,'faultReportEmail',FILTER_SANITIZE_STRING);\n\t\t}\t\n\t\t\n\t\t$faultReportArr=createFaultReport($faultCounty,$faultAddress,$faultMsisdn,$faultType,$faultFrequency,$faultDateFrom,$faultDateTo,$faultLatitude,$faultLongitude,$faultDescription,$faultStatus,$faultUpdate,$faultReportEmail);\n\n\t\tif(isset($faultReportArr['inserted']))\n\t\t{\n\t\t\t$faultReportCreated=$faultReportArr['inserted'];\n\t\t\t$newFaultReportId=$faultReportArr['newFaultReportId'];\n\t\t}\n\n\t\tif($faultReportCreated)\n\t\t{\t\n\t\t\t# if form not submitted properly display error message\n\t\t\theader('Location: ./messageAlert?messageId=5&forwardTo=mapReportFault&formId=3&newFaultReportId='.$newFaultReportId);\n\t\t\texit;\n\t\t}\n\t\telse \n\t\t{\t\t\t\n\t\t\t# if form not submitted properly display error message\n\t\t\theader('Location: ./messageAlert?messageId=9&forwardTo=mapReportFault&formId=3');\n\t\t\texit;\t\n\t\t}\n\t}\n\telse\n\t{\n\t\t# if form not submitted properly display error message\n\t\theader('Location: ./messageAlert?messageId=3&forwardTo=reportFault&loc=1');\n\t\texit;\n\t}\n\t\n\t# try to retrieve submitted values\n\n }", "public function getAcademicAnalyticsPDF()\n {\n\n /*$getUrl = $this->connection->prepare(\"SELECT * FROM `AC_FacultyInfo` WHERE OU_ABBREV = ? AND OUTCOMES_AY = ?\");\n $getUrl->bindParam(1,$this->ouAbbrev,PDO::PARAM_STR);\n $getUrl->bindParam(2,$this->selectedYear,PDO::PARAM_STR);\n $getUrl->execute();\n $data = $getUrl->fetch();\n\n if (!empty($data[\"AC_SUPPL_ACADEMIC_ANALYTICS\"])){\n\n if (file_exists(\"../../uploads/ac_programs/\".$data[\"AC_SUPPL_ACADEMIC_ANALYTICS\"]))\n $this->getSupplementPdf(\"../../uploads/ac_programs/\".$data[\"AC_SUPPL_ACADEMIC_ANALYTICS\"]);\n\n }*/\n\n }" ]
[ "0.5915057", "0.5444586", "0.5415379", "0.53633475", "0.53307897", "0.532492", "0.53043574", "0.5257047", "0.52407765", "0.5232417", "0.52116644", "0.52104384", "0.5178121", "0.5177166", "0.51589197", "0.51415074", "0.512649", "0.5113581", "0.5113197", "0.5104567", "0.5101459", "0.51000607", "0.50924575", "0.50850385", "0.50741947", "0.5067711", "0.5065029", "0.5050839", "0.50488025", "0.50331974", "0.5030237", "0.50289226", "0.50183094", "0.5012748", "0.50114214", "0.4994315", "0.49733004", "0.49720234", "0.49684685", "0.49660155", "0.49656302", "0.49605086", "0.49571648", "0.49552983", "0.49539196", "0.4937089", "0.4928758", "0.49282402", "0.49263343", "0.49212927", "0.49159083", "0.4912924", "0.4905879", "0.49035975", "0.48957142", "0.48833394", "0.48794055", "0.48779127", "0.48777956", "0.48775458", "0.48765317", "0.4873198", "0.48719445", "0.48708874", "0.48680082", "0.4864933", "0.4860403", "0.4859192", "0.48549277", "0.4853252", "0.48426285", "0.48393154", "0.4839197", "0.48388514", "0.48372665", "0.4835442", "0.4834839", "0.48337403", "0.48248753", "0.48202762", "0.4819116", "0.48178825", "0.48151514", "0.4813705", "0.48122197", "0.48120958", "0.48109666", "0.48023498", "0.4799894", "0.4795265", "0.47940728", "0.4793692", "0.47923976", "0.479", "0.47870505", "0.4785704", "0.47842908", "0.47833127", "0.47809243", "0.47740588" ]
0.5509136
1
Set a new subscriber as being the current one Setting a subscriber as being current will allow the notify() function to automatically exclude him from the notifications recipients and avoid a user to see his own messages
public function addCurrentSubscriber($subscriberId, $subscriberType = null) { $name = $this->getSubscriberName($subscriberId, $subscriberType); if (!in_array($name, $this->currentSubscribers)) { $this->currentSubscribers[] = $name; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resetCurrentSubscribers()\n {\n $this->currentSubscribers = [];\n }", "public function handleNewsletterSubscriberSave(Varien_Event_Observer $observer)\n {\n\t $helper = Mage::helper('connector');\n\t $subscriber = $observer->getEvent()->getSubscriber();\n\t $storeId = $subscriber->getStoreId();\n\t $email = $subscriber->getEmail();\n\t $subscriberStatus = $subscriber->getSubscriberStatus();\n\n $websiteId = Mage::app()->getStore($subscriber->getStoreId())->getWebsiteId();\n $contactEmail = Mage::getModel('email_connector/contact')->loadByCustomerEmail($email, $websiteId);\n\t try{\n\t // send new subscriber to an automation\n\t if (! Mage::getModel('newsletter/subscriber')->loadByEmail($email)->getId()) {\n\n\t\t $this->_postSubscriberToAutomation($email, $websiteId);\n\t }\n\n // only for subsribers\n if ($subscriberStatus == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED) {\n\n\t $client = Mage::helper('connector')->getWebsiteApiClient($websiteId);\n\n\t //check for website client\n\t if ($client) {\n\t\t //set contact as subscribed\n\t\t $contactEmail->setSubscriberStatus( $subscriberStatus )\n\t\t ->setIsSubscriber('1');\n\n\t\t $apiContact = $client->postContacts( $email );\n\n\t\t //resubscribe suppressed contacts\n\t\t if ( isset( $apiContact->status ) && $apiContact->status == 'Suppressed' ) {\n\t\t\t $client->postContactsResubscribe( $apiContact );\n\t\t }\n\t }\n\t // reset the subscriber as suppressed\n $contactEmail->setSuppressed(null);\n\n\t //not subscribed\n } else {\n\t //skip if contact is suppressed\n\t if ($contactEmail->getSuppressed())\n\t\t return $this;\n //update contact id for the subscriber\n $client = Mage::helper('connector')->getWebsiteApiClient($websiteId);\n\t //check for website client\n\t if ($client) {\n\t\t $contactId = $contactEmail->getContactId();\n\t\t //get the contact id\n\t\t if ( !$contactId ) {\n\t\t\t //if contact id is not set get the contact_id\n\t\t\t $result = $client->postContacts( $email );\n\t\t\t if ( isset( $result->id ) ) {\n\t\t\t\t $contactId = $result->id;\n\t\t\t } else {\n\t\t\t\t //no contact id skip\n\t\t\t\t $contactEmail->setSuppressed( '1' )\n\t\t\t\t ->save();\n\t\t\t\t return $this;\n\t\t\t }\n\t\t }\n\t\t //remove contact from address book\n\t\t $client->deleteAddressBookContact( $helper->getSubscriberAddressBook( $websiteId ), $contactId );\n\t }\n $contactEmail->setIsSubscriber(null)\n\t ->setSubscriberStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED);\n }\n\n\t //update the contact\n $contactEmail->setStoreId($storeId);\n\t if (isset($contactId))\n\t\t $contactEmail->setContactId($contactId);\n\t //update contact\n\t $contactEmail->save();\n\n }catch(Exception $e){\n Mage::logException($e);\n\t Mage::helper('connector')->getRaygunClient()->SendException($e, array(Mage::getBaseUrl('web')));\n }\n return $this;\n }", "protected function resolveAndSetDefaultSubscribers()\n {\n //Add requested by user as default subscriber\n if ($this->requestedByUser->id > 0)\n {\n NotificationSubscriberUtil::addSubscriber($this->requestedByUser, $this, false);\n }\n NotificationSubscriberUtil::addSubscriber($this->owner, $this, false);\n }", "private function subscribe()\n {\n $this->botman->hears('subscribe', function (BotMan $bot) {\n $userId = $bot->getUser()->getId();\n $user = Subscriber::where('telegram_user_id', $userId)->first();\n $userMsg = 'You are already subscribed';\n\n if(is_null($user))\n {\n Subscriber::create(['telegram_user_id' => $userId]);\n $userMsg = 'You have just subscribed to our updates!';\n }\n\n $bot->reply($userMsg);\n });\n }", "public function set_subscriber($email, $data = NULL);", "public function subscription();", "public function notify($users, $currentRecord = null)\n {\n \n }", "public function subscribe($subscriber);", "function addCurrentUserAsRecipient(){\n // $this->AddRecipient( SessionUser::getProperty(\"firstname\").\" \".SessionUser::getProperty(\"lastname\").\" <\".SessionUser::getProperty(\"username\").\"@\".SITE_EMAILDOMAIN.\">\" );\n $this->AddRecipient( SessionUser::getProperty(\"username\").\"@\".SITE_EMAILDOMAIN );\n }", "public function subscribe($subscriber): void;", "public function send_subscriptions(){\r\n //send email to all those who have subscribed to posts from this author\r\n\r\n }", "function it_exchange_paypal_pro_addon_update_subscriber_id( $paypal_pro_id, $subscriber_id ) {\n\t$transactions = it_exchange_paypal_pro_addon_get_transaction_id( $paypal_pro_id );\n\tforeach( $transactions as $transaction ) { //really only one\n\t\tdo_action( 'it_exchange_update_transaction_subscription_id', $transaction, $subscriber_id );\n\t}\n}", "function subscribe($entity){\n\t\tif($entity instanceof ElggUser){\n\t\t\treturn $entity->setMetaData('isSubscribedNewsletter',true);\n\t\t}else{\n\t\t\tregister_error(elgg_echo('vazco_newsletter:notanuser'));\n\t\t\treturn false;\n\t\t}\n\t}", "public function mailing_list_subscribe()\n\t{\n\t\t// get parameters for first name, last name and email\n\t\t$first_name = ee()->TMPL->fetch_param('first_name');\n\t\t$last_name = ee()->TMPL->fetch_param('last_name');\n\t\t$email = ee()->TMPL->fetch_param('email');\n\n\t\tif(empty($email))\n\t\t{\n\t\t\treturn;\n\t\t}\t\n\n\t\t$this->update_constant_contact('create', $email, $first_name, $last_name);\n\n\t}", "public function setSubscription($subscription) {\n\t\tif (WCF::getUser()->userID && $this->subscribed != $subscription) {\n\t\t\tif (!$subscription) {\n\t\t\t\t// delete notification\n\t\t\t\t$sql = \"DELETE FROM \twbb\".WBB_N.\"_thread_subscription\n\t\t\t\t\tWHERE\t\tuserID = \".WCF::getUser()->userID.\"\n\t\t\t\t\t\t\tAND threadID = \".$this->threadID;\n\t\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// add new notification\n\t\t\t\t$sql = \"INSERT INTO \twbb\".WBB_N.\"_thread_subscription\n\t\t\t\t\t\t\t(userID, threadID, enableNotification)\n\t\t\t\t\tVALUES\t\t(\".WCF::getUser()->userID.\", \".$this->threadID.\", \".WCF::getUser()->enableEmailNotification.\")\";\n\t\t\t\tWCF::getDB()->sendQuery($sql);\n\t\t\t}\n\t\t}\n\t}", "public function beforeSave($observer)\n {\n $model = $observer->getEvent()->getDataObject();\n\n $confirm = Mage::getStoreConfig('emailchef_newsletter/emailchef/require_subscription_confirmation');\n\n // If change is to subscribe, and confirmation required, set to confirmation pending\n if ($model->getStatus() == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED &&\n $confirm\n ) {\n // Always change the status\n $model->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNCONFIRMED);\n }\n\n // Check whether there is a status to change\n $origModel = Mage::getModel('newsletter/subscriber')->load($model->getId());\n if ($origModel->getStatus() == $model->getStatus()) {\n $model->setDoNotChangeSubscription(true);\n\n return;\n }\n }", "public function subscribeCustomer($customer)\n {\n //prüfen ob Magento Plugin aktiviert ist.\n if (!$this->helper->isMailingworkEnabled()) {\n return parent::subscribeCustomer($customer);\n }\n $this->loadByCustomer($customer);\n\n if ($customer->getImportMode()) {\n $this->setImportMode(true);\n }\n\n if (!$customer->getIsSubscribed() && !$this->getId()) {\n // If subscription flag not set or customer is not a subscriber\n // and no subscribe below\n return $this;\n }\n\n if(!$this->getId()) {\n $this->setSubscriberConfirmCode($this->randomSequence());\n }\n\n /*\n * Logical mismatch between customer registration confirmation code and customer password confirmation\n */\n $confirmation = null;\n if ($customer->isConfirmationRequired() && ($customer->getConfirmation() != $customer->getPassword())) {\n $confirmation = $customer->getConfirmation();\n }\n\n $sendInformationEmail = false;\n if ($customer->hasIsSubscribed()) {\n $status = $customer->getIsSubscribed()\n ? (!is_null($confirmation) ? self::STATUS_UNCONFIRMED : self::STATUS_SUBSCRIBED)\n : self::STATUS_UNSUBSCRIBED;\n /**\n * If subscription status has been changed then send email to the customer\n */\n if ($status != self::STATUS_UNCONFIRMED && $status != $this->getStatus()) {\n $sendInformationEmail = true;\n }\n } elseif (($this->getStatus() == self::STATUS_UNCONFIRMED) && (is_null($confirmation))) {\n $status = self::STATUS_SUBSCRIBED;\n $sendInformationEmail = true;\n } else {\n $status = ($this->getStatus() == self::STATUS_NOT_ACTIVE ? self::STATUS_UNSUBSCRIBED : $this->getStatus());\n }\n\n if($status != $this->getStatus()) {\n $this->setIsStatusChanged(true);\n }\n\n $this->setStatus($status);\n\n if(!$this->getId()) {\n $storeId = $customer->getStoreId();\n if ($customer->getStoreId() == 0) {\n $storeId = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId();\n }\n $this->setStoreId($storeId)\n ->setCustomerId($customer->getId())\n ->setEmail($customer->getEmail());\n } else {\n $this->setStoreId($customer->getStoreId())\n ->setEmail($customer->getEmail());\n }\n\n $sendSubscription = $customer->getData('sendSubscription') || $sendInformationEmail;\n if (is_null($sendSubscription) xor $sendSubscription) {\n if ($this->getIsStatusChanged() && $status == self::STATUS_UNSUBSCRIBED) {\n $result = $this->mwOptoutRecipient(true);\n } elseif ($this->getIsStatusChanged() && $status == self::STATUS_SUBSCRIBED) {\n $result = $this->mwOptinRecipient(true);\n }\n }\n\n $this->save();\n return $this;\n }", "private function subNotifiable()\n\t{\n\t\t// Load the \"akeebasubs\" plugins\n\t\tJLoader::import('joomla.plugin.helper');\n\t\tJPluginHelper::importPlugin('akeebasubs');\n\t\t$app = JFactory::getApplication();\n\t\t\n\t\t// We don't care to trigger plugins when certain fields change\n\t\t$ignoredFields = array(\n\t\t\t'notes', 'processor', 'processor_key', 'net_amount', 'tax_amount',\n\t\t\t'gross_amount', 'tax_percent', 'params', 'akeebasubs_coupon_id',\n\t\t\t'akeebasubs_upgrade_id', 'akeebasubs_affiliate_id',\n\t\t\t'affiliate_comission', 'akeebasubs_invoice_id', 'prediscount_amount',\n\t\t\t'discount_amount', 'contact_flag', 'first_contact', 'second_contact'\n\t\t);\n\t\t\n\t\t$info = array(\n\t\t\t'status'\t=>\t'unmodified',\n\t\t\t'previous'\t=> empty($this->_selfCache) ? null : $this->_selfCache,\n\t\t\t'current'\t=> clone $this,\n\t\t\t'modified'\t=> null\n\t\t);\n\t\t\n\t\tif(is_null($this->_selfCache) || !is_object($this->_selfCache)) {\n\t\t\t$info['status'] = 'new';\n\t\t\t$info['modified'] = clone $this;\n\t\t} else {\n\t\t\t$modified = array();\n\t\t\tforeach($this->_selfCache as $key => $value) {\n\t\t\t\t// Skip private fields\n\t\t\t\tif(substr($key,0,1) == '_') continue;\n\t\t\t\t// Skip ignored fileds\n\t\t\t\tif(in_array($key, $ignoredFields)) continue;\n\t\t\t\t// Check if the value has changed\n\t\t\t\tif($this->$key != $value) {\n\t\t\t\t\t$info['status'] = 'modified';\n\t\t\t\t\t$modified[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$info['modified'] = (object)$modified;\n\t\t}\n\t\t\n\t\tif($info['status'] != 'unmodified') {\n\t\t\t// Fire plugins (onAKSubscriptionChange) passing ourselves as a parameter\n\t\t\t$jResponse = $app->triggerEvent('onAKSubscriptionChange', array($this, $info));\n\t\t}\n\t\t\n\t\t$this->_selfCache = clone $this;\n\t\t\n\t\treturn true;\n\t}", "public function incscribe($subscribe_to) {\n\t\t$user_id=$this->Auth->user('id');\n\t\t$userstatrow=$this->Userstat->find('first',array('conditions'=>array('Userstat.user_id'=>$user_id),'contain'=>false,'fields'=>array('Userstat.id')));\n\t\tif($userstatrow!=NULL)\n\t\t{\n\t\t$this->Userstat->id=$userstatrow['Userstat']['id'];\n\t }else{\n\t\t$this->Userstat->id=NULL;\n\t\t}\n\t\t$subscribe=$this->Subscription->find('count',array('conditions'=>array('Subscription.subscriber_id'=>$user_id)));\n\t\t$this->request->data['Userstat']['user_id']=$user_id;\n\t\t$this->request->data['Userstat']['subscribe']=$subscribe;\n\t\tif($this->Userstat->save($this->request->data)){$this->potential($user_id);}\n\t\t//recoded ends\t\n\t\t//recoded begins for subscribeto of channel\n\t\t$userstatrow=$this->Userstat->find('first',array('conditions'=>array('Userstat.user_id'=>$subscribe_to),'contain'=>false,'fields'=>array('Userstat.id')));\n\t\tif($userstatrow!=NULL)\n\t\t{\n\t\t$this->Userstat->id=$userstatrow['Userstat']['id'];\n\t }else{\n\t\t$this->Userstat->id=NULL;\n\t\t}\n\t\t$this->request->data=NULL;\n\t\t$subscribeto=$this->Subscription->find('count',array('conditions'=>array('Subscription.subscriber_to_id'=>$subscribe_to)));\n\t\t$this->request->data['Userstat']['user_id']=$subscribe_to;\n\t\t$this->request->data['Userstat']['subscribeto']=$subscribeto;\n\t\tif($this->Userstat->save($this->request->data)){$this->potential($subscribe_to);}\n\t\t//recoded ends\t\n\t}", "protected function setSubject() {}", "function target_add_topic_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread_notify (user_id, thread_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['topic_id'] .')');\n}", "public function subscribe()\n\t{\n\n\t\t\t$this->data['user'] = $this->subscriber_m->get_new();\t\t\n\t\t//setup the form\n\t\t$rules=$this->subscriber_m->_rules_page;\n\t\t$this->form_validation->set_rules($rules);\n\t\t\n\t\t//process the form \n\t\tif($this->form_validation->run() == TRUE)\n\t\t{\n\t\t\t$data = $this->subscriber_m->array_from_post(array('semail'));\n\t\t\t$this->subscriber_m->save($data);\n//\t\t\tredirect('/');\n\t\t\t\n\t\t}\n\t\t//load SUBSCRIBER view\n\t\t$this->load->view('sidebar',$this->data);\n\t}", "function target_add_forum_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'forum_notify (user_id, forum_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['forum_id'] .')');\n}", "protected function removeRecipient()\n\t{\n\t\t$arrChannels = $this->Input->post('channels');\n\t\t$arrChannels = array_intersect($arrChannels, $this->nl_channels); // see #3240\n\n\t\t// Check the selection\n\t\tif (!is_array($arrChannels) || count($arrChannels) < 1)\n\t\t{\n\t\t\t$_SESSION['UNSUBSCRIBE_ERROR'] = $GLOBALS['TL_LANG']['ERR']['noChannels'];\n\t\t\t$this->reload();\n\t\t}\n\n\t\t$arrSubscriptions = array();\n\t\t\n\t\t$email = \\Idna::encodeEmail($this->Input->post('email', true));\n\t\t\n\t\t$subscriber = new Subscriber($email);\n\n\t\t// Get active subscriptions\n\t\t$objSubscription = $this->Database->prepare(\"SELECT pid FROM tl_newsletter_recipients WHERE email=? AND active=1\")\n\t\t\t\t\t\t\t\t\t\t ->execute($email);\n\n\t\tif ($objSubscription->numRows)\n\t\t{\n\t\t\t$arrSubscriptions = $objSubscription->fetchEach('pid');\n\t\t}\n\n\t\t$arrRemove = array_intersect($arrChannels, $arrSubscriptions);\n\n\t\t// Return if there are no subscriptions to remove\n\t\tif (!is_array($arrRemove) || count($arrRemove) < 1)\n\t\t{\n\t\t\t$_SESSION['UNSUBSCRIBE_ERROR'] = $GLOBALS['TL_LANG']['ERR']['unsubscribed'];\n\t\t\t$this->reload();\n\t\t}\n\n\t\t// check for cleverreach support\n\t\t$objChannel = $this->Database->execute(\"SELECT id FROM tl_newsletter_channel WHERE cleverreach_active = 1 AND id IN(\" . implode(',', array_map('intval', $arrRemove)) . \")\");\n\n\t\t// TODO: multiple channel unsubscription\n\t\t$subscriber->getByChannel($arrRemove[0]);\n\n\t\t// Remove subscriptions\n\t\t$subscriber->remove($arrRemove);\n\t\t\n\t\t// optional Cleverreach Deletion\n\t\tif($objChannel->numRows > 0)\n\t\t{\n\t\t\t$subscriber->removeFromCR($objChannel->fetchEach('id'));\n\t\t}\n\n\t\t// Get channels\n\t\t$objChannels = $this->Database->execute(\"SELECT title FROM tl_newsletter_channel WHERE id IN(\" . implode(',', array_map('intval', $arrRemove)) . \")\");\n\t\t$arrChannels = $objChannels->fetchEach('title');\n\n\t\t// HOOK: post unsubscribe callback\n\t\tif (isset($GLOBALS['TL_HOOKS']['removeRecipient']) && is_array($GLOBALS['TL_HOOKS']['removeRecipient']))\n\t\t{\n\t\t\tforeach ($GLOBALS['TL_HOOKS']['removeRecipient'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$this->{$callback[0]}->{$callback[1]}($varInput, $arrRemove);\n\t\t\t}\n\t\t}\n\n\t\tglobal $objPage;\n\n\t\t// Redirect to jumpTo page\n\t\tif (strlen($this->jumpTo) && $this->jumpTo != $objPage->id)\n\t\t{\n\t\t\t$objNextPage = $this->Database->prepare(\"SELECT id, alias FROM tl_page WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t\t ->execute($this->jumpTo);\n\n\t\t\tif ($objNextPage->numRows)\n\t\t\t{\n\t\t\t\t$this->redirect($this->generateFrontendUrl($objNextPage->fetchAssoc()));\n\t\t\t}\n\t\t}\n\n\t\tif($subscriber->sendUnSubscribeMail($arrRemove))\n\t\t{\n\t\t\t$this->reload();\n\t\t}\n\t}", "function hook_message_subscribe_get_subscribers_alter(&$uids, $values) {\n\n}", "function pgm_add_subscription( $subscriber_id, $list_id ) {\n\n // setup default return value\n $subscription_saved = false;\n\n // IF the subscriber does NOT have the current list subscription\n if( !pgm_subscriber_has_subscription( $subscriber_id, $list_id ) ){\n\n // get subscriptions and append new $list_id\n $subscriptions = pgm_get_subscriptions( $subscriber_id );\n $subscriptions[]=$list_id;\n\n // update pgm_subscriptions\n update_field( pgm_get_acf_key('pgm_subscriptions'), $subscriptions, $subscriber_id );\n\n // subscriptions updated!\n $subscription_saved = true;\n\n }\n\n // return result\n return $subscription_saved;\n\n}", "public function clearSubscribers();", "function set_subscriber($data, $oldId){\n $query = updateRecord(TAB_SUBSCRIBERS, $data, \"id = $oldId\");\n return $query;\n}", "function wpcf7_knews_subscription ($WPCF7_ContactForm) {\n\t\n\t$submission = WPCF7_Submission::get_instance();\n\t$posted_data =& $submission->get_posted_data();\t \n\n\tif(isset($posted_data['knews-subscription'])) {\n\n\t\t$email = $posted_data['email'];\n\t\t\n\t\t$id_list_news = $posted_data['knews-subscription'];\n\t\t$lang = ICL_LANGUAGE_CODE;\n\t\t$lang_locale = get_locale();\n\t\t\n\t\t$extra_fields = $posted_data;\n\t\t$custom_fields = array();\n\t\t\tforeach ($extra_fields as $field) {\n\t\t\t\t$custom_fields[1]=$posted_data['name'];\n\t\t\t\t$custom_fields[2]=$posted_data['surname'];\n\t\t\t}\n\t\n\t\t$bypass_confirmation = true;\n\t\t\n\t\tapply_filters('knews_add_user_db', 0, $email, $id_list_news, $lang, $lang_locale, $custom_fields, $bypass_confirmation);\n\t\t\t\n\t}\t\n}", "public function collectSubscribers();", "public function createSubscriber();", "function pdfbulletin_subscribers_form_submit($form, &$form_state) {\n $subscriptions = array();\n\n $emails = explode(\"\\n\", $form_state['values']['subscribers']);\n foreach ($emails as $email) {\n $email = trim($email);\n if (!empty($email) && valid_email_address($email)) {\n $subscriptions[$email] = $email;\n }\n }\n pdfbulletin_subscribers_save($form_state['values']['pdfbulletin']->nid, $subscriptions);\n drupal_set_message(t('Subscriptions saved'));\n}", "public function getNewSubscribersToFollow()\n {\n return $this->automation->subscribers()\n ->whereRaw(sprintf(table('subscribers') . '.id NOT IN (SELECT COALESCE(subscriber_id, 0) FROM %s WHERE auto_event_id = %s)', table('auto_triggers'), $this->id))\n ->where('subscribers.created_at', '>=', $this->created_at)\n ->whereRaw(sprintf(\"COALESCE(\" . table('subscribers.subscription_type') . \", '') <> %s\", db_quote(Subscriber::SUBSCRIPTION_TYPE_IMPORTED)))\n ->get();\n }", "public function defaultSubscription($user){\n\n $subscription = $user->subscriptions()->create([\n 'subscription_category_id' => SubscriptionCategory::where('subscription_category', 2)->first()->id,\n 'subscription_status_id' => SubscriptionStatus::where('status_code', 1)->first()->id\n ]);\n\n $this->setSubscriptionDetails($subscription);\n\n }", "public function setSubscriber($subscriber)\n {\n $this->subscriber = $subscriber;\n\n return $this;\n }", "public function activateRecipient($strEmail, $arrAdd, $arrCids)\n {\n global $objPage;\n\n if (!empty($arrAdd) && is_array($arrAdd) && !empty($arrCids) && is_array($arrCids))\n {\n foreach ($arrCids as $channelId)\n {\n $subscriberId = null;\n\n if (($objChannel = NewsletterChannelModel::findByPk($channelId)) !== null)\n {\n if ($objChannel->notifyOnSubscriptionActivation)\n {\n if (($objNotification = Notification::findByPk($objChannel->onSubscriptionActivationNotification)) !== null)\n {\n $subscriberId = null;\n\n // Fill newsletter channel token from tl_newsletter_channel\n $arrTokens = array();\n $arrRow = $objChannel->row();\n foreach ($arrRow as $k => $v)\n {\n $arrTokens['newsletter_' . $k] = html_entity_decode($v);\n }\n // Convert timestamp to date\n $arrTokens['newsletter_tstamp'] = Date::parse(Config::get('datimFormat'), $objChannel->tstamp);\n\n // Fill recipient token from tl_newsletter_recipients\n foreach ($arrAdd as $id)\n {\n if (($objSubscriber = NewsletterRecipientsModel::findByPk($id)) !== null)\n {\n if ($objSubscriber->pid === $objChannel->id)\n {\n $subscriberId = $objSubscriber->id;\n foreach ($objSubscriber->row() as $k => $v)\n {\n $arrTokens['recipient_' . $k] = html_entity_decode($v);\n }\n // Convert timestamps to date\n $arrTimestamps = array('tstamp', 'addedOn');\n foreach ($arrTimestamps as $k)\n {\n if ($arrTokens['recipient_' . $k] != '')\n {\n $arrTokens['recipient_' . $k] = Date::parse(Config::get('datimFormat'), $objSubscriber->{$k});\n }\n }\n }\n }\n }\n\n $blnSend = true;\n if ($objNotification !== null && ($objSubscriber = NewsletterRecipientsModel::findByPk($subscriberId) !== null))\n {\n // HOOK: add custom tokens\n if (isset($GLOBALS['TL_HOOKS']['beforeNotifyOnSubscriptionActivation']) && \\is_array($GLOBALS['TL_HOOKS']['beforeNotifyOnSubscriptionActivation']))\n {\n foreach ($GLOBALS['TL_HOOKS']['beforeNotifyOnSubscriptionActivation'] as $callback)\n {\n if ($blnSend)\n {\n $objHook = Controller::importStatic($callback[0]);\n // Pass $arrTokens by reference!\n $blnSend = $objHook->{$callback[1]}($arrTokens, $objSubscriber, $objChannel, $objNotification);\n }\n }\n }\n if ($blnSend)\n {\n $objNotification->send($arrTokens, $objPage->language);\n }\n }\n }\n }\n }\n }\n }\n }", "public function cronNotifyRecipients()\n\t{\n\t\t// Check if notifications should be send.\n\t\tif (!$GLOBALS['TL_CONFIG']['avisota_send_notification'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->loadLanguageFile('avisota_subscription');\n\n\t\t$entityManager = EntityHelper::getEntityManager();\n\t\t$subscriptionRepository = $entityManager->getRepository('Avisota\\Contao:RecipientSubscription');\n\t\t$intCountSend = 0;\n\n\t\t$resendDate = $GLOBALS['TL_CONFIG']['avisota_notification_time'] * 24 * 60 * 60;\n\t\t$now = time();\n\n\t\t// Get all recipients.\n\t\t$queryBuilder = EntityHelper::getEntityManager()->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t\t->select('r')\n\t\t\t\t->from('Avisota\\Contao:Recipient', 'r')\n\t\t\t\t->innerJoin('Avisota\\Contao:RecipientSubscription', 's', 'WITH', 's.recipient=r.id')\n\t\t\t\t->where('s.confirmed=0')\n\t\t\t\t->andWhere('s.reminderCount < ?1')\n\t\t\t\t->setParameter(1, $GLOBALS['TL_CONFIG']['avisota_notification_count']);\n\t\t$queryBuilder->orderBy('r.email');\n\t\t\n\t\t// Execute Query.\n\t\t$query = $queryBuilder->getQuery();\n\t\t$integratedRecipients = $query->getResult();\n\t\t\n\t\t// Check each recipient with open subscription.\n\t\tforeach ($integratedRecipients as $integratedRecipient)\n\t\t{\n\t\t\t$subscriptions = $subscriptionRepository->findBy(array('recipient' => $integratedRecipient->id, 'confirmed' => 0), array('updatedAt' => 'asc'));\n\t\t\t$tokens = array();\n\t\t\t$blnNotify = false;\n\n\t\t\tforeach ($subscriptions as $subscription)\n\t\t\t{\n\t\t\t\t// Check if we are over the $resendDate date.\n\t\t\t\tif (($subscription->updatedAt->getTimestamp() + $resendDate) > $now)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Set some data.\n\t\t\t\t$blnNotify = true;\n\t\t\t\t$tokens[] = $subscription->getToken();\n\n\t\t\t\t// Update the subscription.\n\t\t\t\t$subscription->updatedAt = new \\Datetime();\n\t\t\t\t$subscription->reminderSent = new \\Datetime();\n\t\t\t\t$subscription->reminderCount = $subscription->reminderCount + 1;\n\n\t\t\t\t// Save.\n\t\t\t\t$entityManager->persist($subscription);\n\t\t\t}\n\n\t\t\t// Check if we have to send a notify and if we have a subscription module.\n\t\t\tif ($blnNotify && $subscription->getSubscriptionModule())\n\t\t\t{\n\t\t\t\t$subscription = $subscriptions[0];\n\n\t\t\t\t$parameters = array(\n\t\t\t\t\t'email' => $integratedRecipient->email,\n\t\t\t\t\t'token' => implode(',', $tokens),\n\t\t\t\t);\n\n\t\t\t\t$arrPage = $this->Database\n\t\t\t\t\t\t->prepare('SELECT * FROM tl_page WHERE id = (SELECT avisota_form_target FROM tl_module WHERE id = ?)')\n\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t->execute($subscription->getSubscriptionModule())\n\t\t\t\t\t\t->fetchAssoc();\n\n\t\t\t\t$objNextPage = $this->getPageDetails($arrPage['id']);\n\t\t\t\t$strUrl = $this->generateFrontendUrl($objNextPage->row(), null, $objNextPage->rootLanguage);\n\n\t\t\t\t$url = $this->generateFrontendUrl($arrPage);\n\t\t\t\t$url .= (strpos($url, '?') === false ? '?' : '&');\n\t\t\t\t$url .= http_build_query($parameters);\n\n\t\t\t\t$newsletterData = array();\n\t\t\t\t$newsletterData['link'] = (object) array(\n\t\t\t\t\t\t\t'url' => \\Environment::getInstance()->base . $url,\n\t\t\t\t\t\t\t'text' => $GLOBALS['TL_LANG']['avisota_subscription']['confirmSubscription'],\n\t\t\t\t);\n\n\t\t\t\t// Try to send the email.\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->sendMessage($integratedRecipient, $GLOBALS['TL_CONFIG']['avisota_notification_mail'], $GLOBALS['TL_CONFIG']['avisota_default_transport'], $newsletterData);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exc)\n\t\t\t\t{\n\t\t\t\t\t$this->log(sprintf('Unable to send reminder to \"%s\" with error message - %s', $integratedRecipient->email, $exc->getMessage()), __CLASS__ . ' | ' . __FUNCTION__, TL_ERROR);\n\t\t\t\t}\n\n\t\t\t\t// Update recipient;\n\t\t\t\t$integratedRecipient->updatedAt = new \\DateTime();\n\n\t\t\t\t// Set counter.\n\t\t\t\t$intCountSend++;\n\t\t\t}\n\n\t\t\t// Send only 5 mails per run.\n\t\t\tif ($intCountSend >= 5)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$entityManager->flush();\n\t}", "public function subscribe($force = FALSE);", "public function surrender(){\n $_SESSION['message'] = 'Dealer wins';\n $this ->surrender = true;\n }", "public function afterSubscribeCustomerById(Subscriber $subscriberModel, $subscriber)\n {\n $this->updateSailthruSubscription($subscriber);\n return $subscriber;\n }", "public static function getActiveForThisApp() : Subscription\n {\n return self::getByDefaultCompany(Di::getDefault()->get('userData'));\n }", "function confirm_subscription_notification($subscriber_id=0,$sigup_form_id=0,$user_id=0,$to_email=\"\"){\n\t\t// Fetch sigup form data from database by subscription form ID\n\t\t$signup_array=$this->Signup_Model->get_signup_data(array('id'=>$sigup_form_id,'member_id'=>$user_id));\n\t\t$this->lang->load($signup_array[0]['form_language'], 'signup');\n\t\t// Fetch user data from database\n\t\t$user_data_array=$this->UserModel->get_user_data(array('member_id'=>$user_id));\n\t\t$vmta = $user_data_array[0]['vmta'];\n\t\t$from_email = (trim($signup_array[0]['from_email'])!=\"\")? $signup_array[0]['from_email'] : $user_data_array[0]['email_address'];\n\t\tif(trim($signup_array[0]['from_name'])!=\"\"){\n\t\t\t$from_name=$signup_array[0]['from_name'];\n\t\t}else{\n\t\t\t$from_name =($user_data_array[0]['company']!=\"\")? $user_data_array[0]['company']: $user_data_array[0]['member_username'];\n\t\t}\n\t\t// $user_info=array($from_name,$from_email,$subscriber_id,$to_email,$sigup_form_id,$signup_array[0]['confirmation_emai_message'],$signup_array[0]['subject'], $vmta);\n\t\t// $this->load->helper('transactional_notification');\n\t\t// create_transactional_notification(\"confirm_subscription\",$user_info);\n\n\n\t\t// Following Code updated on 20140912\n\t\t$encodedURLData = $this->is_authorized->base64UrlSafeEncode($subscriber_id.\"-\".$to_email.\"-\".$sigup_form_id);\n\t\t$link=site_url(\"subscription/verify_subscription/\".$encodedURLData);\n\n\t\tif(trim($signup_array[0]['confirmation_emai_message'])==\"\"){\n\t\t\t$confirmationMailBody = $this->lang->line('form_submit_email_content_1').\"\\r\\n\".\n$this->lang->line('form_submit_email_content_2').\"\\r\\n\\r\\n\n$link\n\t\t\t\t\t\t\t\\r\\n\\r\\n\n\".$this->lang->line('form_submit_email_content_3').\"\n\t\t\t\t\t\t\t\\r\\n\";\n\t\t}else{\n\t\t\t$confirmationMailBody = $signup_array[0]['confirmation_emai_message'].\"\\r\\n\\r\\n\n$link\n\t\t\t\t\t\t\\r\\n\\r\\n\t\";\n\t\t}\n\t\t\n\t\t$subject = ('' != trim($signup_array[0]['subject']))?trim($signup_array[0]['subject']):'Please Confirm Your Subscription';\n\n\n\t\t$this->load->helper('transactional_notification');\n\t\tsend_tmail_plain_text($to_email, $from_email, $from_name, $subject, $confirmationMailBody, $vmta);\n\t}", "protected function sendAlreadyVerifiedEmail($subscriber)\n\t{\n\t\t$data = [\n\t\t\t'full_name' => $subscriber->full_name(),\n\t\t];\n\t\tMail::queue('emails.already_verified', $data, function($message) use ($subscriber)\n\t\t{\n\t\t\t$message->to($subscriber->email, $subscriber->full_name())->subject('You are already subscribed to Awesome Newsletter');\n\t\t});\n\t}", "public function subscribes();", "protected function removeRecipient()\n\t{\n\t\t$arrChannels = $this->Input->post('channels');\n\n\t\t// Check selection\n\t\tif (!is_array($arrChannels) || count($arrChannels) < 1)\n\t\t{\n\t\t\t$_SESSION['UNSUBSCRIBE_ERROR'] = $GLOBALS['TL_LANG']['ERR']['noChannels'];\n\t\t\t$this->reload();\n\t\t}\n\n\t\t// Validate e-mail address\n\t\tif (!preg_match('/^\\w+([!#\\$%&\\'\\*\\+\\-\\/=\\?^_`\\.\\{\\|\\}~]*\\w+)*@\\w+([_\\.-]*\\w+)*\\.[a-z]{2,6}$/i', $this->Input->post('email', true)))\n\t\t{\n\t\t\t$_SESSION['UNSUBSCRIBE_ERROR'] = $GLOBALS['TL_LANG']['ERR']['email'];\n\t\t\t$this->reload();\n\t\t}\n\n\t\t$arrSubscriptions = array();\n\n\t\t// Get active subscriptions\n\t\t$objSubscription = $this->Database->prepare(\"SELECT pid FROM tl_newsletter_recipients WHERE email=? AND active=?\")\n\t\t\t\t\t\t\t\t\t\t ->execute($this->Input->post('email', true), 1);\n\n\t\tif ($objSubscription->numRows)\n\t\t{\n\t\t\t$arrSubscriptions = $objSubscription->fetchEach('pid');\n\t\t}\n\n\t\t$arrRemove = array_intersect($arrChannels, $arrSubscriptions);\n\n\t\t// Return if there are no subscriptions to remove\n\t\tif (!is_array($arrRemove) || count($arrRemove) < 1)\n\t\t{\n\t\t\t$_SESSION['UNSUBSCRIBE_ERROR'] = $GLOBALS['TL_LANG']['ERR']['unsubscribed'];\n\t\t\t$this->reload();\n\t\t}\n\n\t\t// Remove subscriptions\n\t\t$this->Database->prepare(\"DELETE FROM tl_newsletter_recipients WHERE email=? AND pid IN(\" . implode(',', $arrRemove) . \")\")\n\t\t\t\t\t ->execute($this->Input->post('email', true));\n\t\t\t\t\t \n\t\t// Remove member\n\t\t$arrRetain = array_diff($arrSubscriptions, $arrChannels);\n\t\tif (count($arrRetain))\n\t\t{\n\t\t\t$this->Database->prepare(\"UPDATE tl_member SET newsletter=? WHERE email=?\")->execute(serialize($arrRetain), $this->Input->post('email'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Delete only if member groups match\n\t\t\t$this->Database->prepare(\"DELETE FROM tl_member WHERE email=? AND groups=?\")->execute($this->Input->post('email'), $this->reg_groups);\n\t\t}\n\n\t\t// Confirmation e-mail\n\t\t$objEmail = new Email();\n\n\t\t// Get channels\n\t\t$objChannel = $this->Database->execute(\"SELECT title FROM tl_newsletter_channel WHERE id IN(\" . implode(',', $arrChannels) . \")\");\n\t\t\n\t\t// HOOK: post unsubscribe callback\n\t\tif (isset($GLOBALS['TL_HOOKS']['removeRecipient']) && is_array($GLOBALS['TL_HOOKS']['removeRecipient']))\n\t\t{\n\t\t\tforeach ($GLOBALS['TL_HOOKS']['removeRecipient'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$this->$callback[0]->$callback[1]($this->Input->post('email', true), $arrRemove, $objChannel->fetchEach('title'));\n\t\t\t}\n\t\t}\n\n\t\t$strText = str_replace('##domain##', $this->Environment->host, $this->nl_unsubscribe);\n\t\t$strText = str_replace(array('##channel##', '##channels##'), implode(\"\\n\", $objChannel->fetchEach('title')), $strText);\n\n\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t$objEmail->subject = sprintf($GLOBALS['TL_LANG']['MSC']['nl_subject'], $this->Environment->host);\n\t\t$objEmail->text = $strText;\n\n\t\t$objEmail->sendTo($this->Input->post('email', true));\n\t\tglobal $objPage;\n\n\t\t// Redirect to jumpTo page\n\t\tif (strlen($this->jumpTo) && $this->jumpTo != $objPage->id)\n\t\t{\n\t\t\t$objNextPage = $this->Database->prepare(\"SELECT id, alias FROM tl_page WHERE id=?\")\n\t\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t\t ->execute($this->jumpTo);\n\n\t\t\tif ($objNextPage->numRows)\n\t\t\t{\n\t\t\t\t$this->redirect($this->generateFrontendUrl($objNextPage->fetchAssoc()));\n\t\t\t}\n\t\t}\n\n\t\t$_SESSION['UNSUBSCRIBE_CONFIRM'] = $GLOBALS['TL_LANG']['MSC']['nl_removed'];\n\t\t$this->reload();\n\t}", "public function subscribers() {\n\n $output['subscribers'] = $this->Admin_model->get_subscriber();\n\n //If you have to display grocery crud in the content panel:\n\n $crud = new grocery_CRUD();\n $crud->set_table('subscribers');\n $crud->set_theme('bootstrap');\n $crud->set_subject('Feliratkozók');\n $crud->display_as(array(\n 'name' => 'Név',\n 'email' => 'E-mail',\n 'date' => 'Dátum',\n 'active' => 'Aktív',\n )\n );\n $output = $crud->render();\n $this->load->viewadmin('index', $output, FALSE, 1);\n\n }", "function subscribeUser()\n\t\t{\n\t\t\techo $this->email.\"add to the database !!\";\n\t\t}", "private function reassignUserSubscriptions($remembered_subscriptions, $to_user) {\n if($remembered_subscriptions) {\n $batch = new DBBatchInsert(TABLE_PREFIX . 'subscriptions', array('parent_type', 'parent_id', 'user_id', 'user_name', 'user_email'), 50, DBBatchInsert::REPLACE_RECORDS);\n\n $escaped_user_id = DB::escape($to_user->getId());\n $escaped_user_name = DB::escape($to_user->getDisplayName());\n $escaped_user_email = DB::escape($to_user->getEmail());\n\n foreach($remembered_subscriptions as $type => $ids) {\n $escaped_type = DB::escape($type);\n\n foreach($ids as $id) {\n $batch->insertEscapedArray(array($escaped_type, DB::escape($id), $escaped_user_id, $escaped_user_name, $escaped_user_email));\n } // foreach\n } // foreach\n\n $batch->done();\n } // if\n }", "public function getSubscriber()\n {\n return $this->subscriber;\n }", "public function __construct()\n\t{\n\t\t$this->type('subscriber');\n\t}", "function addOneTimeObserver($oSubscriber)\n\t\t{\n\t\t\t$query = \"insert into tbl_member set \n\t\t\tfirst_name='\".$oSubscriber->first_name.\"'\n\t\t\t,last_name='\".$oSubscriber->last_name.\"'\n\t\t\t,user_name='\".$oSubscriber->user_name.\"'\n\t\t\t,email='\".$oSubscriber->email.\"'\n\t\t\t,password=md5('\".$oSubscriber->password.\"')\n\t\t\t,member_type='observer'\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$query = \"insert into tbl_subscriber set \n\t\t\tsubscriber_id = '\".$newid.\"'\n\t\t\t,mail_street_address = '\".$oSubscriber->mail_address.\"'\n\t\t\t,mail_city = '\".$oSubscriber->mail_city.\"'\n\t\t\t,mail_state = '\".$oSubscriber->mail_state.\"'\n\t\t\t,mail_zip_code = '\".$oSubscriber->mail_postal_code.\"'\n\t\t\t,is_billing = '\".$oSubscriber->isBillingInfo.\"'\n\t\t\t,bill_street_address = '\".$oSubscriber->billingAddress.\"'\n\t\t\t,bill_city = '\".$oSubscriber->billingCity.\"'\n\t\t\t,bill_state = '\".$oSubscriber->billingState.\"'\n\t\t\t,bill_zip_code = '\".$oSubscriber->billingZipCode.\"'\n\t\t\t,prim_affiliate_id = '\".$oSubscriber->primary_afflliates.\"'\n\t\t\t,secondary_affiliates = '\".$oSubscriber->secondary_afflliates.\"'\";\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t\n\t\t\treturn $newid;\n\t\t}", "function addOneTimeSubscriber($oVisitor)\n\t\t{\n\t\t\t$query = \"insert into tbl_member set \n\t\t\tfirst_name='\".$oVisitor->first_name.\"'\n\t\t\t,last_name='\".$oVisitor->last_name.\"'\n\t\t\t,user_name='onetimesubscriber'\n\t\t\t,email='\".$oVisitor->email.\"'\n\t\t\t,password=md5('123456')\n\t\t\t,member_type='\".$oVisitor->member_type.\"'\n\t\t\t,isActive='n'\n\t\t\t,reg_date=now()\";\n\t\t\t\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$query = \"insert into tbl_subscriber set \n\t\t\tsubscriber_id = '\".$newid.\"'\n\t\t\t,mail_street_address = '\".$oVisitor->mail_address.\"'\n\t\t\t,mail_city = '\".$oVisitor->mail_city.\"'\n\t\t\t,mail_state = '\".$oVisitor->mail_state.\"'\n\t\t\t,mail_zip_code = '\".$oVisitor->mail_postal_code.\"'\n\t\t\t,is_address_changed = 'no'\";\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t\n\t\t\treturn $newid;\n\t\t}", "public function __construct(Subscriber $subscriber)\n {\n $this->subscriber = $subscriber;\n $this->url = Url::signedRoute('change-status-mail', ['subscriber' => $subscriber->id, 'status' => 'INACTIVE']);\n }", "public function subscribe();", "function setCurrentUserAsSender(){\n if( !SessionUser::isLoggedIn() ) return false;\n $this->From = SessionUser::getProperty(\"username\").\"@\".SITE_EMAILDOMAIN;\n $this->FromName = SessionUser::getProperty(\"firstname\").\" \".SessionUser::getProperty(\"lastname\").\" (\".SessionUser::getProperty(\"username\").\")\";\n }", "public function checkForListSubscription()\n {\n $now = Carbon::now();\n $subscribers = $this->getNewSubscribersToFollow();\n foreach($subscribers as $subscriber) {\n if ($now->gte($subscriber->created_at->copy()->modify($this->getDelayInterval()))) {\n $this->fire(collect([$subscriber]));\n }\n }\n }", "function subscribe() {\n\t\t\t\t\t\t //**Store the status to a global variable - debug purposes\n\t\t\t\t\t\t$GLOBALS['statusmsg'] = $GLOBALS['statusmsg'] . \"SUB-OK|\";\n\t\t\t\t}", "public function action_subscriptions()\n\t{\n\t\tglobal $context, $txt;\n\n\t\t// Load the paid template anyway.\n\t\ttheme()->getTemplates()->load('ManagePaid');\n\t\tTxt::load('ManagePaid');\n\n\t\t$memID = currentMemberID();\n\t\t$context['member']['id'] = $memID;\n\n\t\t// Load all of the subscriptions in the system (loads in to $context)\n\t\trequire_once(SUBSDIR . '/PaidSubscriptions.subs.php');\n\t\tloadSubscriptions();\n\n\t\t// Remove any invalid ones, ones not properly set up\n\t\t$this->_remove_invalid();\n\n\t\t// Work out what payment gateways are enabled.\n\t\t$this->_gateways = loadPaymentGateways();\n\t\tforeach ($this->_gateways as $id => $gateway)\n\t\t{\n\t\t\t$this->_gateways[$id] = new $gateway['display_class']();\n\n\t\t\tif (!$this->_gateways[$id]->gatewayEnabled())\n\t\t\t{\n\t\t\t\tunset($this->_gateways[$id]);\n\t\t\t}\n\t\t}\n\n\t\t// No gateways yet, no way to pay then, blame the admin !\n\t\tif (empty($this->_gateways))\n\t\t{\n\t\t\tthrow new Exception($txt['paid_admin_not_setup_gateway']);\n\t\t}\n\n\t\t// Get the members current subscriptions.\n\t\t$context['current'] = loadMemberSubscriptions($memID, $context['subscriptions']);\n\n\t\t// Find the active subscribed ones\n\t\tforeach ($context['current'] as $id => $current)\n\t\t{\n\t\t\tif ($current['status'] == 1)\n\t\t\t{\n\t\t\t\t$context['subscriptions'][$id]['subscribed'] = true;\n\t\t\t}\n\t\t}\n\n\t\t// Simple \"done\"?\n\t\tif (isset($this->_req->query->done))\n\t\t{\n\t\t\t$this->_orderDone($memID);\n\t\t}\n\t\t// They have selected a subscription to order.\n\t\telseif (isset($this->_req->query->confirm, $this->_req->post->sub_id) && is_array($this->_req->post->sub_id))\n\t\t{\n\t\t\t$this->_confirmOrder($memID);\n\t\t}\n\t\t// Show the users whats available and what they have\n\t\telse\n\t\t{\n\t\t\t$context['sub_template'] = 'user_subscription';\n\t\t}\n\t}", "public function subscribes()\r\n\r\n {\r\n\r\n return new Engine_ProxyObject($this, Engine_Api::_()->getDbtable('subscribes', 'core'));\r\n\r\n }", "public function subscriber()\n {\n return $this->belongsTo(\n __NAMESPACE__ . '\\Subscriber', 'subscriber_id', 'id'\n );\n }", "public function useRemoteSubscription()\n {\n return false;\n }", "public function newsletterUnsubscribe($observer)\n {\n $subscriber = $observer->getSubscriber();\n \n $result = Mage::getSingleton('extensions_store_constantcontact/constantcontact')->updateSubscriber($subscriber);\n \n return $observer; \n }", "public function setSubscription(array $data)\n {\n $returnValue = false;\n\n // check if subscription id exists\n if (!isset($data['id'])) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'ID must be set before attempting a save'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $data['id']\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription has properties update the changed one's\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n $createdTimePropertyUri = $this->_subscriptionConfig->get($this->_propertyMatching['created_time']);\n $data['created_time'] = $subscriptionResourceProperties[$createdTimePropertyUri][0]['content'];\n\n // get the current time\n $now = new Zend_Date;\n\n // if lease seconds is set to the subscription, calculate a new expiration time\n if (isset($data['lease_seconds'])) {\n $data['expiration_time'] = $now\n ->add($data['lease_seconds'], Zend_Date::SECOND)\n ->get('yyyy-MM-dd HH:mms');\n }\n\n // generate new add and delete statements from subscriber data array\n $statements = $this->_generateStatements(\n $subscriptionResourceUri,\n $data,\n $subscriptionResourceProperties\n );\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_UPDATE_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add and delete the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n $this->_selectedModelInstance->deleteMultipleStatements($statements['deleteStatements']);\n\n $returnValue = false;\n // if the subscription has now proberties only add the properties\n } else {\n // generate the add statements\n $statements = $this->_generateStatements($subscriptionResourceUri, $data);\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_ADD_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n\n $returnValue = true;\n }\n\n // end versioning\n $this->_versioning->endAction();\n\n return $returnValue;\n }", "public function status_subscription(){\n\t\t\treturn true;\n\t\t}", "public function notify()\n\t\t{\n\t\t\techo \"Notifying via YM\\n\";\n\t\t}", "function change_recipient() {\n\t\treturn \"[email protected]\";\n\t}", "protected function _actionEditsubscription( KCommandContext $context )\n {\n if( $subscription = $this->_subscriber->changeSubscriptionTo( $this->getItem() ) )\n {\n $subscription->endDate = $context->data->endDate;\n }\n }", "public function getSubscriberID()\n {\n return $this->subscriberID;\n }", "public function __construct() {\n notificationController::showNotificationAccordingToCurrentUser();\n }", "public function __construct()\n {\n $this->subscription = new Subscription();\n }", "public function setNewsSubscription( $blSubscribe, $blSendOptIn ){\n\t\t\t$blSuccess = parent::setNewsSubscription($blSubscribe, false);\n\t\t\t\n\t\t\tif($blSuccess){\n\t\t\t\n\t\t\t\t$api = new MCAPI(MC_APIKEY);\n\t\t\t\t$oSubscription = $this->getNewsSubscription();\n\n\t\t\t\tif($blSubscribe){\n\t\t\t\t\t$merge_vars = array('FNAME'=>$oSubscription->oxnewssubscribed__oxfname->value, 'LNAME'=>$oSubscription->oxnewssubscribed__oxlname->value);\t\t\t\n\t\t\t\t\t$retval = $api->listSubscribe( MC_LISTID, $oSubscription->oxnewssubscribed__oxemail->value, $merge_vars );\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$retval = $api->listUnsubscribe( MC_LISTID, $oSubscription->oxnewssubscribed__oxemail->value );\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\tif ($api->errorCode){\n\t\t\t\t\t//oxUtilsView::addErrorToDisplay('#'.$api->errorCode.': '.$api->errorMessage);\t\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $blSuccess;\n\t\t}", "function fanwood_dim_subscription () {\n\tif ( !bbp_is_subscriptions_active() )\n\t\treturn;\n\n\t$user_id = bbp_get_current_user_id();\n\t$id = intval( $_POST['id'] );\n\n\tif ( !current_user_can( 'edit_user', $user_id ) )\n\t\tdie( '-1' );\n\n\tif ( !$topic = bbp_get_topic( $id ) )\n\t\tdie( '0' );\n\n\tcheck_ajax_referer( \"toggle-subscription_$topic->ID\" );\n\n\tif ( bbp_is_user_subscribed( $user_id, $topic->ID ) ) {\n\t\tif ( bbp_remove_user_subscription( $user_id, $topic->ID ) )\n\t\t\tdie( '1' );\n\t} else {\n\t\tif ( bbp_add_user_subscription( $user_id, $topic->ID ) )\n\t\t\tdie( '1' );\n\t}\n\n\tdie( '0' );\n}", "public function subscribe(): void;", "function redirectSubs(){\n $ourUser = wp_get_current_user();\n if(count($ourUser->roles) == 1 AND $ourUser->roles[0] == 'subscriber') {\n wp_redirect(site_url('/'));\n exit;\n }\n}", "public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\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\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}", "public function notify() {}", "public function notify() {}", "public function notify() {}", "public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }", "public function subscribe()\n {\n $this->layout = \"ajax\";\n $this->autoRender = false; \n if(!$this->NewsletterSubscribe->hasAny(array('NewsletterSubscribe.subscribe_email_id'=>$this->request->data['NewsletterSubscribe']['subscribe_email_id']))){ \n if ($this->NewsletterSubscribe->save($this->request->data)) {\n echo \"success\";\n } else {\n echo \"failed\";\n }\n }\n else {\n echo 'already_exists'; \n }\n }", "private function subscribeUser()\n {\n try\n {\n $request = $_POST;\n\n $uid = userid();\n\n if (!$uid)\n throw_error_msg( lang(\"you_not_logged_in\") ) ;\n\n if( !isset($request['subscribed_to']) || $request['subscribed_to']==\"\" )\n throw_error_msg(\"subscribed to not provided\");\n\n if( !is_numeric($request['subscribed_to']) )\n throw_error_msg(\"invalid subscribed to\");\n\n global $userquery;\n $userquery->subscribe_user($request['subscribed_to']);\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'subscribed successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function Subscribe() {\n\t\t// Process pending messages if any\n\t\t$this->ProcessPendingMessages();\n\t\t// Subscribe\n\t\t$this->GetSubsConn()->subscribe(\n\t\t\t[$this->GetChannel()],\n\t\t\t[$this, 'SubscribeCallback']\n\t\t);\n\t}", "public function onKernelRequest()\n {\n if (!$this->tokenStorage->getToken()) {\n return;\n }\n\n $user = $this->tokenStorage->getToken()->getUser();\n $subscriptions = [];\n\n if ($this->authorizationChecker->isGranted('ROLE_CORE_SUBSCRIBE')) {\n /** @var $em EntityManager */\n $em = $this->doctrine->getManager();\n $subscriptions = $em->getRepository('EtuCoreBundle:Subscription')->findBy(['user' => $user]);\n }\n\n $this->globalAccessor->set('notifs', new ArrayCollection());\n $this->globalAccessor->get('notifs')->set('subscriptions', $subscriptions);\n $this->globalAccessor->get('notifs')->set('new', []);\n $this->globalAccessor->get('notifs')->set('new_count', 0);\n }", "function setNotify($notify) {\r\r\n\t\t$this->notify = $notify;\r\r\n\t}", "public function subscribe($subscriber)\n {\n if (is_string($subscriber)) {\n $Class = '\\\\'.$subscriber;\n $subscriber = new $Class($this->c);\n }\n $subscriber->subscribe($this);\n }", "public function subscriber()\n {\n return $this->conversation->leadClient;\n }", "public function newsletterSubscriberSaveAfter($observer)\n {\n $subscriber = $observer->getSubscriber();\n \n $result = Mage::getSingleton('extensions_store_constantcontact/constantcontact')->updateSubscriber($subscriber);\n \n return $observer;\n }", "public function subscribe(SubscriberInterface $subscriber);", "public function saveSubscription()\n {\n $email = $this->request->getParam('email');\n $jsonFactory = $this->jsonFactory->create();\n\n $subscribed_text = $this->helperData->getGeneralConfig(\"is_subscribed_text\");\n $thanksyou_text = $this->helperData->getGeneralConfig(\"thanksyou_text\");\n $confirm_text = $this->helperData->getGeneralConfig(\"confirm_text\");\n\n $subscribed_text = $subscribed_text ? $subscribed_text : __('This email address is already subscribed.');\n $thanksyou_text = $thanksyou_text ? $thanksyou_text : __('Thank you for your subscription.');\n $confirm_text = $confirm_text ? $confirm_text : __('The confirmation request has been sent.');\n\n try {\n $this->validateEmailFormat($email);\n $this->validateGuestSubscription();\n $this->validateEmailAvailable($email);\n\n $subscriber = $this->_subscriberFactory->create()->loadByEmail($email);\n if ($subscriber->getId()\n && $subscriber->getSubscriberStatus() == \\Magento\\Newsletter\\Model\\Subscriber::STATUS_SUBSCRIBED\n ) {\n $jsonData = [\n 'status' => 'error',\n 'message' => $subscribed_text\n ];\n\n return $jsonFactory->setData($jsonData);\n }\n\n $status = $this->_subscriberFactory->create()->subscribe($email);\n\n if ($status == \\Magento\\Newsletter\\Model\\Subscriber::STATUS_NOT_ACTIVE) {\n $jsonData = [\n 'status' => 'success',\n 'message' => $confirm_text\n ];\n } else {\n $jsonData = [\n 'status' => 'success',\n 'message' => $thanksyou_text\n ];\n }\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $jsonData = [\n 'status' => 'error',\n 'message' => __('There was a problem with the subscription: %1', $e->getMessage())\n ];\n } catch (\\Exception $e) {\n $jsonData = [\n 'status' => 'error',\n 'message' => __('Something went wrong with the subscription.')\n ];\n }\n\n return $jsonFactory->setData($jsonData);\n }", "public function customerRegisterSuccess($observer)\n{\n\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $customer = $observer->getEvent()->getCustomer();\n $fname=$customer->getFirstname();\n $lname=$customer->getLastname();\n $email= $customer->getEmail();\n\n $telephone= $customer->getAddressesCollection()->getFirstitem()->getTelephone();\n\n if ($telephone) {\n $text =$settings['customer_notification_message'];\n $text = str_replace('{{firstname}}', $fname, $text);\n $text = str_replace('{{lastname}}', $lname, $text);\n $text = str_replace('{{emailid}}', $email, $text);\n }\n \n array_push($settings['order_noficication_recipients'], $telephone);\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n return;\n}", "function simplenews_subscription_activate($snids, $status) {\n foreach (simplenews_subscriber_load_multiple($snids) as $subscriber) {\n $subscriber->activated = $status;\n simplenews_subscriber_save($subscriber);\n }\n}", "public function customerProductReview($observer)\n{ \n \n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $fname=$customer->getFirstname();\n $lname=$customer->getLastname();\n $email= $customer->getEmail();\n\n $telephone= $customer->getAddressesCollection()->getFirstitem()->getTelephone();\n if ($telephone){\n $text = Mage::getStoreConfig('smsnotifications/customer_notification/customer_review');\n $text = str_replace('{{firstname}}', $fname, $text);\n $text = str_replace('{{lastname}}', $lname, $text);\n $text = str_replace('{{emailid}}', $email, $text);\n // $text = str_replace('{{name}}', $customer_name, $text);\n }\n array_push($settings['order_noficication_recipients'], $telephone);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n return($result);\n}", "public function getSubscriberId()\n {\n return $this->getAttribute('subscriber_id', '', 'subscriber');\n }", "public function setsubscribableAction()\n {\n \n }", "public function getSubscriber()\n {\n return UserPeer::retrieveByPk($this->getSubscriberId());\n }", "public function subscribe()\n {\n $payload = request()->validate([\n 'topics' => 'required|array',\n 'callback' => 'required|url',\n ]);\n\n $topics = array_map(function ($topic) {\n return $this->topics->findOrCreate($topic);\n }, $payload['topics']);\n\n abort_unless(! empty($topics), 404);\n\n $subscriber = $this->subscribers->create($topics, $payload);\n\n }", "private function link_user_with_parent_subscription( $data ){\n $owner_subscription = pms_get_member_subscription( $data['subscription_id'] );\n\n $subscription_data = array(\n 'user_id' => $data['user_id'],\n 'subscription_plan_id' => $owner_subscription->subscription_plan_id,\n 'start_date' => $owner_subscription->start_date,\n 'expiration_date' => $owner_subscription->expiration_date,\n 'status' => 'active',\n );\n\n $subscription = new PMS_Member_Subscription();\n $subscription->insert( $subscription_data );\n\n pms_add_member_subscription_meta( $subscription->id, 'pms_group_subscription_owner', $owner_subscription->id );\n pms_add_member_subscription_meta( $owner_subscription->id, 'pms_group_subscription_member', $subscription->id );\n\n $meta_id = pms_gm_get_meta_id_by_value( $owner_subscription->id, $data['email'] );\n\n pms_delete_member_subscription_meta( $owner_subscription->id, 'pms_gm_invited_emails_' . $meta_id, $data['pms_key'] );\n pms_delete_member_subscription_meta( $owner_subscription->id, 'pms_gm_invited_emails', $data['email'] );\n\n if( function_exists( 'pms_add_member_subscription_log' ) )\n pms_add_member_subscription_log( $subscription->id, 'group_user_accepted_invite' );\n }", "public function admin_subscribeList()\n {\n \tif (!$this->request->is('ajax')) {\n $this->Session->delete('direction');\n $this->Session->delete('sort');\n }\n $this->layout = 'admin';\n $perpage = $this->Functions->get_param('perpage', Configure::read('PER_PAGE'), true);\n $page = $this->Functions->get_param('page', Configure::read('PAGE_NO'), false);\n $counter = (($page - 1) * $perpage) + 1;\n $this->set('counter', $counter);\n\n $search = $this->Functions->get_param('search');\n $this->Functions->set_param('direction'); \n $this->Functions->set_param('sort');\n if ($this->Session->read('sort') != '') {\n $this->paginate['NewsletterSubscribe']['order'] = array($this->Session->read('sort') => $this->Session->read('direction'));\n }else{\n $this->paginate['NewsletterSubscribe']['order']=array('modified'=>'desc');\n }\n $this->paginate['NewsletterSubscribe']['limit'] = $perpage;\n $this->paginate['NewsletterSubscribe']['order']=array('NewsletterSubscribe.id'=>'desc');\n if ($search != '') {\n $this->paginate['NewsletterSubscribe']['conditions'] = array(\n 'NewsletterSubscribe.subscribe_email_id LIKE' => '%' . $search . '%'\n );\n }\n $this->set('subscribers', $this->paginate('NewsletterSubscribe'));\n if ($this->request->is('ajax')) {\n $this->layout = false;\n $this->set('perpage', $perpage);\n $this->set('search', $search);\n $this->render('admin_subscriber_ajax_list'); // View, Layout\n }\n }", "function pgm_subscriber_has_subscription($subscriber_id, $list_id){\n //set default value\n $has_subscription = false;\n\n //get the subscriber from database\n $subscriber = get_post($subscriber_id);\n\n //get subscriptions from database\n $subscriptions = pgm_get_subscriptions($subscriber_id);\n\n //check subscriptions for $list_id\n if(in_array($list_id,$subscriptions)){\n\n $has_subscription = true;\n } else{\n\n //leave to default\n }\n\n return $has_subscription;\n}", "static public function setSendAsNewsletter()\n\t{\n\t\tself::$_sendAsNewsletter = true;\n\t}" ]
[ "0.6496588", "0.6040308", "0.60049266", "0.59243274", "0.5764261", "0.56419426", "0.5605907", "0.5589706", "0.5532604", "0.55096465", "0.5497363", "0.5495481", "0.5483476", "0.54548377", "0.5436061", "0.5420629", "0.539221", "0.53873396", "0.53779703", "0.53280306", "0.5326091", "0.5322713", "0.53188366", "0.5309459", "0.5303699", "0.52847624", "0.52409816", "0.5240816", "0.52380806", "0.5237765", "0.52096045", "0.519916", "0.5198281", "0.5197035", "0.5178658", "0.517669", "0.51736087", "0.5161744", "0.515979", "0.51567423", "0.51514786", "0.5148155", "0.51186156", "0.5105584", "0.5097241", "0.50969315", "0.5083002", "0.50793815", "0.5070162", "0.50633174", "0.5058058", "0.5050485", "0.50464785", "0.50422245", "0.50402284", "0.5037991", "0.50330335", "0.50287193", "0.50237024", "0.5017867", "0.50146437", "0.5014304", "0.50075334", "0.49766168", "0.49615055", "0.49581328", "0.4953028", "0.4946063", "0.494303", "0.49427402", "0.4935788", "0.49322304", "0.49240986", "0.49215674", "0.49093217", "0.49006674", "0.49006674", "0.49006674", "0.48965213", "0.48892936", "0.48890662", "0.48887515", "0.4888697", "0.4882028", "0.48804396", "0.48781422", "0.48728937", "0.48716336", "0.4869102", "0.48612326", "0.485537", "0.48547432", "0.48536462", "0.48501676", "0.4834148", "0.4830091", "0.48280776", "0.4825891", "0.48253277", "0.48198253" ]
0.52270067
30
Reset current subscriber list
public function resetCurrentSubscribers() { $this->currentSubscribers = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearSubscribers();", "public static function reset(): void\n {\n self::$subjectNames = null;\n }", "public function reset()\n {\n $this->values[self::_SYS_MAIL_LIST] = array();\n }", "public function reset()\n {\n $this->_contacts = [];\n $this->_lists = [];\n }", "public function reset()\n {\n $this->values[self::SUBSCRIPTION_ID] = null;\n $this->values[self::PROCESSED_EVENT_IDS] = [];\n }", "public function clearTopicSubscriptions()\n {\n $this->topicSubscriptions->clear();\n }", "public function reset()\n {\n $this->messages = [];\n }", "public function reset() {\n\t\t$this->registered = array();\n\t}", "public function reset()\n {\n $this->values[self::_MEMBERS] = array();\n $this->values[self::_ITEMS] = array();\n }", "public function reset() {\n\t\t\t$this->arList = NULL; \t\n\t\t}", "public function removeSubscribes();", "public function unSubscribe()\n {\n }", "public function clearForumSubscriptions()\n {\n $this->forumSubscriptions->clear();\n }", "public function ajaxresetsubscribersAction()\n {\n $num = Mage::getResourceModel('ddg_automation/contact')->resetSubscribers();\n $message = array('reseted' => $num);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($message));\n }", "public function clearTopics()\n {\n $this->collTopics = null; // important to set this to NULL since that means it is uninitialized\n }", "public function reset()\n {\n $this->values[self::_GUILD_MEMBER] = array();\n }", "public function reset(): void\n {\n $this->set([]);\n }", "protected function resetSynchronised()\n {\n /*\n * Lists\n */\n\n /** @var $lists Laposta_Connect_Model_Mysql4_List_Collection */\n $lists = Mage::getModel('lapostaconnect/list')->getCollection();\n\n /** @var $list Laposta_Connect_Model_List */\n foreach ($lists as $list) {\n $list->setLapostaId('');\n $list->setWebhookToken('');\n $list->setSyncTime(null);\n }\n\n $lists->save();\n\n Mage::helper('lapostaconnect')->log('Lists reset OK.');\n\n /*\n * Fields\n */\n\n $fields = Mage::getModel('lapostaconnect/field')->getCollection();\n\n /** @var $field Laposta_Connect_Model_Field */\n foreach ($fields as $field) {\n $field->setLapostaId('');\n $field->setLapostaTag('');\n $field->setSyncTime(null);\n }\n\n $fields->save();\n\n Mage::helper('lapostaconnect')->log('Fields reset OK.');\n\n /*\n * Subscribers\n */\n\n /** @var $subscribers Laposta_Connect_Model_Mysql4_Subscriber_Collection */\n $subscribers = Mage::getModel('lapostaconnect/subscriber')->getCollection();\n\n /** @var $subscriber Laposta_Connect_Model_Subscriber */\n foreach ($subscribers as $subscriber) {\n $subscriber->setLapostaId('');\n $subscriber->setSyncTime(null);\n }\n\n $subscribers->save();\n\n Mage::helper('lapostaconnect')->log('Subscribers reset OK.');\n }", "public function reset(): void\n {\n $this->_add = new SplObjectStorage();\n $this->_delete = new SplObjectStorage();\n }", "public function unSubscribe()\n {\n $this->disconnect();\n $this->queue = $this->currentEnvelope = null;\n }", "public function reset()\n {\n $this->values[self::_ITEM_ID] = null;\n $this->values[self::_RECEIVER_NAME] = null;\n $this->values[self::_SEND_TIME] = null;\n $this->values[self::_SENDER_NAME] = null;\n }", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_ACCESSORY] = null;\n }", "public function LoadList()\n {\n $this->SetCulture();\n $this->subscriptions_list = $this->GetSubscriptionsList();\n }", "public function reset()\n {\n // don't start a new session to remove something that isn't there\n $this->lazyStart();\n $this->_store = array();\n }", "public function resetLookupCollections()\n\t{\n\t\t$this->lookupCollections[] = null;\n\t}", "public function reset()\n {\n $this->values[self::_USERS] = array();\n $this->values[self::_HIRE_UIDS] = array();\n $this->values[self::_FROM] = null;\n }", "public function reset()\n {\n $this->values[self::_CHAT_BLACKLIST_USER] = array();\n }", "public function clearAuditorias()\n\t{\n\t\t$this->collAuditorias = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }", "public function reset()\n {\n $this->values[self::_LADDER_NOTIFY] = null;\n $this->values[self::_NEW_MAIL] = null;\n $this->values[self::_GUILD_CHAT] = null;\n $this->values[self::_ACTIVITY_NOTIFY] = null;\n $this->values[self::_ACTIVITY_REWARD] = null;\n $this->values[self::_RELEASE_HEROES] = array();\n $this->values[self::_EXCAV_RECORD] = null;\n $this->values[self::_GUILD_DROP] = null;\n $this->values[self::_PERSONAL_CHAT] = null;\n $this->values[self::_SPLITABLE_HEROES] = null;\n }", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::promotions] = array();\n }", "public function reset()\n {\n $this->from = [];\n $this->to = [];\n $this->subject = null;\n $this->body = null;\n $this->html = true;\n }", "public function clear()\n {\n $this->messages = [];\n }", "public function resetList()\n {\n $this->_currentPage = null;\n $this->_listSize = null;\n $this->_asAssoc = false;\n $this->_assocKey = null;\n $this->_assocValue = null;\n $this->_excludeIds = null;\n $this->_includeIds = null;\n $this->_listSize = null;\n $this->_membersRole = null;\n $this->_membersStatus = null;\n $this->_order = null;\n $this->clearWhere();\n return $this;\n }", "public function clear(): void\n {\n $this->messages = [];\n }", "public function clear()\n {\n $this->items = array();\n }", "public function reset(): void\n {\n $this->data = [];\n }", "public function reset()\n {\n $this->values[self::_ITEM_IDS] = array();\n $this->values[self::_NEW_HEROES] = array();\n $this->values[self::_SMASH_IDX] = array();\n }", "public function clearRecipients()\n {\n $this->to = [];\n $this->cc = [];\n $this->bcc = [];\n $this->replyTo = [];\n }", "function clear() {\n\t\t\t$this->items = [];\n\t\t}", "public function resetCountrys()\n {\n $this->countrys = new ArrayCollection();\n $this->hasRestrictedCountries = null;\n }", "public function tearDown() {\n $this->subscriber = null;\n }", "public function reset()\n {\n $this->data = array();\n }", "public function clearBiblioTopics()\n {\n $this->collBiblioTopics = null; // important to set this to NULL since that means it is uninitialized\n }", "function clear()\r\n {\r\n $this->items=array();\r\n }", "public function reset()\n\t{\n\t\t$this->get(1);\n\t}", "public function unsubscribe(): void;", "function Reset()\n\t{\t$this->details = array();\n\t\t$this->courses = array();\n\t\t$this->id = 0;\n\t}", "public function reset() {\n $this->customurlscount = 0;\n }", "public function reset(){}", "public function clear()\n {\n $this->items = array();\n $this->itemsCount = 0;\n }", "public static function cleanAllLists() {\r\n \tself::$list=array();\r\n }", "public function reset()\n {\n $this->values[self::sku_arr] = array();\n $this->values[self::pagination] = null;\n }", "public function clear()\n\t{\n\t\t$this->items = [];\n\t}", "public function reset()\n {\n $this->currentUser->saveLastArticleTime(0);\n }", "function clearAllRecipients() {\n\t\t$this->setRecipients(array());\n\t\t$this->setCcs(array());\n\t\t$this->setBccs(array());\n\t}", "public function reset()\n {\n $this->values[self::user_id] = null;\n $this->values[self::list_type] = null;\n $this->values[self::page] = null;\n $this->values[self::page_size] = null;\n }", "public function reset() {\n foreach ($this->syncedProperties as $property) {\n unset($this->data[$property]);\n }\n\n if (session_id()) {\n unset($_SESSION[self::SESSION_KEY]);\n }\n }", "protected function reset() {\n\t\t$this->data = array();\n\t}", "public function clear()\n {\n $this->links = [];\n }", "public function reset()\n {\n $this->cartItems = [];\n }", "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 }", "function Clear()\r\n {\r\n $this->_items = array();\r\n }", "public function reset()\n {\n $this->values[self::GROUP_ID] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "public function reset()\n {\n $this->values[self::_RANK_LIST] = array();\n }", "public function clearAllRecipients()\n {\n }", "public function reset()\n {\n $this->values[self::MESSAGE] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "public function Clear()\n {\n $this->items = array();\n }", "public function clearMemberReferrals()\n\t{\n\t\t$this->collMemberReferrals = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function clearUserDemoss()\n {\n $this->collUserDemoss = null; // important to set this to NULL since that means it is uninitialized\n }", "public function reset()\n {\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_SPEAKER_UID] = null;\n $this->values[self::_SPEAKER_SUMMARY] = null;\n $this->values[self::_TARGET_UID] = null;\n $this->values[self::_TARGET_SUMMARY] = null;\n $this->values[self::_SPEAKER_POST] = null;\n $this->values[self::_SPEAK_TIME] = null;\n $this->values[self::_CONTENT_TYPE] = null;\n $this->values[self::_CONTENT] = null;\n }", "public function reset() {\n $this->folders = 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 function reset();", "public function reset();", "public static function reset(): void\n {\n self::$defined = null;\n self::$isChannel = false;\n }", "public function reset() {}", "public function reset() {}", "public function reset() {}", "function sf_rebuild_subscriptions()\n{\n\tglobal $wpdb;\n\n\t# Build a list of users with subscribe set\n\t$users = $wpdb->get_col(\"SELECT user_id FROM \".SFUSERMETA.\" WHERE meta_key='\".$wpdb->prefix.\"sfsubscribe'\");\n\tif($users)\n\t{\n\t\t# clear out the old sfsubcribe values ready for the new\n\t\t$wpdb->query(\"DELETE FROM \".SFUSERMETA.\" WHERE meta_key='\".$wpdb->prefix.\"sfsubscribe'\");\n\n\t\tforeach($users as $user)\n\t\t{\n\t\t\t# now build the list of topics into which each user has posted\n\t\t\t$topics = $wpdb->get_col(\"SELECT DISTINCT topic_id FROM \".SFPOSTS.\" WHERE user_id=\".$user);\n\t\t\tif($topics)\n\t\t\t{\n\t\t\t\tforeach($topics as $topic)\n\t\t\t\t{\n\t\t\t\t\tsf_save_subscription($topic, $user, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn;\n}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function flush(): void\n {\n $this->list = [];\n }", "public function clearCCs()\n {\n foreach ($this->cc as $cc) {\n unset($this->all_recipients[strtolower($cc[0])]);\n }\n $this->cc = array();\n $this->clearQueuedAddresses('cc');\n }", "public function reset()\n {\n $this->values[self::_SAY] = null;\n $this->values[self::_FRESH] = null;\n $this->values[self::_FETCH] = null;\n $this->values[self::_CHAT_ADD_BL] = null;\n $this->values[self::_CHAT_DEL_BL] = null;\n $this->values[self::_CHAT_BLACKLIST] = null;\n $this->values[self::_CHAT_BORAD_SAY] = null;\n }" ]
[ "0.7727141", "0.6813812", "0.68128675", "0.67984444", "0.6625125", "0.6454503", "0.6441615", "0.6439703", "0.64239144", "0.64027786", "0.6384784", "0.6304869", "0.6292801", "0.61260736", "0.612118", "0.61081964", "0.6086308", "0.6083359", "0.6043418", "0.6026881", "0.6019895", "0.5992211", "0.59681123", "0.5944479", "0.59260416", "0.5911352", "0.5901926", "0.5899068", "0.5884424", "0.58822757", "0.5864129", "0.5838375", "0.5832336", "0.5831065", "0.582898", "0.5809618", "0.5806424", "0.5806345", "0.57920647", "0.57915103", "0.5779178", "0.57785225", "0.57715976", "0.5760874", "0.575874", "0.575669", "0.5744134", "0.5742633", "0.5736457", "0.57308376", "0.5724926", "0.57245964", "0.57192874", "0.57186294", "0.5716902", "0.57005876", "0.5697747", "0.5694168", "0.56935555", "0.56876856", "0.568345", "0.5678527", "0.5676933", "0.567238", "0.5669254", "0.5666448", "0.5659328", "0.56584096", "0.5645853", "0.5639701", "0.5635543", "0.56354743", "0.56328636", "0.5631633", "0.5631633", "0.5631633", "0.5631633", "0.5631633", "0.5631633", "0.5631633", "0.5631633", "0.5631633", "0.5631633", "0.5631633", "0.5631633", "0.5626468", "0.5624526", "0.5624526", "0.5624526", "0.5624366", "0.5624154", "0.5624154", "0.5624154", "0.5624154", "0.5624154", "0.5624154", "0.5624154", "0.56238854", "0.5613543", "0.56075406" ]
0.85216767
0
Get channel identifier from input parameters
public function getChanId($resourceType, $resourceId) { return $resourceType . ':' . $resourceId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getChannelId() {\n $event = $this->getEvent();\n\n if (isset($event['channel'])) {\n return $event['channel'];\n }\n\n return $event['channel_id'];\n }", "public function getChannelId()\n {\n return $this->channel_id;\n }", "public function getChannel()\n {\n $value = $this->get(self::channel);\n return $value === null ? (integer)$value : $value;\n }", "public function getChannelId(): Snowflake\n {\n return $this->channel_id;\n }", "public function getSalesChannelId();", "function get_channel_id($entry_id)\n\t{\t\n\t\t$this->EE->db->select('channel_id');\n\t\t$this->EE->db->where('entry_id', $entry_id);\n\t\t$query = $this->EE->db->get('channel_titles');\n\t\t$row = $query->row();\n\t\t\n\t\treturn ($row ? $row->channel_id : '');\n\t}", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public static function getChannel()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"channel\"])) ? $config[\"log\"][\"channel\"] : \"Amarki\";\n }", "public function getChannel(): string {\n\t\t\treturn $this->channel;\n\t\t}", "public function getChannel();", "public function getChannel()\n {\n return $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel;\n }", "public function getChannelId($channel_name)\n {\n $query=\"select channel_id\n from channel\n where channel_name= '\".$_POST['channel_name'].\"'\";\n if(($result=$this->db->CustomQuery($query))!=null)\n {\n return $result;\n }\n $this->LastMsg.\"Channel name not found <br>\";\n return false;\n }", "public function getChannel($identifier)\n {\n $query = Channel::with('category', 'display');\n\n if( is_numeric( $identifier ) ) {\n $query->where('id', $identifier);\n }\n else {\n $query->where('sef_name', $identifier);\n }\n\n return $query->first();\n }", "abstract public function getChannel($additionalInformation);", "public function getChannel()\n {\n \treturn $this->_channel;\n }", "public function getChannel()\n\t{\n\t\treturn $this->channel;\n\t}", "private function getChannelId($channelName)\n {\n if ( $channelName == null ) {\n $channelName = $this->defaultChannelName;\n }\n $this->debug(__METHOD__ . \" $channelName\");\n // Check if the channel ID can be parsed as JSON\n $decoded = json_decode($channelName);\n if (is_object($decoded) && isset($decoded->channel_id)) {\n $this->debug(\"return decoded\");\n return $decoded->channel_id;\n }\n\n // If the channel name starts with a '.', use the rest of the string as the channel ID\n if (substr($channelName, 0, 1) == '.') {\n return substr($channelName, 1);\n }\n\n try {\n $response = $this->client->request('GET', 'conversations.list', [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $this->slackToken,\n ],\n ]);\n\n $responseBody = json_decode($response->getBody(), true);\n if ($responseBody['ok']) {\n foreach ($responseBody['channels'] as $channel) {\n if ($channel['name'] == $channelName) {\n return $channel['id'];\n }\n }\n } else {\n throw new \\Exception($responseBody['error']);\n }\n\n // If the channel was not found, return null\n return null;\n } catch (GuzzleException $e) {\n throw new \\Exception($e->getMessage());\n }\n }", "public function getChannelCode()\n {\n return $this->data['fields']['channel_code'];\n }", "public function getChannel()\n {\n if (is_null($this->channel)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_CHANNEL);\n if (is_null($data)) {\n return null;\n }\n\n $this->channel = ChannelResourceIdentifierModel::of($data);\n }\n\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function generateChannel(){\n\t\t$tempArray = array();\n\t\tpreg_match('/\\+(.*?)@/', $this->recipient, $tempArray);\n\t\t$this->channel = $tempArray[1];\n\t}", "private function _getRequestChannel() {\n $td = Request::get('token_data');\n if(isset($td['type']) && $td['type'] == 'channel') {\n return Channel::where('id', $td['channel_id'])->first();\n } else {\n if(!Request::input('channel')) {\n return Response::json([\n 'error' => 'invalid_input',\n 'error_description' => 'No channel specified'\n ], 400);\n }\n\n $uid = Request::input('channel');\n $channel = Channel::where('user_id', Auth::user()->id)->where('uid', $uid)->first();\n if(!$channel)\n return Response::json([\n 'error' => 'not_found',\n 'error_description' => 'Channel not found'\n ], 404);\n else\n return $channel;\n }\n }", "public function getSubchannelId()\n {\n return $this->subchannelId;\n }", "function channelInfo()\n\t{\n\t\treturn $this->_channel;\n\t}", "public function getChannel() {\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public static function getChannelID\n\t(\n\t\t$channel\t\t// <str> The channel (hashtag) to get the channel ID of.\n\t)\t\t\t\t\t// RETURNS <int> the ID of the resulting channel, or 0 on failure.\n\t\n\t// $channelID = AppChat::getChannelID($channel);\n\t{\n\t\treturn (int) Database::selectValue(\"SELECT id FROM chat_channels WHERE channel=? LIMIT 1\", array($channel));\n\t}", "public function getChannel()\n {\n return $this->getData(self::CHANNEL);\n }", "public function getChannelById($id);", "public function id($username)\n {\n $id = $this->_client->processChannelId($username);\n\n if ($id) {\n $this->info(__('ID: {0}', $id));\n } else {\n $this->info(__('The ID or Username is not correct.'));\n }\n\n return $id;\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel($storeId = null);", "public function channel()\n\t{\n\t\treturn $this->xml->channel;\n\t}", "function ts3client_getChannelVariableAsString($serverConnectionHandlerID, $channelID, $flag, &$result) {}", "public function getChannelType(): string;", "protected function getIdentifier()\n {\n if ($this->parameters->scheme === 'unix') {\n return $this->parameters->path;\n }\n\n return \"{$this->parameters->host}:{$this->parameters->port}\";\n }", "public function getChannel()\n {\n return $this->getNodeText('/p:package/p:channel');\n }", "public function getChannel()\n {\n return $this->getComposerJson()->extra->magento_connect->channel;\n }", "function ts3client_getParentChannelOfChannel($serverConnectionHandlerID, $channelID, &$result) {}", "public function getHouseChannelId()\n {\n return $this->_houseChannelId;\n }", "public function channel($channel);", "public static function createChannel\n\t(\n\t\t$channel\t\t\t// <str> The channel (hashtag) to create.\n\t)\t\t\t\t\t\t// RETURNS <int> the ID of the resulting channel, or 0 on failure.\n\t\n\t// $channelID = AppChat::createChannel($channel);\n\t{\n\t\t// Check to see if the channel already exists\n\t\tif($channelID = self::getChannelID($channel))\n\t\t{\n\t\t\treturn $channelID;\n\t\t}\n\t\t\n\t\t// Get the Server ID that this channel is meant for\n\t\t$loadServerID = self::getChannelServer($channel);\n\t\t\n\t\t// Get the Chat Server ID\n\t\t$host = explode(\".\", $_SERVER['SERVER_NAME']);\n\t\t$chatServID = (int) str_replace(\"chat\", \"\", $host[0]);\n\t\t\n\t\t// If you're not on the correct server\n\t\tif($loadServerID != $chatServID)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t// Create the new channel\n\t\tDatabase::query(\"INSERT INTO chat_channels (channel) VALUES (?)\", array($channel));\n\t\t\n\t\treturn Database::$lastID;\n\t}", "public function getDeliveryChannel() {\n return $this->params[\"original\"][\"delivery_channel\"];\n }", "public function getChannel(): Channel\n {\n return $this->channel;\n }", "public function getDistributionChannel()\n {\n if (is_null($this->distributionChannel)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL);\n if (is_null($data)) {\n return null;\n }\n\n $this->distributionChannel = ChannelResourceIdentifierModel::of($data);\n }\n\n return $this->distributionChannel;\n }", "private function getCustomerIdParameter()\n {\n return sprintf('uid-%s-%s', time(), $this->generateRandomString());\n }", "public function getChannel()\n {\n return $this->_access->getChannel();\n }", "public static function getChannel($channel)\r\n\t{\r\n\t\tif(empty(self::$channels[strtolower($channel)]))\r\n\t\t{\r\n\t\t\t$channel_obj = trim($channel, '#');\r\n\t\t\tself::$channels[strtolower($channel)] = new $channel_obj(strtolower($channel));\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$channels[strtolower($channel)];\r\n\t}", "public function getChannelByName($username);", "public function getEntityChannel($entity)\n {\n\n if (is_object($entity))\n $entity = $entity->getTable();\n\n $label = SParserString::subToCamelCase($entity);\n\n $orm = $this->getOrm();\n $channel = $orm->getByKey('WbfsysAnnouncementChannel', 'entity_'.$entity );\n\n // wenn es den channel nicht gibt wird der automatisch angelegt\n if (!$channel) {\n $channel->name = SParserString::subToCamelCase($label);\n $channel->access_key = $entity;\n $channel->description = \"Message Channel for Entity \".$label;\n\n $orm->save($channel);\n }\n\n return $channel;\n\n }", "function getForumId( $params )\n{\n \tif( ! empty( $this->mod_config['comment_forum_id'] ) ) {\n \t\treturn $this->mod_config['comment_forum_id'] ;\n \t} else if( ! empty( $params['forum_id'] ) ) {\n\t\treturn intval( $params['forum_id'] ) ;\n\t} else if( ! empty( $this->mod_config['comment_forum_id'] ) ) {\n\t\treturn $this->mod_config['comment_forum_id'] ;\n\t} else {\n\t\treturn 1 ;\n\t}\n}", "public function getChannelHeader()\n {\n return $this->channel_header;\n }", "public static function channel_name_by_id( $id ) {\n\t\tif ( self::CHANNEL_DEVELOPMENT === $id ) {\n\t\t\t$channel = __( 'Development', 'installer' );\n\t\t} elseif ( self::CHANNEL_BETA === $id ) {\n\t\t\t$channel = __( 'Beta', 'installer' );\n\t\t} else {\n\t\t\t$channel = __( 'Production', 'installer' );\n\t\t}\n\n\t\treturn $channel;\n\t}", "function cemhub_get_incoming_campaign_source_code_id() {\n $campaign_source_id = NULL;\n\n $allowed_parameters = cemhub_get_allowed_external_campaign_parameters();\n foreach ($allowed_parameters as $parameter) {\n if (array_key_exists(trim($parameter), $_GET)) {\n $campaign_source_id = $_GET[trim($parameter)];\n }\n }\n\n return $campaign_source_id;\n}", "public function getChannelByIdentifier($identifier)\n {\n $query = Channel::with('subChannel.category', 'parent', 'category', 'display', 'subChannel.display');\n\n # if an integer was passed through then grab the channel by its ID\n if( is_numeric($identifier) ) {\n $query->where('id', $identifier);\n }\n # then grab the channel by its sef_name field\n else {\n $query->where('sef_name', $identifier);\n }\n\n $result = $query->active()->get()->first();\n\n # if we didn't find anything then say so.\n if( ! $result) {\n return false;\n }\n\n # if there is a parent element and that parent channel is inactive then return \n # nothing as the top level channel has been turned off\n if( isset($result->parent->id) && ! $result->parent->is_active ) {\n return false;\n }\n\n # finally, return an array representation of the channel\n return $result->toArray();\n }", "public function get_nameChannel () {\r\n\t\treturn $this->get_info()['author_name'];\r\n\t}", "private function getChannelId($user)\n {\n $client = new Client();\n $crawler = $client->request('GET', 'https://www.youtube.com/'.$user);\n $url = $crawler->filter('link[rel=\"canonical\"]')->attr('href');\n return explode('/', $url)[4];\n }", "public function getChannel()\n {\n if (! $this->channel) {\n $this->set();\n }\n\n return $this->channel;\n }", "protected function _get_channel_title() {\n\t\t// Lookup the channel title from the database\n\t\t$channel_id = $this->EE->input->get('channel_id');\n\t\t$channel = $this->EE->db->select('channel_title')->where('channel_id', $channel_id)\n\t\t\t\t\t\t\t\t->get('channels')->row();\n\t\t\n\t\t// Return it!\n\t\treturn $channel->channel_title;\n\t}", "public function getDistributionChannel()\n {\n if (is_null($this->distributionChannel)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL);\n if (is_null($data)) {\n return null;\n }\n\n $this->distributionChannel = ChannelKeyReferenceModel::of($data);\n }\n\n return $this->distributionChannel;\n }", "public function getName()\n {\n return 'sample.channel';\n }", "public static function getChannelServer\n\t(\n\t\t$channel\t\t// <str> The channel name.\n\t)\t\t\t\t\t// RETURNS <int> the chat's server integer.\n\t\n\t// $chatServerID = AppChat::getChannelServer($channel);\n\t{\n\t\treturn (int) (ord($channel[0]) + ord($channel[1])) % 10;\n\t}", "function get_chtrm_name($chatid){\r\n\r\n}", "public function getClientId(): string\n {\n return (string) data_get($this->args, 'credentials.id');\n }", "protected function getTrackedClientId() {\n /*if (isset($_COOKIE['_ga'])) {\n list($version,$domainDepth, $cid1, $cid2) = preg_split('[\\.]', $_COOKIE[\"_ga\"],4);\n $contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1.'.'.$cid2);\n $cid = $contents['cid'];\n }\n else {*/\n $cid = $this->client->serial;\n //}\n return $cid;\n }", "public function getConnectorId();", "public function getIdParameter(): string;", "public function getChannelName($channelId, $baseTable = \"channels\")\n {\n\n\n $db = new MidoDb();\n\n $userSql = \"SELECT* FROM $baseTable WHERE id=$channelId\";\n $userRes = $db->selectRecordWithSql($userSql);\n $userResDet = $db->fetchAssoc($userRes);\n\n if (!$userRes) {\n return null;\n } else {\n return $userResDet[0]['channel'];\n }\n }", "public static function getChannelNameByID\n\t(\n\t\t$channelID\t\t// <int> The ID of the channel.\n\t)\t\t\t\t\t// RETURNS <str> the name of the channel, or \"\" on failure.\n\t\n\t// $channel = AppChat::getChannelNameByID($channelID);\n\t{\n\t\treturn Database::selectValue(\"SELECT channel FROM chat_channels WHERE id=? LIMIT 1\", array($channelID));\n\t}", "public function getChannelIds()\n {\n $ids = [];\n foreach ($this as $channel) {\n $channelId = $channel->getChannelId();\n if (!empty($channelId)) {\n $ids[] = $channelId;\n }\n }\n\n return $ids;\n }", "public function getIdentifier()\n {\n return $this->getParam('flowIdentifier');\n }", "function ts3client_setChannelVariableAsString($serverConnectionHandlerID, $channelID, $flag, $value) {}", "public function getDestinationChannel();", "public function getChatId()\n {\n return $this->get(self::_CHAT_ID);\n }", "public function getChatId()\n {\n return $this->get(self::_CHAT_ID);\n }", "function get_channel_id_from_entry_id( $entry_id = '' )\n\t{\n\t\tif ( is_numeric( $entry_id ) === FALSE ) return FALSE;\n\n\t\t// --------------------------------------------\n\t\t// Prep Cache, Return if Set\n\t\t// --------------------------------------------\n\n\t\t$cache_name = __FUNCTION__;\n\t\t$cache_hash = $this->_imploder(func_get_args());\n\n\t\tif (isset($this->cached[$cache_name][$cache_hash]))\n\t\t{\n\t\t\treturn $this->cached[$cache_name][$cache_hash];\n\t\t}\n\n\t\t$this->cached[$cache_name][$cache_hash] = FALSE;\n\n\t\t// --------------------------------------------\n\t\t// Grab from DB\n\t\t// --------------------------------------------\n\n\t\t$query\t= ee()->db\n\t\t\t\t\t\t->select('author_id, channel_id')\n\t\t\t\t\t\t->where('entry_id', $entry_id)\n\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t->get('channel_titles');\n\n\t\tif ( $query->num_rows() > 0 )\n\t\t{\n\t\t\t$this->cached[$cache_name][$cache_hash]\t= $query->row('channel_id');\n\t\t\t$this->cached['get_author_id_from_entry_id'][$cache_hash]\t= $query->row('author_id');\n\t\t}\n\n\t\treturn $this->cached[$cache_name][$cache_hash];\n\t}", "public function getCipherId() {}", "function get_valid_channel($chan) {\r\n\t\tif (!$chan) return null;\r\n\t\tif (mb_check_encoding($chan, 'ASCII')) {\r\n\t\t\treturn $chan;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public function getCommandIdentifier() {}", "private function _getChannelLimit()\n {\n return Yii::$app->params['channelLimit'];\n }", "public function graphQLSubscriptionChannelName(): string\n {\n return '';\n }", "public function get_urlChannel () {\r\n\t\treturn $this->get_info()['author_url'];\r\n\t}", "public function getConnectionId();", "public static function createChannelUrl($channel): string\n {\n return Config::get('SOCKETS_HOST') . 'chan/' . $channel;\n }", "function get_channel_id_pref($id)\r\n\t{\r\n\t\t//cache?\r\n\t\tif (isset($this->cache['channel_ids'][$id]))\r\n\t\t{\r\n\t\t\treturn $this->cache['channel_ids'][$id];\r\n\t\t}\r\n\r\n\t\t$channel_data = $this->get_channel_ids();\r\n\r\n\t\tif ( isset($channel_data[$id]) )\r\n\t\t{\r\n\t\t\t$this->cache['channel_ids'][$id] = $channel_data[$id];\r\n\t\t\treturn $this->cache['channel_ids'][$id];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn array();\r\n\t\t}\r\n\t}", "public function channel()\n {\n }", "function get_chtrm($chatid){\r\n\r\n}", "public function getChannelsRoute(): string;", "public function getReceiverId();", "public function getForumId( $params ) {\n\t\tif ( $this->forum_id ) {\n\t\t\treturn $this->forum_id;\n\t\t}\n\n\t\tif ( ! empty( $params['forum_id'] ) ) {\n\t\t\treturn (int) $params['forum_id'];\n\t\t}\n\n\t\tif ( ! empty( $this->mod_config['comment_forum_id'] ) ) {\n\t\t\treturn $this->mod_config['comment_forum_id'];\n\t\t}\n\n\t\treturn 1;\n\t}", "public function getCid(): string\n\t{\n\t\tif ($this->has('cid')) {\n\t\t\treturn $this->get('cid');\n\t\t}\n\t\t$cid = hash('sha256', $this->get('from_email') . '|' . $this->get('date') . '|' . $this->get('subject') . '|' . $this->get('message_id'));\n\t\t$this->set('cid', $cid);\n\t\treturn $cid;\n\t}", "public function GetVar($channel, $variable, $actionId);", "public function getChannel(): ?Channel\n {\n return $this->channel;\n }" ]
[ "0.76600546", "0.71492463", "0.66044986", "0.64922357", "0.6439586", "0.64364487", "0.6373208", "0.6373208", "0.6373208", "0.63646436", "0.62232715", "0.6203584", "0.60829717", "0.6047839", "0.6017546", "0.60172933", "0.601697", "0.59800553", "0.5972928", "0.5969164", "0.5953227", "0.59404373", "0.59404373", "0.59254736", "0.5914778", "0.5908074", "0.5884292", "0.5850899", "0.5811381", "0.5811381", "0.5785667", "0.578294", "0.57539624", "0.56975174", "0.5687036", "0.568696", "0.568696", "0.568696", "0.56847966", "0.5665682", "0.5643251", "0.56173056", "0.55950207", "0.5591822", "0.55715144", "0.55460906", "0.551914", "0.5511444", "0.54921025", "0.5457148", "0.5455631", "0.5442965", "0.5416723", "0.54133767", "0.5401681", "0.5392833", "0.53911054", "0.5388043", "0.53876364", "0.5374106", "0.53656733", "0.53591985", "0.53179085", "0.53145593", "0.5259179", "0.52569854", "0.52403456", "0.5233936", "0.5222059", "0.5217515", "0.52105623", "0.5208978", "0.5206605", "0.51811427", "0.5146269", "0.5128699", "0.5101415", "0.51000804", "0.50890553", "0.50888294", "0.5084491", "0.5084406", "0.5084398", "0.50800645", "0.50732046", "0.50730264", "0.50608426", "0.5056666", "0.5052338", "0.5040069", "0.50399643", "0.5029954", "0.5028032", "0.5018643", "0.50186384", "0.50171894", "0.5006801", "0.49955773", "0.49924406", "0.49859276" ]
0.5743958
33
Get channel identifier from input parameters
public function getChanIdList($resourceType, $resourceIdList) { $ret = []; foreach (Misc::toIterable($resourceIdList) as $index => $resourceId) { $ret[$index] = $this->getChanId($resourceType, $resourceId); } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getChannelId() {\n $event = $this->getEvent();\n\n if (isset($event['channel'])) {\n return $event['channel'];\n }\n\n return $event['channel_id'];\n }", "public function getChannelId()\n {\n return $this->channel_id;\n }", "public function getChannel()\n {\n $value = $this->get(self::channel);\n return $value === null ? (integer)$value : $value;\n }", "public function getChannelId(): Snowflake\n {\n return $this->channel_id;\n }", "public function getSalesChannelId();", "function get_channel_id($entry_id)\n\t{\t\n\t\t$this->EE->db->select('channel_id');\n\t\t$this->EE->db->where('entry_id', $entry_id);\n\t\t$query = $this->EE->db->get('channel_titles');\n\t\t$row = $query->row();\n\t\t\n\t\treturn ($row ? $row->channel_id : '');\n\t}", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public function getChannel(): string\n {\n return $this->channel;\n }", "public static function getChannel()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"channel\"])) ? $config[\"log\"][\"channel\"] : \"Amarki\";\n }", "public function getChannel(): string {\n\t\t\treturn $this->channel;\n\t\t}", "public function getChannel();", "public function getChannel()\n {\n return $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel;\n }", "public function getChannelId($channel_name)\n {\n $query=\"select channel_id\n from channel\n where channel_name= '\".$_POST['channel_name'].\"'\";\n if(($result=$this->db->CustomQuery($query))!=null)\n {\n return $result;\n }\n $this->LastMsg.\"Channel name not found <br>\";\n return false;\n }", "public function getChannel($identifier)\n {\n $query = Channel::with('category', 'display');\n\n if( is_numeric( $identifier ) ) {\n $query->where('id', $identifier);\n }\n else {\n $query->where('sef_name', $identifier);\n }\n\n return $query->first();\n }", "abstract public function getChannel($additionalInformation);", "public function getChannel()\n {\n \treturn $this->_channel;\n }", "public function getChannel()\n\t{\n\t\treturn $this->channel;\n\t}", "private function getChannelId($channelName)\n {\n if ( $channelName == null ) {\n $channelName = $this->defaultChannelName;\n }\n $this->debug(__METHOD__ . \" $channelName\");\n // Check if the channel ID can be parsed as JSON\n $decoded = json_decode($channelName);\n if (is_object($decoded) && isset($decoded->channel_id)) {\n $this->debug(\"return decoded\");\n return $decoded->channel_id;\n }\n\n // If the channel name starts with a '.', use the rest of the string as the channel ID\n if (substr($channelName, 0, 1) == '.') {\n return substr($channelName, 1);\n }\n\n try {\n $response = $this->client->request('GET', 'conversations.list', [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $this->slackToken,\n ],\n ]);\n\n $responseBody = json_decode($response->getBody(), true);\n if ($responseBody['ok']) {\n foreach ($responseBody['channels'] as $channel) {\n if ($channel['name'] == $channelName) {\n return $channel['id'];\n }\n }\n } else {\n throw new \\Exception($responseBody['error']);\n }\n\n // If the channel was not found, return null\n return null;\n } catch (GuzzleException $e) {\n throw new \\Exception($e->getMessage());\n }\n }", "public function getChannelCode()\n {\n return $this->data['fields']['channel_code'];\n }", "public function getChannel()\n {\n if (is_null($this->channel)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_CHANNEL);\n if (is_null($data)) {\n return null;\n }\n\n $this->channel = ChannelResourceIdentifierModel::of($data);\n }\n\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->channel;\n }", "public function generateChannel(){\n\t\t$tempArray = array();\n\t\tpreg_match('/\\+(.*?)@/', $this->recipient, $tempArray);\n\t\t$this->channel = $tempArray[1];\n\t}", "private function _getRequestChannel() {\n $td = Request::get('token_data');\n if(isset($td['type']) && $td['type'] == 'channel') {\n return Channel::where('id', $td['channel_id'])->first();\n } else {\n if(!Request::input('channel')) {\n return Response::json([\n 'error' => 'invalid_input',\n 'error_description' => 'No channel specified'\n ], 400);\n }\n\n $uid = Request::input('channel');\n $channel = Channel::where('user_id', Auth::user()->id)->where('uid', $uid)->first();\n if(!$channel)\n return Response::json([\n 'error' => 'not_found',\n 'error_description' => 'Channel not found'\n ], 404);\n else\n return $channel;\n }\n }", "public function getSubchannelId()\n {\n return $this->subchannelId;\n }", "function channelInfo()\n\t{\n\t\treturn $this->_channel;\n\t}", "public function getChannel() {\n return $this->channel;\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public function getChannel()\n {\n return $this->Channel;\n }", "public static function getChannelID\n\t(\n\t\t$channel\t\t// <str> The channel (hashtag) to get the channel ID of.\n\t)\t\t\t\t\t// RETURNS <int> the ID of the resulting channel, or 0 on failure.\n\t\n\t// $channelID = AppChat::getChannelID($channel);\n\t{\n\t\treturn (int) Database::selectValue(\"SELECT id FROM chat_channels WHERE channel=? LIMIT 1\", array($channel));\n\t}", "public function getChannel()\n {\n return $this->getData(self::CHANNEL);\n }", "public function getChannelById($id);", "public function getChanId($resourceType, $resourceId)\n {\n return $resourceType . ':' . $resourceId;\n }", "public function id($username)\n {\n $id = $this->_client->processChannelId($username);\n\n if ($id) {\n $this->info(__('ID: {0}', $id));\n } else {\n $this->info(__('The ID or Username is not correct.'));\n }\n\n return $id;\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel()\n {\n return $this->get(self::_CHANNEL);\n }", "public function getChannel($storeId = null);", "public function channel()\n\t{\n\t\treturn $this->xml->channel;\n\t}", "function ts3client_getChannelVariableAsString($serverConnectionHandlerID, $channelID, $flag, &$result) {}", "public function getChannelType(): string;", "protected function getIdentifier()\n {\n if ($this->parameters->scheme === 'unix') {\n return $this->parameters->path;\n }\n\n return \"{$this->parameters->host}:{$this->parameters->port}\";\n }", "public function getChannel()\n {\n return $this->getNodeText('/p:package/p:channel');\n }", "public function getChannel()\n {\n return $this->getComposerJson()->extra->magento_connect->channel;\n }", "function ts3client_getParentChannelOfChannel($serverConnectionHandlerID, $channelID, &$result) {}", "public function getHouseChannelId()\n {\n return $this->_houseChannelId;\n }", "public function channel($channel);", "public static function createChannel\n\t(\n\t\t$channel\t\t\t// <str> The channel (hashtag) to create.\n\t)\t\t\t\t\t\t// RETURNS <int> the ID of the resulting channel, or 0 on failure.\n\t\n\t// $channelID = AppChat::createChannel($channel);\n\t{\n\t\t// Check to see if the channel already exists\n\t\tif($channelID = self::getChannelID($channel))\n\t\t{\n\t\t\treturn $channelID;\n\t\t}\n\t\t\n\t\t// Get the Server ID that this channel is meant for\n\t\t$loadServerID = self::getChannelServer($channel);\n\t\t\n\t\t// Get the Chat Server ID\n\t\t$host = explode(\".\", $_SERVER['SERVER_NAME']);\n\t\t$chatServID = (int) str_replace(\"chat\", \"\", $host[0]);\n\t\t\n\t\t// If you're not on the correct server\n\t\tif($loadServerID != $chatServID)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t// Create the new channel\n\t\tDatabase::query(\"INSERT INTO chat_channels (channel) VALUES (?)\", array($channel));\n\t\t\n\t\treturn Database::$lastID;\n\t}", "public function getDeliveryChannel() {\n return $this->params[\"original\"][\"delivery_channel\"];\n }", "public function getChannel(): Channel\n {\n return $this->channel;\n }", "public function getDistributionChannel()\n {\n if (is_null($this->distributionChannel)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL);\n if (is_null($data)) {\n return null;\n }\n\n $this->distributionChannel = ChannelResourceIdentifierModel::of($data);\n }\n\n return $this->distributionChannel;\n }", "private function getCustomerIdParameter()\n {\n return sprintf('uid-%s-%s', time(), $this->generateRandomString());\n }", "public function getChannel()\n {\n return $this->_access->getChannel();\n }", "public static function getChannel($channel)\r\n\t{\r\n\t\tif(empty(self::$channels[strtolower($channel)]))\r\n\t\t{\r\n\t\t\t$channel_obj = trim($channel, '#');\r\n\t\t\tself::$channels[strtolower($channel)] = new $channel_obj(strtolower($channel));\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$channels[strtolower($channel)];\r\n\t}", "public function getChannelByName($username);", "public function getEntityChannel($entity)\n {\n\n if (is_object($entity))\n $entity = $entity->getTable();\n\n $label = SParserString::subToCamelCase($entity);\n\n $orm = $this->getOrm();\n $channel = $orm->getByKey('WbfsysAnnouncementChannel', 'entity_'.$entity );\n\n // wenn es den channel nicht gibt wird der automatisch angelegt\n if (!$channel) {\n $channel->name = SParserString::subToCamelCase($label);\n $channel->access_key = $entity;\n $channel->description = \"Message Channel for Entity \".$label;\n\n $orm->save($channel);\n }\n\n return $channel;\n\n }", "function getForumId( $params )\n{\n \tif( ! empty( $this->mod_config['comment_forum_id'] ) ) {\n \t\treturn $this->mod_config['comment_forum_id'] ;\n \t} else if( ! empty( $params['forum_id'] ) ) {\n\t\treturn intval( $params['forum_id'] ) ;\n\t} else if( ! empty( $this->mod_config['comment_forum_id'] ) ) {\n\t\treturn $this->mod_config['comment_forum_id'] ;\n\t} else {\n\t\treturn 1 ;\n\t}\n}", "public function getChannelHeader()\n {\n return $this->channel_header;\n }", "public static function channel_name_by_id( $id ) {\n\t\tif ( self::CHANNEL_DEVELOPMENT === $id ) {\n\t\t\t$channel = __( 'Development', 'installer' );\n\t\t} elseif ( self::CHANNEL_BETA === $id ) {\n\t\t\t$channel = __( 'Beta', 'installer' );\n\t\t} else {\n\t\t\t$channel = __( 'Production', 'installer' );\n\t\t}\n\n\t\treturn $channel;\n\t}", "function cemhub_get_incoming_campaign_source_code_id() {\n $campaign_source_id = NULL;\n\n $allowed_parameters = cemhub_get_allowed_external_campaign_parameters();\n foreach ($allowed_parameters as $parameter) {\n if (array_key_exists(trim($parameter), $_GET)) {\n $campaign_source_id = $_GET[trim($parameter)];\n }\n }\n\n return $campaign_source_id;\n}", "public function getChannelByIdentifier($identifier)\n {\n $query = Channel::with('subChannel.category', 'parent', 'category', 'display', 'subChannel.display');\n\n # if an integer was passed through then grab the channel by its ID\n if( is_numeric($identifier) ) {\n $query->where('id', $identifier);\n }\n # then grab the channel by its sef_name field\n else {\n $query->where('sef_name', $identifier);\n }\n\n $result = $query->active()->get()->first();\n\n # if we didn't find anything then say so.\n if( ! $result) {\n return false;\n }\n\n # if there is a parent element and that parent channel is inactive then return \n # nothing as the top level channel has been turned off\n if( isset($result->parent->id) && ! $result->parent->is_active ) {\n return false;\n }\n\n # finally, return an array representation of the channel\n return $result->toArray();\n }", "public function get_nameChannel () {\r\n\t\treturn $this->get_info()['author_name'];\r\n\t}", "private function getChannelId($user)\n {\n $client = new Client();\n $crawler = $client->request('GET', 'https://www.youtube.com/'.$user);\n $url = $crawler->filter('link[rel=\"canonical\"]')->attr('href');\n return explode('/', $url)[4];\n }", "public function getChannel()\n {\n if (! $this->channel) {\n $this->set();\n }\n\n return $this->channel;\n }", "protected function _get_channel_title() {\n\t\t// Lookup the channel title from the database\n\t\t$channel_id = $this->EE->input->get('channel_id');\n\t\t$channel = $this->EE->db->select('channel_title')->where('channel_id', $channel_id)\n\t\t\t\t\t\t\t\t->get('channels')->row();\n\t\t\n\t\t// Return it!\n\t\treturn $channel->channel_title;\n\t}", "public function getDistributionChannel()\n {\n if (is_null($this->distributionChannel)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL);\n if (is_null($data)) {\n return null;\n }\n\n $this->distributionChannel = ChannelKeyReferenceModel::of($data);\n }\n\n return $this->distributionChannel;\n }", "public function getName()\n {\n return 'sample.channel';\n }", "public static function getChannelServer\n\t(\n\t\t$channel\t\t// <str> The channel name.\n\t)\t\t\t\t\t// RETURNS <int> the chat's server integer.\n\t\n\t// $chatServerID = AppChat::getChannelServer($channel);\n\t{\n\t\treturn (int) (ord($channel[0]) + ord($channel[1])) % 10;\n\t}", "function get_chtrm_name($chatid){\r\n\r\n}", "public function getClientId(): string\n {\n return (string) data_get($this->args, 'credentials.id');\n }", "protected function getTrackedClientId() {\n /*if (isset($_COOKIE['_ga'])) {\n list($version,$domainDepth, $cid1, $cid2) = preg_split('[\\.]', $_COOKIE[\"_ga\"],4);\n $contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1.'.'.$cid2);\n $cid = $contents['cid'];\n }\n else {*/\n $cid = $this->client->serial;\n //}\n return $cid;\n }", "public function getConnectorId();", "public function getIdParameter(): string;", "public function getChannelName($channelId, $baseTable = \"channels\")\n {\n\n\n $db = new MidoDb();\n\n $userSql = \"SELECT* FROM $baseTable WHERE id=$channelId\";\n $userRes = $db->selectRecordWithSql($userSql);\n $userResDet = $db->fetchAssoc($userRes);\n\n if (!$userRes) {\n return null;\n } else {\n return $userResDet[0]['channel'];\n }\n }", "public static function getChannelNameByID\n\t(\n\t\t$channelID\t\t// <int> The ID of the channel.\n\t)\t\t\t\t\t// RETURNS <str> the name of the channel, or \"\" on failure.\n\t\n\t// $channel = AppChat::getChannelNameByID($channelID);\n\t{\n\t\treturn Database::selectValue(\"SELECT channel FROM chat_channels WHERE id=? LIMIT 1\", array($channelID));\n\t}", "public function getChannelIds()\n {\n $ids = [];\n foreach ($this as $channel) {\n $channelId = $channel->getChannelId();\n if (!empty($channelId)) {\n $ids[] = $channelId;\n }\n }\n\n return $ids;\n }", "public function getIdentifier()\n {\n return $this->getParam('flowIdentifier');\n }", "function ts3client_setChannelVariableAsString($serverConnectionHandlerID, $channelID, $flag, $value) {}", "public function getDestinationChannel();", "public function getChatId()\n {\n return $this->get(self::_CHAT_ID);\n }", "public function getChatId()\n {\n return $this->get(self::_CHAT_ID);\n }", "function get_channel_id_from_entry_id( $entry_id = '' )\n\t{\n\t\tif ( is_numeric( $entry_id ) === FALSE ) return FALSE;\n\n\t\t// --------------------------------------------\n\t\t// Prep Cache, Return if Set\n\t\t// --------------------------------------------\n\n\t\t$cache_name = __FUNCTION__;\n\t\t$cache_hash = $this->_imploder(func_get_args());\n\n\t\tif (isset($this->cached[$cache_name][$cache_hash]))\n\t\t{\n\t\t\treturn $this->cached[$cache_name][$cache_hash];\n\t\t}\n\n\t\t$this->cached[$cache_name][$cache_hash] = FALSE;\n\n\t\t// --------------------------------------------\n\t\t// Grab from DB\n\t\t// --------------------------------------------\n\n\t\t$query\t= ee()->db\n\t\t\t\t\t\t->select('author_id, channel_id')\n\t\t\t\t\t\t->where('entry_id', $entry_id)\n\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t->get('channel_titles');\n\n\t\tif ( $query->num_rows() > 0 )\n\t\t{\n\t\t\t$this->cached[$cache_name][$cache_hash]\t= $query->row('channel_id');\n\t\t\t$this->cached['get_author_id_from_entry_id'][$cache_hash]\t= $query->row('author_id');\n\t\t}\n\n\t\treturn $this->cached[$cache_name][$cache_hash];\n\t}", "public function getCipherId() {}", "function get_valid_channel($chan) {\r\n\t\tif (!$chan) return null;\r\n\t\tif (mb_check_encoding($chan, 'ASCII')) {\r\n\t\t\treturn $chan;\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public function getCommandIdentifier() {}", "private function _getChannelLimit()\n {\n return Yii::$app->params['channelLimit'];\n }", "public function graphQLSubscriptionChannelName(): string\n {\n return '';\n }", "public function get_urlChannel () {\r\n\t\treturn $this->get_info()['author_url'];\r\n\t}", "public function getConnectionId();", "public static function createChannelUrl($channel): string\n {\n return Config::get('SOCKETS_HOST') . 'chan/' . $channel;\n }", "function get_channel_id_pref($id)\r\n\t{\r\n\t\t//cache?\r\n\t\tif (isset($this->cache['channel_ids'][$id]))\r\n\t\t{\r\n\t\t\treturn $this->cache['channel_ids'][$id];\r\n\t\t}\r\n\r\n\t\t$channel_data = $this->get_channel_ids();\r\n\r\n\t\tif ( isset($channel_data[$id]) )\r\n\t\t{\r\n\t\t\t$this->cache['channel_ids'][$id] = $channel_data[$id];\r\n\t\t\treturn $this->cache['channel_ids'][$id];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn array();\r\n\t\t}\r\n\t}", "public function channel()\n {\n }", "function get_chtrm($chatid){\r\n\r\n}", "public function getChannelsRoute(): string;", "public function getReceiverId();", "public function getForumId( $params ) {\n\t\tif ( $this->forum_id ) {\n\t\t\treturn $this->forum_id;\n\t\t}\n\n\t\tif ( ! empty( $params['forum_id'] ) ) {\n\t\t\treturn (int) $params['forum_id'];\n\t\t}\n\n\t\tif ( ! empty( $this->mod_config['comment_forum_id'] ) ) {\n\t\t\treturn $this->mod_config['comment_forum_id'];\n\t\t}\n\n\t\treturn 1;\n\t}", "public function getCid(): string\n\t{\n\t\tif ($this->has('cid')) {\n\t\t\treturn $this->get('cid');\n\t\t}\n\t\t$cid = hash('sha256', $this->get('from_email') . '|' . $this->get('date') . '|' . $this->get('subject') . '|' . $this->get('message_id'));\n\t\t$this->set('cid', $cid);\n\t\treturn $cid;\n\t}", "public function GetVar($channel, $variable, $actionId);", "public function getChannel(): ?Channel\n {\n return $this->channel;\n }" ]
[ "0.76600546", "0.71492463", "0.66044986", "0.64922357", "0.6439586", "0.64364487", "0.6373208", "0.6373208", "0.6373208", "0.63646436", "0.62232715", "0.6203584", "0.60829717", "0.6047839", "0.6017546", "0.60172933", "0.601697", "0.59800553", "0.5972928", "0.5969164", "0.5953227", "0.59404373", "0.59404373", "0.59254736", "0.5914778", "0.5908074", "0.5884292", "0.5850899", "0.5811381", "0.5811381", "0.5785667", "0.578294", "0.57539624", "0.5743958", "0.56975174", "0.5687036", "0.568696", "0.568696", "0.568696", "0.56847966", "0.5665682", "0.5643251", "0.56173056", "0.55950207", "0.5591822", "0.55715144", "0.55460906", "0.551914", "0.5511444", "0.54921025", "0.5457148", "0.5455631", "0.5442965", "0.5416723", "0.54133767", "0.5401681", "0.5392833", "0.53911054", "0.5388043", "0.53876364", "0.5374106", "0.53656733", "0.53591985", "0.53179085", "0.53145593", "0.5259179", "0.52569854", "0.52403456", "0.5233936", "0.5222059", "0.5217515", "0.52105623", "0.5208978", "0.5206605", "0.51811427", "0.5146269", "0.5128699", "0.5101415", "0.51000804", "0.50890553", "0.50888294", "0.5084491", "0.5084406", "0.5084398", "0.50800645", "0.50732046", "0.50730264", "0.50608426", "0.5056666", "0.5052338", "0.5040069", "0.50399643", "0.5029954", "0.5028032", "0.5018643", "0.50186384", "0.50171894", "0.5006801", "0.49955773", "0.49924406", "0.49859276" ]
0.0
-1
Get subscriber names list
protected function getSubscriberNameList($subscriberIdList, $type) { $ret = []; foreach (Misc::toIterable($subscriberIdList) as $index => $subscriberId) { $ret[$index] = $this->getSubscriberName($subscriberId, $type); } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetSubscriptionsNamesForImport()\n {\n \t$output = array();\n \n \t$rs = mysql_query(\"SELECT subscription_name_en FROM subscriptions ORDER BY subscription_name_en ASC\");\n \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\tarray_push($output, $row['subscription_name_en']);\n \t\t}\n \t}\n \n \treturn $output;\n }", "public function getSubscriberRecords() {\n if($stmt = $this->pdo->query(\"SELECT * FROM subscribers;\")){\n $subscribers = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $subscribers[] = $row;\n }\n return $subscribers;\n }else{\n return 'unset';\n }\n }", "public function GetSubscriptionsList()\n {\n \t$output = array();\n \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions ORDER BY \" . $this->lang_name_field . \" ASC\");\n \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\t$output[] = array(\n\t \t\t\t\t\t\"subscription_id\" => $row['subscription_id'],\n\t \t\t\t\t\t\"subscription_name\"\t=> $row[$this->lang_name_field]\n \t\t\t);\n \t\t}\n \t}\n \n \treturn $output;\n }", "public function getNames();", "public function getSubscribers()\n {\n return $this['subscribers'];\n }", "public function getNames() {}", "public function getNames() {}", "public function getNames() {}", "public function getSubscriberEmails() {\n $stmt = $this->pdo->query(\"SELECT email\n FROM subscribers\n \");\n $subscribers = [];\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n $subscribers[] = $row['email'];\n }\n return $subscribers;\n }", "public function getNameList() {\n return $this->_get(1);\n }", "public static function getSubjectList()\n {\n return self::pluck('name', 'id');\n }", "public function getSubscribers()\n\t\t{\n\t\t\treturn $this->subscribers;\n\t\t}", "public function getAllNames() {}", "public function index()\n {\n $subscribers = $this->subscribers->getSubscribers();\n\n abort_unless(! empty($subscribers), 204);\n\n return $subscribers;\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNames(): Collection\n {\n return $this->names;\n }", "public function getNames()\n {\n return (array) ldap_get_names($this->username);\n }", "public function get_names()\n {\n }", "public function getSubjectNames() {\n\t\ttry {\n\n\t\t\t$subjectNamesQuery = \"SELECT * FROM subject\";\n\t\t\treturn DB::select($subjectNamesQuery);\n\n\t\t} catch (\\Exception $ex) {\n\t\t\tprint_r($ex->getMessage());\n\n\t\t}\n\t}", "abstract protected function getSubClientNames();", "public function getNames() {\n return $this->names;\n }", "public function getNames()\n {\n return $this->names;\n }", "function render_subscriber_list($subscribers) {\n $s = '<ul>';\n foreach($subscribers as $row) {\n $name = \"<b>$row[name]</b>\";\n $email = \"email: $row[email]\";\n $s .= \"<li>$name - $email</li>\";\n }\n $s .= '</ul>';\n return $s;\n }", "public function getNameList() {\n return $this->_get(3);\n }", "public function getNameList() {\n return $this->_get(3);\n }", "public function getNameList() {\n return $this->_get(3);\n }", "public function getNames() {\n\t\treturn $this->names;\n\t}", "function get_subscriberList(){\n return selectQuery(TAB_SUBSCRIBERS, \"\", \"id DESC\");\n}", "public function getNames() {\n return $this->_names;\n }", "public function collectSubscribers();", "public function get_subscribers( $list_id ) {\n \n $this->db->select('body');\n $this->db->from('scheduled_stats');\n $this->db->where(['unsubscribed' => '1']);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n $result = parse_array($query->result_array());\n return $result;\n \n } else {\n \n return [''];\n \n }\n \n }", "static function listCampaignNames() {\n $campaigns = EmailmarketingCampaign::where('active', '1');\n $result = $campaigns->get()->toArray();\n if (count($result)>0) return $result;\n return array();\n }", "public function get_lists(){\n $items = array();\n $lists = $this->service->doRequest( 'subscribers_list/lists' )['lists'];\n if( $lists ){\n foreach( $lists as $list ){\n $items[$list['subscriberListHash']] = $list['name'];\n }\n }\n return $items;\n }", "function getUsernames(){\n $arr = array();\n for($x=0;$x<count($this->names);$x++){\n array_push($arr,$this->names[$x]);\n }\n return $arr;\n }", "public function fetchNames()\n {\n $res = $this->_fetch($this->_cfg['namesUri']);\n\n return $res;\n }", "public function getSubscriptions();", "public static function getNames() {\n $contactArray = X2Model::model('Contacts')->findAll();\n $names = array(0 => 'None');\n foreach ($contactArray as $user) {\n $first = $user->firstName;\n $last = $user->lastName;\n $name = $first . ' ' . $last;\n $names[$user->id] = $name;\n }\n return $names;\n }", "public function list_all() {\n global $retailers;\t\t\n $this->names = array_column($retailers, 'name');\n }", "public static function getAllNames() {\n $contactArray = X2Model::model('Contacts')->findAll($condition = 'visibility=1');\n $names = array(0 => 'None');\n foreach ($contactArray as $user) {\n $first = $user->firstName;\n $last = $user->lastName;\n $name = $first . ' ' . $last;\n $names[$user->id] = $name;\n }\n return $names;\n }", "public function _list() {\n\t\t// assign user based on api key\n\t\tif (empty($this->params[0])) {\n\t\t\t$json = [\n\t\t\t\t'error' => 'No channel specified'\n\t\t\t];\n\t\t\treturn $json;\n\t\t}\n\t\t$account = filter_var($this->params[0], FILTER_SANITIZE_STRING);\n\t\t$params = array($account);\n\t\t$sql = \"SELECT * FROM \" . $this->db->sub_table . \" WHERE subscriber = $1 OR host_account = $1\";\n\t\t$result = pg_query_params($this->db->link, $sql, $params);\n\t\t$subscribed = [];\n\t\t$subscribers = [];\n\t\twhile ($row = pg_fetch_assoc($result)) {\n\t\t\tif ($row['host_account'] === $account) {\n\t\t\t\t$subscribers[] = $row['subscriber'];\n\t\t\t} \n\t\t\tif ($row['subscriber'] === $account) {\n\t\t\t\t$subscribed[] = $row['host_account'];\n\t\t\t}\n\t\t}\n\t\t$json = [\n\t\t\t'subscribed' => $subscribed,\n\t\t\t'subscribers' => $subscribers\n\t\t];\n\t\treturn json_encode($json);\n\t}", "public static function getAllNames() {\n\t\t$contactArray = X2Model::model('Contacts')->findAll($condition='visibility=1');\n\t\t$names=array(0=>'None');\n\t\tforeach($contactArray as $user){\n\t\t\t$first = $user->firstName;\n\t\t\t$last = $user->lastName;\n\t\t\t$name = $first . ' ' . $last;\n\t\t\t$names[$user->id]=$name;\n\t\t}\n\t\treturn $names;\n\t}", "protected function getSubClientNames()\n {\n return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );\n }", "public function getLists()\n\t{\n\n\t\t$command = \"Command=Subscriber.GetLists\";\n\t\t\n\t\t$apiPath = $command\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}", "protected function getMemberNames()\n {\n $arrMembers = array();\n\n $objMembers = $this->Database\n ->execute(\"SELECT id, username, firstname, lastname\n\t\t\t FROM tl_member\n\t\t\t WHERE login = 1\"\n );\n\n while ($objMembers->next()) {\n $varId = $objMembers->id;\n $varName = $objMembers->firstname . ' ' . $objMembers->lastname;\n\n $arrMembers[$varId] = $varName;\n }\n\n return $arrMembers;\n }", "public function newsletterList()\n {\n return $this->ozioma->newsletter->list();\n }", "public function getNames()\n {\n return $this->_name;\n }", "abstract public function getNames($domain = '');", "public function getNameValueList()\n {\n return $this->nameValueList;\n }", "public function GetSubscriptionsRecords()\n {\n \t$output = array();\n \n \t$rs = mysql_query(\"SELECT * FROM subscriptions ORDER BY \" . $this->lang_name_field . \" ASC\");\n \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\t$output[] = array(\n\t \t\t\t\t\t\"subscription_id\" \t=> $row['subscription_id'],\n\t \t\t\t\t\t\"subscription_name_fr\"\t=> $row['subscription_name_fr'],\n\t \t\t\t\t\t\"subscription_name_en\"\t=> $row['subscription_name_en'],\n\t \t\t\t\t\t\"subscription_desc_fr\"\t=> $row['subscription_desc_fr'],\n\t \t\t\t\t\t\"subscription_desc_en\"\t=> $row['subscription_desc_en'],\n\t \t\t\t\t\t\"created_by_id\" \t\t=> $row['created_by_id'],\n\t \t\t\t\t\t\"created_date\" \t\t=> $row['created_date'],\n\t \t\t\t\t\t\"modified_by_id\" \t\t=> $row['modified_by_id'],\n\t \t\t\t\t\t\"modified_date\" \t\t=> $row['modified_date']\n \t\t\t);\n \t\t}\n \t}\n \n \treturn $output;\n }", "public function getJobNames();", "public function getSubscriptions()\n {\n return [\n self::NAME.'.command.message',\n self::NAME.'.command.part',\n self::NAME.'.command.join',\n self::NAME.'.command.quit',\n self::NAME.'.command.kick',\n self::NAME.'.command.invite',\n ];\n }", "public function getEventNames()/*# : array */;", "public function names(): array;", "public function names(): array;", "public function getRecipients();", "public function getSubscribersCount()\n {\n return $this->formattedData['subscribers'];\n }", "public function get_members(){\n return $this->connected_clients;\n }", "public function authors_name() {\n $authors = $this -> author;\n $res = [];\n\n foreach($authors as $author) {\n array_push($res, $author->name . ' ' . $author -> surname);\n }\n\n return $res;\n }", "function & _getDestinationUsernames() {\n\t\tif (empty($this->_destination_usernames)) {\n\t\t\t$params = & $this->_getParams();\n\t\t\t\n\t\t\t$usernames = trim($params->get('alerts_jabber_destination'), \", \\r\\n\");\n\t\t\t$usernames = explode(',', $usernames);\n\t\t\t\n\t\t\t\n\t\t\t$validUsernames = array();\n\t\t\t\n\t\t\tforeach ($usernames as $k => $v) {\n\t\t\t\t$v = trim($v, \", \\r\\n\");\n\t\t\t\t\n\t\t\t\tif ($this->_isValidUsername($v))\n\t\t\t\t\t$validUsernames [ ] = $v; \n\t\t\t}\n\t\t\t\n\t\t\t$this->_destination_usernames = $validUsernames;\n\t\t}\n\t\t\n\t\treturn $this->_destination_usernames;\n\t}", "protected function _getList($showunsub)\n {\n if ($showunsub && isset($this->_cache['fulllist'])) {\n return $this->_cache['fulllist'];\n } elseif (!$showunsub && isset($this->_cache['subscribed'])) {\n return $this->_cache['subscribed'];\n }\n\n $searches = array();\n foreach (array_keys($this->_namespaces) as $val) {\n $searches[] = $val . '*';\n }\n\n $imp_imap = $GLOBALS['injector']->getInstance('IMP_Imap');\n $result = $imp_imap->listMailboxes($searches, $showunsub ? Horde_Imap_Client::MBOX_ALL : Horde_Imap_Client::MBOX_SUBSCRIBED_EXISTS, array(\n 'attributes' => true,\n 'delimiter' => true,\n 'sort' => true\n ));\n\n /* INBOX must always appear. */\n if (empty($result['INBOX'])) {\n $result = $imp_imap->listMailboxes('INBOX', Horde_Imap_Client::MBOX_ALL, array('attributes' => true, 'delimiter' => true)) + $result;\n }\n\n $tmp = array();\n foreach ($result as $val) {\n $tmp[strval($val['mailbox'])] = $val;\n }\n $this->_cache[$showunsub ? 'fulllist' : 'subscribed'] = $tmp;\n\n return $result;\n }", "public function delegateListTableNames();", "public function getList()\n {\n return $this->returnText('Full list of users and queues can be found here: https://nbq.2g.be/'. $this->c->id .'/'. urlencode($this->c->displayName) .' ');\n }", "function getAllSubscriber($search_field=\"\",$search_text=\"\")\n\t\t{\n\t\n\t\t\t\n\t\t\tif(isset($_REQUEST[\"search_field\"]))\n\t\t\t{\n\t\t\t\n\t\t\t\tif($_REQUEST[\"search_field\"] == 'name')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT member_id, concat(first_name,' ',last_name) as fullname,email, isActive \n\t\t\t\t\t\tFROM tbl_member where (member_type='subscriber' or member_type='observer' ) and\n\t\t\t\t\t\t( first_name like '%\".$search_text.\"%' or last_name like '%\".$search_text.\"%') \";\n\t\t \t\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT member_id, concat(first_name,' ',last_name) as fullname,email, isActive \n\t\t\t\t\t\tFROM tbl_member where (member_type='subscriber' or member_type='observer' ) and\n\t\t\t\t\t\t\".$search_field .\"='\".$search_text.\"'\";\n\t\t \t\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$query = \"SELECT member_id, concat(first_name,' ',last_name) as fullname,email, isActive \n\t\t\t\t\tFROM tbl_member where (member_type='subscriber' or member_type='observer' )\";\n\t\t \n\t\t\t}\n\t\t\t\n\t\t \n\t\t $rs\t\t=\t$this->Execute($query);\n\t\t return $this->_getPageArray($rs, 'Subscriber');\n\t\t}", "function getUserNameList()\r\n\t{\r\n\t\treturn $this->UserNameList;\r\n\t}", "private function get_subscribers()\n {\n return array(\n new CommentIQ_Subscriber_AssetsSubscriber($this->plugin_url . 'assets/', $this->get_supported_post_types()),\n new CommentIQ_Subscriber_PostmaticAssetsSubscriber($this->plugin_path . 'assets/' ),\n new CommentIQ_Subscriber_AutomatedatozsitesCommentSubscriber($this->get_atozsites_comment_generator(), $this->get_supported_post_types()),\n new CommentIQ_Subscriber_CommentIQAPISubscriber($this->api_client, $this->get_supported_post_types()),\n );\n }", "public function getCandidatesNamesForUsers()\n {\n $db = Zend_Db_Table::getDefaultAdapter();\n $query = \"select c.id,c.candidate_name,c.emailid from main_candidatedetails c \n where c.isactive = 1 and c.cand_status = 'Selected' and c.backgroundchk_status in ('Yet to start','Completed') and c.id not in (select rccandidatename from main_users \n where isactive = 1 and rccandidatename is not null)\";\n $result = $db->query($query);\n $data = array();\n while($row = $result->fetch())\n {\n \n $data[$row['id']] = $row['candidate_name'];\n \n }\n return $data;\n }", "public function getNewsletterRecipientIDs();", "public static function subjects_with_subscriptions($term) {\n // since it is run inside a daemon script\n $subject_ids = array();\n $results = db::$connection->query(\"SELECT subject_id FROM MyStellarSubscription \"\n . \"WHERE term='$term' GROUP BY subject_id\");\n while($results && $row = $results->fetch_assoc()) {\n $subject_ids[] = $row['subject_id'];\n }\n if($results) {\n $results->close();\n }\n return $subject_ids;\n }", "public function getsubscribers() {\r\n if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH']==\"XMLHttpRequest\") {\r\n $this->db->select()\r\n ->from('ci_subscribers sub')\r\n ->where('sub.status', 1)\r\n ->order_by('sid', 'ASC');\r\n $query = $this->db->get();\r\n $query = $query->result_array();\r\n print json_encode($query);\r\n }else{\r\n header(\"Location: \" . base_url());\r\n }\r\n }", "public function _getAllSender() {\r\n $gate = $this->config->api;\r\n $url = $gate.self::$apiMethods['get_alphanames']['url'];\r\n $method = self::$apiMethods['get_alphanames']['method'];\r\n return json_decode($this->_curl($url, $method), true);\r\n\t}", "function og_simplenews_get_subscriptions($tid) {\n $emails = array();\n\n $result = db_query('\n SELECT ss.mail\n FROM {simplenews_subscriptions} ss\n INNER JOIN {simplenews_snid_tid} sn\n ON ss.snid = sn.snid\n WHERE sn.tid = %d', $tid);\n\n while ($row = db_fetch_array($result)) {\n $emails[] = $row['mail'];\n }\n\n return $emails;\n}", "public function names()\n {\n $names = [];\n foreach ($this->items as $item) {\n $names[] = $item->getName();\n }\n\n return $names;\n }", "function getPrefixes() {\n return array(\"from\" => \"froms\", \"subject\" => \"subjects\", \"text\" => \"texts\");\n}", "public function subscribers() {\n\n $output['subscribers'] = $this->Admin_model->get_subscriber();\n\n //If you have to display grocery crud in the content panel:\n\n $crud = new grocery_CRUD();\n $crud->set_table('subscribers');\n $crud->set_theme('bootstrap');\n $crud->set_subject('Feliratkozók');\n $crud->display_as(array(\n 'name' => 'Név',\n 'email' => 'E-mail',\n 'date' => 'Dátum',\n 'active' => 'Aktív',\n )\n );\n $output = $crud->render();\n $this->load->viewadmin('index', $output, FALSE, 1);\n\n }", "public function getLoggerNames() {}", "public function getNameserversForAdding()\n {\n return $this->nameserversForAdding;\n }", "public function getSubscribersCount();", "public function listNames(callable $filter = null): array\n {\n return iterator_to_array($this->scanNames($filter));\n }", "function getSubscribersCount()\r\n\t{\r\n\t\t$query = 'SELECT COUNT(*)'\r\n\t\t\t\t.' FROM #__flexicontent_favourites'\r\n\t\t\t\t.' WHERE itemid = ' . (int)$this->_id\r\n//\t\t\t\t.' AND notify = 1'\r\n\t\t\t\t;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$subscribers = $this->_db->loadResult();\r\n\t\treturn $subscribers;\r\n\t}", "public function all()\n {\n return response()->json(\n Subscriber::all()\n );\n }", "public function get_seubjects_list(){\n\t\t$this->verify();\n\t\t$subjects=$this->admin_model->fetch_subjects_list($_GET['search']);\n\t\tforeach ($subjects as $key => $value) {\n\t\t\t$data[] = array('id' => $value['SUBJECT_ID'], 'text' => $value['SUBJECT']);\t\t\t \t\n \t\t}\n\t\techo $officers=json_encode($data);\n\t}", "protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }", "public function getUserNames()\n {\n $result = $this->getUsers()->all();\n if( is_null( $result ) ) return [];\n return array_map( function($o) {return $o->namedId;}, $result );\n }", "public function index()\n\t{\n\t\t$names = $this->name->all();\n\n\t\treturn $names;\n\t}", "public function all()\n {\n return $this->subscriptions;\n }", "public static function getNames()\n\t{\n\t\t$list = [];\n\t\tforeach (self::getCodes() as $code)\n\t\t{\n\t\t\t$list[$code] = Base::getNameByCode($code);\n\t\t}\n\n\t\treturn $list;\n\t}", "public function getProviderNames();", "public function getSubscriptionTypes();", "public function NotificationRecipients() {\n\t\t$members = new ArrayList();\n\t\t$members->merge($this->NotifyMembers());\n\t\t/** @var \\Group $group */\n\t\tforeach ($this->NotifyGroups() as $group) {\n\t\t\t$members->merge($group->Members());\n\t\t}\n\t\t$members->removeDuplicates();\n\t\treturn $members;\n\t}", "public function getTopics() {\n $names = [];\n foreach ($this->topics as $topic) {\n $names[] = $topic->entity->topic->entity->name->value;\n }\n sort($names);\n return $names;\n }", "public function get_names() {\n return String_util::get_lines(Text_file::read($this->_storage_path));\n }", "public function listInscriptions()\n {\n $slug_socio = Auth()->user()->Socio->slugSocio;\n return Inscription::listaInscripciones($slug_socio);\n }", "private function emailList()\n {\n return array(\n '[email protected]',\n '[email protected]',\n '[email protected]',\n );\n }", "public function getSubjects() {\n\t\t$error_return = \"false\";\n\n\t\t$query = \"SELECT id, full_name FROM subject\";\n\t\ttry {\n\t\t\t$results = pg_query($query);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\treturn $error_return;\n\t\t}\n\n\t\t$arr = array();\n\t\twhile ($line = pg_fetch_array($results)) {\n\t\t\t$arr[] = array('id' => $line[0], 'name' => $line[1]);\n\t\t}\n\n\t\tif (count($arr) == 0)\n\t\t\treturn $error_return;\n\t\telse\n\t\t\treturn json_encode($arr);\n\t}" ]
[ "0.75239253", "0.7135713", "0.70640355", "0.69593704", "0.6917017", "0.69065756", "0.69065756", "0.69062656", "0.6809456", "0.6561546", "0.65610844", "0.6560262", "0.65478444", "0.65375364", "0.6525476", "0.6525476", "0.6525476", "0.6525476", "0.6525476", "0.6525476", "0.6525476", "0.65163267", "0.65045106", "0.65002275", "0.6483472", "0.64648145", "0.6403088", "0.63819957", "0.6381645", "0.6371141", "0.6371141", "0.6371141", "0.6346014", "0.6341088", "0.63355345", "0.6280461", "0.6264891", "0.6239482", "0.6235227", "0.623043", "0.62091845", "0.6176241", "0.61406755", "0.61197895", "0.6119265", "0.61127657", "0.60899544", "0.6077076", "0.60534936", "0.60461074", "0.60442823", "0.6039288", "0.60275376", "0.6003827", "0.6001199", "0.5989388", "0.59762174", "0.5954872", "0.5942426", "0.5942426", "0.59327906", "0.592421", "0.5916229", "0.59159744", "0.5892411", "0.5888918", "0.58659756", "0.5865504", "0.5850171", "0.5838562", "0.5835359", "0.58323145", "0.5826278", "0.5818015", "0.58013827", "0.5796886", "0.5792619", "0.57828546", "0.5781265", "0.57580274", "0.57548267", "0.5735361", "0.5734741", "0.5729972", "0.5719807", "0.57130474", "0.57121086", "0.5699668", "0.5696308", "0.56871736", "0.56707674", "0.56541455", "0.5650574", "0.5639352", "0.5637833", "0.563384", "0.56337845", "0.5630382", "0.56257296", "0.5621333" ]
0.6031234
52
Remove all data from the given resource
public function deleteResource($resourceType, $resourceId) { $this->backend->deleteChannels($this->getChanIdList($resourceType, $resourceId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Resource $resource)\n {\n //\n }", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "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 delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function clearData() {\n unset($this->data);\n }", "public function remove_all_data()\n\t{\n\t\t$this->_data = array();\n\t}", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "public function cleanup() {\r\n\t\t$this->resource->cleanup();\r\n\t}", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "public function clean() {\n $this->requires = array();\n $this->getResource()->clear();\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function clear(): void\n {\n $app = App::get();\n $list = $app->data->getList()\n ->filterBy('key', '.temp/cache/', 'startWith');\n foreach ($list as $item) {\n $app->data->delete($item->key);\n };\n }", "public function 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 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 __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->resource);\n\t\t\tunset($this->methods);\n\t\t\tunset($this->name);\n\t\t}", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function __unset($name)\n {\n if (is_array($this->resource)) {\n\n unset($this->resource[$name]);\n\n return;\n }\n\n unset($this->resource->$name);\n }", "public function clear()\n\t{\n\t\t$this->getObject()->clear();\n\t}", "protected function _postDelete()\n {\n $this->clearResources();\n }", "public function __destruct()\n {\n unset($this->data);\n }", "public function __unset($key)\n {\n unset($this->resource->{$key});\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function clearApplicationData();", "public function delete_data_to_tombstone(){\n }", "public function destroy(): void\n {\n foreach ($this->getAll() as $k => $v) {\n if (strlen(strval($k)) > 0) {\n $this->remove($k);\n }\n }\n return;\n }", "function remove($aws_data_object) {\n\t\t}", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove() {}", "public function remove() {}", "private function clearData()\n {\n $this->_data=array();\n }", "function destructor()\n\t{\n\t\tunset($Resources,$FileName,$FileType,$FileSize,$NumRes,$FileVersion,$Description,$DataOffset);\n\t}", "public function __destruct()\n {\n $this->data = null;\n }", "public function removeTemporary();", "public function clear()\n {\n $this->data = [];\n }", "private function _clearCache()\n {\n Cache::forget(\"roaddamage-resource:{$this->id}\");\n foreach ($this->getReports() as $report) {\n Cache::forget(\"report-resource:{$report->id}\");\n }\n }", "public function clear()\n {\n $this->_data = [];\n }", "function deleteResourceByID($id)\n{\n\t$sql = \"DELETE FROM `\".DB_NAME.\"`.`resources` WHERE `resources`.`rid` = \".$id;\n\t\n\t$result = mysql_query($sql);\n\t\n\treturn $result;\n}", "public function offsetUnset($key)\n {\n if (is_array($this->resource) or $this->resource instanceof \\ArrayAccess) {\n\n unset($this->resource[$key]);\n } elseif (is_object($this->resource) and isset($this->resource->{$key})) {\n\n unset($this->resource->{$key});\n }\n }", "public function delete()\n {\n try {\n $connection = $this->resourceConfig->getConnection();\n $connection->delete(\n $this->resourceConfig->getMainTable(),\n [\n $connection->quoteInto('path = ?', Data::XML_META_TAG),\n ]\n );\n $this->cleanCache();\n $response = ['status' => 'OK'];\n } catch (\\Exception $e) {\n $this->logError($e);\n $response['status'] = 'FAILED';\n $response['message'] = $e->getMessage() . '. For more info please check magento squarefeed log file.';\n\n }\n return [$response];\n }", "public function removeAll()\n {\n foreach ($this->findAll() as $object) {\n $this->remove($object);\n }\n }", "public function clear()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->multiRef = [];\n\n }", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function clear() {\n $this->_data = [];\n }", "public function flushData()\n\t{\n\t\t$class = get_class($this);\n\t\tunset($this->_data[$class]);\n\t}", "public function reclaim();", "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 delTemplateData() {\r\n\t\t$this->templateData = [];\r\n\t}", "protected function clear() {}", "public function unload()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->orm = null;\n\n $this->multiRef = [];\n $this->i18n = null;\n\n }", "abstract protected function unSerializeData();", "public function destroy(ResourceSubject $resourceSubject)\n {\n //\n }", "public function clean()\n\t{\n\t\t$this->deleteFromContainer($this->binary);\n\t}", "public function destroy()\n {\n $this->items = array();\n }", "public function clearResources()\n {\n AM_Tools::clearContent($this->_getIssueHelpPage()->getThumbnailPresetType(), $this->_getIssueHelpPage()->id_issue);\n AM_Tools::clearResizerCache($this->_getIssueHelpPage()->getThumbnailPresetType(), $this->_getIssueHelpPage()->id_issue);\n }", "public 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(Data $data)\n {\n //\n }", "public function clearPending();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function clear();", "public function remove() {\n\n // Updates DB (data & metadata)\n $this->attributes->removeAll($this->get(\"id\"));\n $this->db->delete(XCMS_Tables::TABLE_USERS, array(\n \"id\" => $this->get(\"id\")\n ));\n\n }", "public function remove($data, array $context = [])\n {\n $data->setArchivage(true);\n $this->em->remove($data);\n $this->em->persist($data);\n //$this->em->remove($data);\n $this->em->flush();\n }", "private function eraseObject() {\n $this->tripId = \"\";\n $this->journalId = \"\";\n $this->created = null;\n $this->updated = null;\n $this->latestUpdated = null;\n $this->userId = \"\";\n $this->journalDate = \"\";\n $this->journalTitle = \"\";\n $this->journalText = \"\";\n $this->deleted = \"N\";\n $this->hash = \"\";\n $this->latestHash = \"\";\n }", "public function destroy()\n {\n $this->_info = new stdClass();\n if( is_resource($this->_resource) )\n {\n imagedestroy($this->_resource);\n }\n }", "public function __destruct() {\n\t\t\tparent::__destruct();\n\t\t\tunset($this->data);\n\t\t\tunset($this->file);\n\t\t\tunset($this->image);\n\t\t\tunset($this->uri);\n\t\t}", "protected function DELETE(ResourceObject $resource) {\n\t\tif ($this->request->headers['Depth'] != null &&\n\t\t $this->request->headers['Depth'] != 'infinity')\n\t\t\tthrow new HTTPStatusException(400, 'Bad Request');\n\n#[TODO]\t\t// check lock status\n#\t\tif (!$this->_check_lock_status($this->path))\n#\t\t\tthrow new HTTPStatusException(423, 'Locked');\n\n\t\t// delete the resource\n\t\tif (!$resource->getParent()->deleteChild(basename($resource->getPath())))\n\t\t\tthrow new HTTPStatusException(424, 'Failed Dependency');\n\t\t// return no content\n\t\t$this->response->status->set(204);\n\t}", "public function rm_whole() {\n\t\t$this->rm_controller();\n\t\t$this->rm_model();\n\t\t$this->rm_entity();\n\t}", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function purge();", "public function purge();", "public function purge();", "abstract public function remove();", "abstract public function remove();", "abstract public function remove();", "public function destroy() {\n unset($this->items);\n $this->items = false;\n }" ]
[ "0.67114913", "0.6629104", "0.6500741", "0.64957446", "0.6438744", "0.6369617", "0.63552535", "0.62876713", "0.62855494", "0.6283532", "0.6232912", "0.6222492", "0.6208339", "0.61838716", "0.6150772", "0.61491525", "0.6109051", "0.607161", "0.60643256", "0.6051124", "0.6046812", "0.6039922", "0.6026616", "0.6017234", "0.6017234", "0.6017234", "0.6017234", "0.5991426", "0.5987698", "0.5928981", "0.59173846", "0.59111214", "0.59022117", "0.5901831", "0.587542", "0.5863139", "0.58516383", "0.58359593", "0.5831992", "0.58308196", "0.58257645", "0.5809782", "0.579567", "0.5790231", "0.57901984", "0.5784707", "0.5771536", "0.5766996", "0.5764801", "0.57642317", "0.57589847", "0.5756533", "0.5753452", "0.57521766", "0.5743693", "0.5720512", "0.56999403", "0.56991166", "0.5691423", "0.56851995", "0.5679389", "0.56770414", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.566719", "0.56415206", "0.5640778", "0.56377935", "0.56368834", "0.5634628", "0.5633709", "0.5629412", "0.5627609", "0.5627608", "0.5627608", "0.5627608", "0.5625263", "0.5625263", "0.5625263", "0.56243706" ]
0.0
-1
Subscribe to a chan This method will implicetely create the channel if non existant
public function subscribe( $resourceType, $resourceId, $subscriberId, $subscriberType = null ) { $chanIdList = $this->getChanIdList($resourceType, $resourceId); // Create the channels if they don't exists, no errors $this->backend->createChannels($chanIdList, true); // FIXME: Optimize this whenever this becomes possible foreach ($this->getSubscriberNameList($subscriberId, $subscriberType) as $name) { foreach ($chanIdList as $chanId) { $this->backend->subscribe($chanId, $name); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function subscribe($channel)\n {\n return parent::subscribe($channel);\n }", "public function Subscribe() {\n\t\t// Process pending messages if any\n\t\t$this->ProcessPendingMessages();\n\t\t// Subscribe\n\t\t$this->GetSubsConn()->subscribe(\n\t\t\t[$this->GetChannel()],\n\t\t\t[$this, 'SubscribeCallback']\n\t\t);\n\t}", "public function subscribe($channels);", "public function subscribe();", "public function subscribes();", "function channelCreate(ChannelInterface $channel);", "private function subscribe()\n {\n $this->botman->hears('subscribe', function (BotMan $bot) {\n $userId = $bot->getUser()->getId();\n $user = Subscriber::where('telegram_user_id', $userId)->first();\n $userMsg = 'You are already subscribed';\n\n if(is_null($user))\n {\n Subscriber::create(['telegram_user_id' => $userId]);\n $userMsg = 'You have just subscribed to our updates!';\n }\n\n $bot->reply($userMsg);\n });\n }", "public function subscribe(): void;", "private static function subscribe($ch, $dir) {\n\t\t$channel = Channel::getChannelData(Input::get('channel'));\n\n\t\t$response = Reddit::fetch('api/subscribe', [\n\t\t\t'action' => ($dir ? 'sub' : 'unsub'),\n\t\t\t'sr' => 't5_'.$channel['id']\n\t\t], 'POST'); \n\n\t\tCache::tags(Session::get('user.name'))->forget('mine');\n\n\t\treturn;\n\t}", "public function channel()\n {\n }", "function channel(): Channel\n {\n return new Channel();\n }", "function ts3client_requestChannelSubscribeAll($serverConnectionHandlerID) {}", "public function subscribe( $sChannel )\n\t{\n\t\t//var_dump( \"******************************************* PubSubZmq subscribe\", $sChannel );\n\n\t\t$this->initSubscriber();\n\n\t\tif ( $this->m_bHasEventLoop )\n\t\t{\n\t\t\t$this->m_cSubscriber->subscribe( $sChannel );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->m_cSubscriber->setSockOpt( \\ZMQ::SOCKOPT_SUBSCRIBE, $sChannel );\n\t\t}\n\t}", "public function generateChannel(){\n\t\t$tempArray = array();\n\t\tpreg_match('/\\+(.*?)@/', $this->recipient, $tempArray);\n\t\t$this->channel = $tempArray[1];\n\t}", "public function subscription();", "private function subscribe(Twitch $twitch, Channel $channel, string $activity): void\n {\n if ($this->options[self::OPTIONS_ONLY] && !in_array($activity, $this->options[self::OPTIONS_ONLY], true)) {\n return;\n }\n\n $requiresUserAccessToken = in_array($activity, self::AFFILIATE_AND_PARTNER_ONLY_WEBHOOKS, true);\n\n $subscriber = new Subscriber();\n $callbackUrl = $this->getCallbackUrl($channel->getKey(), $activity);\n $feedUrl = Subscriber::getFeedUrl($twitch, $channel->getKey(), $activity);\n\n if ($requiresUserAccessToken) {\n // prevent subscribe of affiliate & partner-only webhooks for normal broadcasters\n if (empty($channel->broadcaster_type)) {\n $this->skip($subscriber, $feedUrl, 'The broadcaster type is empty.');\n return;\n }\n\n if (empty($channel->oauth_access_token)) {\n $this->skip($subscriber, $feedUrl, 'The oauth access token is empty.');\n return;\n }\n\n $twitch->setToken($channel->oauth_access_token);\n }\n\n $subscriber->subscribe($callbackUrl, $feedUrl, $channel->getKey());\n }", "public function onChannel($channel);", "public function subscribe($force = FALSE);", "public abstract function subscribe(Subject $subject);", "public function subscribe(SubscriberInterface $subscriber);", "public function channel($channel);", "public function createSubscriber();", "public function broadcastOn()\n {\n// return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n// return new PrivateChannel('channel-name');\n }", "public function broadcastOn() {\n// return new PrivateChannel('channel-name');\n }", "private function initSubscriber()\n\t{\n\t\tif ( !isset( $this->m_cSubscriber ) || !$this->m_cSubscriber )\n\t\t{\n\t\t\tif ( $this->m_bHasEventLoop )\n\t\t\t{\n\t\t\t\t$this->m_cSubscriber = $this->m_cContext->getSocket( \\ZMQ::SOCKET_SUB );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->m_cSubscriber = new \\ZMQSocket( $this->m_cContext, \\ZMQ::SOCKET_SUB );\n\t\t\t}\n\n\t\t\t$this->m_cSubscriber->connect( \"tcp://\". Config::getWampZmqIP() .\":\". Config::getWampZmqPort() );\n\t\t}\n\t}", "public function subscribe($subscriber);", "function target_add_forum_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'forum_notify (user_id, forum_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['forum_id'] .')');\n}", "public function store($channel, Thread $thread)\n {\n $thread->subscribe();\n }", "public function getChannel();", "public function subscribe()\n {\n $payload = request()->validate([\n 'topics' => 'required|array',\n 'callback' => 'required|url',\n ]);\n\n $topics = array_map(function ($topic) {\n return $this->topics->findOrCreate($topic);\n }, $payload['topics']);\n\n abort_unless(! empty($topics), 404);\n\n $subscriber = $this->subscribers->create($topics, $payload);\n\n }", "public function subscribe(ConnectionInterface $conn, Topic $topic)\n {\n $resource_id = $conn->resourceId;\n\n $client = Client::where('resource_id', $resource_id)->first();\n if (!$client) {\n qlog(\"Unverified client attempted to start listening to {$topic}.\");\n $conn->close();\n }\n\n list($original, $channel, $key, $event) = $this->seperatePrivateChannel($topic);\n list($channel, $site) = $this->validatePrivateToken($conn, $channel, $key);\n\n if (!is_null($channel)) {\n if (!$client->isSubscribed($channel, $event)) {\n $client->subscriptions()->attach($channel->id, ['event' => $event]);\n }\n qlog(\"{$resource_id} tuned into {$channel->name} on {$site->name}, listening to {$event}.\");\n }\n }", "function target_add_topic_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread_notify (user_id, thread_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['topic_id'] .')');\n}", "function subscribe($user, $data, ConnectionInterface $conn)\n {\n\n\n if ($user->is_block_from($data->roomId, 100))return;\n\n if (isset($user->id)) {\n\n if (isset($this->userresources[$data->channel][$user->id])) {\n if (!in_array($conn->resourceId, $this->userresources[$data->channel][$user->id])) {\n //$this->userresources[$data->userId][] = $conn->resourceId;\n $this->userresources[$data->channel][$user->id]['resourceId'] = $conn->resourceId;\n $this->userresources[$data->channel][$user->id]['userName'] = $user->nick_name;\n $this->userresources[$data->channel][$user->id]['cantWrite'] = $user->is_block_from($data->roomId, 2);\n $this->userresources[$data->channel][$user->id]['cantChangeColor'] = $user->is_block_from($data->roomId, 3);\n $this->userresources[$data->channel][$user->id]['cantSendPrivateMessage'] = $user->is_block_from($data->roomId, 5);\n }\n } else {\n $this->userresources[$data->channel][$user->id] = [];\n $this->userresources[$data->channel][$user->id]['resourceId'] = $conn->resourceId;\n $this->userresources[$data->channel][$user->id]['userName'] = $user->nick_name;\n $this->userresources[$data->channel][$user->id]['cantWrite'] = $user->is_block_from($data->roomId, 2);\n $this->userresources[$data->channel][$user->id]['cantChangeColor'] = $user->is_block_from($data->roomId, 3);\n $this->userresources[$data->channel][$user->id]['cantSendPrivateMessage'] = $user->is_block_from($data->roomId, 5);\n }\n }\n\n $userId = $user->id;\n\n /*$counts = array_count_values($this->subscriptions);\n $filtered = array_filter($this->subscriptions, function ($value) use ($counts, $data) {\n return $counts[$value] = $data->channel;\n });\n $users = [];\n foreach ($filtered as $key => $value)\n {\n $users[$key] = $this->userresources[$key];\n //array_push($users, $this->userresources[$key]);\n }*/\n $result['type'] = 'room_users';\n $result['data'] = $this->userresources[$data->channel];\n $result['testData'] = '';\n $conn->send(json_encode($result));\n\n $this->subscriptions[$conn->resourceId] = $data->channel;\n $result['type'] = 'room_messages';\n $result['data'] = Message::with('user')->where(\"room_id\", $data->roomId)->get()->toJson();\n\n $conn->send(json_encode($result));\n $this->groupChat($user, $data, $conn, true);\n }", "public function broadcastOn()\n {\n //return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n //return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n //return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n //return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new Channel('my-channel');\n }", "public function subscribeThread(ThreadRepositoryInterface $thread): PodiumResponse;", "public function broadcastOn()\n {\n // Have no idea about this\n // return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n// return new PrivateChannel('news-action');\n// return ['news-action'];\n return new Channel('news-action.');\n }", "public function subscribeToChannel($channelTag) {\n return $this->_request(self::API_SUBSCRIPTIONS, array(\n 'channel_tag' => $channelTag,\n ));\n }", "public function subscribe($channels, Closure $callback)\n {\n $this->client->subscribe((array) $channels, function ($redis, $channel, $message) use ($callback) {\n $callback($message, $channel);\n });\n }", "public function channels(): ChannelsService;", "public function subscribe($subscriber): void;", "private function __constuct()\n\t{\n\t\t$this->channels = new Channels();\n\t}", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function broadcastOn()\n {\n return new PrivateChannel('channel-name');\n }", "public function createSubscription($channels, Closure $callback, $method = 'subscribe')\n {\n //\n }", "public function subscribe($commandName, CommandHandlerInterface $handler);", "public function subscribesCounter();", "public function channel() {\n if(is_null($this->channel)) {\n $this->channel = new Channel($this->connect()->connect([]));\n }\n \n return $this->channel;\n }", "function Newsubscriptions($command,$subscriber,$keyword){\n\t$keyword=strtoupper($keyword);\n\t$sqlKW = \"select channelID,channelName,keyword from infoChannels where keyword like '%$keyword%' limit 1\";\n\t$resultKW = mysql_query($sqlKW);\n\t#log errors\n\t\n\tif(!$resultKW){\n\t\t##Notify user...probably wrong keyword\n\t\tinvalidKeyword($subscriber, $keyword);\n\t\t$dbErr=\"SQL Error: \".mysql_error().\"SQL CODE: \".$sqlKW;\n\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t}\n\twhile($rows=mysql_fetch_array($resultKW)){\n\t\t$channelID = $rows['channelID'];\n\t}\n\t\n\t$sql_newSub = \"insert into subscriptions(channelID,msisdn,dateSubscribed) values($channelID,'$subscriber',now())\";\n\t$result_newSub = mysql_query($sql_newSub);\n\t#log errors\n\tif(!$result_newSub){\n\t\t$dbErr=\"SQL Error: \".mysql_error().\"SQL CODE: \".$sqlKW;\n\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t}\n\telse{\n\t\t$subsLogs = \"Successfully subscribed \".$subscriber .\" to $keyword alerts\";\n\t\tlogSubs($subsLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t$state= 'subscribe';\n\t\tsubscriptionStatus($subscriber, $keyword, $state);\n\t}\n}", "public function channel($id_or_name, $synced_at = null);", "public function broadcastOn()\n {\n return new Channel('riskgenius');\n }", "public function broadcastOn() {\n return new PrivateChannel('channel-name');\n }", "public function subscribe(Topic $topic, Connection $connection);" ]
[ "0.6533913", "0.6376047", "0.63607186", "0.62793094", "0.60998684", "0.60696137", "0.6053881", "0.5993224", "0.59272623", "0.5904284", "0.57162416", "0.57097095", "0.5706684", "0.56542784", "0.56498015", "0.56310725", "0.5612791", "0.5573114", "0.5549742", "0.5542514", "0.5534092", "0.5508991", "0.54679966", "0.54679966", "0.54616255", "0.5437589", "0.5425691", "0.5394751", "0.5390567", "0.5362297", "0.536158", "0.53569204", "0.5339675", "0.5327572", "0.5323362", "0.5323362", "0.5323362", "0.5323362", "0.5308973", "0.5296173", "0.5242237", "0.5223535", "0.5220746", "0.5181061", "0.5171145", "0.51581836", "0.51488894", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.5132957", "0.51322955", "0.51280725", "0.51197475", "0.51156133", "0.50961626", "0.509006", "0.5078415", "0.50769097", "0.5076045" ]
0.5181487
43