query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Get the path to where we should create the interface.
protected function getInterfacePath() { return './app/Repositories/' . $this->className . 'Interface.php'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInterfacePath (string $file): string {\n\treturn _ROOT_PATH.'classes/interfaces/'.$file.'.php';\n}", "protected function _getPath()\n {\n if (!empty($this->_path)) {\n return $this->_path;\n }\n\n $id = $this->_config['id'];\n $dir0 = $id % 10000;\n $dir1 = $dir0 % 100;\n $dir2 = $dir0 - $dir1 * 100;\n if ($dir2 < 0) {\n $dir2 = 0;\n }\n $path = 'apps/';\n\n switch ($this->_config['section']) {\n case 1 :\n $path .= 'scripteditor/' . $dir2 . '/' . $dir1 . '/';\n break;\n \tcase 2 :\n $path .= 'slave/' . $dir2 . '/' . $dir1 . '/';\n break;\n default :\n $path .= 'tmp/';\n break;\n }\n $this->_path = $path;\n return $this->_path;\n }", "protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }", "private static function getPath() : string {\n return getBasePath() . '/miaus';\n }", "function getPath(): string;", "public function getWritePath();", "abstract protected function getPath();", "public function path(): string\n {\n return components_path($this->name);\n }", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "public function getPath(): string;", "protected abstract function getPath();", "protected function getStubPath()\n {\n // Stub path.\n $stub_path = dirname(dirname(dirname(dirname(__DIR__)))).'/resources/stubs/';\n // Return the stub path.\n return $stub_path;\n }", "public function path();", "public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }", "public function path()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'app';\n }", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function getPath() {}", "public function createPath()\n {\n return config('maxolex.config.views').'/'.$this->parser->singular().'/'.'create.blade.php';\n }", "public function getInstallationPath()\n {\n return get_storage_path($this->getSubdir().DIRECTORY_SEPARATOR.$this->getId());\n }", "protected function getInstancePath() {}" ]
[ "0.6625407", "0.6476941", "0.6331884", "0.63185585", "0.62933266", "0.6293271", "0.6279562", "0.6279519", "0.6246223", "0.6246223", "0.6246223", "0.6246223", "0.6246223", "0.6246223", "0.6246223", "0.6246223", "0.62335765", "0.6226768", "0.62226045", "0.62222993", "0.62222993", "0.6215859", "0.6215859", "0.6215859", "0.6215859", "0.6215092", "0.6214828", "0.62033105", "0.6194289", "0.6191683" ]
0.7623572
0
Compile the repository stub.
protected function compileRepositoryStub() { $stub = $this->files->get(__DIR__ . '/stubs/repository.stub'); $this ->replaceAppNamespace($stub) ->replaceClassName($stub) ->replaceEntityName($stub); return $stub; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function compileInterfaceStub()\n {\n $stub = $this->files->get(__DIR__ . '/stubs/repository-interface.stub');\n $this\n ->replaceAppNamespace($stub)\n ->replaceClassName($stub)\n ->replaceEntityName($stub);\n\n return $stub;\n }", "protected function makeRepository()\n {\n if ($this->files->exists($path = $this->getRepositoryPath())) {\n return $this->error($this->className . ' already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileRepositoryStub());\n $this->info('Repository created successfully.');\n }", "protected function makeRepositoryInterface()\n {\n if ($this->files->exists($path = $this->getInterfacePath())) {\n return $this->error($this->classParts() . 'Interface already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileInterfaceStub());\n $this->info('Repository Interface created successfully.');\n }", "public function createStub()\n {\n $stub = <<<STUB\n#!/usr/bin/env php\n<?php\n\n/**\n * Genereated by Box: http://github.com/kherge/Box\n */\n\nPhar::mapPhar('{$this->alias}');\n\n\nSTUB\n ;\n\n if ($this->intercept) {\n $stub .= <<<STUB\nPhar::interceptFileFuncs();\n\n\nSTUB\n ;\n }\n\n if ($this->main) {\n $stub .= <<<STUB\nrequire 'phar://{$this->alias}/{$this->main}';\n\n\nSTUB\n ;\n }\n\n $stub .= \"__HALT_COMPILER();\";\n\n return $stub;\n }", "protected function compileMigrationStub()\n {\n $stub = $this->files->get(__DIR__ . '/../stubs/migration.stub');\n $this->replaceClassName($stub)\n ->replaceSchema($stub)\n ->replaceTableName($stub);\n return $stub;\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/repository.stub';\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/repository.stub';\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/repository.stub';\n }", "public static function compiles()\n {\n $dir = static::guessPackageClassPath('royalcms/repository');\n\n return [\n $dir . \"/Repositories/AbstractRepository.php\",\n $dir . \"/Traits/Cacheable.php\",\n $dir . \"/Contracts/RepositoryContract.php\",\n $dir . \"/RepositoryServiceProvider.php\",\n ];\n }", "protected function getStub()\n {\n return __DIR__.'/../stubs/repository.stub';\n }", "public function compile ();", "protected function getStub()\n {\n return __DIR__ . '/stubs/repository-interface.stub';\n }", "protected function getInterfacesStub()\n {\n return __DIR__.'/../stubs/repository.interface.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../stubs/repository.stub';\n }", "function repositoryCustom()\n {\n }", "public function repository(): RepositoryContract;", "protected function compileControllerStub()\n {\n $stub = $this->files->get(substr(__DIR__,0, -5) . 'Stubs/controller.stub');\n\n $stub = $this->buildStub($this->flaravelCommandObj->getMeta(), $stub);\n\n $stub = str_replace('\\{{Folder}}', $this->flaravelCommandObj->option('f') == null ? '' : '\\\\'.$this->flaravelCommandObj->option('f'), $stub);\n\n return $stub;\n }", "private function getStub(): string\n {\n $stub = <<<'EOF'\n#!/usr/bin/env php\n<?php\nPhar::mapPhar('php-optimize.phar');\nrequire 'phar://php-optimize.phar/bin/php-optimize';\n__HALT_COMPILER(); ?>\nEOF;\n\n return $stub;\n }", "protected function compileStub(string $type = 'store'): string\n {\n $stub = $this->files->get($this->resolveStubPath('/app/Http/Requests/Request.stub'));\n\n $this\n ->replaceSchema($stub)\n ->replaceClassTypeName($stub, $type)\n ->replaceNamespace($stub)\n ->replaceModelName($stub);\n\n return $stub;\n }", "function compile ($src);", "public function initRepository(): void;", "private function getStub()\n {\n return app_path() . '\\Stubs\\repository_contract.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../Stubs/RepositoryInterface.stub';\n }", "private function createStub()\n {\n $stub = $this->getStub();\n $populatedStub = $this->populateStub($stub);\n $this->writeFile($populatedStub);\n }", "public static function init($stubs) {\n\n\t\tif (empty($stubs)) {\n\t\t\treturn;\n\t\t}\n\n\t\tumask(0);\n\n\t\t// something totally nasty, just for fun\n\t\t$path = static::getPath();\n\t\tis_dir($path) or mkdir($path) or die('cannot mkdir');\n\t\tis_writable($path) or die('cannot write path');\n\n\t\t// this gonna be nasty anyway\n\t\t$code = '';\n\n\t\tforeach ($stubs as $eachClassName=>$eachStubbedMethods) {\n\t\t\t$classPath = $path . '/' . $eachClassName;\n\t\t\tis_dir($classPath) or mkdir ($classPath);\n\n\t\t\t$ninjaClassName = 'ninja\\\\' . $eachClassName;\n\t\t\t$code.= <<<EOS\n\nclass $eachClassName extends $ninjaClassName {\n\nEOS;\n\n\t\t\tforeach ($eachStubbedMethods as $eachStubbedMethod) {\n\n\t\t\t\t$methodPath = $classPath . '/' . $eachStubbedMethod;\n\t\t\t\tis_dir($methodPath) or mkdir($methodPath);\n\n\t\t\t\t$Method = new \\ReflectionMethod($ninjaClassName, $eachStubbedMethod);\n\n\t\t\t\t$xStatic = $Method->isStatic() ? 'static ' : '';\n\t\t\t\t$xPrivate = $Method->isPrivate() ? 'private ' : '';\n\t\t\t\t$xProtected = $Method->isProtected() ? 'protected ' : '';\n\t\t\t\t$xPublic = strlen($xPrivate . $xProtected) ? '' : 'public ';\n\n\t\t\t\t$numReqParams = $Method->getNumberOfRequiredParameters();\n\t\t\t\t$numParams = $Method->getNumberOfParameters();\n\n\t\t\t\t$params = [];\n\t\t\t\tfor ($i=0; $i<$numReqParams; $i++) {\n\t\t\t\t\t$params[] = '$p' . $i;\n\t\t\t\t}\n\t\t\t\tfor ($i; $i<$numParams; $i++) {\n\t\t\t\t\t$params[] = '$p' . $i . '=null';\n\t\t\t\t}\n\n\t\t\t\t$params = implode(', ', $params);\n\t\t\t\t$code.= <<<EOS\n\n\t$xStatic$xPrivate$xProtected${xPublic}function $eachStubbedMethod ($params) {\n\t\tstatic \\$counter=0;\n\n\t\t\\$ret = call_user_func_array(['$ninjaClassName', '$eachStubbedMethod'], func_get_args());\n\n\t\t\\$fname = md5(\\$_SERVER['REQUEST_URI']);\n\t\t\\$fname = '$methodPath/' . \\$fname . '-' . \\$counter++ . '.php';\n\n\t\t\\$requestUri = \\$_SERVER['REQUEST_URI'];\n\t\t\\$othis = str_replace(\"'\", \"\\\\'\", serialize(\\$this));\n\t\t\\$method = '$eachStubbedMethod';\n\t\t\\$params = str_replace(\"'\", \"\\\\'\", serialize(func_get_args()));\n\t\t\\$oret = str_replace(\"'\", \"\\\\'\", serialize(\\$ret));\n\n\t\tfile_put_contents(\n\t\t\t\\$fname,\n\t\t\t'<?php return [\n\t\\'requestUri\\' => \\'' . \\$requestUri . '\\',\n\t\\'object\\' => unserialize(\\'' . \\$othis . '\\'),\n\t\\'method\\' => \\'' . \\$method . '\\',\n\t\\'params\\' => unserialize(\\'' . \\$params . '\\'),\n\t\\'returned\\' => unserialize(\\'' . \\$oret . '\\'),\n];\n'\n\t\t);\n\t\treturn \\$ret;\n\t}\n\nEOS;\n\n\t\t\t}\n\n\t\t}\n\n\t\t$code.= <<<EOS\n\n};\n\nEOS;\n\n\t\techop($code);\n\n\t\t// stubbed class is now in $code\n\t\teval($code);\n\n\t}", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "protected function getStub()\n {\n //\n }", "protected function makeRepo()\n {\n // debido a que el repositorio de direccion depende\n // del repositorio de empleado que tiene sus\n // dependendias, y como no queremos usar\n // el IOC container, lo hacemos\n // explicitamente aqui.\n return new AddressRepository(\n new Address(),\n new EmployeeRepository(\n new Employee(),\n new UserRepository(new User())\n )\n );\n }", "protected function getStub(): string\n {\n return __DIR__.'/stubs/php_cs.stub';\n }" ]
[ "0.6496916", "0.59265435", "0.59239167", "0.5685118", "0.56538516", "0.5651959", "0.5651959", "0.5651959", "0.56041217", "0.5577557", "0.550506", "0.54653037", "0.53241444", "0.5295008", "0.528207", "0.52576166", "0.52220124", "0.52162635", "0.520693", "0.52029586", "0.5170955", "0.5153811", "0.5140522", "0.51327294", "0.5115077", "0.50979334", "0.5089927", "0.5086248", "0.50772077", "0.50726026" ]
0.748778
0
Compile the repository stub.
protected function compileInterfaceStub() { $stub = $this->files->get(__DIR__ . '/stubs/repository-interface.stub'); $this ->replaceAppNamespace($stub) ->replaceClassName($stub) ->replaceEntityName($stub); return $stub; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function compileRepositoryStub()\n {\n $stub = $this->files->get(__DIR__ . '/stubs/repository.stub');\n $this\n ->replaceAppNamespace($stub)\n ->replaceClassName($stub)\n ->replaceEntityName($stub);\n\n return $stub;\n }", "protected function makeRepository()\n {\n if ($this->files->exists($path = $this->getRepositoryPath())) {\n return $this->error($this->className . ' already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileRepositoryStub());\n $this->info('Repository created successfully.');\n }", "protected function makeRepositoryInterface()\n {\n if ($this->files->exists($path = $this->getInterfacePath())) {\n return $this->error($this->classParts() . 'Interface already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileInterfaceStub());\n $this->info('Repository Interface created successfully.');\n }", "public function createStub()\n {\n $stub = <<<STUB\n#!/usr/bin/env php\n<?php\n\n/**\n * Genereated by Box: http://github.com/kherge/Box\n */\n\nPhar::mapPhar('{$this->alias}');\n\n\nSTUB\n ;\n\n if ($this->intercept) {\n $stub .= <<<STUB\nPhar::interceptFileFuncs();\n\n\nSTUB\n ;\n }\n\n if ($this->main) {\n $stub .= <<<STUB\nrequire 'phar://{$this->alias}/{$this->main}';\n\n\nSTUB\n ;\n }\n\n $stub .= \"__HALT_COMPILER();\";\n\n return $stub;\n }", "protected function compileMigrationStub()\n {\n $stub = $this->files->get(__DIR__ . '/../stubs/migration.stub');\n $this->replaceClassName($stub)\n ->replaceSchema($stub)\n ->replaceTableName($stub);\n return $stub;\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/repository.stub';\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/repository.stub';\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/repository.stub';\n }", "public static function compiles()\n {\n $dir = static::guessPackageClassPath('royalcms/repository');\n\n return [\n $dir . \"/Repositories/AbstractRepository.php\",\n $dir . \"/Traits/Cacheable.php\",\n $dir . \"/Contracts/RepositoryContract.php\",\n $dir . \"/RepositoryServiceProvider.php\",\n ];\n }", "protected function getStub()\n {\n return __DIR__.'/../stubs/repository.stub';\n }", "public function compile ();", "protected function getStub()\n {\n return __DIR__ . '/stubs/repository-interface.stub';\n }", "protected function getInterfacesStub()\n {\n return __DIR__.'/../stubs/repository.interface.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../stubs/repository.stub';\n }", "function repositoryCustom()\n {\n }", "public function repository(): RepositoryContract;", "protected function compileControllerStub()\n {\n $stub = $this->files->get(substr(__DIR__,0, -5) . 'Stubs/controller.stub');\n\n $stub = $this->buildStub($this->flaravelCommandObj->getMeta(), $stub);\n\n $stub = str_replace('\\{{Folder}}', $this->flaravelCommandObj->option('f') == null ? '' : '\\\\'.$this->flaravelCommandObj->option('f'), $stub);\n\n return $stub;\n }", "private function getStub(): string\n {\n $stub = <<<'EOF'\n#!/usr/bin/env php\n<?php\nPhar::mapPhar('php-optimize.phar');\nrequire 'phar://php-optimize.phar/bin/php-optimize';\n__HALT_COMPILER(); ?>\nEOF;\n\n return $stub;\n }", "protected function compileStub(string $type = 'store'): string\n {\n $stub = $this->files->get($this->resolveStubPath('/app/Http/Requests/Request.stub'));\n\n $this\n ->replaceSchema($stub)\n ->replaceClassTypeName($stub, $type)\n ->replaceNamespace($stub)\n ->replaceModelName($stub);\n\n return $stub;\n }", "function compile ($src);", "public function initRepository(): void;", "private function getStub()\n {\n return app_path() . '\\Stubs\\repository_contract.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../Stubs/RepositoryInterface.stub';\n }", "private function createStub()\n {\n $stub = $this->getStub();\n $populatedStub = $this->populateStub($stub);\n $this->writeFile($populatedStub);\n }", "public static function init($stubs) {\n\n\t\tif (empty($stubs)) {\n\t\t\treturn;\n\t\t}\n\n\t\tumask(0);\n\n\t\t// something totally nasty, just for fun\n\t\t$path = static::getPath();\n\t\tis_dir($path) or mkdir($path) or die('cannot mkdir');\n\t\tis_writable($path) or die('cannot write path');\n\n\t\t// this gonna be nasty anyway\n\t\t$code = '';\n\n\t\tforeach ($stubs as $eachClassName=>$eachStubbedMethods) {\n\t\t\t$classPath = $path . '/' . $eachClassName;\n\t\t\tis_dir($classPath) or mkdir ($classPath);\n\n\t\t\t$ninjaClassName = 'ninja\\\\' . $eachClassName;\n\t\t\t$code.= <<<EOS\n\nclass $eachClassName extends $ninjaClassName {\n\nEOS;\n\n\t\t\tforeach ($eachStubbedMethods as $eachStubbedMethod) {\n\n\t\t\t\t$methodPath = $classPath . '/' . $eachStubbedMethod;\n\t\t\t\tis_dir($methodPath) or mkdir($methodPath);\n\n\t\t\t\t$Method = new \\ReflectionMethod($ninjaClassName, $eachStubbedMethod);\n\n\t\t\t\t$xStatic = $Method->isStatic() ? 'static ' : '';\n\t\t\t\t$xPrivate = $Method->isPrivate() ? 'private ' : '';\n\t\t\t\t$xProtected = $Method->isProtected() ? 'protected ' : '';\n\t\t\t\t$xPublic = strlen($xPrivate . $xProtected) ? '' : 'public ';\n\n\t\t\t\t$numReqParams = $Method->getNumberOfRequiredParameters();\n\t\t\t\t$numParams = $Method->getNumberOfParameters();\n\n\t\t\t\t$params = [];\n\t\t\t\tfor ($i=0; $i<$numReqParams; $i++) {\n\t\t\t\t\t$params[] = '$p' . $i;\n\t\t\t\t}\n\t\t\t\tfor ($i; $i<$numParams; $i++) {\n\t\t\t\t\t$params[] = '$p' . $i . '=null';\n\t\t\t\t}\n\n\t\t\t\t$params = implode(', ', $params);\n\t\t\t\t$code.= <<<EOS\n\n\t$xStatic$xPrivate$xProtected${xPublic}function $eachStubbedMethod ($params) {\n\t\tstatic \\$counter=0;\n\n\t\t\\$ret = call_user_func_array(['$ninjaClassName', '$eachStubbedMethod'], func_get_args());\n\n\t\t\\$fname = md5(\\$_SERVER['REQUEST_URI']);\n\t\t\\$fname = '$methodPath/' . \\$fname . '-' . \\$counter++ . '.php';\n\n\t\t\\$requestUri = \\$_SERVER['REQUEST_URI'];\n\t\t\\$othis = str_replace(\"'\", \"\\\\'\", serialize(\\$this));\n\t\t\\$method = '$eachStubbedMethod';\n\t\t\\$params = str_replace(\"'\", \"\\\\'\", serialize(func_get_args()));\n\t\t\\$oret = str_replace(\"'\", \"\\\\'\", serialize(\\$ret));\n\n\t\tfile_put_contents(\n\t\t\t\\$fname,\n\t\t\t'<?php return [\n\t\\'requestUri\\' => \\'' . \\$requestUri . '\\',\n\t\\'object\\' => unserialize(\\'' . \\$othis . '\\'),\n\t\\'method\\' => \\'' . \\$method . '\\',\n\t\\'params\\' => unserialize(\\'' . \\$params . '\\'),\n\t\\'returned\\' => unserialize(\\'' . \\$oret . '\\'),\n];\n'\n\t\t);\n\t\treturn \\$ret;\n\t}\n\nEOS;\n\n\t\t\t}\n\n\t\t}\n\n\t\t$code.= <<<EOS\n\n};\n\nEOS;\n\n\t\techop($code);\n\n\t\t// stubbed class is now in $code\n\t\teval($code);\n\n\t}", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "protected function getStub()\n {\n //\n }", "protected function makeRepo()\n {\n // debido a que el repositorio de direccion depende\n // del repositorio de empleado que tiene sus\n // dependendias, y como no queremos usar\n // el IOC container, lo hacemos\n // explicitamente aqui.\n return new AddressRepository(\n new Address(),\n new EmployeeRepository(\n new Employee(),\n new UserRepository(new User())\n )\n );\n }", "protected function getStub(): string\n {\n return __DIR__.'/stubs/php_cs.stub';\n }" ]
[ "0.748778", "0.59265435", "0.59239167", "0.5685118", "0.56538516", "0.5651959", "0.5651959", "0.5651959", "0.56041217", "0.5577557", "0.550506", "0.54653037", "0.53241444", "0.5295008", "0.528207", "0.52576166", "0.52220124", "0.52162635", "0.520693", "0.52029586", "0.5170955", "0.5153811", "0.5140522", "0.51327294", "0.5115077", "0.50979334", "0.5089927", "0.5086248", "0.50772077", "0.50726026" ]
0.6496916
1
Tests whether we can connect to the devserver.
private function testDevServerConnection($port) { $connection = @fsockopen('127.0.0.1', $port, $errno, $errstr, 1); if (is_resource($connection)) { fclose($connection); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function checkConnection() {\r\n\t\t$url = MoufReflectionProxy::getLocalUrlToProject().\"src/direct/test_connection.php\";\r\n\t\r\n\t\t$response = self::performRequest($url);\r\n\t\t\r\n\t\tif ($response == 'ok') {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "private function isDev()\n {\n $is_localhost = (@$_SERVER['HTTP_HOST'] == 'localhost');\n $is_dev_server = (isset($GLOBALS['is_development_server']) && $GLOBALS['is_development_server'] == '1');\n $debug_enabled = $this->getSystemSetting('enable-js-debug-logging');\n $is_dev = ($is_localhost || $is_dev_server || $debug_enabled) ? 1 : 0;\n return $is_dev;\n }", "public static function is_webpack()\n {\n $baseURL = Config::inst()->get('Webpack', 'dev_server_baseurl');\n $parts = parse_url($baseURL);\n $port = $parts['port'];\n\n if (Director::isDev()) {\n $socket = @fsockopen('localhost', $port, $errno, $errstr, 1);\n\n return !$socket ? false : true;\n }\n }", "public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }", "function checkIfTestServerIsRunning(): void\n{\n try {\n file_get_contents('http://localhost:4020');\n } catch (Throwable $e) {\n handleTestServerNotRunning();\n }\n}", "final public function test() {\n return (function_exists('mysqli_connect'));\n }", "function ticketbud_server_connectivity_ok() {\n\t// skip the check on WPMU because the status page is hidden\n\tglobal $ticketbud_unused_api_key;\n\tif ( $ticketbud_unused_api_key )\n\t\treturn true;\n\t$servers = ticketbud_get_server_connectivity();\n\treturn !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );\n}", "public static function isDev()\n {\n return isset($_SERVER['ENV']) && $_SERVER['ENV'] == 'dev';\n }", "function is_development(): bool\n{\n return stripos(getenv('HTTP_HOST'), 'sunshine') != 0;\n}", "static public function is_connected()\n {\n return R::testConnection();\n }", "public function shouldCheckHttpHost()\n {\n return !Director::is_cli() && isset($_SERVER['HTTP_HOST']);\n }", "public function testConnection() {\n\t\t/** @var Thrive_Dash_Api_WebinarJamStudio $api */\n\t\t$api = $this->getApi();\n\t\t/**\n\t\t * just try getting the list of the webinars as a connection test\n\t\t */\n\t\ttry {\n\t\t\t$api->getUpcomingWebinars(); // this will throw the exception if there is a connection problem\n\t\t} catch ( Thrive_Dash_Api_WebinarJamStudio_Exception $e ) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\n\t\treturn true;\n\t}", "function is_connected()\n {\n static $isConnected = null;\n if ($isConnected !== null) {\n return $isConnected;\n }\n $isConnected = false;\n $connection = env('IS_CONNECTED', true) ? @fsockopen('www.google.com', 80) : null;\n if ($connection) {\n fclose($connection);\n $isConnected = true;\n }\n\n return $isConnected;\n }", "public function connect() : bool\r\n {\r\n if ($this->authenticated() === false)\r\n return false;\r\n\r\n // TODO: check connection with basic api request\r\n\r\n return true;\r\n }", "public function isDev(): bool;", "public function inDevelopment() {\n try {\n return Config::get()->environment === 'dev';\n } catch (Throwable $e) {\n return false;\n }\n }", "public function isConnected()\n\t{\n\t\t// TODO: Make this check the login functionality or something..!!\n\t\treturn true;\n\t}", "function check_localhost()\n{\n if ( $_SERVER[\"SERVER_ADDR\"] == '127.0.0.1' )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n}", "public static function isDev() {\n // Acquia.\n if (defined('AH_SITE_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'prod'));\n }\n\n // Pantheon.\n if (defined('PANTHEON_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'live'));\n }\n\n return FALSE;\n }", "public function checkConnection(){\r\n\t\treturn false;\r\n\t}", "private function canRun()\n {\n $confEnabled = $this->config()->get('cdn_rewrite');\n $devEnabled = ((!Director::isDev()) || ($this->config()->get('enable_in_dev')));\n return ($confEnabled && $devEnabled);\n }", "public function isValid () {\n\tif ($this->doConnect()) return true;\n\treturn false;\n }", "public function isConnected()\n\t{\n\t\treturn isset( $this->pdo );\n\t}", "public function isForServer()\n {\n return $this->server !== null;\n }", "function available() {\n\t\treturn function_exists('fsockopen');\n\t}", "function probe() {\n $this->probe_errors = array();\n if (!function_exists('mysql_connect')){\n $this->probe_errors[] = sprintf(DB_ERR_EXTENSION_UNAVAILABLE,'MySQL');\n return false;\n }\n if (!($conn = @mysql_connect($this->server.(($this->port==\"\")?\"\":\":\".$this->port),\n $this->login,\n $this->password )) ) {\n $this->probe_errors[] = sprintf(DB_ERR_CONNECT_SERVER,$this->server);\n return false;\n }\n if (!@mysql_select_db($this->db,$conn)){\n $this->probe_errors[] = sprintf(DB_ERR_CONNECT_DATABASE,$this->db);\n return false;\n }\n return true;\n }", "public function testHttpTestServerAvailable() {\n\t\t$this->assertTrue(\\REQUESTS_TEST_SERVER_HTTP_AVAILABLE);\n\t}", "public function isConnect()\n {\n return $this->bbb->isConnectionWorking();\n }", "public static function isDebug() \n {\n if (array_key_exists(self::APPLICATION_ENV_KEY, $_SERVER))\n {\n return strtolower($_SERVER[self::APPLICATION_ENV_KEY]) == self::DEV_ENV_VALUE;\n }\n }", "public function isConnected() {}" ]
[ "0.6879808", "0.6848976", "0.683399", "0.6796172", "0.67642576", "0.67101634", "0.66511106", "0.65780634", "0.65168864", "0.650752", "0.6446477", "0.6401901", "0.636444", "0.63520414", "0.63461804", "0.6322379", "0.6314616", "0.62928855", "0.62762785", "0.62739444", "0.6264645", "0.6264367", "0.6250833", "0.6242287", "0.6213311", "0.6203998", "0.6200461", "0.6191586", "0.6189672", "0.6182322" ]
0.70026714
0
Injects a script with the basedir into the content.
private function injectScript($content) { $request = request(); $uri = $request->route()->uri(); $uri = substr($uri, 0, strpos($uri, '{')); $baseDir = rtrim(Path::getRelative($request->path(), $uri, $_SERVER['SUBDIRECTORY']), '/'); $csrf = ''; if (request()->route()->getOption('csrf')) { $token = csrf_token(); $csrf = "window.csrfToken='$token';"; } $snippet = sprintf("<script>window.baseDir='%s';$csrf</script>", $baseDir); return preg_replace('/^([ \t]*)(<script)/mi', "$1$snippet\n$1$2", $content, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function register_script();", "public function scripts()\n {\n foreach ($this->controller->scripts as $value)\n echo \"\\t<script src='\" . DOMAIN . $value . \"' ></script>\\n\";\n echo \"</body>\\n</html>\";\n }", "function pushScript ($script) {\n\t\t$this->_roof[\"cuerpo\"][] = \"<script type=\\\"text/javascript\\\" src=\\\"\".$script.\"\\\"></script>\";\n\t}", "protected static function addScript($base, $file, $replace = true)\n {\n $doc = JFactory::getDocument();\n\n $url = JURI::root(true) . '/' . $base . '/' . $file;\n $url = str_replace(DS, '/', $url);\n\n $urlFork = null;\n if (file_exists(JPATH_SITE . DS . $base . DS . 'fork' . DS . $file)) {\n $urlFork = JURI::root(true) . '/' . $base . '/fork/' . $file;\n $urlFork = str_replace(DS, '/', $urlFork);\n }\n\n if ($replace && $urlFork) {\n $url = $urlFork;\n }\n\n $doc->addScript($url);\n\n if ( ! $replace && $urlFork) {\n $doc->addScript($urlFork);\n }\n }", "public function script() {\r\n\t\tif ($this->scriptable === true || $this->scriptable === 'true') {\r\n\t\t\t$page = pzk_page();\r\n\t\t\tif ($page) {\r\n\t\t\t\t$page->addJsInst($this->toArray());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function injectScript(Response $response)\n {\n if (function_exists('mb_stripos')) \n {\n $posrFunction = 'mb_strripos';\n $substrFunction = 'mb_substr';\n } \n else \n {\n $posrFunction = 'strripos';\n $substrFunction = 'substr';\n }\n\n $content = $response->getContent();\n $pos = $posrFunction($content, '</body>');\n\n if (false !== $pos) \n {\n $script = \"http://$this->host:$this->port/livereload.js\";\n\n if ($this->check_server_presence) \n {\n $headers = @get_headers($script);\n if (!is_array($headers) || strpos($headers[0], '200') === false) {\n return;\n }\n }\n\n $content = $substrFunction($content, 0, $pos).\"\\n<script src=\\\"$script\\\"></script>\\n\".$substrFunction($content, $pos);\n $response->setContent($content);\n }\n }", "private function register_script() {\n\n\t\tif ( $this->inline ) {\n\t\t\twp_register_script(\n\t\t\t\t$this->handle,\n\t\t\t\t'',\n\t\t\t\t$this->deps,\n\t\t\t\t$this->ver,\n\t\t\t\t$this->footer\n\t\t\t);\n\t\t\tif ( $this->does_file_exist( $this->src ) ) {\n\t\t\t\twp_add_inline_script( $this->handle, file_get_contents( $this->src ) );\n\t\t\t}\n\t\t} else {\n\t\t\twp_register_script(\n\t\t\t\t$this->handle,\n\t\t\t\t$this->src,\n\t\t\t\t$this->deps,\n\t\t\t\t$this->ver,\n\t\t\t\t$this->footer\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $this->localize ) ) {\n\t\t\twp_localize_script( $this->handle, $this->handle, $this->localize );\n\t\t}\n\n\t\twp_enqueue_script( $this->handle );\n\t}", "protected function injectFromAssetManager() {\n $asset = dirname(__FILE__) .'/js/';\n $passet = Yii::app()->assetManager->publish($asset);\n $cs = Yii::app()->clientScript;\n foreach ($this->jsFiles as $jf) {\n $cs->registerScriptFile($passet . '/' . $jf, CClientScript::POS_HEAD);\n }\n }", "public function embed_scripts() {}", "function fresh_text_add_js()\n\t{\n\t\techo '<script>';\n\t\techo require_once 'replacement.php';\n\t\techo '</script>';\n\t}", "public function setScript()\n {\n $container = strtoupper($this->getCurrentWidget()->getPlugin());\n $NameAction = strtolower($this->getCurrentWidget()->getAction()); \n // If the widget is a \"gedmo snippet\"\n if ( ($container == 'CONTENT') && ($NameAction == 'snippet') ) {\n // if the configXml field of the widget is configured correctly.\n try {\n $xmlConfig = new \\Zend_Config_Xml($this->getCurrentWidget()->getConfigXml());\n if ($xmlConfig->widgets->get('content')){\n $snippet_widget = $this->getWidgetById($xmlConfig->widgets->content->id);\n $container = strtoupper($snippet_widget->getPlugin());\n $NameAction = strtolower($snippet_widget->getAction());\n }\n } catch (\\Exception $e) {\n } \n }\n // If the widget is a \"gedmo snippet\"\n elseif ( ($container == 'GEDMO') && ($NameAction == 'snippet') ) {\n // if the configXml field of the widget is configured correctly.\n try {\n $xmlConfig = new \\Zend_Config_Xml($this->getCurrentWidget()->getConfigXml());\n if ($xmlConfig->widgets->get('gedmo')){\n $snippet_widget = $this->getWidgetById($xmlConfig->widgets->gedmo->id);\n $container = strtoupper($snippet_widget->getPlugin());\n $NameAction = strtolower($snippet_widget->getAction());\n }\n } catch (\\Exception $e) {\n }\n } \n $this->script['js'][$container.$NameAction] = $this->extensionWidget->ScriptJsFunction($container, $NameAction);\n $this->script['css'][$container.$NameAction] = $this->extensionWidget->ScriptCssFunction($container, $NameAction);\n }", "protected function injectScript($step)\n {\n if (in_array(Input::get('import'), array('prepare', 'import'), null)) {\n return;\n }\n\n if (!array_key_exists($step, $this->settings)) {\n $GLOBALS['TL_MOOTOOLS'][] =\n \"<script>location.href = 'contao/main.php\" .\n \"?do=member_import&import=prepare&rt=\" . REQUEST_TOKEN . \"&ref=\" . TL_REFERER_ID .\n \"'</script>\";\n\n return;\n }\n\n $GLOBALS['TL_MOOTOOLS'][] =\n \"<script>location.href = 'contao/main.php\" .\n \"?do=member_import&import=load&step=\" . $step . \"&rt=\" . REQUEST_TOKEN . \"&ref=\" . TL_REFERER_ID .\n \"'</script>\";\n }", "abstract public function addScript($file = '', $options = array(), $attribs = array());", "private static function setScriptRelativePath() {\n\t\tself::$_ScriptRelativePath = str_replace(\n\t\t\tself::getConfig()->getBasePath().self::getDirSeparator(), '', self::getScriptPath()\n\t\t);\n\t}", "public function forgeScript()\n {\n // check if we have a script creation array\n if ($this->provider && isset($this->provider['render']['script'])) {\n // Start script tag.\n $script = '<script';\n\n foreach ($this->provider['render']['script'] as $attribute => $val) {\n $script .= sprintf(' %s=\"%s\"', $attribute, $val);\n }\n\n // Close script tag.\n $script .='></script>';\n\n return $script;\n }\n }", "public function script($script) {\n\t\tif (strpos($script, 'http') === false) {\n\t\t\techo \"<script src='http://\".Config::$baseurl.\"js/{$script}'></script>\";\n\t\t} else {\n\t\t\techo \"<script src='{$script}'></script>\";\n\t\t}\n\t}", "public function addScriptWrapper() {\n if ($this->doAddScript) {\n $this->addScript();\n }\n }", "function add_script($name, $file)\n{\n\tglobal $scripts_included;\n\t$scripts_included[$name] = \"<script type='text/javascript' src='\".site_url.$file.\"'></script>\\n\";\n}", "public function __construct($type = null, $src = null, $content = null) {\n parent::__construct('script');\n\n $this->type($type);\n $this->src($src);\n $this->content($content);\n \n }", "public function setScriptPath()\n\t{\n\t\t$this->scriptPath = Yii::getPathOfAlias('webroot').$this->ds.$this->suffix.$this->ds;\n\t}", "protected function insertScriptElements() {\n\t\t$base = $this->doc->createElement('base');\n\t\t$base->setAttribute('href', WP_Insights_Utils::url_get_base($this->record['url']));\n\t\t$ini_comm = $this->doc->createComment(\" begin wpi tracking code \");\n\t\t$end_comm = $this->doc->createComment(\" end wpi tracking code \");\n\t\t$api_comm = $this->doc->createComment(\" load wpi drawing API \");\n\t\t// point to (smt) aux functions\n\t\t//$js_aux = $this->doc->createExternalScript($this->auxjspath);\n\t\t$js_replayer = $this->doc->createExternalScript($this->js_replayer_path);\n\t\t$js_create = $this->doc->createExternalScript($this->js_create_path);\n\t\t// and peppy selector library\n\t\t//$js_selector = $this->doc->createExternalScript($this->selectorjspath);\n\t\t// rebuild parsed page\n\t\t$head = $this->doc->getElementsByTagName('head');\n\t\tforeach ($head as $h) {\n\t\t\t// loading order is crucial!\n\t\t\t$h->insertBefore($base, $h->firstChild);\n\t\t\t$h->appendChild($ini_comm);\n\t\t\t$h->appendChild($js_create);\n\t\t\t$h->appendChild($js_replayer);\n\t\t\t$h->appendChild($this->js_user_data);\n\t\t\t/*$h->appendChild($js_selector);\n\t\t\tif (isset($js_widget)) $h->appendChild($js_widget);\n\t\t\t$h->appendChild($api_comm);\n\t\n\t\t\tif ($this->api == \"js\") {\n\t\t\t\t$h->appendChild($this->js_graphics);\n\t\t\t\t$h->appendChild($this->js_json);\n\t\t\t} else if ($this->api == \"swf\") {\n\t\t\t\t$h->appendChild($this->js_swfobject);\n\t\t\t\t$h->appendChild($this->css_swf);\n\t\t\t}*/\n\t\t\t$h->appendChild($end_comm);\n\t\t}\n\t\t// append tracking script at the end of the page body\n\t\t/*$body = $this->doc->getElementsByTagName('body');\n\t\tforeach ($body as $b) {\n\t\t\tif ($this->api == \"js\") {\n\t\t\t\t$b->appendChild($this->js_replay);\n\t\t\t\t$b->appendChild($this->js_options);\n\t\t\t} else if ($this->api == \"swf\") {\n\t\t\t\t$b->appendChild($this->js_swf);\n\t\t\t}\n\t\t}*/\n\t}", "function javaScripts($dirs)\n{\n echo assets($dirs, '<script src=\"{link}\"></script>');\n}", "public function register_scripts()\n {\n }", "public function registerScript(/*string*/ $scriptSrc);", "static function script(){\n\n\t\t$phelper = new PrivilegeHelper();\n\t\t\n\t\t$uid = Request::getVar(\"a_uid\",\"cookie\");\n\t\t$privilege = explode(\",\",$phelper->getPrivilege($uid));\n\t\t\n\t\t$config = new Config();\n\t\t$privilegeConfig = $config->getConfig(\"privilege\");\n\t\t$globalConfig = $config->getConfig(\"global\");\n\t\t\n\t\t$privilegeList = $privilegeConfig->privilege();\n\t\t$script = <<<END\n\t\t\t<script>\n\t\t\tvar title = \"{$globalConfig->title}\";\n\t\t\tvar folders = new Array();\nEND;\n\t\tforeach($privilegeList as $i=>$item){\n\t\t\tif(in_array($i,$privilege)||$i==(count($privilegeList)-1)){\n\t\t\t\t$script .= self::_getScriptItem($privilegeList[$i]);\n\t\t\t}\n\t\t}\n\t\t$script .= \"</script>\";\n\t\t\n\t\treturn $script;\n\t}", "public function add_script($data){\n\t\tif(filter_var($data, FILTER_VALIDATE_URL)){\n\t\t\t$this->add_content_var(new elem(\"script\",\"\",array(\"src\"=>$data,\"type\"=>\"text/javascript\")));\n\t\t}\n\t\telse{\n\t\t\t$this->add_content_var(new elem(\"script\",$data,array(\"type\"=>\"text/javascript\")));\n\t\t}\n\t}", "private function loadScripts() {\n\t\tif(isset($this->scripts) && $this->scripts != \"\") {\n\t\t\tforeach (explode(\",\", $this->scripts) as $script) {\n\t\t\t\tOCP\\Util::addscript('ocDashboard', 'widgets/'.$this->id.'/'.$script);\n\t\t\t}\n\t\t}\n\t}", "public function embed_scripts()\n {\n }", "public function script($src = 'script.js') {\n echo \"<script src='assets/js/\" . $src . \"'></script>\";\n }", "private function autoload_scripts() {\n\t\t\n\t}" ]
[ "0.5714394", "0.5623811", "0.5616933", "0.56091887", "0.5595279", "0.55554664", "0.55541587", "0.5545596", "0.54760563", "0.5461117", "0.5426175", "0.54033136", "0.53812784", "0.5381271", "0.53708583", "0.5363715", "0.5309254", "0.5280575", "0.52742195", "0.5250845", "0.5230176", "0.52239037", "0.5222167", "0.52149624", "0.5202542", "0.5197566", "0.51891834", "0.5185645", "0.5177572", "0.5170797" ]
0.7437747
0
fix up form data if necessary
function mungeFormData(&$formvars) { // trim off excess whitespace $formvars['Name'] = trim($formvars['Name']); $formvars['Comment'] = trim($formvars['Comment']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }", "private function resetFormData()\r\n {\r\n $_charset = $this->config->getModuleVar('common', 'charset');\r\n\r\n $this->viewVar['cauthor'] = htmlentities($this->strip($this->cauthor), ENT_COMPAT, $_charset);\r\n $this->viewVar['cemail'] = htmlentities($this->strip($this->cemail), ENT_COMPAT, $_charset);\r\n $this->viewVar['cbody'] = htmlentities($this->strip($this->cbody), ENT_COMPAT, $_charset);\r\n }", "public function cleanFormData()\n {\n parent::cleanFormData();\n\n // You can only save data for the current user\n $this->formData['gsf_id_user'] = $this->currentUser->getUserId();\n }", "private function resetInputFields()\n {\n $this->name = '';\n $this->code = '';\n $this->agency_id = '';\n\n $this->phone = '';\n $this->fax = '';\n\n $this->email = '';\n $this->address = '';\n $this->country = '';\n }", "private function resetInputFields()\n {\n $this->agency_id = '';\n $this->state_id = '';\n $this->name = '';\n $this->logo = '';\n $this->email = '';\n $this->phone = '';\n $this->fax = '';\n $this->address = '';\n $this->facebook = '';\n $this->instagram = '';\n $this->youtube = '';\n $this->viber = '';\n $this->whatsapp = '';\n $this->url = '';\n }", "protected function prepareForValidation()\n {\n $request = $this->request->all();\n if(!empty($request['country']) && $request['country']=='All'){\n unset($request['country']);\n }\n $this->replace($request);\n }", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "function NormalizeFormVars()\r\n {\r\n //the element means false. Explicitely setting this false here\r\n //to help in later form value processing\r\n $arr_elements = \r\n $this->config->element_info->GetElements($this->GetCurrentPageNum());\r\n \r\n foreach($arr_elements as $ename => $e)\r\n {\r\n $preparsed_var = $this->config->GetPreParsedVar($ename);\r\n if(isset($this->formvars[$preparsed_var]))\r\n {\r\n $disp_var = $this->config->GetDispVar($ename);\r\n $this->formvars[$disp_var] = $this->formvars[$ename];\r\n $this->formvars[$ename] = $this->formvars[$preparsed_var];\r\n }\r\n if(isset($this->formvars[$ename])){continue;}\r\n \r\n switch($e['type'])\r\n {\r\n case 'single_chk':\r\n {\r\n $this->formvars[$ename] = false;\r\n break;\r\n }\r\n case 'chk_group':\r\n case 'multiselect':\r\n {\r\n $this->formvars[$ename] = array();\r\n break;\r\n }\r\n default:\r\n {\r\n $this->formvars[$ename]='';\r\n }\r\n }\r\n }\r\n }", "protected function processInput()\n {\n if (empty($this->input)) {\n $this->input = request()->except('_token');\n\n if ($this->injectUserId) {\n $this->input['user_id'] = Auth::user()->id;\n }\n }\n $this->sanitize();\n request()->replace($this->input); // @todo IS THIS NECESSARY?\n }", "private function resetInputFields(){\n $this->name = '';\n $this->content = '';\n $this->todo_id = '';\n }", "private function resetInputFields(){\n $this->title = '';\n $this->original_url = '';\n $this->platform_id = '';\n }", "public function sanitize_input_fields()\n {\n }", "private function resetInputFields(){\n $this->title = '';\n $this->body = '';\n $this->page_id = '';\n }", "protected function _readFormFields() {}", "private function resetInputFields(){\n $this->teacher_id = '';\n $this->lending_id = '';\n $this->note = '';\n $this->device_id = '';\n $this->org_id_1 = '';\n $this->org_id_2 = '';\n $this->lendingDate = '';\n $this->returnDate = '';\n }", "protected function mergeflexFormValuesIntoConf() {}", "function resetFormFieldVars()\n{\n\t$ProductName = \"\";\n\t$Description = \"\";\n\t$Price = \"\";\n\t$Quantity = \"\";\n\t$SalePrice = 0.0;\n}", "private function resetInputFields(){\n $this->nom = '';\n $this->departements_id = '';\n $this->arrondissement_id = '';\n }", "function _cleanup_input_data($data = array()) {\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Cleanup data array\n\t\t$_tmp = array();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\t$k = trim($k);\n\t\t\tif (!strlen($k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$_tmp[$k] = $v;\n\t\t}\n\t\t$data = $_tmp;\n\t\tunset($_tmp);\n\t\t// Remove non-existed fields from query\n\t\t$avail_fields = $this->_get_avail_fields();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\tif (!isset($avail_fields[$k])) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\t// Last check\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $data;\n\t}", "function sanitizeFields()\n\t{\n\t\tif(isset($this->sanitize) && isset($this->data[$this->name]))\n\t\t{\n\t\t\tforeach($this->data[$this->name] as $field => $value)\n\t\t\t{\n\t\t\t\tif(isset($this->sanitize[$field]))\n\t\t\t\t{\n\t\t\t\t\tif(!is_array($this->sanitize[$field]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $this->sanitize[$field]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tforeach($this->sanitize[$field] as $action)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->data[$this->name][$field] = $this->sanitize($this->data[$this->name][$field], $action);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "public function reset() {\n\t\tif ($this->Common->isPosted()) {\n\t\t\t$selection = (array)$this->request->getData('Form.sel');\n\t\t\tforeach ($selection as $sel) {\n\t\t\t\tif (!empty($sel)) {\n\t\t\t\t\tswitch ($sel) {\n\t\t\t\t\t\tcase 'terms':\n\t\t\t\t\t\t\t$this->TranslateDomains->TranslateStrings->TranslateTerms->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'strings':\n\t\t\t\t\t\t\t$this->TranslateDomains->TranslateStrings->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'groups':\n\t\t\t\t\t\t\t$this->TranslateDomains->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'languages':\n\t\t\t\t\t\t\t$this->TranslateDomains->TranslateStrings->TranslateTerms->TranslateLanguages->truncate();\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t$this->Flash->success('Done');\n\n\t\t\treturn $this->redirect(['action' => 'index']);\n\t\t}\n\n\t\t//FIXME\n\t\t//$this->request->data['Form']['sel'][] = 'terms';\n\t\t//$this->request->data['Form']['sel'][] = 'strings';\n\n\t\t//$this->request->data['Form']['sel']['languages'] = 0;\n\t\t//$this->request->data['Form']['sel']['groups'] = 0;\n\t}", "private function prepare_form_data()\n {\n $form_data = array(\n 'email' => array(\n 'name' => 'email',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-email', 'autofocus'=>''),\n ),\n 'password' => array(\n 'name' => 'password',\n 'options' => array(\n '' => '--',\n ),\n 'extra' => array('id'=>'login-password'),\n ),\n\n 'lbl-email' => array(\n 'target' => 'email',\n 'label' => 'E-mail Address',\n ),\n 'lbl-password' => array(\n 'target' => 'password',\n 'label' => 'Password',\n ),\n\n 'btn-submit' => array(\n 'value' => 'Login',\n 'extra' => array(\n 'class' => 'btn btn-primary',\n ),\n ),\n );\n\n return \\DG\\Utility::massage_form_data($form_data);\n }", "public function populateForm() {}", "function clean_form_input($form_data){\n\t$temp = str_ireplace(\",\",\"@\", $form_data);\n\t$temp = str_ireplace(\"\\\"\",\"|\", $temp); \n\t$temp = str_ireplace(\"<\", \"$\", $temp);\n\t$temp = str_ireplace(\">\", \"?\", $temp);\n return $temp;\n}", "function wyz_ajax_business_form_builder_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\tupdate_option( 'wyz_business_form_builder_data', $form_data );\n\twp_die();\n}", "protected function _updatefields() {}", "public static function sanitize() {\n\n $new_input = self::get_options();\n $default_options = self::default_options();\n $parts = parse_url($_POST['_wp_http_referer']);\n parse_str($parts['query'], $query);\n $tab = (array_key_exists('tab', $query)) ? $query['tab'] : 'general';\n\n switch ($tab) {\n case 'general':\n default:\n $new_input['cris_org_nr'] = isset($_POST[self::option_name]['cris_org_nr']) ? sanitize_text_field($_POST[self::option_name]['cris_org_nr']) : 0;\n break;\n\n case 'layout':\n $new_input['cris_pub_order'] = isset($_POST[self::option_name]['cris_pub_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_pub_order'])) : $default_options['cris_pub_order'];\n $new_input['cris_pub_subtypes_order'] = isset($_POST[self::option_name]['cris_pub_subtypes_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_pub_subtypes_order'])) : $default_options['cris_pub_subtypes_order'];\n $new_input['cris_univis'] = in_array($_POST[self::option_name]['cris_univis'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_univis'] : $default_options['cris_univis'];\n $new_input['cris_bibtex'] = isset($_POST[self::option_name]['cris_bibtex']) ? 1 : 0;\n $new_input['cris_url'] = isset($_POST[self::option_name]['cris_url']) ? 1 : 0;\n $new_input['cris_doi'] = isset($_POST[self::option_name]['cris_doi']) ? 1 : 0;\n $new_input['cris_oa'] = isset($_POST[self::option_name]['cris_oa']) ? 1 : 0;\n $new_input['cris_name_order_plugin'] = (isset($_POST[self::option_name]['cris_name_order_plugin'])\n && $_POST[self::option_name]['cris_name_order_plugin'] == 'lastname-firstname') ? 'lastname-firstname' : 'firstname-lastname';\n $new_input['cris_award_order'] = isset($_POST[self::option_name]['cris_award_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_award_order'])) : $default_options['cris_award_order'];\n $new_input['cris_award_link'] = in_array($_POST[self::option_name]['cris_award_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_award_link'] : $default_options['cris_award_link'];\n $new_input['cris_fields_num_pub'] = isset($_POST[self::option_name]['cris_fields_num_pub']) ? sanitize_text_field($_POST[self::option_name]['cris_fields_num_pub']) : 0;\n\t $new_input['cris_field_link'] = in_array($_POST[self::option_name]['cris_field_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_field_link'] : $default_options['cris_field_link'];\n\t $new_input['cris_project_order'] = isset($_POST[self::option_name]['cris_project_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_project_order'])) : $default_options['cris_project_order'];\n $new_input['cris_project_link'] = in_array($_POST[self::option_name]['cris_project_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_project_link'] : $default_options['cris_project_link'];\n $new_input['cris_patent_order'] = isset($_POST[self::option_name]['cris_patent_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_patent_order'])) : $default_options['cris_patent_order'];\n $new_input['cris_patent_link'] = in_array($_POST[self::option_name]['cris_patent_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_patent_link'] : $default_options['cris_patent_link'];\n $new_input['cris_activities_order'] = isset($_POST[self::option_name]['cris_activities_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_activities_order'])) : $default_options['cris_activities_order'];\n $new_input['cris_activities_link'] = in_array($_POST[self::option_name]['cris_activities_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_activities_link'] : $default_options['cris_activities_link'];\n $new_input['cris_standardizations_order'] = isset($_POST[self::option_name]['cris_standardizations_order']) ? explode(\"\\n\", str_replace(\"\\r\", \"\", $_POST[self::option_name]['cris_standardizations_order'])) : $default_options['cris_standardizations_order'];\n $new_input['cris_standardizations_link'] = in_array($_POST[self::option_name]['cris_standardizations_link'], array('person', 'cris', 'none')) ? $_POST[self::option_name]['cris_standardizations_link'] : $default_options['cris_standardizations_link'];\n break;\n case 'sync':\n $new_input['cris_sync_check'] = isset($_POST[self::option_name]['cris_sync_check']) ? 1 : 0;\n if(is_array($_POST[self::option_name]['cris_sync_shortcode_format'])) {\n /*foreach ($_POST[self::option_name]['cris_sync_shortcode_format'] as $_check){\n foreach ($_check as $_k => $_v) {\n $new_input['cris_sync_shortcode_format'][$_k] = $_v;\n }\n }*/\n $new_input['cris_sync_shortcode_format'] = $_POST[self::option_name]['cris_sync_shortcode_format'];\n }\n break;\n }\n return $new_input;\n }", "public function updateFromPOST() {\n if ($this->isSubmit()) {\n foreach (Tools::getValue($this->namebase(), array()) as $name => $value) {\n $key = $this->nameify($name);\n $this->input_values[$key] = $value;\n }\n Configuration::updateValue($this->key(), json_encode($this->input_values));\n }\n }", "function wyz_ajax_business_sidebar_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\tupdate_option( 'wyz_business_sidebar_order_data', $form_data ); \n\twp_die();\n}" ]
[ "0.7109494", "0.7019208", "0.6941115", "0.67597055", "0.6553294", "0.6521094", "0.64184994", "0.63893676", "0.63626534", "0.63404876", "0.6317543", "0.6283575", "0.6273961", "0.6256645", "0.62479913", "0.62463254", "0.61867726", "0.6174347", "0.615875", "0.61523724", "0.6143273", "0.6098559", "0.6081042", "0.6023793", "0.6020027", "0.60040075", "0.60026175", "0.59953356", "0.59950763", "0.5973527" ]
0.70244116
1
Get sales datafields (a subset of contact data fields).
public function getSalesDatafields() { return array_filter($this->contactDatafields, function ($array) { return isset($array['context']) && $array['context'] === 'sales'; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getContactDataFields();", "public function getSaleData($conditions,$fields) {\t\r\n return $this->find('all', array('fields' => $fields,'conditions'=>$conditions));\r\n }", "function get_field_data_by_id($field_id, $contact)\n{\n if (isset($contact['custom_fields'])) {\n $out = array();\n\n foreach ($contact['custom_fields'] as $key => $value) {\n if ($value['id'] == $field_id) {\n foreach ($value['values'] as $key => $data) {\n $out[] = $data['value'];\n }\n }\n }\n }\n\n if (!empty($out)) {\n return $out;\n } else {\n return false;\n }\n}", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.invoice.fields'\n );\n return $fullResult;\n }", "public function getDataFields()\n {\n $query = 'response > record > marcRecord > datafield';\n $dataFields = $this->domCrawler->filter($query)->each(function (Crawler $node) {\n return new DataField($node);\n });\n\n\n return $dataFields;\n }", "public function getDataFieldsToShow()\n {\n $datafieldsToShow = array();\n $dataFieldsFromConfig = $this->_getWebsiteConfigFromHelper(\n Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_ADDRESSBOOK_PREF_SHOW_FIELDS,\n $this->getCustomer()->getStore()->getWebsite()\n );\n if ($dataFieldsFromConfig !== '') {\n $dataFieldsFromConfig = explode(',', $dataFieldsFromConfig);\n $contact = $this->getConnectorContact();\n if ($this->contactId) {\n $contactDataFields = $contact->dataFields;\n $processedContactDataFields = array();\n foreach ($contactDataFields as $contactDataField) {\n $processedContactDataFields[$contactDataField->key]\n = $contactDataField->value;\n }\n\n $connectorDataFields = $this->_getApiClient()\n ->getDataFields();\n $processedConnectorDataFields = array();\n foreach ($connectorDataFields as $connectorDataField) {\n $processedConnectorDataFields[$connectorDataField->name]\n = $connectorDataField;\n }\n\n foreach ($dataFieldsFromConfig as $dataFieldFromConfig) {\n if (isset($processedConnectorDataFields[$dataFieldFromConfig])) {\n $value = \"\";\n if (isset(\n $processedContactDataFields[$processedConnectorDataFields[$dataFieldFromConfig]\n ->name]\n )) {\n if ($processedConnectorDataFields[$dataFieldFromConfig]->type == \"Date\") {\n $value = $processedContactDataFields[\n $processedConnectorDataFields[$dataFieldFromConfig]->name\n ];\n //@codingStandardsIgnoreStart\n $value = Mage::app()->getLocale()->date($value)->toString(\"Y/M/d\");\n //@codingStandardsIgnoreEnd\n } else {\n $value = $processedContactDataFields[\n $processedConnectorDataFields[$dataFieldFromConfig]->name\n ];\n }\n }\n\n $datafieldsToShow[] = array(\n 'name' => $processedConnectorDataFields[$dataFieldFromConfig]->name,\n 'type' => $processedConnectorDataFields[$dataFieldFromConfig]->type,\n 'value' => $value\n );\n }\n }\n }\n }\n\n //@codingStandardsIgnoreEnd\n\n return $datafieldsToShow;\n }", "public function getSelectDataFields();", "function getFields();", "public function getSaleFirstData($conditions,$fields) {\t\r\n return $this->find('first', array('fields' => $fields,'conditions'=>$conditions,'recursive'=>-1));\r\n }", "public function getDataFieldsToShow()\n {\n $datafieldsToShow = [];\n $dataFieldsFromConfig = $this->_getWebsiteConfigFromHelper(\n \\Dotdigitalgroup\\Email\\Helper\\Config::XML_PATH_CONNECTOR_ADDRESSBOOK_PREF_SHOW_FIELDS,\n $this->getCustomer()->getStore()->getWebsite()\n );\n\n if (! empty($dataFieldsFromConfig)) {\n $dataFieldsFromConfig = explode(',', $dataFieldsFromConfig);\n $contact = $this->getConnectorContact();\n if ($this->contactId) {\n $contactDataFields = $contact->dataFields;\n $processedContactDataFields = [];\n foreach ($contactDataFields as $contactDataField) {\n $processedContactDataFields[$contactDataField->key]\n = $contactDataField->value;\n }\n\n $connectorDataFields = $this->_getApiClient()\n ->getDataFields();\n $processedConnectorDataFields = [];\n foreach ($connectorDataFields as $connectorDataField) {\n $processedConnectorDataFields[$connectorDataField->name]\n = $connectorDataField;\n }\n foreach ($dataFieldsFromConfig as $dataFieldFromConfig) {\n if (isset($processedConnectorDataFields[$dataFieldFromConfig])) {\n $value = '';\n if (isset($processedContactDataFields[$processedConnectorDataFields[\n $dataFieldFromConfig]->name])) {\n if ($processedConnectorDataFields[$dataFieldFromConfig]->type\n == 'Date'\n ) {\n $value\n = $processedContactDataFields[$processedConnectorDataFields[\n $dataFieldFromConfig]->name];\n $value = $this->_localeDate->convertConfigTimeToUtc($value, 'm/d/Y');\n } else {\n $value\n = $processedContactDataFields[$processedConnectorDataFields[\n $dataFieldFromConfig]->name];\n }\n }\n\n $datafieldsToShow[] = [\n 'name' => $processedConnectorDataFields[$dataFieldFromConfig]->name,\n 'type' => $processedConnectorDataFields[$dataFieldFromConfig]->type,\n 'value' => $value,\n ];\n }\n }\n }\n }\n\n return $datafieldsToShow;\n }", "public function fetchFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getAllSales()\n {\n return $this->join('customers','sales.customer_id','=','customers.id')\n ->select('sales.*','customers.name as customer')\n ->get();\n }", "public function getDataListByField(string $field_name)\n {\n switch ($field_name) {\n case 'PostalCode': return $this -> get_postal_code_list(); break;\n case 'City': return $this -> generate_city_value_list(); break;\n }\n }", "protected function getData(){\n $result= array();\n $dSource = $this->getDataSource();\n if($dSource !== null){\n foreach($dSource->getFields() as $field){\n $result[$field->getName()] = $field->getValue();\n }\n }\n return($result);\n }", "private function _getTicketsReferentSales()\n {\n $this->loadModel('Users');\n $users = $this->Users->find('all')->toArray();\n $data = [];\n\n foreach ($users as $user) {\n $count = $this->Tickets->find('all')->where(['paid' => 1, 'user_code' => $user->code])->count();\n\n if($count > 0) {\n $data[] = [\n 'label' => $user->firstname . ' ' . $user->lastname,\n 'value' => $this->Tickets->find('all')->where(['paid' => 1, 'user_code' => $user->code])->count()\n ];\n }\n }\n\n return $data;\n }", "public function getAllFields();", "public function getCustomFields($product_info, $ro_combs) {\n\t\treturn \\liveopencart\\ext\\ro::getInstance($this->registry)->getCustomFields($product_info, $ro_combs);\n\t\t\n\t}", "public function fields()\n {\n $fullResult = $this->client->call(\n 'crm.dealcategory.fields'\n );\n return $fullResult;\n }", "public function getFields() {}", "public function getFields() {}", "public function getFields() {}", "public static function fields()\n {\n return [\n 'p.entity_id as entity_id',\n 'p.rebates as rebates',\n 'p.name',\n 'a.name as first_category_name',\n 'b.name as second_category_name',\n 'c.name as third_category_name',\n 'd.sort as wholesaler_weight',\n 'p.status',\n 'p.commission',\n 'p.label1',\n 'p.type',\n 'p.type2',\n 'p.sales_type',\n 'br.sort as brand_weight',\n 'promotion_text',\n 'lsin',\n 'barcode',\n 'wholesaler_id',\n 'first_category_id',\n 'second_category_id',\n 'third_category_id',\n 'brand',\n 'package_num',\n 'package_spe',\n 'state',\n 'sort_weights',\n 'sold_qty',\n 'price',\n 'special_price',\n 'rule_id',\n 'special_from_date',\n 'special_to_date',\n 'promotion_text_from',\n 'promotion_text_to',\n 'real_sold_qty',\n 'qty',\n 'minimum_order',\n 'gallery',\n 'export',\n 'origin',\n 'package',\n 'specification',\n 'shelf_life',\n 'description',\n 'production_date',\n 'restrict_daily',\n 'subsidies_lelai',\n 'subsidies_wholesaler',\n 'promotion_title_from',\n 'promotion_title_to',\n 'promotion_title',\n 'sales_attribute_name',\n 'sales_attribute_value',\n 'specification_num',\n 'specification_unit',\n 'fake_sold_qty',\n 'special_rebates_from',\n 'special_rebates_to',\n 'special_rebates_lelai_from',\n 'special_rebates_lelai_to',\n 'special_rebates_lelai',\n 'special_rebates',\n 'is_calculate_lelai_rebates',\n 'rebates_lelai',\n 'shelf_from_date',\n 'shelf_to_date',\n ];\n }", "abstract public function getFields();", "abstract public function getFields();" ]
[ "0.73630947", "0.63038564", "0.6140943", "0.60745394", "0.60056084", "0.59122473", "0.589951", "0.581609", "0.5784599", "0.5772066", "0.57698065", "0.5766092", "0.5766092", "0.5766092", "0.5766092", "0.5766092", "0.5766092", "0.5761752", "0.5758824", "0.57331526", "0.5717229", "0.56918365", "0.56881416", "0.56722736", "0.5657315", "0.5657315", "0.5657315", "0.56158024", "0.5601101", "0.5601101" ]
0.8546239
0
Get extra data fields.
public function getExtraDataFields() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExtraFields()\n {\n return isset($this->extraFields) ? $this->extraFields : null;\n }", "function &getExtraFieldData() {\n\t\tif (!isset($this->extra_field_data)) {\n\t\t\t$this->extra_field_data = array();\n\t\t\t$res = db_query_params ('SELECT * FROM artifact_extra_field_data WHERE artifact_id=$1 ORDER BY extra_field_id',\n\t\t\t\t\t\tarray ($this->getID())) ;\n\t\t\t$ef = $this->ArtifactType->getExtraFields();\n\t\t\twhile ($arr = db_fetch_array($res)) {\n\t\t\t\t$type=$ef[$arr['extra_field_id']]['field_type'];\n\t\t\t\tif (($type == ARTIFACT_EXTRAFIELDTYPE_CHECKBOX) || ($type==ARTIFACT_EXTRAFIELDTYPE_MULTISELECT)) {\n\t\t\t\t\t//accumulate a sub-array of values in cases where you may have multiple rows\n\t\t\t\t\tif (!array_key_exists($arr['extra_field_id'], $this->extra_field_data) || !is_array($this->extra_field_data[$arr['extra_field_id']])) {\n\t\t\t\t\t\t$this->extra_field_data[$arr['extra_field_id']] = array();\n\t\t\t\t\t}\n\t\t\t\t\t$this->extra_field_data[$arr['extra_field_id']][]=$arr['field_data'];\n\t\t\t\t} else {\n\t\t\t\t\t$this->extra_field_data[$arr['extra_field_id']] = $arr['field_data'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this->extra_field_data;\n\t}", "public function getExtraData();", "public function getAdditionalFields()\n {\n return $this->additional_fields;\n }", "public function getAdditionalFields()\n {\n return $this->additionalFields;\n }", "public function getAdditionalFields()\n {\n return $this->additionalFields;\n }", "public function extraFields()\n {\n return [\n 'modals',\n 'modal_windows',\n ];\n }", "public function getExtraInformation() {\n return $this->extra;\n }", "public function getAdditionalFields()\n {\n return $this->postRequest('GetAdditionalFields');\n }", "public function getExtraInfo()\n {\n return $this->extra;\n }", "public function getAdditionalData()\n {\n return $this->additionalData;\n }", "function getExtraFieldDataText() {\n\t\t// First we get the list of extra fields and the data\n\t\t// associated to the fields\n\t\t$efs = $this->ArtifactType->getExtraFields();\n\t\t$efd = $this->getExtraFieldData();\n\n\t\t$return = array();\n\n\t\tforeach ($efs as $efid => $ef) {\n\t\t\t$name = $ef[\"field_name\"];\n\t\t\t$type = $ef[\"field_type\"];\n\n\t\t\t// Get the value according to the type\n\t\t\tswitch ($type) {\n\n\t\t\t\t// for these types, the associated value comes straight\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_TEXT:\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_TEXTAREA:\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_RELATION:\n\t\t\t\tcase ARTIFACT_EXTRAFIELDTYPE_INTEGER:\n\t\t\t\t\tif (isset($efd[$efid])) {\n\t\t\t\t\t\t$value = $efd[$efid];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = '';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// the other types have and ID or an array of IDs associated to them\n\t\t\t\tdefault:\n\t\t\t\t\tif (isset($efd[$efid])) {\n\t\t\t\t\t\t$value = $this->ArtifactType->getElementName($efd[$efid]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$value = 'None';\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t$return[$efid] = array(\"name\" => $name, \"value\" => $value, 'type' => $type);\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getAdditionalFields() {\n\t\t\n\t\t$fields = array();\n\t\t\n\t\tif ($this->installed()) {\n\t\t\t$ro_settings = $this->config->get('related_options');\n\t\t\t$std_fields = array('sku', 'upc', 'ean', 'location');\n\t\t\tforeach ($std_fields as $field) {\n\t\t\t\tif ( isset($ro_settings['spec_'.$field]) && $ro_settings['spec_'.$field] ) {\n\t\t\t\t\t$fields[] = $field;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $fields;\n\t}", "public function getExtra()\n {\n return json_decode($this->extra);\n }", "public function getExtraFields()\n {\n $extraFields = new FieldList();\n\n $token = $this->getSecurityToken();\n if ($token) {\n $tokenField = $token->updateFieldSet($this->fields);\n if ($tokenField) {\n $tokenField->setForm($this);\n }\n }\n $this->securityTokenAdded = true;\n\n // add the \"real\" HTTP method if necessary (for PUT, DELETE and HEAD)\n if (strtoupper($this->FormMethod() ?? '') != $this->FormHttpMethod()) {\n $methodField = new HiddenField('_method', '', $this->FormHttpMethod());\n $methodField->setForm($this);\n $extraFields->push($methodField);\n }\n\n return $extraFields;\n }", "public function getAdditionalData() {\n\t\treturn $this->additional_data;\n\t}", "public function get_additional_info()\n {\n return array();\n }", "public function getExtra()\n {\n return $this->extra;\n }", "public function getExtra()\n {\n return $this->extra;\n }", "public function getAdditionalData()\n {\n return $this->data;\n }", "public function getFields() {\r\n\r\n $fields = array();\r\n\r\n $fields['userid'] = $this->userid;\r\n $fields['itemid'] = $this->itemid;\r\n\r\n $fields['type'] = $this->type;\r\n $fields['detail'] = $this->detail;\r\n $fields['date'] = $this->date;\r\n\r\n $fields['location_simple'] = $this->location_simple;\r\n $fields['location_latlong'] = $this->location_latlong;\r\n\r\n foreach ($this->extra as $key => $value) {\r\n $fields[$key] = $value;\r\n }\r\n\r\n return $fields;\r\n }", "public function extraFields()\n {\n return[\n 'fullname'=>function(){\n return $this->firstname.' '.$this->lastname;\n },\n\n 'fulladdress'=>function ($model)\n {\n $address=$this->address1.\"\\r\\n\";\n $address=$address.$this->address2.\"\\r\\n\";\n $address=$address.$this->address3.\"\\r\\n\";\n $address=$address.$this->city.\"\\r\\n\";\n $address=$address.$this->state.\"\\r\\n\";\n $address=$address.$this->country.\"\\r\\n\";\n $address=$address.'PIN: '.$this->pin.\"\\r\\n\";\n return $address;\n }\n ];\n }", "public function getRequiredExtraFields(): array\n {\n return [];\n }", "public function getExtra();", "function getAdditionalMetadataFieldNames() {\n\t\treturn $this->getMetadataFieldNames(false);\n\t}", "function get_fields() {\n global $Tainacan_Item_Metadata;\n return $Tainacan_Item_Metadata->fetch($this, 'OBJECT');\n\n }", "public function getAdditionalData() {\n return $this->item->getAdditionalData();\n }", "public function getContactDataFields();", "protected function additionalData()\n {\n return [\n 'options' => $this->options\n ];\n }", "public function getAdditionalInformation() {}" ]
[ "0.82823557", "0.7883902", "0.7845351", "0.76586676", "0.757823", "0.757823", "0.7545114", "0.73929214", "0.734949", "0.7308875", "0.7180664", "0.7177283", "0.71651775", "0.7106467", "0.70743614", "0.7049969", "0.7024458", "0.70172036", "0.70172036", "0.70050985", "0.698712", "0.6914182", "0.6907979", "0.6871984", "0.68342966", "0.6833389", "0.6819684", "0.6800632", "0.6793831", "0.6790318" ]
0.80123067
1
Return the Extra Forum View Settings model
protected function _getForumextraModel() { return XenForo_Model::create('KomuKu_ForumExtras_Model_ForumExtras'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSettings(){\n $allSettings = GeneralSetting::all();\n \n $settingsArray = array();\n foreach ($allSettings as $settings) {\n $refl3 = new ReflectionObject($settings);\n $prop3 = $refl3->getProperty('attributes');\n $prop3->setAccessible(true);\n $setting = $prop3->getValue($settings);\n array_push($settingsArray, $setting);\n \n }\n $this->layout->content = View::make('admin.settings')->with('settings',$settingsArray);\n }", "function _settings(&$model) {\n return $this->settings[$model->name];\n }", "public function getSettings()\n {\n $data = $this->_plugin->getSettings();\n\n return Frenet_SettingsModel::populateModel($data);\n }", "public function model()\n {\n $this->fieldSearchable = config('litepie.news.news.search');\n return config('litepie.news.news.model');\n }", "public function getForumsGridSettings() {\n\t\treturn $this->forumsGridSettings;\n\t}", "public function model()\n {\n return config('litecms.forum.category.model.model');\n }", "private function settings()\n {\n if (!$this->settings) {\n $this->settings = userSettings::findOrMake($this->tid);\n }\n return $this->settings;\n }", "public function settings()\n {\n $this->authCheck();\n\n $settings = DB::table('site_settings')\n ->get();\n \n $settings=view('admin.settings')\n ->with('settings',$settings);\n\n return view('admin.master')\n ->with('main_content',$settings);\n }", "public function settings()\n\t{\n\t\t$core_features = array(\n\t\t\t// cp = custom profile fields.\n\t\t\t'cp' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'featuresettings', 'sa' => 'profile', '{session_data}']),\n\t\t\t\t'save_callback' => 'custom_profiles_toggle_callback',\n\t\t\t\t'setting_callback' => function ($value) {\n\t\t\t\t\tif (!$value)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t'disabled_profile_fields' => '',\n\t\t\t\t\t\t\t'registration_fields' => '',\n\t\t\t\t\t\t\t'displayFields' => '',\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\treturn array();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t),\n\t\t\t// k = karma.\n\t\t\t'k' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'featuresettings', 'sa' => 'karma', '{session_data}']),\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'karmaMode' => 2,\n\t\t\t\t),\n\t\t\t),\n\t\t\t// l = likes.\n\t\t\t'l' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'featuresettings', 'sa' => 'likes', '{session_data}']),\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'likes_enabled' => 1,\n\t\t\t\t),\n\t\t\t\t'setting_callback' => function ($value) {\n\t\t\t\t\tglobal $modSettings;\n\n\t\t\t\t\trequire_once(SUBSDIR . '/Mentions.subs.php');\n\n\t\t\t\t\t// Makes all the like/rlike mentions invisible (or visible)\n\t\t\t\t\ttoggleMentionsVisibility('likemsg', !empty($value));\n\t\t\t\t\ttoggleMentionsVisibility('rlikemsg', !empty($value));\n\n\t\t\t\t\t$current = !empty($modSettings['enabled_mentions']) ? explode(',', $modSettings['enabled_mentions']) : array();\n\n\t\t\t\t\tif (!empty($value))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn array('enabled_mentions' => implode(',', array_merge($current, array('likemsg', 'rlikemsg'))));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn array('enabled_mentions' => implode(',', array_diff($current, array('likemsg', 'rlikemsg'))));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t),\n\t\t\t// ml = moderation log.\n\t\t\t'ml' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'logs', 'sa' => 'modlog', '{session_data}']),\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'modlog_enabled' => 1,\n\t\t\t\t),\n\t\t\t),\n\t\t\t// pe = post email\n\t\t\t'pe' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'maillist', 'sa' => 'emailsettings']),\n\t\t\t\t'save_callback' => 'postbyemail_toggle_callback',\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'maillist_enabled' => 1,\n\t\t\t\t\t'pbe_post_enabled' => 2,\n\t\t\t\t\t'pbe_pm_enabled' => 2,\n\t\t\t\t),\n\t\t\t),\n\t\t\t// pm = post moderation.\n\t\t\t'pm' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'permissions', 'sa' => 'postmod', '{session_data}']),\n\t\t\t\t'setting_callback' => function ($value) {\n\t\t\t\t\t// Cannot use warning post moderation if disabled!\n\t\t\t\t\tif (!$value)\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_once(SUBSDIR . '/Moderation.subs.php');\n\t\t\t\t\t\tapproveAllUnapproved();\n\n\t\t\t\t\t\treturn array('warning_moderate' => 0);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn array();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t),\n\t\t\t// ps = Paid Subscriptions.\n\t\t\t'ps' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'paidsubscribe']),\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'paid_enabled' => 1,\n\t\t\t\t),\n\t\t\t\t'setting_callback' => 'subscriptions_toggle_callback',\n\t\t\t),\n\t\t\t// rg = report generator.\n\t\t\t'rg' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'reports']),\n\t\t\t),\n\t\t\t// w = warning.\n\t\t\t'w' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'securitysettings', 'sa' => 'moderation']),\n\t\t\t\t'setting_callback' => function ($value) {\n\t\t\t\t\tglobal $modSettings;\n\n\t\t\t\t\tlist ($modSettings['warning_enable'], $modSettings['user_limit'], $modSettings['warning_decrement']) = explode(',', $modSettings['warning_settings']);\n\t\t\t\t\t$warning_settings = ($value ? 1 : 0) . ',' . $modSettings['user_limit'] . ',' . $modSettings['warning_decrement'];\n\t\t\t\t\tif (!$value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$returnSettings = array(\n\t\t\t\t\t\t\t'warning_watch' => 0,\n\t\t\t\t\t\t\t'warning_moderate' => 0,\n\t\t\t\t\t\t\t'warning_mute' => 0,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telseif (empty($modSettings['warning_enable']) && $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$returnSettings = array(\n\t\t\t\t\t\t\t'warning_watch' => 10,\n\t\t\t\t\t\t\t'warning_moderate' => 35,\n\t\t\t\t\t\t\t'warning_mute' => 60,\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$returnSettings = array();\n\t\t\t\t\t}\n\n\t\t\t\t\t$returnSettings['warning_settings'] = $warning_settings;\n\n\t\t\t\t\treturn $returnSettings;\n\t\t\t\t},\n\t\t\t),\n\t\t\t// Search engines\n\t\t\t'sp' => array(\n\t\t\t\t'url' => getUrl('admin', ['action' => 'admin', 'area' => 'sengines']),\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'spider_mode' => 1,\n\t\t\t\t),\n\t\t\t\t'setting_callback' => function ($value) {\n\t\t\t\t\t// Turn off the spider group if disabling.\n\t\t\t\t\tif (!$value)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn array('spider_group' => 0, 'show_spider_online' => 0);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'on_save' => function () {\n\t\t\t\t\trequire_once(SUBSDIR . '/SearchEngines.subs.php');\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\t\t$this->_getModulesConfig($core_features);\n\n\t\t// Anyone who would like to add a core feature?\n\t\tcall_integration_hook('integrate_core_features', array(&$core_features));\n\n\t\treturn $core_features;\n\t}", "public function getForum()\n {\n // get articles\n $articles = Article::orderBy('updated_at', 'desc')->take(10)->get();\n\n // return view with articles\n return view('articles.forum', [\n 'articles' => $articles,\n 'article_type_hash' => $this->article_type_hash,\n ]);\n }", "public function model()\n {\n return Setting::class;\n }", "public function model()\n {\n return Setting::class;\n }", "public function forum()\n\t{\n\t\treturn $this->belongsTo('App\\Models\\Forum');\n\t}", "public function social()\n {\n $id = 1; // make $id to always be one\n //Find social_setting by id in social_settings table and store it in \"$social_setting\" variable\n $social_setting = socialSetting::find($id);\n return view('admin/settings/social', [\n 'social_setting' => $social_setting,\n ]);\n }", "public function general()\n {\n $id = 1; // make $id to always be one\n //Find general_setting by id in general_settings table and store it in \"$general_setting\" variable\n $general_setting = GeneralSetting::find($id);\n return view('admin/settings/general', [\n 'general_setting' => $general_setting,\n ]);\n }", "public function notification_settings()\n {\n return $this->hasOne('App\\NotificationSettings');\n }", "public function settings(){\n $adminDetails = Admin::where('email',Auth::guard('admin')->user()->email)->first();\n return view('admin.admin_settings')->with(compact('adminDetails'));\n }", "public function getSettings()\n {\n $this->view('user.settings');\n }", "public function get_settings()\n {\n $data['menu_active'] = 'settings';\n $data['title'] = \"General Settings\";\n $data['settings'] = Settings::get();\n return view('admin.settings.index', $data);\n }", "public function get_settings() {\n\t\t$settings = parent::get_settings();\n\n\t\t$settings[] = 'ogone_directlink';\n\n\t\treturn $settings;\n\t}", "public function model()\n {\n return TipsSetting::class;\n// return Businesses::class;\n }", "function get_settings() {\n\t\treturn $this->settings;\n\t}", "public function get_blog_settings_data()\n\t{\n\t\t$result = $this->db->from(\"blog_settings\")->limit(1)->get();\n\t\treturn $result;\n\t}", "public function get_blog_settings_data()\n\t{\n\t\t$result = $this->db->from(\"blog_settings\")->limit(1)->get();\n\t\treturn $result;\n\t}", "public function __invoke()\n {\n $account = Auth::user();\n\n return $this->getView('settings', compact('account'));\n }", "private function _get_current_settings()\n\t{\n\t\t$query = ee()->db->select('settings')\n\t\t ->from('extensions')\n\t\t ->where('class', $this->class_name)\n\t\t ->limit(1)\n\t\t ->get();\n\n\t\treturn @unserialize($query->row('settings'));\n\t}", "public function getSettings() {\n return $this->settings->attributes;\n }", "private function getSettings(){\n $settings = Auth::user()->settings;\n if(!$settings){\n $settings = new \\App\\Setting;\n $settings->user_id = Auth::id();\n foreach(Cons::$default_settings as $key => $value){\n $settings->{$key} = $value;\n }\n $settings->save();\n return Cons::$default_settings;\n }\n return $settings; // return created settings\n }", "public function extra_settings()\n\t{\n\t\t$itemSettings = array( 0 => array( 'form_type' \t=> 'formsimpleinput',\n\t\t\t\t\t\t\t\t\t\t 'field' \t\t=> 'si_max_num',\n\t\t\t\t\t\t\t\t\t\t 'words' \t\t=> $this->lang->words['max_emoticon_size'],\n\t\t\t\t\t\t\t\t\t\t 'desc' \t\t=> ''\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 1 => array( 'form_type' \t=> 'formsimpleinput',\n\t\t\t\t\t\t\t\t\t\t 'field' \t\t=> 'si_extra_settings_1',\n\t\t\t\t\t\t\t\t\t\t 'words' \t\t=> $this->lang->words['max_emoticon_height'],\n\t\t\t\t\t\t\t\t\t\t 'desc' \t\t=> ''\n\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t\t 2 => array( 'form_type' \t=> 'formsimpleinput',\n\t\t\t\t\t\t\t\t\t\t 'field' \t\t=> 'si_extra_settings_2',\n\t\t\t\t\t\t\t\t\t\t 'words' \t\t=> $this->lang->words['max_emoticon_width'],\n\t\t\t\t\t\t\t\t\t\t 'desc' \t\t=> ''\n\t\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 3 => array( 'form_type' => 'formMultiDropdown',\n\t\t\t\t\t\t\t\t\t\t 'field' \t=> 'si_extra_settings_3',\n\t\t\t\t\t\t\t\t\t\t 'words' \t=> $this->lang->words['emoticon_image_formats'],\n\t\t\t\t\t\t\t\t\t\t 'desc' \t\t=> '',\n\t\t\t\t\t\t\t\t\t\t 'type' => 'image_types'\n\t\t\t\t\t\t\t\t\t\t )\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t );\n\t\t\n\t\treturn $itemSettings;\n\t}", "public function getSettingsedit(){\n\n $allSettings = GeneralSetting::all();\n\n //$item = GeneralSetting::find($id);\n if($allSettings != null){\n $settingsArray = array();\n foreach ($allSettings as $setting_item) {\n\n $refl4 = new ReflectionObject($setting_item);\n $prop4 = $refl4->getProperty('attributes');\n $prop4->setAccessible(true);\n $item = $prop4->getValue($setting_item);\n\n $item_type = $item['type'];\n if($item_type == 'max_exam_time'){\n $time_string = $item['value'];\n $timeArray = explode(\":\",$time_string);\n $time_min= $timeArray[0]*60+$timeArray[1];\n\n $item['time_min'] = $time_min;\n }\n array_push($settingsArray,$item);\n\n } \n /* echo \"<pre>\";\n print_r($settingsArray);exit;*/\n \n $this->layout->content = View::make('admin.settingEdit')->with('settings',$settingsArray);\n }else{\n return Redirect::to('admin/settings')->with('message', 'No such settings exist!'); \n }\n }" ]
[ "0.61899656", "0.5852582", "0.5819514", "0.57556164", "0.5746914", "0.57232785", "0.56998444", "0.56346965", "0.56315416", "0.56117386", "0.5586368", "0.5586368", "0.5581351", "0.55563605", "0.5554985", "0.5531331", "0.55259544", "0.5521986", "0.55034196", "0.54810804", "0.5478579", "0.5473654", "0.54298496", "0.54298496", "0.5417917", "0.54158074", "0.5407595", "0.5390161", "0.5389611", "0.5385009" ]
0.6173269
1
Sets the default value for a route variable.
public function value(string $variable, $default): Route { $this->setDefault($variable, $default); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRouteDefault($key, $value)\n {\n $this->defaults[$key] = $value;\n return $this;\n }", "function setDefault($value)\n {\n $this->_defValue = $value;\n }", "public function setDefault($value);", "public function setDefaultRouteParameters(array $defaultRouteParams);", "public function getDefault($var);", "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}", "function define_default($param, $value) {\n\t\t//\n\t}", "public function setDefaultValue($value);", "public function setDefaultValue($value=null);", "static public function setDefault($key, $value)\r\n {\r\n /* If there is no such variable yet, set the value */\r\n if(!self::has($key))\r\n {\r\n self::set($key, $value);\r\n }\r\n }", "public function setDefaultParam($name, $value);", "protected function setDefaultValues()\n {\n parent::setDefaultValues();\n $request = DRequest::load();\n $this->setFieldValue(self::FIELD_IP_ADDRESS, $request->getIpAddress());\n $this->setFieldValue(self::FIELD_URL, self::getRequestUrl());\n }", "private function get_defaultRoute()\n\t{\n\t\treturn $this->m_defaultRoute;\n\t}", "public function setDefaultValue ($name, $value) {\n // xxx finish\n }", "function setDefaultValue($var, $val)\n{\n\tif (!array_key_exists($var, $GLOBALS))\n\t{\n\t\t$GLOBALS[$var] = $val;\n\t}\n}", "function defaults(&$var, $value) {\n isset($var) || $var = $value;\n}", "function default_value(&$var, $def = null) {\n return isset($var)?$var:$def;\n}", "public function setDefault(string $default): void\n {\n $this->default = trim($default);\n }", "function setDefault($key, $defvalue) {\n\t\t$this->defaultmap[$key] = $defvalue;\n\t}", "function progress_default_value(&$var, $def = null) {\n return isset($var)?$var:$def;\n}", "function usp_ews_default_value(&$var, $def = null) {\n return isset($var)?$var:$def;\n}", "public function set_default_value($value) {\n\t\t$this->default_value = $value;\n\t\tif ($this->ISOPEN)\n\t\t\t$this->DEFAULTS = array_fill(0, count($this->HEADERS), $this->default_value);\n\t}", "function setRoute(DynamicValue $p_route):void\n {\n $this->route=$p_route; \n }", "function get_url_param( $variable, $default='' )\n {\n return !empty( $_GET[ $variable ] )?$_GET[ $variable ]:$default;\n }", "private function get_userDefaultRoute()\n\t{\n\t\treturn $this->m_userDefaultRoute;\n\t}", "public function pi_setPiVarDefaults() {}", "public final function post_value($default_value = \\null)\n {\n }", "function _setDefaults() {}", "public function setDefaultValue($defaultValue)\n {\n $this->_defaultValue = $defaultValue;\n }", "public function setDefaultValue($defaultValue)\n {\n $this->defaultValue = $defaultValue;\n }" ]
[ "0.6579281", "0.63643426", "0.63215303", "0.6240801", "0.62327087", "0.6210193", "0.61929435", "0.6113726", "0.610803", "0.6093142", "0.60831213", "0.6059599", "0.6042911", "0.5979067", "0.5964296", "0.59340274", "0.59166294", "0.58960354", "0.5810401", "0.57989895", "0.57512033", "0.57271093", "0.5711757", "0.5672539", "0.56388766", "0.5588755", "0.55635977", "0.55622804", "0.5558103", "0.5522667" ]
0.67716825
0
Sets a converter for a route variable.
public function convert(string $variable, callable $callback): Route { $converters = $this->getOption('_converters'); $converters[$variable] = $callback; $this->setOption('_converters', $converters); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setConverter($converter)\n {\n $this->setAttributeClosure('converter', $converter);\n }", "public function addConverter($parameter, $converter);", "public function setConverter(ConverterInterface $converter)\n {\n $this->converter = $converter;\n }", "public function setConvert($value)\n {\n return $this->set('Convert', $value);\n }", "public function setConvert($value)\n {\n return $this->set('Convert', $value);\n }", "public function setConvert($value)\n {\n return $this->set('Convert', $value);\n }", "public function setConverter(PrizeConverter $converter): void\n {\n $this->converter = $converter;\n }", "public function setConverterOptions($converter, $attribute, array $converterOptions)\n {\n if (!isset($this->converterOptions[$converter])) {\n $this->converterOptions[$converter] = [];\n }\n $this->converterOptions[$converter][strtolower($attribute)] = $converterOptions;\n }", "public function setConvertido($lConvertido) {\n $this->lConvertido = $lConvertido;\n }", "public function addConverter($from, ConverterInterface $converter)\n {\n $this->converter[$from] = $converter;\n }", "public function getConverter()\n {\n return $this->converter;\n }", "public function setRoute($routeTo) {\n $this->isDynamic = true;\n $xRouteTo = null;\n $type = gettype($routeTo);\n\n if (!is_callable($routeTo) && $type != 'object' && !class_exists($routeTo)) {\n $cleaned = str_replace('\\\\', DS, $routeTo);\n $xRouteTo = str_replace('/', DS, $cleaned);\n $explode = explode('.', $routeTo);\n $extension = $explode[count($explode) - 1];\n\n if ($extension != 'php') {\n $this->isDynamic = false;\n }\n } else if (is_callable($routeTo)) {\n $this->setType(Router::CLOSURE_ROUTE);\n $xRouteTo = $routeTo;\n } else if ($type == 'object') {\n $xRouteTo = get_class($routeTo);\n } else if (class_exists($routeTo)) {\n $xRouteTo = $routeTo;\n }\n\n $this->routeTo = $xRouteTo;\n }", "public function getConverterName();", "public function setArgument(string $key, $value) : Route\n {\n if (!empty($key) && strlen($key) >= 2) {\n $this->args[$key] = urldecode($value);\n }\n return $this;\n }", "public function setResolver(ParameterInterface $resolver);", "abstract protected function getConverterFactory();", "private function __converter(&$value, $key) {\n\t\tif (is_bool($value)) {\n\t\t\t$value = ($value ? '1' : '0');\n\t\t}\n\t}", "private function getConverter(\n ParameterAwareAnnotation $annotation,\n ConverterProvider $converterProvider,\n TypeToken $type\n ): Converter {\n switch ($annotation->converterType()) {\n case RequestBodyConverter::class:\n return $converterProvider->getRequestBodyConverter($type);\n case StringConverter::class:\n return $converterProvider->getStringConverter($type);\n }\n\n throw new LogicException(sprintf(\n 'Retrofit: Unable to handle converter of type %s. Please use RequestBodyConverter or StringConverter',\n $annotation->converterType()\n ));\n }", "public function set_resolver(Resolver $resolver);", "public static function setToArrayConverter($converter)\n {\n if ($converter instanceof \\MUtil_Util_ClassList) {\n self::$_toArrayConverter = $converter;\n } elseif (is_array($converter)) {\n self::$_toArrayConverter = new \\MUtil_Util_ClassList($converter);\n }\n }", "public function convert($name);", "public static function set($route) {\n self::registerRoute($route);\n }", "public function addConverter($column, $callback)\n {\n $this->_column($column)->converters[] = FaZend_Callback::factory($callback);\n return $this;\n }", "function setRoute(DynamicValue $p_route):void\n {\n $this->route=$p_route; \n }", "public function set_router( sn\\base\\routing\\I_Router $router );", "protected function getSensioFrameworkExtra_Converter_ListenerService()\n {\n return $this->services['sensio_framework_extra.converter.listener'] = new \\Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ParamConverterListener($this->get('sensio_framework_extra.converter.manager'), true);\n }", "protected function fieldAttributeConverter(): FieldAttributeConverterInterface {\n return \\Drupal::service('apigee_edge.converter.field_attribute');\n }", "public function getTypeConverter() {}", "public function resolveRouteBinding($value);", "public function __set($var, $value) { $this->{$this->_parameterMap[$var]} = $value; }" ]
[ "0.6396224", "0.6201782", "0.5725786", "0.5505384", "0.55027187", "0.55027187", "0.530109", "0.5152746", "0.47267032", "0.467979", "0.45981932", "0.45717242", "0.4566709", "0.44076484", "0.43682274", "0.43558973", "0.43556994", "0.43540668", "0.434584", "0.43452516", "0.4326784", "0.42938215", "0.42593727", "0.42361897", "0.4235522", "0.42093047", "0.41951472", "0.41938725", "0.41907415", "0.41820097" ]
0.6423221
0
Sets the requirement for HTTP (no HTTPS) on this Route.
public function requireHttp(): Route { $this->setSchemes('http'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requireHttps(): Route\n {\n $this->setSchemes('https');\n\n return $this;\n }", "public function setHttp($Http)\r\n {\r\n $this->Http = $Http;\r\n }", "public function setHttp($http)\n {\n $this->http = $http;\n }", "public function testSchemeIsHttpByDefault()\n {\n $request = new Request($this->config, []);\n\n $this->assertEquals('http://', $request->scheme);\n $this->assertEquals('http://', $request->getScheme());\n }", "public function useHttps($flag = true) {\r\n\t\t$this->useHttps = true;\r\n\t\treturn $this;\r\n\t}", "public function useSecureProtocol($protocol)\n {\n if($protocol == true)\n {\n $this->protocol = 'https';\n }\n else\n {\n $this->protocol = 'http';\n }\n }", "public function usesHttps()\n {\n return $this->useHttps;\n }", "public function testSchemeIsHttpsIfHttpsValueIsOn()\n {\n $server = ['HTTPS' => 'on'];\n $request = new Request($this->config, $server);\n\n $this->assertEquals('https://', $request->scheme);\n $this->assertEquals('https://', $request->getScheme());\n }", "private function usesNonStandardHttpPort(): bool\n {\n return 'http' === $this->getScheme() && '80' != $this->router->getContext()->getHttpPort();\n }", "function setUseHttp($use_http) {\n $this->helper->setUseHttp($use_http);\n return $this;\n }", "function setUseHttp($use_http) {\n $this->helper->setUseHttp($use_http);\n return $this;\n }", "function setUseHttp($use_http) {\n $this->helper->setUseHttp($use_http);\n return $this;\n }", "function setUseHttp($use_http) {\n $this->helper->setUseHttp($use_http);\n return $this;\n }", "function setUseHttp($use_http) {\n $this->helper->setUseHttp($use_http);\n return $this;\n }", "public function testHttp()\n {\n $request = Request::create('http://example.com/test');\n $response = $this->app->handle($request);\n $this->assertEquals(301, $response->getStatusCode());\n $this->assertTrue($response->isRedirect('https://example.com/test'));\n }", "public static function checkHttps()\n\t{\n\t\tif (!ConfigCls::getNeedHttps())\n\t\t\treturn true;\n\n\t\t//Else, return true only if HTTP is set\n\t\tif (!self::httpsUsed())\n\t\t\tdie('HTTPS connection required');\n\t}", "function http() {\n\treturn !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https':'http';\n}", "public function http()\n {\n return ($this->isSsl()) ? 'https://' : 'http://';\n }", "public function setHttpVersion($version) {}", "public function isHttponly(): bool\n {\n return $this->httponly;\n }", "private static function httpOrHttps()\n {\n if(isset($_SERVER['HTTPS'])) {\n return 'https://';\n }\n return 'http://';\n }", "private function setProtocol()\n {\n $urlE = $this->explodedUrl;\n\n $this->protocol = substr($urlE[0], 0, -1);\n }", "public function setUrlGeneratorPolicy()\n {\n $policy = $this->app['config']->get('cms.linkPolicy', 'detect');\n\n switch (strtolower($policy)) {\n case 'force':\n $appUrl = $this->app['config']->get('app.url');\n $schema = \\Str::startsWith($appUrl, 'http://') ? 'http' : 'https';\n $this->app['url']->forceRootUrl($appUrl);\n $this->app['url']->forceScheme($schema);\n break;\n\n case 'insecure':\n $this->app['url']->forceScheme('http');\n break;\n\n case 'secure':\n $this->app['url']->forceScheme('https');\n break;\n }\n }", "public function httpOnly()\n {\n return in_array('http', $this->action, true);\n }", "public function testGenerationWithHttpsOption(): void\n {\n Router::fullBaseUrl('http://app.test');\n Router::createRouteBuilder('/')->connect('/{controller}/{action}/*');\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index',\n ],\n 'environment' => ['HTTP_HOST' => 'localhost'],\n ]);\n Router::setRequest($request);\n\n $result = Router::url([\n '_https' => true,\n ]);\n $this->assertSame('https://app.test/Images/index', $result);\n\n $result = Router::url([\n '_https' => false,\n ]);\n $this->assertSame('http://app.test/Images/index', $result);\n }", "public function forceSSL();", "public function forceSSL();", "public function setInsecure()\n\t{\n\t\t$this->insecure = true;\n\t}", "private function usesNonStandardHttpsPort(): bool\n {\n return 'https' === $this->getScheme() && '443' != $this->router->getContext()->getHttpsPort();\n }", "public function setHttpOnly( $httponly )\n {\n $this->httponly = ub($httponly);\n }" ]
[ "0.6471407", "0.6236798", "0.6082176", "0.5846088", "0.5824886", "0.55918676", "0.55809987", "0.5556115", "0.5495883", "0.5436704", "0.5436704", "0.5436704", "0.5436704", "0.5436704", "0.54112303", "0.5365604", "0.5346262", "0.53370583", "0.5316627", "0.531424", "0.5312279", "0.5291085", "0.52873796", "0.52563316", "0.5244619", "0.52403104", "0.52403104", "0.5228427", "0.5221467", "0.5207407" ]
0.7046834
0
Sets the requirement for HTTPS on this Route.
public function requireHttps(): Route { $this->setSchemes('https'); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function usesHttps()\n {\n return $this->useHttps;\n }", "public function useHttps($flag = true) {\r\n\t\t$this->useHttps = true;\r\n\t\treturn $this;\r\n\t}", "public static function checkHttps()\n\t{\n\t\tif (!ConfigCls::getNeedHttps())\n\t\t\treturn true;\n\n\t\t//Else, return true only if HTTP is set\n\t\tif (!self::httpsUsed())\n\t\t\tdie('HTTPS connection required');\n\t}", "public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }", "public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }", "public function isUsingHttps() {\r\n\t\treturn $this->useHttps;\r\n\t}", "public function isHttps() {\n global $is_https;\n\n return $is_https;\n }", "public function isHttps(): bool {\n\t\treturn $this->getScheme() === 'https' ? TRUE : FALSE;\n\t}", "public function testSchemeIsHttpsIfHttpsValueIsOn()\n {\n $server = ['HTTPS' => 'on'];\n $request = new Request($this->config, $server);\n\n $this->assertEquals('https://', $request->scheme);\n $this->assertEquals('https://', $request->getScheme());\n }", "public static function setHttpsOnly($httpsOnly) {\n\t\tself::instance()->httpsOnly($httpsOnly);\n\t}", "public function useSecureProtocol($protocol)\n {\n if($protocol == true)\n {\n $this->protocol = 'https';\n }\n else\n {\n $this->protocol = 'http';\n }\n }", "public function forceSSL();", "public function forceSSL();", "protected function isHttps() {\n $request = $this->requestStack->getCurrentRequest();\n return $request->getScheme() === 'https';\n }", "public function testGenerationWithHttpsOption(): void\n {\n Router::fullBaseUrl('http://app.test');\n Router::createRouteBuilder('/')->connect('/{controller}/{action}/*');\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index',\n ],\n 'environment' => ['HTTP_HOST' => 'localhost'],\n ]);\n Router::setRequest($request);\n\n $result = Router::url([\n '_https' => true,\n ]);\n $this->assertSame('https://app.test/Images/index', $result);\n\n $result = Router::url([\n '_https' => false,\n ]);\n $this->assertSame('http://app.test/Images/index', $result);\n }", "public function isHttpsOnly()\n {\n return in_array('https', $this->action, true);\n }", "public function hasUseHttps()\n {\n return $this->use_https !== null;\n }", "public function set_use_ssl($_use_ssl)\n {\n $this->_use_ssl = $_use_ssl;\n }", "public function testIsSSLA() {\n // To revert\n $https = ( isset( $_SERVER['HTTPS'] ) ) ? $_SERVER['HTTPS'] : NULL;\n\n // If it's off, it should not show ssl\n $_SERVER['HTTPS'] = 'off';\n\n // Should NOT be SSL\n $this->assertFalse( security::is_ssl() );\n\n // Revert\n $_SERVER['HTTPS'] = $https;\n }", "public function testGenerateWithHttpsInHttps(): void\n {\n Router::createRouteBuilder('/')->connect('/{controller}/{action}/*');\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'environment' => ['HTTP_HOST' => 'app.test', 'HTTPS' => 'on'],\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Images',\n 'action' => 'index',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url([\n '_https' => false,\n ]);\n $this->assertSame('http://app.test/Images/index', $result);\n\n $result = Router::url([\n '_https' => true,\n ]);\n $this->assertSame('https://app.test/Images/index', $result);\n }", "public function testIsSSLD() {\n // If it's HTTPS is set, SSL\n $_SERVER['HTTP_X_FORWARDED_PROTO'] = 'HTTPS';\n\n $this->assertTrue( security::is_ssl() );\n }", "function qa_is_https_probably()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn (@$_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')) || (@$_SERVER['SERVER_PORT'] == 443);\n}", "private function usesNonStandardHttpsPort(): bool\n {\n return 'https' === $this->getScheme() && '443' != $this->router->getContext()->getHttpsPort();\n }", "public function httpsOnly()\n {\n return $this->secure();\n }", "public function setIsSecure($flag = true)\n {\n $this->setServer('HTTPS', $flag ? 'on' : null);\n return $this;\n }", "public function isSecure(): bool\n {\n //Double check though attributes?\n return $this->request()->getUri()->getScheme() === 'https';\n }", "public function isSSL()\n {\n if (is_null($this->is_ssl)) {\n $server = provider::access('server');\n\n $this->is_ssl = (\n $server->isExist('HTTP_HOST') &&\n $server->isExist('HTTPS') &&\n $server->isValid('HTTPS', validate::T_PATTERN, array('pattern' => '/on/i'))\n );\n }\n\n return $this->is_ssl;\n }", "public function __https()\n{\n\tif(strpos($_SERVER['HTTP_HOST'],'www') === false or !isset($_SERVER['HTTPS']))\n\t{\n\t\theader('Location: '._https);\n\t\texit(0);\n\t}\n}", "function trigger_https()\n\t{\n\t\t$exclude_url_list = array();\n\t\t//$exclude_url_list[] = '/(.*)js$/';\n\t\tforeach ($exclude_url_list as $exclude_url) {\n\t\t\tif(preg_match($exclude_url, uri_string()))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t \n\t\t// switch to HTTPS for these urls\n\t\t$ssl_url_list = array();\n\t\t$ssl_url_list[] = '/(.*)contact(.*)$/';\n\t \n\t\tforeach ($ssl_url_list as $ssl_url) {\n\t\t\tif(preg_match($ssl_url, uri_string()))\n\t\t\t{\n\t\t\t\tforce_ssl();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t \n\t\t// still here? switch to HTTP (if necessary)\n\t\tremove_ssl();\n\t}", "function wp_is_https_supported()\n {\n }" ]
[ "0.7177525", "0.7033442", "0.6809299", "0.68027663", "0.68027663", "0.6756763", "0.6691686", "0.6660385", "0.6577301", "0.65380144", "0.65144086", "0.64811087", "0.64811087", "0.6441674", "0.64045084", "0.6399802", "0.63748175", "0.6343627", "0.62878275", "0.62667304", "0.62579787", "0.6236242", "0.62361664", "0.6211155", "0.6208634", "0.61934096", "0.6180319", "0.617557", "0.61678475", "0.6123556" ]
0.7596234
0
Sets a callback to handle after the route callback.
public function after(callable $callback): Route { $current = $this->getOption('after_middlewares'); $current[] = $callback; $this->setOption('_after_middlewares', $current); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function after($callback);", "public function after(\\Closure $callback)\n {\n $this->affirmCallable($callback, \"after\");\n $this->after = $callback;\n }", "function on ($uri, $callback)\r\n\t{\r\n\t\tif ($this->called)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// NOTE: Last callback param is $matches\r\n\t\tlist($success, $matches) = Routing::match($uri, $this->request->URI);\r\n\t\tif ($success)\r\n\t\t{\r\n\t\t\tcall_user_func_array($callback, array_merge($this->runArgs, $matches));\r\n\t\t\t$this->called = true;\r\n\t\t}\r\n\t}", "public function after(Closure $callback)\n\t{\n\t\t$this->globalMiddlewares['after'][] = $callback;\n\t}", "public function setCallback($callback);", "function afterroute() {\r\n\r\n }", "public function setCallback($callback = null) : Route\n {\n if ($callback !== null) {\n $this->callback = $callback;\n }\n return $this;\n }", "public function after($callback)\n {\n $this->app['events']->listen('custom.queue.after', $callback);\n }", "public function after($callback)\r\n {\r\n // TODO: Implement after() method.\r\n }", "function afterroute() {\n\t}", "public function post($route, $callback)\r\n {\r\n $this->registerRoute(self::cleanUrl($route), $callback, 'post');\r\n }", "public static function handle($route, $callback)\n {\n if ($route === $_SERVER['REQUEST_URI']) {\n $callback();\n }\n }", "public function onRequestComplete($callback) {\n $this->eventManager->attach('complete', $callback);\n }", "public function setCallback($callback)\n\t{\n\t\t$this->callback = $callback;\n\t}", "public function post($path, $callback) {\n $this->routes['post'][$path] = $callback; \n }", "protected function handleRouteCallback(Route $route, RouteCollection $matched, array $methods_matched)\r\n {\r\n // Handle the callback\r\n $returned = call_user_func(\r\n $route->getCallback(), // Instead of relying on the slower \"invoke\" magic\r\n $this->request,\r\n $this->response,\r\n $this->service,\r\n $this->app,\r\n $this, // Pass the Klein instance\r\n $matched,\r\n $methods_matched\r\n );\r\n\r\n if ($returned instanceof AbstractResponse) {\r\n $this->response = $returned;\r\n } else {\r\n // Otherwise, attempt to append the returned data\r\n try {\r\n $this->response->append($returned);\r\n } catch (LockedResponseException $e) {\r\n // Do nothing, since this is an automated behavior\r\n }\r\n }\r\n }", "public function post($path, $callback)\n\t{\n\t\t$this->routes['post'][$path] = $callback;\n\t}", "public function setCallback(mixed $callback): void\n {\n $this->callback = $callback;\n }", "public function finish(Closure $callback)\n\t{\n\t\t$this->globalMiddlewares['finish'][] = $callback;\n\t}", "public function afterDispatch($callback)\r\n {\r\n $this->after_filter_callbacks->enqueue($callback);\r\n }", "function handle_callback() {\r\n }", "public function add_callback($callback)\n {\n }", "public function setCallback($callback): Router\n {\n $this->callback = $callback;\n return $this;\n }", "public function post($identifier, callable $callback)\n {\n $this->routes[] = $this->route_factory->build($identifier, 'POST', $callback);\n }", "public function after($callback)\n {\n $this->app['events']->listen(Events\\JobProcessed::class, $callback);\n }", "public function after($callback)\n {\n $this->app['events']->listen(Events\\JobProcessed::class, $callback);\n }", "public function withRoutes(Closure $callback): self\n {\n $this->callbacks[] = $callback;\n\n return $this;\n }", "public function setCallback(string $path, string $cb, ?string $arg = null): bool {}", "public function setCallback(callable $cb, mixed $arg = null): void {}", "public static function post($route, $callback)\n {\n $callback = self::parseCallback($callback);\n add_action('admin_action_' . $route, $callback);\n }" ]
[ "0.6801826", "0.6678508", "0.66266394", "0.65520525", "0.64197147", "0.63466555", "0.6339645", "0.6295458", "0.6279045", "0.6269848", "0.624551", "0.62027764", "0.61746716", "0.6153482", "0.6000387", "0.59905326", "0.59249884", "0.5923443", "0.5812598", "0.5796405", "0.57946646", "0.5773149", "0.57689834", "0.5757244", "0.5710665", "0.5710665", "0.568206", "0.56812924", "0.5657174", "0.5632461" ]
0.66930526
1
Sets a condition for the route to match.
public function when(string $condition): Route { $this->setCondition($condition); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCondition($condition);", "public function addCondition($condition);", "public final function addCondition($k,$v){\n $this->defaultMatchCondition[$k]=$v;\n }", "public function testRouteConditionTranslation() {\n\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['Test']);\n\n\t\tforeach(Nether\\Option::Get('nether-avenue-condition-shortcuts') as $old => $new)\n\t\t(new Verify(\n\t\t\t\"pattern {$old} translates as expected.\",\n\t\t\t$router->TranslateRouteCondition($old)\n\t\t))->equals($new);\n\n\t\treturn;\n\t}", "public function\n\tTranslateRouteCondition(String $Cond):\n\tString {\n\n\t\t$Old = NULL;\n\t\t$New = NULL;\n\n\t\tforeach(Nether\\Option::Get('nether-avenue-condition-shortcuts') as $Old => $New)\n\t\t$Cond = str_replace($Old,$New,$Cond);\n\n\t\treturn $Cond;\n\t}", "public function setCondition($condition) {\r\n $this->_validateEnumValue($condition, [\r\n 'New', \r\n 'UsedLikeNew', \r\n 'UsedVeryGood', \r\n 'UsedAcceptable', \r\n 'CollectibleLikeNew', \r\n 'CollectibleVeryGood', \r\n 'CollectibleGood', \r\n 'CollectibleAcceptable',\r\n 'Refurbished',\r\n 'Club']);\r\n $this->_data['Condition'] = $condition;\r\n return $this; \r\n }", "protected function setCondition( $aCondition )\n\t{ $this->myCondition = $aCondition ; return $this ; }", "protected function setCondition($state) {\n if ($state === null){\n $this->condition = null;\n } else {\n $this->condition = boolval($state);\n }\n }", "public function testRouteMatchesResourceWithConditions()\n {\n $resource = '/hello/Josh/and/John';\n $route = new \\Slim\\Route('/hello/:first/and/:second', function () {});\n $route->conditions(array('first' => '[a-zA-Z]{3,}'));\n $result = $route->matches($resource);\n $this->assertTrue($result);\n $this->assertEquals(array('first' => 'Josh', 'second' => 'John'), $route->getParams());\n }", "function testDoesMatchingWithConditionsFunction() {\n $rule = new Rule(\".+\", \"test.php\", \"\");\n $rule->addCondition(new Condition('%{SERVER_ADMIN}', '[email protected]', ''));\n $rule->addCondition(new Condition('%{SERVER_PORT}', '=1337', ''));\n $result = $rule->rewrite($this->_request);\n $this->assertEquals(HTRouter::STATUS_NO_MATCH, $result->rc);\n $this->assertEquals(\"foo\", $this->_request->getFilename());\n\n // Rule matches, since [email protected] is correct, and we need OR\n $rule = new Rule(\".+\", \"test.php\", \"\");\n $rule->addCondition(new Condition('%{SERVER_ADMIN}', '[email protected]', '[OR]'));\n $rule->addCondition(new Condition('%{SERVER_PORT}', '=1337', ''));\n $result = $rule->rewrite($this->_request);\n// $this->assertEquals(HTRouter::STATUS_OK, $result->rc);\n// $this->assertEquals(\"/test.php\", $this->_request->getFilename());\n\n // Rule matches, since both conditions are true\n $rule = new Rule(\".+\", \"test.php\", \"\");\n $rule->addCondition(new Condition('%{SERVER_ADMIN}', '[email protected]', ''));\n $rule->addCondition(new Condition('%{SERVER_PORT}', '=80', ''));\n $result = $rule->rewrite($this->_request);\n $this->assertEquals(HTRouter::STATUS_OK, $result->rc);\n $this->assertEquals(\"/test.php\", $this->_request->getFilename());\n }", "public function set_matched_route($route)\n {\n }", "public function setCondition($value) \n {\n $this->_fields['Condition']['FieldValue'] = $value;\n return $this;\n }", "public function testRouteConditionQueryVars() {\n\n\t\t$_GET['omg'] = 'true';\n\t\t$_GET['bbq'] = 'yey';\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['TestQuery']);\n\n\t\t$router->ClearRoutes()->AddRoute('{@}//test??tacobell','herp::derp');\n\t\t$route = $router->GetRoute();\n\t\t(new Verify(\n\t\t\t'this route fails because there is no tacobell in get.',\n\t\t\t($route instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->false();\n\n\t\t$router->ClearRoutes()->AddRoute('{@}//test??omg','herp::derp');\n\t\t$route = $router->GetRoute();\n\t\t(new Verify(\n\t\t\t'this route passes because we had omg',\n\t\t\t($route instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->true();\n\n\t\t$router->ClearRoutes()->AddRoute('{@}//test??omg&bbq','herp::derp');\n\t\t$route = $router->GetRoute();\n\t\t(new Verify(\n\t\t\t'this route passes because we had omg and bbq',\n\t\t\t($route instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->true();\n\n\t\t$router->ClearRoutes()->AddRoute('{@}//test??omg&wtf&bbq','herp::derp');\n\t\t$route = $router->GetRoute();\n\t\t(new Verify(\n\t\t\t'this route fails because we had omg and bbq, but no wtf.',\n\t\t\t($route instanceof Nether\\Avenue\\RouteHandler)\n\t\t))->false();\n\n\t\treturn;\n\t}", "public function setCondition($args = null){\r\n $this->_conditions = $args;\r\n return $this;\r\n }", "public function setCondition(string $condition): FcmMessage\n {\n $this->condition = $condition;\n\n return $this;\n }", "public function setWhen($condition, string $key, $value): self\n {\n return $this->when($condition, function () use ($key, $value) {\n return $this->set($key, $value);\n });\n }", "public function setIfMatch(string $ifMatch): self\n {\n $this->options['ifMatch'] = $ifMatch;\n return $this;\n }", "public function setIfMatch(string $ifMatch): self\n {\n $this->options['ifMatch'] = $ifMatch;\n return $this;\n }", "public function setCondition($condition)\n {\n $this->condition = $condition;\n\n return $this;\n }", "public function testRouteDefaultConditions()\n {\n \\Slim\\Route::setDefaultConditions(array('id' => '\\d+'));\n $r = new \\Slim\\Route('/foo', function () {});\n //Case A\n $this->assertEquals(\\Slim\\Route::getDefaultConditions(), $r->getConditions());\n //Case B\n $r->conditions(array('name' => '[a-z]{2,5}'));\n $c = $r->getConditions();\n $this->assertArrayHasKey('id', $c);\n $this->assertArrayHasKey('name', $c);\n }", "public function setCondition(\\StructType\\WatchFolderCondition $condition = null)\n {\n if (is_null($condition) || (is_array($condition) && empty($condition))) {\n unset($this->Condition);\n } else {\n $this->Condition = $condition;\n }\n return $this;\n }", "public function setConditions( $conditions )\n\t\t{\n\t\t\t$this->_conditions = $conditions;\n\t\t}", "public function testRouteDoesNotMatchResourceWithConditions()\n {\n $resource = '/hello/Josh/and/John';\n $route = new \\Slim\\Route('/hello/:first/and/:second', function () {});\n $route->conditions(array('first' => '[a-z]{3,}'));\n $result = $route->matches($resource);\n $this->assertFalse($result);\n $this->assertEquals(array(), $route->getParams());\n }", "public function testSetRouteParamWhenExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n $this->assertEquals('anderson', $route->getParam('last'));\n\n // Set param\n $route->setParam('last', 'smith');\n\n // Get new param\n $this->assertEquals('smith', $route->getParam('last'));\n }", "public function addCondition(ConditionInterface $condition);", "public function addCondition(ConditionInterface $condition);", "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 }", "public function setCondition(callable $condition): ConfigNode\n {\n $this->nodeConditions[] = $condition;\n\n return $this;\n }" ]
[ "0.65983903", "0.59745103", "0.592202", "0.58740157", "0.5720146", "0.56853116", "0.5644908", "0.562732", "0.55748683", "0.5548018", "0.54846984", "0.5354489", "0.53527194", "0.53309935", "0.52672654", "0.5240914", "0.5204503", "0.5204503", "0.5134904", "0.51097286", "0.51029193", "0.50791466", "0.50644255", "0.50271267", "0.49899775", "0.49899775", "0.49833906", "0.49833906", "0.49833906", "0.49620232" ]
0.6353441
1
addUsuario para guardar el usuario en la sesion.
public function addUsuario($usuario){ $_SESSION["usuario"]=$usuario; $this->usuario=$usuario; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addUsuario($principal, $secundario, $nome, $sobrenome, $email, $senha, $permissao, $imgUser)\n {\n $imgUser = $this->salvaImgUser($imgUser, $email);\n // Fim do codigo\n\n $senha = password_hash($senha, PASSWORD_DEFAULT);\n\n $emailVerify = LoginHandler::emailExist($email);\n\n if (empty($emailVerify)) {\n $pdo = Usuario::sqlSelect();\n\n $sql = \"INSERT INTO usuarios (nome, sobrenome, email, senha, permissao, id_usuario_principal, img_user, id_usuario_cadastrou) VALUES (:nome, :sobrenome, :email, :senha, :permissao, $principal, :img_user, $secundario)\";\n $sql = $pdo->prepare($sql);\n $sql->bindValue(\":nome\", $nome);\n $sql->bindValue(\":sobrenome\", $sobrenome);\n $sql->bindValue(\":email\", $email);\n $sql->bindValue(\":senha\", $senha);\n $sql->bindValue(\":permissao\", $permissao);\n $sql->bindValue(\":img_user\", $imgUser);\n\n $sql->execute();\n\n if ($sql->rowCount() > 0) {\n $_SESSION['aviso'] = \"Usuário adicionado com sucesso!\";\n $_SESSION['color'] = \"lightgreen\";\n } else {\n $_SESSION['aviso'] = \"Error: Algo deu errado!\";\n $_SESSION['color'] = \"lightcoral\";\n }\n } else {\n $_SESSION['aviso'] = \"Error: E-mail já cadastrado!\";\n $_SESSION['color'] = \"lightcoral\";\n }\n }", "public function agregarUsuario(){\n \n }", "public static function add(Usuario $usuario) {\n\n $req = Db::getInstance()->prepare(\"INSERT INTO usuario (login,senha) VALUES (:login,:senha)\");\n $req->bindValue(\":login\", $usuario->getLogin());\n $req->bindValue(\":senha\", $usuario->getSenha());\n return $req->execute();\n }", "public function saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }", "function add(Usuario $objeto) {\n $campos = self::_getCampos($objeto);\n unset($campos['id']);\n return $this->db->insertParameters(self::TABLA, $campos, false);\n }", "public function crearUsuario() {\n\n\n if ($this->seguridad->esAdmin()) {\n $id = $this->usuario->getLastId();\n $usuario = $_REQUEST[\"usuario\"];\n $contrasenya = $_REQUEST[\"contrasenya\"];\n $email = $_REQUEST[\"email\"];\n $nombre = $_REQUEST[\"nombre\"];\n $apellido1 = $_REQUEST[\"apellido1\"];\n $apellido2 = $_REQUEST[\"apellido2\"];\n $dni = $_REQUEST[\"dni\"];\n $imagen = $_FILES[\"imagen\"];\n $borrado = 'no';\n if (isset($_REQUEST[\"roles\"])) {\n $roles = $_REQUEST[\"roles\"];\n } else {\n $roles = array(\"2\");\n }\n\n if ($this->usuario->add($id,$usuario,$contrasenya,$email,$nombre,$apellido1,$apellido2,$dni,$imagen,$borrado,$roles) > 1) {\n $this->perfil($id);\n } else {\n echo \"<script>\n i=5;\n setInterval(function() {\n if (i==0) {\n location.href='index.php';\n }\n document.body.innerHTML = 'Ha ocurrido un error. Redireccionando en ' + i;\n i--;\n },1000);\n </script>\";\n } \n } else {\n $this->gestionReservas();\n }\n \n }", "public function addUser(){}", "public function agregarUsuario(UsuarioComposite $usuario) {\n\t\tif (!$this->getContenidos()->contains($usuario)) {\n\t\t\t$this->getContenidos()->add($usuario);\n\t\t\t$usuario->addGrupoPertenece($this);\n\t\t}\n\t}", "public function add(Usuarios $usuarios) {\n\n \n try {\n $sql = sprintf(\"insert into mydb.usuarios (idusuarios, contraseña, fecha_registro, fecha_actualizacion, personas_idpersonas) \n values (%s,%s,%s,%s,%s)\",\n $this->labAdodb->Param(\"idusuarios\"),\n $this->labAdodb->Param(\"contraseña\"),\n $this->labAdodb->Param(\"fecha_registro\"),\n $this->labAdodb->Param(\"fecha_actualizacion\"),\n $this->labAdodb->Param(\"personas_idpersonas\")); \n \n $sqlParam = $this->labAdodb->Prepare($sql);\n\n $valores = array();\n\n $valores[\"idusuarios\"] = $usuarios->getidusuarios();\n $valores[\"contraseña\"] = $usuarios->getcontraseña();\n $valores[\"fecha_registro\"] = $usuarios->getfecha_registro();\n $valores[\"fecha_actualizacion\"] = $usuarios->getfecha_actualizacion();\n $valores[\"personas_idpersonas\"] = $usuarios->getpersonas_idpersonas();\n \n\n $this->labAdodb->Execute($sqlParam, $valores) or die($this->labAdodb->ErrorMsg());\n } catch (Exception $e) {\n throw new Exception('No se pudo insertar el registro (Error generado en el metodo add de la clase usuariosDao), error:'.$e->getMessage());\n }\n }", "public function add(){\n\t\tif($this->request->is('post'))\n\t\t{\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['role'] = 'user';\n\t\t\tif($this->User->save($this->request->data))\n\t\t\t{\n\t\t\t\t$this->Session->setFlash('Usuario creado');\n\t\t\t\treturn $this-redirect(array('action' =>'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->Session->setFlash('Usuario no creado');\n\t\t\t}\n\t\t}\n\n\t}", "public function guardarUsuario()\r\n {\r\n $user = new \\App\\Models\\User;\r\n \r\n $user->Seq_Usuario = $_REQUEST['Seq_Usuario'];\r\n $user->Usuario = $_REQUEST['username'];\r\n $user->Password = $_REQUEST['password'];\r\n $user->sys_rol_id = $_REQUEST['rolID'];\r\n\r\n\r\n $userController = new App\\Controllers\\UserController;\r\n\r\n if($user->Seq_Usuario > 0) {\r\n $result = $userController->updateUser($user);\r\n } else {\r\n $result = $userController->createUser($user);\r\n }\r\n \r\n /**\r\n * Variable de sesión usada para mostrar la notificación del\r\n * resultado de la solicitud.\r\n */\r\n $_SESSION['result'] = $result;\r\n \r\n header('Location: ?c=Registro&a=usuarios');\r\n }", "public function insertarUsuario($usuario)\n {\n $usuariosEnJSON = file_get_contents(\"..\\json\\usuarios.json\");\n // convierto el json en array\n $usuarios = json_decode($usuariosEnJSON);\n // agrego el nuevo usuario al array de la base de datos\n // validar que el usuario no exista\n\n if(existeUsuario($_POST[\"usuario\"]))\n {\n $errorUsuarioYaExiste=\"El nombre de usuario ya está en uso, por favor ingrese otro\";\n }else\n {\n echo \"entra\";\n // nos guardarmos los datos del post en un array\n // $usuario=[\n // \"id\"=> md5($_POST[\"usuario\"]),\n // \"usuario\" => $_POST[\"usuario\"],\n // \"nombreYapellido\" => $_POST[\"nombreYapellido\"],\n // \"email\" => $_POST[\"email\"],\n // \"fotoPerfil\"=>$_POST[\"fotoPerfil\"],\n // \"contrasenia\" => $contrasenia\n // ];\n $usuarios[] = $usuario;\n //convierto el nuevo array completo a json\n $nuevosUsuariosEnJSON = json_encode($usuarios);\n\n //escribo el nuevo json en el archivo .json\n file_put_contents(\"..\\json\\usuarios.json\",$nuevosUsuariosEnJSON);\n }\n }", "public function addUser(){\n\t}", "function agregar($nombre,$correo,$usuario,$rol,$zonah,$estado,$psw)\n {\n $Valores = \"'\".$usuario.\"','\".$psw.\"','\".$nombre.\"','\".$correo.\"',\".$estado.\",\".$zonah.\",\".$rol;\n $this->Insertar(\"usuarios\",\"usuario,password,nombre,correo,activo,zonashorarias_id,roles_id\",$Valores);\n }", "public function insertarUsuario($usuario, $contrasenia, $nombre, $apellido, \n $correo, $imagen, $rol){\n if(empty($usuario) or \n empty($contrasenia) or \n empty($nombre) or \n empty($apellido) or \n empty($correo) or\n empty($imagen) or \n empty($rol)){\n header(\"Location:usuarios.php?accion=add_usuario&i=1\");\n exit();\n }\n \n $sql = \"INSERT INTO usuarios VALUES(null, ?, ?, ?, ?, ?, ?, ?)\";\n\n $resultado = $this->db->prepare($sql);\n\n $resultado->bindValue(1, $usuario);\n $resultado->bindValue(2, $contrasenia);\n $resultado->bindValue(3, $nombre);\n $resultado->bindValue(4, $apellido);\n $resultado->bindValue(5, $correo);\n $resultado->bindValue(6, $imagen);\n $resultado->bindValue(7, $rol);\n \n\n if(!$resultado->execute()){\n header(\"Location:usuarios.php?accion=add_usuario&i=2\");\n }else{\n //Insertamos el registro\n if($resultado->rowCount()>0){\n header(\"Location:usuarios.php?accion=add_usuario&i=3\");\n }else{\n header(\"Location:usuarios.php?accion=add_usuario&i=4\");\n }\n }\n }", "public function save(User $usuario){\n $sql = \"INSERT INTO users\n (name,\n email,\n password\n )\n VALUES\n ('\".$usuario->getName().\"', \n '\".$usuario->getEmail().\"',\n '\".$usuario->getPassword().\"')\";\n\n $stmt = $this->cnx->prepare($sql);\n //print $sql;\n $result = $stmt->execute();\n if(!$result){\n throw new Exception(\"Ocorreu um erro ao inserir o registro em usuario!\");\n }\n }", "public function add($cadastro){\n if($cadastro[\"senha\"] != $cadastro[\"conf_senha\"]){\n return [\"error\" => TRUE, \"msg\" => \"senhas_nao_conferem\"];\n }\n unset($cadastro[\"conf_senha\"]);\n // --- checa se o nome do usuario ja esta cadastrado !!!! mudar essa parte para checar contra o skambitdb!!!\n $user_list = $this->getLogins();\n foreach($user_list as $id => $item) {\n if($item == $cadastro[\"login\"]){\n return [\"error\" => TRUE, \"msg\" => \"usuario_ja_cadastrado\"];\n }\n }\n // --- essa parte da funcao cuida do upload e manuseio das imagens de avatar\n $cadastro[\"avatar\"] = $this->setAvatar();\n // --- criptografa a senha\n $cadastro[\"senha\"] = password_hash($cadastro[\"senha\"], PASSWORD_DEFAULT);\n $cadastro[\"status_id\"] = 1;\n $cadastro[\"rating\"] = 5;\n $query = $this->pdo->prepare('INSERT INTO usuarios( `primeiro_nome`, `ultimo_nome`, `cep`, `login`, `senha`, `avatar`, `email`, `status_id`, `rating`)\n VALUES( :primeiro_nome, :ultimo_nome, :cep, :login, :senha, :avatar, :email, :status_id, :rating)');\n var_dump($cadastro);\n $query->execute($cadastro);\n return [\"error\" => FALSE, \"msg\" => \"cadastro_ok\"];\n }", "function agregar($nombre_usuario, $nick_usuario, $clave, $apellido_usuario, $direccion_usuario, $telefono_usuario, $email_usuario, $genero_usuario, $id_rol){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"INSERT INTO\n\t\t\t\t\t\t\t\tusuario(nombre_usuario, nick_usuario, clave, apellido_usuario, direccion_usuario, telefono_usuario, email_usuario, genero_usuario, id_rol)\n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'$nombre_usuario',\n\t\t\t\t\t\t\t\t'$nick_usuario',\n\t\t\t\t\t\t\t\t'$clave',\n\t\t\t\t\t\t\t\t'$apellido_usuario',\n\t\t\t\t\t\t\t\t'$direccion_usuario',\n\t\t\t\t\t\t\t\t'$telefono_usuario',\n\t\t\t\t\t\t\t\t'$email_usuario',\n\t\t\t\t\t\t\t\t'$genero_usuario',\n\t\t\t\t\t\t\t\t$id_rol\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$id = $resultado;\n\t\t$conexion -> cerrar();\n\t\trequire('usuarioClass.php');\n\t\t$usuario = new Usuario($id, $nombre_usuario, $nick_usuario, $clave, $apellido_usuario, $direccion_usuario, $telefono_usuario, $email_usuario, $genero_usuario, $id_rol);\n\t\t//Regreso los productos\n\t\treturn $usuario;\n\t}", "public function saveUser($nome,$email,$senha){\n \t$id = time();\n $nome = parent::escapeString($nome);\n $senha = md5(parent::escapeString($senha));\n $email = parent::escapeString($email);\n \t//fazer uma validação para ver se o usuario já não está cad\n \t$sql = \"insert into `usuarios` ( `id`,`nome`, `email`, `senha` ) values ('$id','$nome', '$email', '$senha')\"; \n return parent::executaQuery($sql);\n }", "public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n user_first_name,\n user_last_name) \n VALUES (:email,\n :pass,\n :firstName,\n :lastName)');\n\n $result->bindParam(':email', $this->user_email); \n $result->bindParam(':pass', $this->user_password); \n $result->bindParam(':firstName', $this->user_first_name);\n $result->bindParam(':lastName', $this->user_last_name);\n \n $result->execute();\n $db->disconnect();\n }", "public function register()\n {\n $user = new UserManager;\n $request = new Request;\n $errorMessage = '';\n $method = $request->getMethode();\n if ($method == \"POST\") {\n $mailUser = $request->getPost('mail');\n $password = $request->getPost('mdp');\n $checkPassword = $request->getPost('cmdp');\n $userName = $request->getPost('userName');\n $userData = array();\n $userData['mail'] = $mailUser;\n $userData['pass'] = $password;\n $userData['userName'] = $userName;\n $userData['role'] = 'user';\n $mailUsed = $user->checkMail($mailUser);\n $userNameUsed = $user->checkUserName($userName);\n\n //if true register user on session \n if (!$mailUsed) {\n if (!$userNameUsed) {\n if ($password == $checkPassword) {\n if (filter_var($mailUser, FILTER_VALIDATE_EMAIL)) {\n $errorMessage = 'Vous êtes connecté avec succés ';\n $request->newSession(\"user\", $userData);\n $hashPassword = hash(\"sha256\", $password);\n $user->newUser($userName, $mailUser, $hashPassword);\n } else {\n $errorMessage = 'Le format de l\\'email est incorrect ';\n }\n } else {\n $errorMessage = 'Les mots de passe ne sont pas identique ';\n }\n } else {\n $errorMessage = 'Le nom d\\'utilisateur entré n\\'est pas disponible ';\n }\n } else {\n $errorMessage = 'Cette email est déja utilisé';\n }\n return $this->render('user/register.html.twig', ['errorMessage' => $errorMessage]);\n }\n return $this->render('user/register.html.twig', ['errorMessage' => $errorMessage]);\n }", "public function save(){\n if(isset($_POST)){\n\n $nombre = isset($_POST[\"nombre\"]) ? $_POST[\"nombre\"] : false;\n $apellidos = isset($_POST[\"apellidos\"]) ? $_POST[\"apellidos\"] : false;\n $email = isset($_POST[\"email\"]) ? $_POST[\"email\"] : false;\n $password = isset($_POST[\"password\"]) ? $_POST[\"password\"] : false;\n\n\n\n if($nombre && $apellidos && $email && $password){\n \n $usuario= new Usuario(); \n $usuario->setNombre($nombre);\n $usuario->setApellidos($apellidos);\n $usuario->setEmail($email);\n $usuario->setPassword($password);\n /* llamo al metodo que tengo en el modelo para guardar el usuario */\n $save= $usuario->save();\n /* condicion por si el metodo save falla */\n if($save){\n /* cuando el registro esté correcto, abri una session */\n $_SESSION['register']= \"complete\";\n }else{\n $_SESSION['register']= \"failed\"; \n }\n }else{\n $_SESSION['register']= \"failed\"; \n }\n\n }else{\n $_SESSION['register']= \"failed\"; \n }\n /* para redirigir */\n header(\"Location:\".base_url.'usuario/registro');\n }", "public function store(CreateUsuarioRequest $request)\n {\n $empresa_id = $request->EMPRESA_ID;\n $codigoProveedorSap = $request->codigoProveedorSap;\n //dd($request->all());\n\n $usuario = new User();\n\n $usuario->nombre = $request->nombre;\n $usuario->email = $request->email;\n $usuario->password = bcrypt($request->password);\n $usuario->tel_codpais = $request->tel_codpais;\n $usuario->telefono = $request->telefono;\n //$usuario->usersap_id = $request->usersap_id;\n $usuario->activo = $request->activo;\n $usuario->anulado = $request->anulado;\n\n if ($usuario->anulado === null) {\n $usuario->anulado = 0;\n }\n\n $usuario->save();\n\n /** Esto debe ser reubicado queda pendiete\n UsuarioEmpresa::insert( ['USER_ID' => $usuario->id, 'EMPRESA_ID' => $empresa_id, 'CODIGO_PROVEEDOR_SAP' => $codigoProveedorSap, 'ANULADO' => 0] );\n **/\n\n return redirect::to('usuarios');\n\n }", "public function store(SalvarUsuarioRequest $request)\n {\n // Se for dentista preciso validar se foi selecionado ao menos uma especialidade\n if ($request->fk_tipo_usuario == 3) {\n if (!isset($request->clinico_geral) && !isset($request->implantodontia) && !isset($request->odontopediatria) && !isset($request->orofacial) && !isset($request->ortodontia)) {\n return redirect()->back()->with('especialidade', 'Por favor, selecione ao menos uma especialidade')->withInput();\n }\n }\n\n $usuario = new Usuario();\n $usuario->fk_empresa = Auth::user()->fk_empresa;\n $usuario->fk_tipo_usuario = $request->fk_tipo_usuario;\n $usuario->nome = $request->nome;\n $usuario->cpf = Helper::deixaApenasNumeros($request->cpf);\n $usuario->data_nascimento = $request->data_nascimento;\n $usuario->email = $request->email;\n $usuario->celular = $request->celular;\n $usuario->login = $request->login;\n $usuario->senha = Hash::make($request->senha);\n $usuario->save();\n LogSistemaController::logSistemaTipoInsert('usuarios', $usuario);\n\n $endereco = new Endereco_usuario();\n $endereco->fk_empresa = Auth::user()->fk_empresa;\n $endereco->fk_usuario = $usuario->id;\n $endereco->fk_cidade = $request->cidade;\n $endereco->cep = $request->cep;\n $endereco->logradouro = $request->logradouro;\n $endereco->numero = $request->numero;\n $endereco->bairro = $request->bairro;\n $endereco->complemento = $request->complemento;\n $endereco->save();\n LogSistemaController::logSistemaTipoInsert('endereco_usuarios', $endereco);\n\n $usuario_mm_empresa = new Usuario_mm_empresa();\n $usuario_mm_empresa->fk_usuario = $usuario->id;\n $usuario_mm_empresa->fk_empresa = Auth::user()->fk_empresa;\n $usuario_mm_empresa->save();\n LogSistemaController::logSistemaTipoInsert('usuario_mm_empresas', $usuario_mm_empresa);\n\n if ($request->fk_tipo_usuario == 3) {\n $usuario_mm_esp = new Usuario_mm_especialidade();\n $usuario_mm_esp->fk_empresa = Auth::user()->fk_empresa;\n $usuario_mm_esp->fk_usuario = $usuario->id;\n $usuario_mm_esp->fk_especialidade = 1;\n\n if (isset($request->clinico_geral)) {\n $usuario_mm_esp['ativo'] = 1;\n } else {\n $usuario_mm_esp['ativo'] = 0;\n }\n\n $usuario_mm_esp->save();\n LogSistemaController::logSistemaTipoInsert('usuario_mm_especialidade', $usuario_mm_esp);\n }\n if ($request->fk_tipo_usuario == 3) {\n $usuario_mm_esp = new Usuario_mm_especialidade();\n $usuario_mm_esp->fk_empresa = Auth::user()->fk_empresa;\n $usuario_mm_esp->fk_usuario = $usuario->id;\n $usuario_mm_esp->fk_especialidade = 2;\n\n if (isset($request->ortodontia)) {\n $usuario_mm_esp['ativo'] = 1;\n } else {\n $usuario_mm_esp['ativo'] = 0;\n }\n\n $usuario_mm_esp->save();\n LogSistemaController::logSistemaTipoInsert('usuario_mm_especialidade', $usuario_mm_esp);\n }\n if ($request->fk_tipo_usuario == 3) {\n $usuario_mm_esp = new Usuario_mm_especialidade();\n $usuario_mm_esp->fk_empresa = Auth::user()->fk_empresa;\n $usuario_mm_esp->fk_usuario = $usuario->id;\n $usuario_mm_esp->fk_especialidade = 3;\n\n if (isset($request->implantodontia)) {\n $usuario_mm_esp['ativo'] = 1;\n } else {\n $usuario_mm_esp['ativo'] = 0;\n }\n\n $usuario_mm_esp->save();\n LogSistemaController::logSistemaTipoInsert('usuario_mm_especialidade', $usuario_mm_esp);\n }\n if ($request->fk_tipo_usuario == 3) {\n $usuario_mm_esp = new Usuario_mm_especialidade();\n $usuario_mm_esp->fk_empresa = Auth::user()->fk_empresa;\n $usuario_mm_esp->fk_usuario = $usuario->id;\n $usuario_mm_esp->fk_especialidade = 4;\n\n if (isset($request->odontopediatria)) {\n $usuario_mm_esp['ativo'] = 1;\n } else {\n $usuario_mm_esp['ativo'] = 0;\n }\n\n $usuario_mm_esp->save();\n LogSistemaController::logSistemaTipoInsert('usuario_mm_especialidade', $usuario_mm_esp);\n }\n if ($request->fk_tipo_usuario == 3) {\n $usuario_mm_esp = new Usuario_mm_especialidade();\n $usuario_mm_esp->fk_empresa = Auth::user()->fk_empresa;\n $usuario_mm_esp->fk_usuario = $usuario->id;\n $usuario_mm_esp->fk_especialidade = 5;\n \n if (isset($request->orofacial)) {\n $usuario_mm_esp['ativo'] = 1;\n } else {\n $usuario_mm_esp['ativo'] = 0;\n }\n\n $usuario_mm_esp->save();\n LogSistemaController::logSistemaTipoInsert('usuario_mm_especialidade', $usuario_mm_esp);\n }\n\n return redirect('/usuarios')->with('success', 'Sucesso!');\n }", "public function agregar_usuario_controlador()\n {\n $nombres = strtoupper(mainModel::limpiar_cadena($_POST['usu_nombres_reg']));\n $apellidos = strtoupper(mainModel::limpiar_cadena($_POST['usu_apellidos_reg']));\n $identidad=mainModel::limpiar_cadena($_POST['usu_identidad_reg']);\n $puesto=mainModel::limpiar_cadena($_POST['usu_puesto_reg']);\n $unidad=mainModel::limpiar_cadena($_POST['usu_unidad_reg']);\n $rol = mainModel::limpiar_cadena($_POST['usu_rol_reg']);\n $celular = mainModel::limpiar_cadena($_POST['usu_celular_reg']);\n $usuario = strtolower(mainModel::limpiar_cadena($_POST['usu_usuario_reg']));\n $email=$usuario . '@didadpol.gob.hn' ;\n\n\n /*comprobar campos vacios*/\n if ($nombres == \"\" || $apellidos == \"\" || $usuario == \"\" || $email == \"\" || $rol == \"\" || $identidad == \"\" || $puesto == \"\" || $unidad == \"\") {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"NO HAS COMPLETADO TODOS LOS CAMPOS QUE SON OBLIGATORIOS\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n\n if (mainModel::verificar_datos(\"[A-ZÁÉÍÓÚáéíóúñÑ ]{3,35}\", $nombres)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL CAMPO NOMBRES SOLO DEBE INCLUIR LETRAS Y DEBE TENER UN MÍNIMO DE 3 LETRAS\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n if (mainModel::verificar_datos(\"[A-ZÁÉÍÓÚáéíóúñÑ ]{3,35}\", $apellidos)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL CAMPO APELLIDOS SOLO DEBE INCLUIR LETRAS Y DEBE TENER UN MÍNIMO DE 3 LETRAS\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n if ($celular != \"\") {\n if (mainModel::verificar_datos(\"[0-9]{8}\", $celular)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL NÚMERO DE CELULAR NO COINCIDE CON EL FORMATO SOLICITADO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n }\n if (mainModel::verificar_datos(\"[0-9]{13}\", $identidad)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL NÚMERO DE IDENTIDAD NO COINCIDE CON EL FORMATO SOLICITADO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n /*validar DNI*/\n $check_dni = mainModel::ejecutar_consulta_simple(\"SELECT identidad FROM tbl_usuarios WHERE identidad='$identidad'\");\n if ($check_dni->rowCount() > 0) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL NÚMERO DE IDENTIDAD YA ESTÁ REGISTRADO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n\n if (mainModel::verificar_datos(\"[a-z]{3,15}\", $usuario)) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL CAMPO NOMBRE DE USUARIO SOLO DEBE INCLUIR LETRAS Y DEBE TENER UN MÍNIMO DE 5 Y UN MAXIMO DE 15 LETRAS\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n\n /*validar usuario*/\n $check_user = mainModel::ejecutar_consulta_simple(\"SELECT nom_usuario FROM tbl_usuarios WHERE nom_usuario='$usuario'\");\n if ($check_user->rowCount() > 0) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"EL USUARIO YA ESTÁ REGISTRADO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n /*validar email*/\n\n \n $caracteres = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n $pass = \"\";\n for ($i = 0; $i < 8; $i++) {\n $pass .= substr($caracteres, rand(0, 64), 1);\n }\n $message = \"<html><body><p>Hola, \" . $nombres . \" \" . $apellidos;\n $message .= \" Estas son tus credenciales para ingresar al sistema de DIDADPOL\";\n $message .= \"</p><p>Usuario: \" . $usuario;\n $message .= \"</p><p>Correo: \" . $email;\n $message .= \"</p><p>Contraseña: \" . $pass;\n $message .= \"</p><p>Inicie sesión aquí para cambiar la contraseña por defecto \" . SERVERURL . \"login\";\n $message .= \"<p></body></html>\";\n\n $res = mainModel::enviar_correo($message, $nombres, $apellidos, $email);\n if (!$res) {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"NO SE ENVIÓ CORREO ELECTRÓNICO\",\n \"Tipo\" => \"error\"\n ];\n echo json_encode($alerta);\n exit();\n }\n\n $passcifrado = mainModel::encryption($pass);\n\n $datos_usuario_reg = [\n \"rol\" => $rol,\n \"puesto\"=>$puesto,\n \"unidad\"=>$unidad,\n \"usuario\" => $usuario,\n \"nombres\" => $nombres,\n \"apellidos\" => $apellidos,\n \"dni\"=>$identidad,\n \"clave\" => $passcifrado,\n \"estado\" => \"NUEVO\",\n \"email\" => $email,\n \"celular\" => $celular\n ];\n $agregar_usuario = usuarioModelo::agregar_usuario_modelo($datos_usuario_reg);\n if ($agregar_usuario->rowCount() == 1) {\n $alerta = [\n \"Alerta\" => \"limpiar\",\n \"Titulo\" => \"USUARIO REGISTRADO\",\n \"Texto\" => \"LOS DATOS DEL USUARIO SE HAN REGISTRADO CON ÉXITO\",\n \"Tipo\" => \"success\"\n ];\n } else {\n $alerta = [\n \"Alerta\" => \"simple\",\n \"Titulo\" => \"OCURRIÓ UN ERROR INESPERADO\",\n \"Texto\" => \"NO SE HA PODIDO REGISTRAR EL USUARIO\",\n \"Tipo\" => \"error\"\n ];\n }\n echo json_encode($alerta);\n }", "public function persist() {\n $bd = BD::getConexion();\n $sql = \"insert into usuarios (nombre, clave) values (:nombre, :clave)\";\n $sthSql = $bd->prepare($sqlInsertUsuario);\n $result = $sthSql->execute([\":nombre\" => $this->nombre, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }", "function crearUsuario(){\n\t\t$params = array(\n\t\t\t':nombres' => $_POST['nombres'],\n\t\t\t':apellidos' => $_POST['apellidos'],\n\t\t\t':direccion' => $_POST['direccion'],\n\t\t\t':foto' => $_POST['foto'],\n\t\t\t':email' => $_POST['email'],\n\t\t\t':usuario' => $_POST['usuario'],\n\t\t\t':contrasena' => $_POST['contrasena'],\n\t\t\t\n\t\t);\n\t\n\t\t/* Preparamos el query apartir del array $params*/\n\t\t$query = 'INSERT INTO usuarios \n\t\t\t\t\t(nombres, apellidos, direccion, foto, email, usuario, contrasena, permisos) \n\t\t\t\tVALUES \n\t\t\t\t\t(:nombres,:apellidos,:direccion,:foto,:email,:usuario,:contrasena, 2)';\n\n\t\t/* Ejecutamos el query con los parametros */\n\t\t$result = excuteQuery(\"blogs\",\"\", $query, $params);\n\t\tif ($result > 0){\n\t\t\theader('Location: formlogin.php?result=true');\n\t\t}else{\n\t\t\theader('Location: addUser.php?result=false');\n\t\t}\n\t}", "function registrarSesion () {\n\n if (!empty($this->id_usuario)) {\n $this->salvar(['ultima_session' => 'current_timestamp',\n 'activo' => 1\n ]);\n Helpers\\Sesion::sessionLogin();\n }\n else return false;\n\n }", "function adicionaUsuario() {\n $usuarioAtual = array(\n \"usuario\"=>$this->usuario,\n \"senha\"=>$this->senha,\n \"nome\"=>$this->nome,\n \"email\"=>$this->email\n );\n\n $usuarioAtual_str = json_encode($usuarioAtual);\n\n //retira o colchete e coloca a vírgula no arquivo\n $arquivo_str = file_get_contents(\"data/usuarios.json\");\n $arquivo_str_novo = str_replace(\"]\", \",\", $arquivo_str);\n\n //abre o arquivo\n $usuarios = fopen(\"data/usuarios.json\", \"w\"); //sobreescreve\n fwrite($usuarios, $arquivo_str_novo . $usuarioAtual_str . \"]\");\n fclose($usuarios);\n }", "private function __setSessionLoginUsuario($usuario) {\n $sessionUsuario = ['id' => $usuario->id, 'email' => $usuario->email];\n $usuario->last_login = date('Y-m-d H:i:s');\n $usuario->save();\n $this->session->set('Usuario', $sessionUsuario);\n return;\n }" ]
[ "0.7074813", "0.6827484", "0.6823031", "0.67555857", "0.66776955", "0.6624108", "0.65504605", "0.6467025", "0.63469505", "0.63237286", "0.6288088", "0.62435675", "0.62159365", "0.620948", "0.6202654", "0.6190699", "0.6163579", "0.6163136", "0.61596304", "0.61496294", "0.6143326", "0.61112463", "0.607314", "0.60710686", "0.60479134", "0.60471106", "0.60279703", "0.6022111", "0.6021859", "0.60114264" ]
0.74597806
0
retourne un objet contrat en fonction de son id
public function getobjcontrat($idcontrat){ $uncontrat = R::load('contrat', $idcontrat); //équivalent à "select * from contrat where idcontrat ='$idcontrat'" $idclient = $uncontrat->idclient; //recupère l'id du client dans une variable $client = R::load('client', $idclient); // select * from client en fonction de l'idclient récupérer précedemment $idcontact = $client->idcontact; $contact = r::load('contact', $idcontact); $uncontact = new contact ($contact->email1, $contact->email2, $contact->email3, $contact->bureau, $contact->fax, $contact->tel3); $unclient = new client($client->raisonsocial, $uncontact, $client->siret, $client->adr, $client->ville, $client->codepostal); $idconsultant = $uncontrat->idutilisateur; $consultant = r::getAll('select * from utilisateur join consultant on utilisateur.id=consultant.idutilisateur where idutilisateur='.$idconsultant.''); for ($i=0; $i<count($consultant);$i++){ $unconsultant = new consultant ($consultant[$i]['nom'], $consultant[$i]['prenom'], $consultant[$i]['adresse'], $consultant[$i]['ville'], $consultant[$i]['cp'], $consultant[$i]['tel'], $consultant[$i]['email'], $consultant[$i]['typecontrat'], $consultant[$i]['salaire'], $consultant[$i]['tarif']); } $contrat = new contrat($uncontrat->id, $unclient, $unconsultant, $uncontrat->datedebut,$uncontrat->datefin, $uncontrat->mission, $uncontrat->salaire, $uncontrat->tarif, $uncontrat->typecontrat); //var_dump($contrat); return $contrat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_id($id){\n\t\t$this->id = $id;\n\t}", "abstract public function getId();", "function get_id(){\n return $this -> id;\n }", "function get_id(){\n return $this -> id;\n }", "public function __construct($id);", "public function __construct($id);", "public function getId(){return $this->id;}", "public function __construct($id) { $this->id = $id; }", "public function testid() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo(NULL, NULL, NULL);\n\t$id=$tarjeta->obtenerID();\n $boleto = new Boleto(NULL, NULL, $tarjeta, $tarjeta->obtenerID(),NULL, NULL, NULL, NULL, $tiempo);\n\n $this->assertEquals($boleto->obteneriID(), $id);\n }", "public function create($id) //pasamos el id del cliente\n {\n \n }", "abstract public function objId();", "public function __construct($id=null){\n\t\tif($id==null){\n\t\t\t$this->_model_poliza = new Model_Poliza();\n\t\t\t$this->_model_poliza_valores = new Model_PolizaValores();\n\t\t\t$this->_mode_detalle_poliza = null; //Aca todavia no se el tipo de poliza, no puedo traer el modelo asociado\n\n\t\t}else{\n\n\t\t\t$model_poliza = new Model_Poliza();\n\t\t\t$model_poliza_valores = new Model_PolizaValores();\n\n\t\t\t$this->_model_poliza = $model_poliza->getTable()->find($id) ;\n\t\t\t$this->_model_poliza_valores = $model_poliza_valores->getTable()->find($this->_model_poliza->poliza_valores_id);\n\t\t\t//En este caso tengo el tipo de poliza ergo traigo el detalle correspondiente\n\t\t\t$this->_model_detalle_poliza = $this->getModelDetallePoliza($this->_model_poliza->tipo_poliza_id);\n\t\t}\n\n\t\t//como tengo varios modelos en esta clase tengo que instanciar primero el Modelo\n\t\t//Principal, luego traer los id de los otros modelos e instanciarlos\n\t\t//$model_poliza_valores = new Model_PolizaValores();\n\t\t//$this->_model_poliza_valores = ($id==null)?new $model_poliza_valores: $model_poliza->getTable()->find($id) ;\n\n\t}", "public function getId($id=null)\n {\n if ($id != null && is_array($this->livres) && count($this->livres)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE id = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$id]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId($d['id']);\n$this->setTitre($d['titre']);\n$this->setDescription($d['description']);\n$this->setDate($d['date']);\n$this->setClivres_id($d['clivres_id']);\n$this->setAuteur($d['auteur']);\n$this->setPhoto($d['photo']);\n$this->setChemin($d['chemin']);\n$this->livres =$data; \n return $this;\n }\n \n } else {\n return $this->id;\n }\n \n }", "public function getId() ;", "public function get_id(){ return $this->_id;}", "public function get_id(){ return $this->_id;}", "public function get_id(){ return $this->_id;}", "function getId(){\n\t\t\treturn $this->$id;\n\t\t}", "public function rechercherId($id)\n {\n }", "public function __construct($id=null){\n if($id){\n $c = kuharica_baza::connect();\n $sql = \"SELECT * FROM vrsta_jela WHERE id = $id LIMIT 1\";\n $r = $c->query($sql);\n $row = $r->fetch_assoc();\n $this->id = $row['id'];\n $this->naziv = $row['naziv'];\n }\n }", "public function personaYCargo($id)\n {\n\n }", "function id()\r\n {\r\n return $this->ID;\r\n }", "public function getId(){\n\t return $this->id;\n}", "public function __construct($id)\n {\n $this->id = $id;\n //\n\n }", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "public function getId()\n{\nreturn $this->id;\n}", "function __construct($id)\n\t{\n\t\t$this->sql= new Sql;\n\t\t\n\t\t$this->recht_ID = $id;\n\t\t$call = \"Select * From tb_recht Where Recht_ID = '$id'\";\n\t\t$call = $this->sql->call($call);\n\t\t\n\t\t$this->recht_ID = $call['Recht_ID'];\n\t\t$this->rechtName = $call['RechtName'];\n\t\t$this->anzahlStunden = $call['AnzahlStunden'];\n\t\t$this->anzahlPlaetze = $call['AnzahlPlaetze'];\n\t\t$this->anzahlReservierungen = $call['AnzahlReservierungen'];\n\t\t$this->tageVoraus = $call['TageVoraus'];\n\t\t$this->reservierungLoeschen = $call['ReservierungLoeschen'];\n\t\t$this->reservierungVerschieben = $call['ReservierungVerschieben'];\n\t\t$this->benutzerVerwalten = $call['BenutzerVerwalten'];\n\t\t$this->rechteVerteilen = $call['RechteVerteilen'];\n\t\t$this->platzVerwalten = $call['PlatzVerwalten'];\n\t\t$this->saisonFestlegen = $call['SaisonFestlegen'];\n\t\t$this->serienReservieren = $call['SerienReservieren'];\n\t\t$this->farbeFestlegen = $call['FarbeFestlegen'];\n\t\t\n\t}", "public function getId() {return $this->id;}" ]
[ "0.6625113", "0.6607926", "0.65764236", "0.65764236", "0.65740746", "0.65740746", "0.6558505", "0.65405786", "0.65229875", "0.65227896", "0.6471678", "0.6466598", "0.64662325", "0.64481705", "0.6446251", "0.6446251", "0.6446251", "0.64317405", "0.6410352", "0.6407794", "0.64058656", "0.6403454", "0.63903147", "0.6375423", "0.63516766", "0.63516766", "0.63516766", "0.6341349", "0.63181925", "0.6316843" ]
0.66225976
1
Returns the DB driver name and version
private static function _dbDriver(): string { $db = Craft::$app->getDb(); if ($db->getIsMysql()) { $driverName = 'MySQL'; } else { $driverName = 'PostgreSQL'; } return $driverName . ' ' . App::normalizeVersion($db->getSchema()->getServerVersion()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDriverName()\n {\n return $this->db->get_dbfamily();\n }", "public function getDriverVersion()\n {\n return $this->driver_version;\n }", "public function getDriverName() {\n return $this->pdoObj->getAttribute( \\PDO::ATTR_DRIVER_NAME );\n }", "protected function getDriver(): string\n {\n return $this->pdo->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n }", "public function getDriverName()\n {\n return $this->pdo->getAttribute ( \\PDO::ATTR_DRIVER_NAME );\n }", "public function getDriver()\r\n\t{\r\n\t\treturn $this->dbDriver;\r\n\t}", "public function getDriverName()\n {\n return $this->getConfig('driver');\n }", "public function getDriverName()\n {\n return isset($this->driverName) ? $this->driverName : null;\n }", "public function getDriverName()\n {\n return $this->driverName;\n }", "public function getDriverName() {\n return $this->driverName;\n }", "final public function getDriverName(): string\n {\n return $this->driver;\n }", "function dbName()\n{\n\treturn $this->drv->dbName();\n}", "public function getDefaultDriver(): string\n {\n return $this->config('version');\n }", "public function getVersion()\n {\n if ( ! isset($this->dbh) || ! $this->dbh ) {\n $this->connect($this->dbuser, $this->dbpassword, $this->dbhost, $this->dbport);\n if($this->select($this->dbname,$this->encoding) == false){\n throw new \\Exception(\"dose connect mysql failed.\");\n }\n }\n\n return $this->dbh->get_server_info();\n }", "public function getDriverName()\n\t{\n\t\treturn $this->neoeloquent->getDriverName();\n\t}", "public function driver()\n {\n return strtolower($this->driver);\n }", "public static function getDatabasePlatform(): string;", "public static function getDriverName()\n {\n }", "public function getDriverIdentifier()\n {\n return $this->driver;\n }", "protected function getSelectedDbalDriver() {}", "public function getDriver()\n {\n if ($this->driver === null) {\n $this->driver = $this->getPDO()->getAttribute(PDO::ATTR_DRIVER_NAME);\n }\n\n return $this->driver;\n }", "public function getDriver()\n {\n return $this->config['driver'];\n }", "static function get_db_version()\n {\n global $db;\n \n $query = mysqli_query($db, \"SELECT `version` FROM `version`\");\n $version = mysqli_fetch_array($query);\n \n return $version['version'];\n }", "public function getVersion()\n {\n $version = $this->getAttribute(PDO::ATTR_SERVER_VERSION);\n // clean version number from alphabetic characters\n return preg_replace('/[^0-9,.]/', '', $version);\n }", "function sql_driver() {\n\t$sql = sql_connect();\n\treturn $sql->getAttribute(PDO::ATTR_DRIVER_NAME);\n}", "function sql_get_client_info()\n {\n global $SQL_DBH;\n return $SQL_DBH->getAttribute(constant(\"PDO::ATTR_CLIENT_VERSION\"));\n }", "public function getDriver()\n {\n return $this->driver;\n }", "public function getDatabaseName(): string\n {\n if (isset($this->database)) {\n return $this->database;\n }\n\n $connection = $this->getConnection();\n $db = $connection->getSelectDb() ?: $connection->getDb();\n // release\n $connection->release();\n\n return $db;\n }", "public function getDriver()\n\t{\n\t\treturn $this->driver;\n\t}", "public function getDriver()\n {\n return $this->_driver;\n }" ]
[ "0.76823664", "0.7450536", "0.725666", "0.71515656", "0.7148968", "0.7127727", "0.7114071", "0.7047493", "0.7022962", "0.69650185", "0.6929797", "0.69124204", "0.6886517", "0.6876523", "0.6833931", "0.6688435", "0.6671935", "0.6662696", "0.66323006", "0.6626548", "0.65995777", "0.6568337", "0.651769", "0.6512493", "0.6501446", "0.64870256", "0.6480231", "0.64490503", "0.6444962", "0.64245737" ]
0.83527184
0
Returns the image driver name and version
private static function _imageDriver(): string { $imagesService = Craft::$app->getImages(); if ($imagesService->getIsGd()) { $driverName = 'GD'; } else { $driverName = 'Imagick'; } return $driverName . ' ' . $imagesService->getVersion(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function getAvailableDriver()\n {\n $serverDiagnostic = new ServerDiagnostic();\n $candidates = [\n [\n \"name\" => \"gd\",\n \"type\" => \"extension\",\n ],\n [\n \"name\" => \"imagick\",\n \"type\" => \"extension\",\n ],\n ];\n $diagnostic = $serverDiagnostic->checkRequirements($candidates);\n\n if ($diagnostic[\"imagick\"][\"passed\"]) {\n return \"imagick\";\n } else if ($diagnostic[\"gd\"][\"passed\"]) {\n return \"gd\";\n }\n\n // Return gd by default\n return \"gd\";\n }", "public function getDriverVersion()\n {\n return $this->driver_version;\n }", "private static function _dbDriver(): string\n {\n $db = Craft::$app->getDb();\n\n if ($db->getIsMysql()) {\n $driverName = 'MySQL';\n } else {\n $driverName = 'PostgreSQL';\n }\n\n return $driverName . ' ' . App::normalizeVersion($db->getSchema()->getServerVersion());\n }", "public function getDefaultDriver(): string\n {\n return $this->config('version');\n }", "public static function getDriverName()\n {\n }", "final public function getDriverName(): string\n {\n return $this->driver;\n }", "public function getDriverName()\n {\n return $this->getConfig('driver');\n }", "public function getDriverName()\n {\n return isset($this->driverName) ? $this->driverName : null;\n }", "public function getDriverName(): string;", "public function getDriverName()\n {\n return $this->driverName;\n }", "public function getDriverName() {\n return $this->pdoObj->getAttribute( \\PDO::ATTR_DRIVER_NAME );\n }", "public function getDriverName() {\n return $this->driverName;\n }", "public function getDriverName()\n {\n return $this->db->get_dbfamily();\n }", "public function getDriverName()\n {\n return $this->pdo->getAttribute ( \\PDO::ATTR_DRIVER_NAME );\n }", "protected function getDriver(): string\n {\n return $this->pdo->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n }", "public function getRelease()\n {\n return php_uname('r');\n }", "public function driver()\n {\n return strtolower($this->driver);\n }", "protected function determineImageMagickVersion() {}", "public function getDriverName()\n\t{\n\t\treturn $this->neoeloquent->getDriverName();\n\t}", "public function getDriverIdentifier()\n {\n return $this->driver;\n }", "public function getDriver()\n {\n return $this->_list->getDriver();\n }", "public function getInfo()\n {\n return php_uname();\n }", "public function getVersion()\n {\n return php_uname('v');\n }", "public function getDefaultDriver()\n {\n return $this->configurations['driver'] ?? 'gd';\n }", "public function getDriver()\n {\n return $this->config['driver'];\n }", "Public Function getDriver() { Return $this->driver; }", "function strGetDriverType() {\n return $this->strDriverType;\n }", "public function getDriverType() {}", "public function getDriver()\n {\n return $this->driver;\n }", "public function getDriver()\n\t{\n\t\treturn $this->driver;\n\t}" ]
[ "0.7047886", "0.6900526", "0.68955374", "0.6739247", "0.67277503", "0.66961616", "0.6596256", "0.65909487", "0.6584592", "0.64969164", "0.6469747", "0.64300513", "0.63087946", "0.6308603", "0.6280231", "0.62652516", "0.62434", "0.6241849", "0.6221113", "0.61978424", "0.6157536", "0.6136531", "0.6130359", "0.61225504", "0.6112398", "0.6066338", "0.60648596", "0.60561085", "0.60516906", "0.59662586" ]
0.80527174
0
Returns the default message for this exception
public static function getDefaultMessage(): string;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDefaultMessage()\n {\n return $this->defaultMessage;\n }", "public function getMessage()\n {\n return '';\n }", "public function message()\n {\n return 'Invalid message mark up.';\n }", "public function defaultMessage()\n {\n return \"There are no webhooks registered for {$this->eventName}\";\n }", "public function message()\n {\n return \"Ошибочное значение\";\n }", "public function getMessage()\n {\n if ($this->exception instanceof Exception) {\n return $this->exception->getMessage();\n }\n\n return null;\n }", "private function setErrorMessageFromException($exception, $defaultMessage)\n {\n return $exception->getMessage() == null ? $defaultMessage : $exception->getMessage();\n }", "public function getMessage()\n {\n return isset($this->data->failure_msg) ? $this->data->failure_msg : '';\n }", "public function compoundMessage() {\n return sprintf(\n 'Exception %s (statuscode %d: %s)',\n nameof($this),\n $this->statuscode,\n $this->message\n );\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function getMessage(): string\n {\n return $this->requireString('message');\n }", "function getMessage()\n {\n return ($this->error_message_prefix . $this->message);\n }", "public function getMessDefault ()\n {\n return $this->mess_default;\n }", "public function getMessage()\n {\n return self::getMessageForError($this->value);\n }", "public function getMessage(): string\n\t{\n\t\treturn $this->err->getMessage();\n\t}", "public function getGeneralMessage()\n {\n return \"Entity Not Found\";\n }", "public function message()\n {\n return 'The validation error messagess.';\n }", "public function message()\n {\n return $this->getError();\n }", "public function message()\n {\n return trans('validation.field_not_exists_in_table', [\n 'field' => $this->notFoundField,\n 'table' => $this->table\n ]);\n }", "function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}", "public function message()\n {\n if ($this->error['type'] === 'custom') {\n return $this->error['message'];\n }\n\n $messages = null;\n\n if ($this->request) {\n $messages = $this->request->messages();\n }\n\n $message = $messages[\"{$this->error['attribute']}.check_file_{$this->error['type']}\"] ??\n trans(\"validation.check_file_{$this->error['type']}\");\n\n [$keys, $values] = Arr::divide($this->error['payload'] ?? []);\n\n $keys = \\array_map(function (string $key) {\n return \":{$key}\";\n }, $keys);\n\n return \\str_replace($keys, $values, $message);\n }", "public function message()\n {\n return $this->errorText;\n }", "public function getMessage(): string\n {\n return \"The $this->name field is not a valid date.\";\n }", "public function message(): string\n {\n return $this->errorMessage;\n }", "public function getMessage()\n {\n return $this->_error;\n }" ]
[ "0.8187874", "0.73366344", "0.7333884", "0.72315544", "0.7190911", "0.71262634", "0.7116215", "0.7096432", "0.7084712", "0.7005293", "0.7005293", "0.7005293", "0.7005293", "0.7005293", "0.7005293", "0.69990766", "0.6984077", "0.6973256", "0.69731355", "0.6923753", "0.6891545", "0.6872443", "0.68027174", "0.6802155", "0.6795372", "0.67645574", "0.6756082", "0.6753031", "0.6748162", "0.6729595" ]
0.8193742
0
Converts list of regions to identifiers list.
protected function _identifierList(array $options): array { if (empty($options)) { $options = [ 'Africa' => DateTimeZone::AFRICA, 'America' => DateTimeZone::AMERICA, 'Antarctica' => DateTimeZone::ANTARCTICA, 'Arctic' => DateTimeZone::ARCTIC, 'Asia' => DateTimeZone::ASIA, 'Atlantic' => DateTimeZone::ATLANTIC, 'Australia' => DateTimeZone::AUSTRALIA, 'Europe' => DateTimeZone::EUROPE, 'Indian' => DateTimeZone::INDIAN, 'Pacific' => DateTimeZone::PACIFIC, 'UTC' => DateTimeZone::UTC, ]; } $identifiers = []; foreach ($options as $name => $region) { $list = (array)DateTimeZone::listIdentifiers($region); /** @psalm-suppress InvalidScalarArgument */ $identifiers[$name] = array_combine($list, $list); } if (count($identifiers) === 1) { $identifiers = current($identifiers); } return $identifiers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTheRegionIDs(){\n\t\treturn isEmptyString($this->getRegionIDs()) ? array() : explode(\",\", trim($this->getRegionIDs())); \n\t}", "public function getIdentifiers();", "private function getRegions(): array\n {\n try {\n /** @var Regions[] $regions */\n $regions = $this->getDoctrine()\n ->getRepository(Regions::class)\n ->findAll();\n }\n catch(\\Exception $ex) {\n return [];\n }\n\n return $regions;\n }", "public function getIds();", "public function getIds();", "public function getRegionJsonList()\n {\n $collectionByCountry = [];\n /** @var \\Magento\\Directory\\Model\\ResourceModel\\Region\\Collection $collection */\n $collection = $this->regionCollectionFactory->create();\n /** @var \\Magento\\Directory\\Model\\Region $item */\n foreach ($collection as $item) {\n $collectionByCountry[$item->getData('country_id')][] = $item->getData();\n }\n\n return $collectionByCountry;\n }", "public function getAllIdentifiers() {}", "public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }", "public function regionlist(){\n if($this->request->all()){\n $id = array_flatten($this->request->all());\n $sorted = $this->region->select('id','region')->whereIn('id',$id)->where('status',1)->get()->sortBy('region');\n }else{\n $sorted = $this->region->select('id','region')->where('status',1)->get()->sortBy('region');\n }\n return $sorted->values()->all();\n }", "public abstract function get_ids();", "public function getIdsList() {\n return $this->_get(1);\n }", "public static function getRegionOptions() {\n $file = fopen(drupal_get_path('module', 'smart_content_smart_ip') . '/data/region_codes.csv', \"r\");\n $region_codes = [];\n while (!feof($file)) {\n $regions = fgetcsv($file);\n if (!empty($regions[2])) {\n $country_name = self::getCountryNameFromCode($regions[0]);\n $region_codes[$country_name][$regions[2]] = $regions[2];\n }\n }\n ksort($region_codes);\n foreach ($region_codes as $key => $value) {\n ksort($value);\n $region_codes[$key] = $value;\n }\n return $region_codes;\n }", "public function provider_get_region() {\n\t\t$array_provide = array();\n\t\tforeach ( self::ARRAY_REGION as $region ) {\n\t\t\t$expected = str_replace( '_', '-', strtolower( $region ) );\n\t\t\t$array_provide[] = array( $region, $expected );\n\t\t}\n\t\treturn $array_provide;\n\t}", "public function getIdentifiers()\n {\n return $this->init()->_identifiers;\n }", "protected function updateRegions()\n {\n $regions = [\n ['_stateId' => 1, 'name' => 'Almería'],\n ['_stateId' => 1, 'name' => 'Cádiz'],\n ['_stateId' => 1, 'name' => 'Córdoba'],\n ['_stateId' => 1, 'name' => 'Granada'],\n ['_stateId' => 1, 'name' => 'Huelva'],\n ['_stateId' => 1, 'name' => 'Jaén'],\n ['_stateId' => 1, 'name' => 'Málaga'],\n ['_stateId' => 1, 'name' => 'Sevilla'],\n ['_stateId' => 2, 'name' => 'Huesca'],\n ['_stateId' => 2, 'name' => 'Teruel'],\n ['_stateId' => 2, 'name' => 'Zaragoza'],\n ['_stateId' => 3, 'name' => 'Asturias'],\n ['_stateId' => 4, 'name' => 'Islas Baleares'],\n ['_stateId' => 5, 'name' => 'Las Palmas'],\n ['_stateId' => 5, 'name' => 'Santa Cruz de Tenerife'],\n ['_stateId' => 6, 'name' => 'Cantabria'],\n ['_stateId' => 7, 'name' => 'Ávila'],\n ['_stateId' => 7, 'name' => 'Burgos'],\n ['_stateId' => 7, 'name' => 'León'],\n ['_stateId' => 7, 'name' => 'Palencia'],\n ['_stateId' => 7, 'name' => 'Salamanca'],\n ['_stateId' => 7, 'name' => 'Segovia'],\n ['_stateId' => 7, 'name' => 'Soria'],\n ['_stateId' => 7, 'name' => 'Valladolid'],\n ['_stateId' => 7, 'name' => 'Zamora'],\n ['_stateId' => 8, 'name' => 'Albacete'],\n ['_stateId' => 8, 'name' => 'Ciudad Real'],\n ['_stateId' => 8, 'name' => 'Cuenca'],\n ['_stateId' => 8, 'name' => 'Guadalajara'],\n ['_stateId' => 8, 'name' => 'Toledo'],\n ['_stateId' => 9, 'name' => 'Barcelona'],\n ['_stateId' => 9, 'name' => 'Girona'],\n ['_stateId' => 9, 'name' => 'Lleida'],\n ['_stateId' => 9, 'name' => 'Tarragona'],\n ['_stateId' => 10, 'name' => 'Alicante'],\n ['_stateId' => 10, 'name' => 'Castellón'],\n ['_stateId' => 10, 'name' => 'Valencia'],\n ['_stateId' => 11, 'name' => 'Badajoz'],\n ['_stateId' => 11, 'name' => 'Cáceres'],\n ['_stateId' => 12, 'name' => 'A Coruña'],\n ['_stateId' => 12, 'name' => 'Lugo'],\n ['_stateId' => 12, 'name' => 'Ourense'],\n ['_stateId' => 12, 'name' => 'Pontevedra'],\n ['_stateId' => 13, 'name' => 'Madrid'],\n ['_stateId' => 14, 'name' => 'Murcia'],\n ['_stateId' => 15, 'name' => 'Navarra'],\n ['_stateId' => 16, 'name' => 'Álava'],\n ['_stateId' => 16, 'name' => 'Bizkaia'],\n ['_stateId' => 16, 'name' => 'Gipuzkoa'],\n ['_stateId' => 17, 'name' => 'La Rioja'],\n ['_stateId' => 18, 'name' => 'Ceuta'],\n ['_stateId' => 19, 'name' => 'Melilla']\n ];\n\n foreach ($regions as $rData) {\n $region = Region::findOne([\n 'name' => $rData['name'],\n ]);\n $region->state_id = $rData['_stateId'];\n if ($region->save() === false) {\n throw new SaveException($region);\n }\n }\n }", "public function getStudyIdsList() {\n return $this->_get(12);\n }", "public function getAllIds();", "public static function getIdsToIdentifiers() : array\n\t{\n\t\treturn [\n\t\t\tStatId::HP => 'hp',\n\t\t\tStatId::ATTACK => 'atk',\n\t\t\tStatId::DEFENSE => 'def',\n\t\t\tStatId::SPEED => 'spe',\n\t\t\tStatId::SPECIAL => 'spc',\n\t\t\tStatId::SPECIAL_ATTACK => 'spa',\n\t\t\tStatId::SPECIAL_DEFENSE => 'spd',\n\t\t];\n\t}", "public function getStudyIdsList() {\n return $this->_get(3);\n }", "public function getObjectIds();", "public function getIdentifiers()\n {\n return $this->identifiers;\n }", "function getRegions() {\n $query = \" SELECT ID,Name,CityID FROM #__ssregions \";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function getRegions()\n {\n return $this->regions;\n }", "public function getIds(): array\n {\n return array_map(fn (Entity $entity) => $entity->getId(), $this->entities);\n }", "public function getInstitutionIds()\n {\n return $this->institutions->lists('id')->toArray();\n }", "public function getAgentIds() {\n $retVal = [];\n foreach ($this->rAgents as $agent) {\n $retVal[] = $agent->id;\n }\n return $retVal;\n }", "public function getIdentifiers() {\n $fields = array('identifiers' => array(\n 'identifierDescriptor' => 'header',\n 'identifier',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return (is_array($result)) ? reset($result) : $result;\n }", "function getIds( array $Objects );", "public function by_region_multi($region_list, array $order_by=null, $offset=null, $limit=null) {\n $keys = [];\n if ($region_list instanceof \\neoform\\region\\collection) {\n foreach ($region_list as $k => $region) {\n $keys[$k] = [\n 'region_id' => (int) $region->id,\n ];\n }\n } else {\n foreach ($region_list as $k => $region) {\n $keys[$k] = [\n 'region_id' => (int) $region,\n ];\n }\n }\n return parent::_by_fields_multi(\n self::BY_REGION,\n $keys,\n $order_by,\n $offset,\n $limit\n );\n }", "public function getIds()\n {\n return $this->restrictedCountryIds;\n }" ]
[ "0.65570223", "0.597143", "0.59044623", "0.5893484", "0.5893484", "0.58084387", "0.575867", "0.56736535", "0.56637967", "0.5653798", "0.5619891", "0.56157786", "0.5605399", "0.55997366", "0.5568122", "0.55589706", "0.5557286", "0.5533723", "0.5522192", "0.55210537", "0.55180424", "0.55146414", "0.5511163", "0.5457118", "0.5454714", "0.54531395", "0.54458225", "0.5439706", "0.54379654", "0.5431404" ]
0.66227424
0
/ return timestamp of the date client added in oour system
function getClientAddDate($clientId) { $addedDate = 0; if($clientId > 0) { $sqlGetClientAddDate = "SELECT creationDate FROM person WHERE id = '$clientId'"; $resGetClientAddDate = DB::do_query($sqlGetClientAddDate); $rowGetClientAddDate = DB::db_fetch_assoc($resGetClientAddDate); $addedDate = explode(' ', $rowGetClientAddDate['creationDate']); $addedDate = strtotime($addedDate[0]); } return $addedDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getServerTimestamp();", "public function timestamp();", "private function getTimestamp() {\n\t$dateTime = new DateTime('now', new DateTimeZone(self::TIME_ZONE));\n\treturn $dateTime->format(self::DATE_FORMAT);\n }", "function getUTCTimestamp() {\n\t\treturn\t$this->mServerTimestamp->getUTCTimestamp();\n\t}", "public function action_getTimeStamp()\n\t{\n\t\t$offset_sec = date(\"Z\"); // offset in seconds depends on timezone\n\t\t$curtime = time() + $offset_sec; // current time depends on timezone\n\t\t$this->response->body(json_encode(array(\"unix_timestamp\" => time(),\"offset\" => $offset_sec,\"curtime\" => $curtime)));\n\t}", "public static function timestamp() {}", "public function getEventTimestamp();", "public function getInvoiceTimestamp();", "public function getTimestamp()\n {\n return $this->proxyBase->timestamp;\n }", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "public function getTimestamp()\n {\n }", "public function getDateInTimestamp(){\n $defaultTimeZone = date_default_timezone_get();\n date_default_timezone_set(Mage::getStoreConfig('general/locale/timezone'));\n $timestamp = strtotime($this->_getData('date'));\n date_default_timezone_set($defaultTimeZone);\n return $timestamp;\n }", "private static function timeStamp() {\n return date(\"Y-m-d H:i:s\");\n }", "function timeStamp()\n {\n return date(\"YmdHis\");\n }", "abstract public function getTstamp();", "function funcs_getTimeStamp($date){\n\t$date = new Mydate($date);\n\treturn $date->getStamp();\n}", "public function getOffer_timestamp()\n {\n return $this->offer_timestamp;\n }", "protected function getTimestamp()\r\n {\r\n return gmdate(\"Y-m-d\\TH:i:s.\\\\0\\\\0\\\\0\\\\Z\", time());\r\n }", "function getTimestamp() {\r\r\n\t\treturn $this->timestamp;\r\r\n\t}", "public function getDate_added() {\n\t\treturn $this->date_added;\n\t}", "public function getTimestamp(): int;", "public function getTimestamp(): int;", "public function getTimestamp()\n {\n return $this->dateIssued->getTimestamp();\n }", "function getTimestamp() {\n return $this->time_stamp;\n }", "public static function getTimestamp(){\r\n\t\treturn time();\r\n\t}", "private static function timestamp(){\n date_default_timezone_set('Africa/Nairobi');\n $time = time();\n return date(\"Y-m-d G:i:s\", $time);\n }", "public function getTimestamp()\n {\n return $this->server['REQUEST_TIME'];\n }", "public function getTimestamp(){\n\t\treturn $this->_timestamp;\n\t}" ]
[ "0.6902688", "0.67193747", "0.660471", "0.6525445", "0.64618397", "0.64593774", "0.6439911", "0.6403066", "0.6399845", "0.6394042", "0.6394042", "0.6394042", "0.635012", "0.63404334", "0.63290066", "0.6315174", "0.63079447", "0.6269962", "0.62597126", "0.62278706", "0.6208165", "0.6201464", "0.619554", "0.619554", "0.6193593", "0.61881137", "0.6173657", "0.6149393", "0.61388636", "0.6117623" ]
0.67373353
1
/Returning the remaining start up balance for a client till a perticular date
function getClientStartUpBal($clientId) { $startUpBal = 0; $startUpBalAlloc = 0; if($clientId > 0) { //getting the startup balance for client while client added in our system $sqlGetStartUpBal = "SELECT startupBalance FROM person WHERE id='$clientId'"; $resGetStartUpBal = DB::do_query($sqlGetStartUpBal); if($resGetStartUpBal) { $rowGetStartUpBal = DB :: db_fetch_array($resGetStartUpBal); $startUpBal = $rowGetStartUpBal['startupBalance']; //getting allocation done for this client towards start up balance $sqlStartBal = "SELECT csb.amt_paid FROM clientstartupbalallocation AS csb WHERE csb.client_id = $clientId AND is_erased = 0 ORDER BY csb.id ASC"; $resStartBal = DB::do_query($sqlStartBal); if($resStartBal && (DB::db_fetch_num_rows($resStartBal) > 0)) { While($rowStartBal = DB :: db_fetch_array($resStartBal)) { $startUpBalAlloc += $rowStartBal['amt_paid']; } } $startUpBal -= $startUpBalAlloc; } } return $startUpBal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClientBal($clientId, $providerId, $startDate = '', $endDate = '', $runSesId = '', $incStratup='0', $payerId='') {\n\n\t\t$clientBalInfo = array();\n\t\t$isShowNA = 1;\n\t\ttry {\n\t\t\n\t\t\tif($clientId > 0) {\n\t\t\t\t\n\t\t\t\t$fromDate = $startDate;\n\t\t\t\t$toDate = $endDate;\n\t\t\t\t\n\t\t\t\t$clientBal = 0;\n\t\t\t\t$estimationCopay = $procCopayArray = $clientBalCalMethod = array();\n\n\t\t\t\t$balMethod = new GetBalMethod();\n\t\t\t\n\t\t\t\t$sqlGetSes = \"SELECT cs.id, cs.sessionDate, cs.fee, cs.adj_fee, cs.other_ins_adj, cs.amt_paid, cs.out_of_network_ins_type,\n\t\t\t\t\t\tcs.procedureID, cs.pending_personinsurance_id, pp.code\n\t\t\t\t\t\tFROM clientsession AS cs \n\t\t\t\t\t\tLEFT JOIN providerprocedure AS pp ON cs.procedureID = pp.id\n\t\t\t\t\t\tWHERE cs.clientID = '$clientId'\n\t\t\t\t\t\tAND cs.sessionStatus = 1\";\n\t\t\t\tif($runSesId != '') {\n\t\t\t\t\t$sqlGetSes .= \" AND cs.id='$runSesId'\";\n\t\t\t\t}\n\t\t\t\tif($payerId != '' && $payerId != '0') {\n\t\t\t\t\t$sqlGetSes .= \" AND cs.clientcontact_id= '$payerId'\";\t\n\t\t\t\t}\n\t\t\t\tif($fromDate != '') {\n\t\t\t\t\t$sqlGetSes .= \" AND cs.sessionDate >= '$fromDate' \";\n\t\t\t\t}\n\t\t\t\tif($toDate != '') {\n\t\t\t\t\t$sqlGetSes .= \" AND cs.sessionDate <= '$toDate'\";\n\t\t\t\t}\n\n\t\t\t\t$sqlGetSes .= \" order by sessionDate\";\t\n\t\t\t\t$i = 0;\n\t\t\t\t\n\t\t\t\t$resGetSes = DB::do_query($sqlGetSes);\n\t\t\t\t\n\t\t\t\tif(DB::db_fetch_num_rows($resGetSes)) {\n\t\t\t\t\n\t\t\t\t\twhile($rowGetSes = DB :: db_fetch_array($resGetSes )) {\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t$sesId = $rowGetSes['id'];\n\t\t\t\t\t\t$sesDate = $rowGetSes['sessionDate'];\n\t\t\t\t\t\t$sesProc = $rowGetSes['code'];\n\t\t\t\t\t\t$sesFee = $rowGetSes['fee'];\n\t\t\t\t\t\t$sesAdjFee = $rowGetSes['adj_fee'];\n\t\t\t\t\t\t$sesOthInsAdj = $rowGetSes['other_ins_adj'];\n\t\t\t\t\t\t$sesInsPay = $rowGetSes['amt_paid'];\n\t\t\t\t\t\t$pendingInsId = $rowGetSes['pending_personinsurance_id'];\n\t\t\t\t\t\t$ONNType = $rowGetSes['out_of_network_ins_type'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t//getting the client payment done for each session\n\t\t\t\t\t\t$sqlCPay = \"SELECT SUM(cpa.amt_paid) AS client_amt_paid, SUM(cpa.amt_write_off) AS amt_write_off \n\t\t\t\t\t\t\t\t\tFROM clientpaymentallocation AS cpa\n\t\t\t\t\t\t\t\t\tWHERE cpa.session_id = '$sesId'\n\t\t\t\t\t\t\t\t\tAND cpa.is_erased = 0 \n\t\t\t\t\t\t\t\t\tGROUP BY cpa.session_id\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$resCPay = DB::do_query($sqlCPay);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$clientPayArray = array();\t\t\n\t\t\t\t\t\t$j = 0;\n\t\t\t\t\t\t$sesCPay = 0;\n\t\t\t\t\t\t$sesCAmtWrtOff = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//if client has payments allocated to its sessions\n\t\t\t\t\t\tif(DB::db_fetch_num_rows($resCPay)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$rowCPay = DB::db_fetch_assoc($resCPay);\n\t\t\t\t\t\t\t$sesCPay = $rowCPay['client_amt_paid'];\n\t\t\t\t\t\t\t$sesCAmtWrtOff = $rowCPay['amt_write_off'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sesBal = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//if pending to client or Out of network type insurance, then we need to assign the full remaining amount to client\n\t\t\t\t\t\tif($pendingInsId == 0 || $ONNType) {\n\t\t\t\t\t\t\t$sesBal = $sesAdjFee - ($sesOthInsAdj + $sesInsPay + $sesCPay + $sesCAmtWrtOff);\n\t\t\t\t\t\t\t$isShowNA = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$clientBalCalMethod = $balMethod->checkClientBalCalcMethodToUse(strtotime($sesDate), $clientId, $providerId, $sesProc);\n\t\t\t\t\t\t\t$coPayAmt = 0;\n\t\t\t\t\t\t\tif(count($clientBalCalMethod) && $clientBalCalMethod['method'] == 2) {\n\n\t\t\t\t\t\t\t\tif(array_key_exists($sesProc, $clientBalCalMethod['copay'])) {\n\t\t\t\t\t\t\t\t\t$coPayAmt = $clientBalCalMethod['copay'][$sesProc];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$coPayAmt = $balMethod->getFirstCopayUcrAmount($clientBalCalMethod['balCustId'], $sesProc, 1);\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$estimationCopay[$sesProc] = $sesFee;\n\t\t\t\t\t\t\t\tif($coPayAmt >= $sesFee) {\n\t\t\t\t\t\t\t\t\t$coPayAmt = $sesFee;\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$sesBal = $coPayAmt - ($sesCPay + $sesCAmtWrtOff);\n\t\t\t\t\t\t\t\t$isShowNA = 0;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$isShowNA *= 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$clientBal += $sesBal;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// getting the start up bal and adding it to client bal\n\t\t\tif($runSesId == '') {\n\n\t\t\t\t$startUpBal = 0;\n\t\t\t\t//@$incStratup = 0 we need to add startup balance @$incStratup=1 not to add startup\n\t\t\t\tif($incStratup == '0') {\n\t\t\t\t\t$startUpBal = $this->getClientStartUpBal($clientId);\t\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\t$clientBal += $startUpBal;\n\t\t\t\t$clientAdjFee = $this->getClientAdj($clientId, $fromDate, $toDate, 0);\n\t\t\t\t\n\t\t\t\t$clientUnAllocatedPayment = $this->getClientUnAllocatePay($clientId, $fromDate, $toDate, $payerId);\n\n\t\t\t\t// adding client adjustment and substrcting the unallocated client payment\n\t\t\t\t$clientBal += $clientAdjFee - $clientUnAllocatedPayment;\n\t\t\t\tif($isShowNA == 1) {\n\t\t\t\t\tif($startUpBal > 0 || $clientAdjFee > 0 || $clientUnAllocatedPayment > 0 || $clientBal > 0) {\n\t\t\t\t\t\t$isShowNA = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$finePrintText = '';\n\t\t\t$estimatedFlag = 0;\n\n\t\t\tif(count($estimationCopay)) {\n\t\t\t\t\n\t\t\t\t$finePrintText = \"* Based on an estimated copay of \";\n\t\t\t\t$count = 0;\n\t\t\t\t\n\t\t\t\tforeach($estimationCopay as $key=>$val) {\n\t\t\t\t\t\n\t\t\t\t\tif($count) {\n\t\t\t\t\t\t$finePrintText .= ' and ';\n\t\t\t\t\t}\n\t\t\t\t\t$finePrintText .= '$'.number_format($val, 2).\" for $key\";\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\t$estimatedFlag = 1;\n\t\t\t}\t\n\t\t\t\n\t\t\t$clientBalInfo[] = round($clientBal, 2);\n\t\t\t$clientBalInfo[] = $finePrintText;\n\t\t\t$clientBalInfo[] = $estimatedFlag;\n\t\t\t$clientBalInfo[] = $isShowNA ;\n\t\t\n\t\t}catch(Exception $e) {\n\t\t\tAPP::logErrors($e);\n\t\t}\n\t\t\n\t\treturn $clientBalInfo;\n\t}", "function getClientAdj($clientId, $startDate = '', $endDate = '') {\n\t\n\t\t$clientAdj = 0;\n\t\t\n\t\tif($clientId > 0) {\n\t\t\t\n\t\t\t$fromDate = $startDate;\n\t\t\t$toDate = $endDate;\n\t\t\t\n\t\t\t$sqlGetAdj = \"SELECT SUM(amount) AS adjAmt\n\t\t\t\t\t\tFROM clientadjustment\n\t\t\t\t\t\tWHERE client_id = '$clientId'\n\t\t\t\t\t\tAND status = 1\";\n\t\t\t\t\t\t\t\t\n\t\t\tif($fromDate != '') {\n\t\t\t\t$sqlGetAdj .= \" AND added_date >= '$fromDate 00:00:00' \";\n\t\t\t}\n\t\t\tif($toDate != '') {\n\t\t\t\t$sqlGetAdj .= \" AND added_date < '$toDate'\";\n\t\t\t}\n\t\t\t\n\t\t\t$resGetAdj = DB::do_query($sqlGetAdj);\n\t\t\t\n\t\t\tif(DB::db_fetch_num_rows($resGetAdj) > 0) {\n\t\t\t\n\t\t\t\t$rowGetAdj = DB::db_fetch_assoc($resGetAdj);\n\t\t\t\t$clientAdj = $rowGetAdj['adjAmt'];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $clientAdj;\n\t}", "public function initialConsolidatedLoanBalances($userid,$entry_date)\n {\n $loanDeductions = Userconsolidatedloan::\n where('user_id',$userid)\n ->where('date_entry','<',$entry_date)\n ->orderBy('date_entry', 'asc')\n ->orderBy('entry_time', 'asc')\n ->get();\n\n\n $credit = $loanDeductions->sum('credit');\n $debit = $loanDeductions->sum('debit');\n return $balance = $debit - $credit;\n }", "public function getbalance(){\n $balance = $this->_run('getbalance');\n return $balance;\n }", "function fetchRunningClientBal($providerId, $clientId, $sesId) {\n\n\t\tif($providerId != '' && $clientId != '' && $sesId != '') {\n\n\t\t\t//here we are using the to get the client Balanace method to get cliet balance\n\t\t\t$clientBalArr = $this->getClientBal($clientId, $providerId, '', '', $sesId);\n\t\t\t\n\t\t}\n\n\t\treturn $clientBalArr;\n\t}", "function getClientUnAllocatePay($clientId, $startDate = '', $endDate = '', $payerId = '0') {\n\t\n\t\t$clientUnAllocPay = 0;\n\t\t\n\t\tif($clientId > 0) {\n\t\t\n\t\t\t$fromDate = $startDate;\n\t\t\t$toDate = $endDate;\t\t\t\n\t\t\t\n\t\t\t$sqlGetPay = \"SELECT SUM(totalAmountRem) AS amtRem\n\t\t\t\t\t\tFROM clientpayment\n\t\t\t\t\t\tWHERE clientID = '$clientId'\n\t\t\t\t\t\tAND isDeleted = 0\";\n\t\t\tif($payerId != '0' && $payerId != '') {\n\t\t\t\t$sqlGetPay .= \" AND clientcontact_id = '$payerId' \";\n\t\t\t}\n\t\t\tif($fromDate != '') {\n\t\t\t\t$sqlGetPay .= \" AND paymentDate >= '$fromDate' \";\n\t\t\t}\n\n\t\t\tif($toDate != '') {\n\t\t\t\t$sqlGetPay .= \" AND paymentDate <= '$toDate'\";\n\t\t\t}\n\n\t\t\t\n\t\t\t$resGetPay= DB::do_query($sqlGetPay);\n\t\t\t\n\t\t\tif(DB::db_fetch_num_rows($resGetPay) > 0) {\n\t\t\t\n\t\t\t\t$rowGetPay = DB::db_fetch_assoc($resGetPay);\n\t\t\t\t$clientUnAllocPay = $rowGetPay['amtRem'];\n\t\t\t}\n\t\t}\n\t\treturn $clientUnAllocPay;\n\t}", "function CurrentBalance($depamount, $prevamount) {\r\n $total = $prevamount + $depamount;\r\n return $total;\r\n }", "function recalculateRebillDate()\n {\n if (is_null($this->tm_started) || in_array($this->status, array(self::RECURRING_FAILED, self::RECURRING_FINISHED, self::RECURRING_CANCELLED))) {\n $this->updateQuick('rebill_date', null);\n return;\n }\n $date = null;\n $c = $this->getPaymentsCount();\n if ($this->first_total <= 0)\n $c++; // first period is \"fake\" because it was free trial\n //if ($c < $this->getExpectedPaymentsCount()) // not yet done with rebills\n if ($this->rebill_times > ($c - 1)) { // not yet done with rebills\n // we count starting from first payment date, we rely on tm_started field here\n if ($this->first_total <= 0)\n list($date, ) = explode(' ', $this->tm_started);\n else\n $date = $this->getAdapter()\n ->selectCell(\"SELECT MIN(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n $date = date('Y-m-d', strtotime($date));\n\n $period1 = new Am_Period($this->first_period);\n $date = $period1->addTo($date);\n $period2 = new Am_Period($this->second_period);\n for ($i = 1; $i < $c; $i++) { // we skip first payment here, already added above\n $date = $period2->addTo($date);\n }\n // If date is in the past, something is wrong here. Now we try to calculate rebill date from user's last payment.\n if ($date < $this->getDi()->dateTime->format('Y-m-d')) {\n\n $last_payment_date = $this->getAdapter()\n ->selectCell(\"SELECT MAX(dattm) FROM ?_invoice_payment WHERE invoice_id=?d\", $this->invoice_id);\n if ($last_payment_date) {\n\n $period = new Am_Period($this->second_period);\n $date = date('Y-m-d', strtotime($last_payment_date));\n $date = $period->addTo($date);\n }\n // date is in the past again; Use tomorrow's date instead;\n $restore_limit_date = $this->getDi()->dateTime;\n $restore_limit_date->modify('-30 days');\n if (($date < $this->getDi()->sqlDate) && ($date > $restore_limit_date->format('Y-m-d'))) {\n $tomorrow = $this->getDi()->dateTime;\n $tomorrow->modify('+1 days');\n $date = $tomorrow->format('Y-m-d');\n }\n }\n }\n $this->updateQuick('rebill_date', $date);\n }", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "public function getBalance();", "function get_opening_balance_by_date($group_id, $from_date, $to_date) {\n\n $CI = & get_instance();\n $CI->load->helper('traialbalance');\n $CI->load->model('account/report');\n $returnArr = get_opening_balance_cal_by_date($group_id, $from_date, $to_date);\n $opening_balance = 0;\n foreach ($returnArr as $row) {\n if ($row['account_type'] == 'Dr') {\n $opening_balance = $opening_balance + $row['opening_balance'];\n }\n if ($row['account_type'] == 'Cr') {\n $opening_balance = $opening_balance - $row['opening_balance'];\n }\n }\n return $opening_balance;\n}", "public function get_balance_client($client_id)\n {\n $q=$this->db->where(['client_id'=>$client_id])->get('clients');\n return $q->result_array()[0]['client_balance'];\n }", "function getPartnerAccountingBalance($clfoco,$date=false)\n {\n global $gTables;\n if ( $this->target>0 && $clfoco==0 ) {\n $clfoco=$this->target;\n }\n if (!$date){\n $date = strftime(\"%Y-%m-%d\", mktime (0,0,0,date(\"m\"),date(\"d\"),date(\"Y\")));\n }\n\t$sqlquery= \"SELECT \".$gTables['tesmov'].\".datreg ,\".$gTables['rigmoc'].\".import, \".$gTables['rigmoc'].\".darave\n FROM \".$gTables['rigmoc'].\" LEFT JOIN \".$gTables['tesmov'].\n \" ON \".$gTables['rigmoc'].\".id_tes = \".$gTables['tesmov'].\".id_tes\n WHERE codcon = $clfoco AND caucon <> 'CHI' AND caucon <> 'APE' OR (caucon = 'APE' AND codcon = $clfoco AND datreg IN (SELECT MIN(datreg) FROM \".$gTables['tesmov'].\")) ORDER BY datreg ASC\";\n $rs = gaz_dbi_query($sqlquery);\n $date_ctrl = new DateTime($date);\n $acc=0.00;\n while ($r = gaz_dbi_fetch_array($rs)) {\n $dr = new DateTime($r['datreg']);\n if ($dr<=$date_ctrl){\n if ($r['darave']=='D'){\n $acc+=$r['import'];\n } else {\n $acc-=$r['import'];\n }\n }\n }\n\treturn round($acc,2);\n }", "public function balance()\n\t{\n\t\treturn $this->curl('/ovo/balance', Constant::HTTP_POST);\n\t}", "public function balance () {\n\t\t\t// get the response from the api server in json format\n\t\t\t$response = $this->request();\n\t\t\tif ($response->status == 1 || $response->remarks == 'success') {\n\t\t\t\treturn $response->balance;\n\t\t\t}\n\t\t\t$this->error = $response->remarks;\n\t\t\t\n\t\t\treturn 0;\n\t\t}", "public function balanceOnDate(Carbon $date)\n {\n if ($date < $this->openingbalancedate) {\n $date = $this->openingbalancedate;\n }\n $now = new Carbon;\n if ($now->diffInMonths($date) > 2) {\n $cacheTime = 20160;\n } else {\n $cacheTime = 10;\n }\n /** @noinspection PhpUndefinedFieldInspection */\n $key = $date->format('Y-m-d') . $this->id . '-balanceOndate';\n\n if (cache::has($key)) {\n // @codeCoverageIgnoreStart\n return Cache::get($key);\n // @codeCoverageIgnoreEnd\n } else {\n\n $r = floatval($this->balancemodifiers()->where('date', '<=', $date->format('Y-m-d'))->sum('balance'));\n Cache::put($key, $r, $cacheTime);\n return $r;\n }\n }", "public function getBalanceOn(Carbon $date): Money\n {\n return $this->getCreditBalanceOn($date)->subtract($this->getDebitBalanceOn($date));\n }", "public function setStartBalance($balance = 0, $date = null)\n {\n $balance = (float) str_replace(',', '.', $balance);\n \n if(is_null($date)) $date = time();\n else $date = strtotime($date);\n\n $this->startBalance = ($balance > 0 ? \"C\" : \"D\") . date('ymd', $date) . $this->makeAmount($balance, $this->currency);\n return $this;\n }", "public function get_balance() {\n\t\treturn $this->balance;\n\t}", "public function getCurrentBalance(): Money\n {\n return $this->getBalanceOn(Carbon::now());\n }", "public function getbalance()\n {\n $theAccountBalance = [\"currency\" => \"NGN\", \"balance\"=> 0];\n try {\n $thePaystack = new Paystack();\n $theCurrentAcctBalance = $thePaystack->checkBalance();\n if ( isset($theCurrentAcctBalance['data']) && count($theCurrentAcctBalance['data'])){\n $theAccountBalance = $theCurrentAcctBalance['data'][0];\n }\n } catch (\\Throwable $th) {\n //throw $th;\n return $th;\n }\n\n return $theAccountBalance;\n }", "function compute_interest($date) {\n $money = 0;\n if ($this->earning->interest_schedule) {\n $this->earning->set_balance($this->get_balance());\n $money = $this->earning->compute_interest($date);\n $this->set_balance($this->earning->get_balance());\n }\n return $money;\n }", "public function balance($refTmp = NULL) {\n $this->auth->checkIfOperationIsAllowed('native_report_balance');\n $data = getUserContext($this);\n $refDate = date(\"Y-m-d\");\n if ($refTmp != NULL) {\n $refDate = date(\"Y-m-d\", $refTmp);\n }\n $data['refDate'] = $refDate;\n $data['title'] = lang('reports_balance_title');\n $data['help'] = $this->help->create_help_link('global_link_doc_page_leave_balance_report');\n $this->load->view('templates/header', $data);\n $this->load->view('menu/index', $data);\n $this->load->view('reports/balance/index', $data);\n $this->load->view('templates/footer');\n }", "public function getBalanceReport(Carbon $start, Carbon $end, $shared)\n {\n $repository = App::make('FireflyIII\\Repositories\\Budget\\BudgetRepositoryInterface');\n $tagRepository = App::make('FireflyIII\\Repositories\\Tag\\TagRepositoryInterface');\n $balance = new Balance;\n\n // build a balance header:\n $header = new BalanceHeader;\n\n $accounts = $this->query->getAllAccounts($start, $end, $shared);\n $budgets = $repository->getBudgets();\n foreach ($accounts as $account) {\n $header->addAccount($account);\n }\n\n /** @var BudgetModel $budget */\n foreach ($budgets as $budget) {\n $line = new BalanceLine;\n $line->setBudget($budget);\n\n // get budget amount for current period:\n $rep = $repository->getCurrentRepetition($budget, $start);\n $line->setRepetition($rep);\n\n // loop accounts:\n foreach ($accounts as $account) {\n $balanceEntry = new BalanceEntry;\n $balanceEntry->setAccount($account);\n\n // get spent:\n $spent = $this->query->spentInBudgetCorrected($account, $budget, $start, $end); // I think shared is irrelevant.\n\n $balanceEntry->setSpent($spent);\n $line->addBalanceEntry($balanceEntry);\n }\n // add line to balance:\n $balance->addBalanceLine($line);\n }\n\n // then a new line for without budget.\n // and one for the tags:\n $empty = new BalanceLine;\n $tags = new BalanceLine;\n $diffLine = new BalanceLine;\n\n $tags->setRole(BalanceLine::ROLE_TAGROLE);\n $diffLine->setRole(BalanceLine::ROLE_DIFFROLE);\n\n foreach ($accounts as $account) {\n $spent = $this->query->spentNoBudget($account, $start, $end);\n $left = $tagRepository->coveredByBalancingActs($account, $start, $end);\n bcscale(2);\n $diff = bcsub($spent, $left);\n\n // budget\n $budgetEntry = new BalanceEntry;\n $budgetEntry->setAccount($account);\n $budgetEntry->setSpent($spent);\n $empty->addBalanceEntry($budgetEntry);\n\n // balanced by tags\n $tagEntry = new BalanceEntry;\n $tagEntry->setAccount($account);\n $tagEntry->setLeft($left);\n $tags->addBalanceEntry($tagEntry);\n\n // difference:\n $diffEntry = new BalanceEntry;\n $diffEntry->setAccount($account);\n $diffEntry->setSpent($diff);\n $diffLine->addBalanceEntry($diffEntry);\n\n }\n\n $balance->addBalanceLine($empty);\n $balance->addBalanceLine($tags);\n $balance->addBalanceLine($diffLine);\n\n $balance->setBalanceHeader($header);\n\n return $balance;\n }", "public function getBalance()\n {\n return $this->balance;\n }", "public function SumAccountBeforeDate($account_id,$startdate)\n{\n \n //Let's get the balance of the given account before given date\n $sum =$this->db->select_sum('amount')\n ->where('created_at <',$startdate)\n ->where('account_id',$account_id)\n ->get($this->postingsTable)\n ->result()[0]\n ->amount;\n //if the sum is null which means there is no transaction for this account then instead of return \n // null let us return 0\n\n return (is_null($sum))?0:$sum; \n}", "public function getRemainingHoursOfNewOrd(){\n return 0;\n }", "public function balance() : int;", "public function checkBalance()\n {\n if ($this->_client) {\n $balance = $this->_client->checkBalance();\n\n if ($balance['balance'] <= env('SMS_CREDIT_THRESHOLD')) {\n // Send warning email\n $subject = 'SMS service balance running low';\n $vars = ['balance'=>$balance];\n \\Mail::send(['text'=>'errors.sms_balance'], $vars, function($message) use ($subject)\n {\n $message->to(env('DEVELOPER_EMAIL'))->subject($subject);\n });\n }\n }\n }", "function getGuardCharge($guardid,$startdate,$enddate){\n\t$result = mysql_query(\"SELECT * FROM guardschedule\");\n\t$scheduledays = 0;\n\t\n\t//Put all data into arrays if they are in between those dates specified\n\twhile($line = mysql_fetch_array($result, MYSQL_ASSOC)){\n\t\t//Set payment dates if they are not set\n\t\tif(trim($startdate) == \"\"){\n\t\t\t$datearray = getRowAsArray(\"SELECT lastpaymentdate, dateofemployment FROM guards WHERE guardid='\".$guardid.\"'\");\n\t\t\tif($datearray['lastpaymentdate'] != \"\"){\n\t\t\t\t$startdate = $datearray['lastpaymentdate'];\n\t\t\t} else {\n\t\t\t\t$startdate = $datearray['dateofemployment'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Give it the current date if it has not been set yet\n\t\tif(trim($enddate) == \"\"){\n\t\t\t$enddate = date(\"d-M-Y\");\n\t\t}\n\t\t\n\t\tif((strtotime($line['dateentered']) >= strtotime(trim($startdate,\"'\"))) && (strtotime($line['dateentered']) <= strtotime(trim($enddate,\"'\")))){\n\t\t\t$schedulearray = split(\",\",$line['schedule']);\n\t\t\t//Get all known guard statuses\n\t\t\t$statusarr = getAllScheduleStatus();\n\t\t\t\n\t\t\tfor($i=0;$i<count($schedulearray);$i++){\n\t\t\t\t$assgnarr = split(\"=\",$schedulearray[$i]);\n\t\t\t\tif(!in_array($assgnarr[1],$statusarr) && $assgnarr[0] == $guardid && $assgnarr[1] != \"\"){\n\t\t\t\t\t$scheduledays++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Return the amount to be paid to the guard for regular work done\n\t$guard = getRowAsArray(\"SELECT rate FROM guards WHERE guardid='\".$guardid.\"'\");\n\t\n\treturn $scheduledays*$guard['rate'];\n}" ]
[ "0.6185725", "0.61582446", "0.6122968", "0.5926081", "0.5897295", "0.5883599", "0.58769345", "0.5875106", "0.58201116", "0.5817896", "0.5789412", "0.57514197", "0.57320887", "0.57246757", "0.5713269", "0.5617682", "0.55308634", "0.55038744", "0.5502469", "0.54934883", "0.5490207", "0.54862887", "0.54689324", "0.5463549", "0.54561514", "0.54494476", "0.5445551", "0.5443408", "0.5432413", "0.54198915" ]
0.744844
0
/ Returning adjustment done for client for a given date range, if no date range given end date is a current date and start date is the default date according to our logic(getDefaultStartDate function) Data not included the end date
function getClientAdj($clientId, $startDate = '', $endDate = '') { $clientAdj = 0; if($clientId > 0) { $fromDate = $startDate; $toDate = $endDate; $sqlGetAdj = "SELECT SUM(amount) AS adjAmt FROM clientadjustment WHERE client_id = '$clientId' AND status = 1"; if($fromDate != '') { $sqlGetAdj .= " AND added_date >= '$fromDate 00:00:00' "; } if($toDate != '') { $sqlGetAdj .= " AND added_date < '$toDate'"; } $resGetAdj = DB::do_query($sqlGetAdj); if(DB::db_fetch_num_rows($resGetAdj) > 0) { $rowGetAdj = DB::db_fetch_assoc($resGetAdj); $clientAdj = $rowGetAdj['adjAmt']; } } return $clientAdj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function set_date_range_parameters($adjust_empty_vals = TRUE)\n\t{\n\t\tif ($this->P->value('date_range_start') !== FALSE AND\n\t\t\t$this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\n\t\t\tif ($this->P->value('show_years') > 0 OR\n\t\t\t\t$this->P->value('show_months') > 0 OR\n\t\t\t\t$this->P->value('show_weeks') > 0 OR\n\t\t\t\t$this->P->value('show_days') > 0)\n\t\t\t{\n\t\t\t\t$this->P->set('date_range_end', $this->P->params['date_range_start']['value']);\n\n\t\t\t\tif ($this->P->value('show_years') > 0)\n\t\t\t\t{\n\t\t\t\t\t $this->CDT->add_year($this->P->value('show_years') -1, TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_months') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_month(($this->P->value('show_months') - 1), TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_weeks') > 0)\n\t\t\t\t{\n\t\t\t\t\t//get the current day of week (1-7)\n\t\t\t\t\t$dow\t\t= $this->CDT->get_day_of_week(\n\t\t\t\t\t\t$this->CDT->year,\n\t\t\t\t\t\t$this->CDT->month,\n\t\t\t\t\t\t$this->CDT->day\n\t\t\t\t\t) + 1;\n\n\t\t\t\t\t//first day of week\n\t\t\t\t\t$fdow \t\t= $this->get_first_day_of_week();\n\n\t\t\t\t\t//we need to calculate 2 weeks backwards, counting today (-1) removing the remaining\n\t\t\t\t\t//days of the week, MINUS the first day of the week...\n\t\t\t\t\t//this will give is first day of the week, x weeks forward, counting this week as a full\n\t\t\t\t\t//week regardless of the day\n\n\t\t\t\t\t$this->CDT->add_day(( 7 * $this->P->value('show_weeks') ) - ($dow - $fdow));\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_days') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day($this->P->value('show_days') - 1);\n\t\t\t\t}\n\n\t\t\t\t$end = $this->CDT->datetime_array();\n\n\t\t\t\t$end[\"time\"]\t= \"2359\";\n\t\t\t\t$end[\"hour\"]\t= '23';\n\t\t\t\t$end[\"minute\"]\t= '59';\n\n\t\t\t\t$this->P->set('date_range_end', $end);\n\t\t\t}\n\t\t}\n\t\telseif ($this->P->value('date_range_start') === FALSE AND\n\t\t\t\t$this->P->value('date_range_end') !== FALSE)\n\t\t{\n\t\t\t$this->CDT->change_ymd($this->P->value('date_range_end', 'ymd'));\n\n\t\t\tif ($this->P->value('show_years') > 0 OR\n\t\t\t\t$this->P->value('show_months') > 0 OR\n\t\t\t\t$this->P->value('show_weeks') > 0 OR\n\t\t\t\t$this->P->value('show_days') > 0)\n\t\t\t{\n\t\t\t\tif ($this->P->value('show_years') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_year(-$this->P->value('show_years') + 1, TRUE, 'backward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_months') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_month(-$this->P->value('show_months') + 1, TRUE, 'backward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_weeks') > 0)\n\t\t\t\t{\n\t\t\t\t\t//get the current day of week (1-7)\n\t\t\t\t\t$dow\t\t= $this->CDT->get_day_of_week(\n\t\t\t\t\t\t$this->CDT->year,\n\t\t\t\t\t\t$this->CDT->month,\n\t\t\t\t\t\t$this->CDT->day\n\t\t\t\t\t) + 1;\n\n\t\t\t\t\t//first day of week\n\t\t\t\t\t$fdow \t\t= $this->get_first_day_of_week();\n\n\t\t\t\t\t//we need to calculate 2 weeks backwards, counting today (+1) removing the remaining\n\t\t\t\t\t//days of the week, MINUS the first day of the week...\n\t\t\t\t\t//this will give is first day of the week, x weeks back, counting this week as a full\n\t\t\t\t\t//week regardless of the day\n\t\t\t\t\t$this->CDT->add_day(( -7 * $this->P->value('show_weeks') ) + 1 + (7 - ($dow - $fdow)));\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_days') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day(-$this->P->value('show_days') + 1);\n\t\t\t\t}\n\n\t\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\t\t\t}\n\t\t}\n\t\telseif ($adjust_empty_vals === TRUE AND\n\t\t\t\t$this->P->value('date_range_start') === FALSE AND\n\t\t\t\t$this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', $this->CDT->datetime_array());\n\n\t\t\tif ($this->P->value('show_years') > 0 OR\n\t\t\t\t$this->P->value('show_months') > 0 OR\n\t\t\t\t$this->P->value('show_weeks') > 0 OR\n\t\t\t\t$this->P->value('show_days') > 0)\n\t\t\t{\n\t\t\t\tif ($this->P->value('show_years') > 0)\n\t\t\t\t{\n\t\t\t\t\t $this->CDT->add_year($this->P->value('show_years') -1, TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_months') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_month(($this->P->value('show_months') - 1), TRUE, 'forward');\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_weeks') > 0)\n\t\t\t\t{\n\t\t\t\t\t//get the current day of week (1-7)\n\t\t\t\t\t$dow\t\t= $this->CDT->get_day_of_week(\n\t\t\t\t\t\t$this->CDT->year,\n\t\t\t\t\t\t$this->CDT->month,\n\t\t\t\t\t\t$this->CDT->day\n\t\t\t\t\t) + 1;\n\n\t\t\t\t\t//first day of week\n\t\t\t\t\t$fdow \t\t= $this->get_first_day_of_week();\n\n\t\t\t\t\t//we need to calculate 2 weeks backwards, counting today (-1) removing the remaining\n\t\t\t\t\t//days of the week, MINUS the first day of the week...\n\t\t\t\t\t//this will give is first day of the week, x weeks forward, counting this week as a full\n\t\t\t\t\t//week regardless of the day\n\n\t\t\t\t\t$this->CDT->add_day(( 7 * $this->P->value('show_weeks') ) - ($dow - $fdow));\n\t\t\t\t}\n\t\t\t\telse if ($this->P->value('show_days') > 0)\n\t\t\t\t{\n\t\t\t\t\t$this->CDT->add_day($this->P->value('show_days') - 1);\n\t\t\t\t}\n\n\t\t\t\t$end = $this->CDT->datetime_array();\n\n\t\t\t\t$end[\"time\"]\t= \"2359\";\n\t\t\t\t$end[\"hour\"]\t= '23';\n\t\t\t\t$end[\"minute\"]\t= '59';\n\n\t\t\t\t$this->P->set('date_range_end', $end);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$end = $this->P->params['date_range_start']['value'];\n\n\t\t\t\t$end[\"time\"]\t= \"2359\";\n\t\t\t\t$end[\"hour\"]\t= '23';\n\t\t\t\t$end[\"minute\"]\t= '59';\n\n\t\t\t\t$this->P->set('date_range_end', $end);\n\n\t\t\t\t//$this->P->set('date_range_end', $this->P->value('date_range_start'));\n\t\t\t}\n\t\t}\n\t}", "public function compare_default_date(){\n\t\t$getdates = $this->Timerecordsummary_model->get_default_date()->row();\n\t\tif(!(empty($getdates))){\n\t\t\t$data = array(\"success\" => 1, \"date_ranges\" => $getdates);\n\t\t}else{\n\t\t\t$data = array(\"success\" => 0, \"date_ranges\" => \"Please input valid date range from Time Record Summary Range in settings\");\n\t\t}\n\t\techo json_encode($data);\n\n\t}", "public function leadsInDates($start, $end, $data = []);", "public function calculateRangeKwhCosts($beginDate, $endDate){\n \t \n\t\treturn $this->calculateTimeRangeKwhCosts(date (\"Y-m-d 00:00:00\", strtotime($beginDate)),date (\"Y-m-d 00:00:00\", strtotime (\"+1 day\", strtotime($endDate))) );\n\n }", "protected function dates_filter(){\n \t//+Constraint Isgi: only one year data\n \t$temporal = $this->get_temporal();\n \tif( strtolower($temporal->end) == \"now\"){\n \t\t$now = new \\DateTime();\n \t\t$temporal->end = $now->format(\"Y-m-d\");\n \t}\n \t\n \t\n \t//change start and end\n \tif( $this->start < $temporal->start){\n \t\t$this->start = $temporal->start;\n \t}\n \tif( $this->end > $temporal->end){\n \t\t$this->end = $temporal->end;\n \t}\n \t$update = $this->get_update();\n \tif( !empty( $update) && $update < $this->end){\n \t\t$this->end = $update;\n \t}\n \t// diff between start and end\n \t$start = new \\DateTime( $this->start);\n \t$end = new \\DateTime( $this->end);\n \t$interval = $start->diff( $end);\n \tif( $interval->invert){\n \t\t//end < start\n \t\t$this->error = \"NO_DATA\";\n \t}else{\n\t \tif( $interval->days > 365){\n\t \t\t$start = clone $end;\n\t \t\t$start->sub( new \\DateInterval(\"P364D\"));\n\t \t\t$this->start = $start->format(\"Y-m-d\");\n\t \t}\n \t}\n }", "function calculateDates()\n\t\t\t{\n\t\t\t\t$dates = [ 'mailshot_1_date'=>'+7 day', 'mailshot_2_date' => '+14 day',\n\t\t\t\t\t'employer_engagement_start'=>' +14 day', 'employer_engagement_end'=>'-9 week', 'self_place_deadline'=>'-7 week',\n\t\t\t\t\t 'matching_end'=>'-7 week'];\n\n\t\t\t\t$placement = ['employer_engagement_end'=>'-9 week', 'self_place_deadline' =>'-7 week','matching_end' =>'-7 week'];\n\t\t\t\tif (!empty($_POST)) {\n\t\t\t\t\tif ($this->input->post('campaign_place_start_date')) {\n\t\t\t\t\t\t$start = new DateTime();\n\t\t\t\t\t\t$start->setTimestamp( strtotime($this->input->post('campaign_start_date')));\n\t\t\t\t\t\t$place_start = new DateTime();\n\t\t\t\t\t\t$place_start->setTimestamp( strtotime($this->input->post('campaign_place_start_date')));\n\t\t\t\t\t\t$place_end = new DateTime();\n\t\t\t\t\t\t$place_end->setTimestamp(strtotime($this->input->post('campaign_place_end_date')));\n\t\t\t\t\t\t$array = [];\n\t\t\t\t\t\t\tforeach ($dates as $k => $day){\n\t\t\t\t\t\t\t\tif(in_array($k,(array_keys($placement)))){\n\t\t\t\t\t\t\t\t\t$array[$k] = date ('d/m/Y',strtotime( $day));\n\t\t\t\t\t\t\t\t}\n else {\n $array[$k] = date('d/m/Y', strtotime( $day));\n }\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\techo json_encode($array, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function tradeoff_date_range($definition)\n {\n return app(Models\\Problem\\Range\\DateRange::class)->setData($definition);\n }", "public function reportsInPeriodScope($dateStart, $dateEnd);", "private function getPostDateRange() {\n \n switch($this->validFilter['postDate']) {\n case 'today' :\n $dateStart = new \\DateTime();\n $dateStart->setTime(0, 0, 1);\n $dateEnd = new \\DateTime();\n $dateEnd->setTime(23, 59, 59);\n break;\n\n case 'yesterday':\n $dateStart = new \\DateTime('yesterday');\n $dateStart->setTime(0, 0, 1);\n $dateEnd = new \\DateTime('yesterday');\n $dateEnd->setTime(23, 59, 59);\n break;\n\n case 'thisWeek':\n $today = new \\DateTime();\n if('Sunday' == $today->format('l')) {\n $dateStart = clone $today;\n $dateStart->modify('Monday last week');\n $dateStart->setTime(0, 0, 1);\n $dateEnd = $today;\n $dateEnd->setTime(23, 59, 59);\n } else {\n $dateStart = clone $today;\n $dateStart->modify('Monday this week');\n $dateStart->setTime(0, 0, 1);\n $dateEnd = clone $today;\n $dateEnd->modify('Sunday this week');\n $dateEnd->setTime(23, 59, 59);\n }\n break;\n\n case 'lastWeek':\n $dateStart = new \\DateTime();\n $dateStart->setTime(0, 0, 1);\n $dateStart->sub(new \\DateInterval('P7D'));\n $dateEnd = new \\DateTime();\n $dateEnd->setTime(23, 59, 59);\n break;\n\n case 'pastMonth':\n $dateStart = new \\DateTime();\n $dateStart->setTime(0, 0, 1);\n $dateStart->sub(new \\DateInterval('P1M'));\n $dateEnd = new \\DateTime();\n $dateEnd->setTime(23, 59, 59);\n break;\n default :\n $dateStart = new \\DateTime($this->validFilter['postDate']);\n $dateStart->setTime(0, 0, 1);\n $dateEnd = new \\DateTime($this->validFilter['postDate']);\n $dateEnd->setTime(23, 59, 59);\n break;\n } // end of switch\n \n return array($dateStart, $dateEnd);\n }", "public function date_range_report()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->data['company_list'] = $this->reports_personnel_schedule_model->company_list();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/date_range_report',$this->data);\n\t}", "public function updateDateRange($date,$range = false){\r\r\n\t\t\t// $range in format array keys - 'd' 'm' 'y'\r\r\n\t\t\tlist($month, $day, $year) = split(\"/\", $date);\r\r\n\t\t\t$month = (int)$month;\r\r\n\t\t\t$day = (int)$day;\r\r\n\t\t\t$year = (int)$year;\r\r\n\t\t\tif(!$range || empty($range) ){\r\r\n\t\t\t\t$range['low'] = array(\r\r\n\t\t\t\t\t'd' => $day,\r\r\n\t\t\t\t\t'm' => $month,\r\r\n\t\t\t\t\t'y' => $year,\r\r\n\t\t\t\t);\r\r\n\t\t\t\t$range['high']= array(\r\r\n\t\t\t\t\t'd' => $day,\r\r\n\t\t\t\t\t'm' => $month,\r\r\n\t\t\t\t\t'y' => $year,\r\r\n\t\t\t\t);\r\r\n\t\t\t}else{\r\r\n\t\t\t\t$l = $range['low'];\r\r\n\t\t\t\t$h = $range['high'];\r\r\n\t\t\t\t$higher = false;\r\r\n\t\t\t\t$lower = false;\r\r\n\r\r\n\t\t\t\t//check higher\r\r\n\t\t\t\tif ($year > $h['y']){\r\r\n\t\t\t\t\t$higher =true;\r\r\n\t\t\t\t}elseif($year == $h['y']){\r\r\n\t\t\t\t\tif($month > $h['m']){\r\r\n\t\t\t\t\t\t$higher = true;\r\r\n\t\t\t\t\t}elseif($month == $h['m']){\r\r\n\t\t\t\t\t\tif($day > $h['d']){\r\r\n\t\t\t\t\t\t\t$higher = true;\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\t\t\t\t//check lower\r\r\n\t\t\t\tif ($year < $l['y']){\r\r\n\t\t\t\t\t$lower =true;\r\r\n\t\t\t\t}elseif($year == $l['y']){\r\r\n\t\t\t\t\tif($month < $l['m']){\r\r\n\t\t\t\t\t\t$lower = true;\r\r\n\t\t\t\t\t}elseif($month == $l['m']){\r\r\n\t\t\t\t\t\tif($day < $l['d']){\r\r\n\t\t\t\t\t\t\t$lower = true;\r\r\n\t\t\t\t\t\t}\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}\r\r\n\r\r\n\t\t\t\tif($higher){\r\r\n\t\t\t\t\t$range['high']= array(\r\r\n\t\t\t\t\t\t'd' => $day,\r\r\n\t\t\t\t\t\t'm' => $month,\r\r\n\t\t\t\t\t\t'y' => $year,\r\r\n\t\t\t\t\t);\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif($lower){\r\r\n\t\t\t\t\t$range['low']= array(\r\r\n\t\t\t\t\t\t'd' => $day,\r\r\n\t\t\t\t\t\t'm' => $month,\r\r\n\t\t\t\t\t\t'y' => $year,\r\r\n\t\t\t\t\t);\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t\treturn $range;\r\r\n\t\t}", "function companydatesupdate(){\n $this->auth(SUPPORT_ADM_LEVEL);\n $contest_id = $this->input->post('contest_id');\n $start = $this->input->post('start');\n $stop = $this->input->post('stop');\n if($this->m_contest->updateContestDates($contest_id, $start, $stop)){\n if($this->m_contest_dates->updateContestDates($contest_id, $stop)){\n $this->companyadmin();\n }\n }else{\n //todo not able to update, show error on admin page\n echo 'error';\n }\n }", "public static function failsafeDateScope($startYmd, $endYmd, $defaultTimestamp)\n {\n $startDate = self::failsafeDate($startYmd, $defaultTimestamp);\n $endDate = self::failsafeDate($endYmd, $defaultTimestamp);\n\n if ($startDate > $endDate) {\n /**\n * End date is earlier, not good, let's fix it.\n */\n $holdDate = $endDate;\n $endDate = $startDate;\n $startDate = $holdDate;\n }\n\n $nDays = $endDate->diffInDays($startDate);\n\n /**\n * Same start and end date means 1 day. Let's adjust.\n */\n $nDays += 1;\n\n return [$startDate, $endDate, $nDays];\n }", "function GetDates(DateRange $startingDates);", "public function reportOvercrowded($start_date,$end_date){\n\n\t\t$mcoData = new Application_Model_DbTable_McoData();\n\t\t$select = $mcoData->select()->setIntegrityCheck(false);\n\t\t$select ->from(array(\"md\" => \"mco_data\"),array('md.line','md.vehicle_number','md.start_hour','vp.name','md.end_hour',\n\t\t\t'gr.gratuity_factor','gr.turnover_factor','gr.research_date',\n\t\t\t'date_exibition' => 'md.start_date',\n\t\t\t'qtd_passenger' => new Zend_Db_Expr('(md.amount_passenger*gr.gratuity_factor)/gr.turnover_factor'),\n\t\t\t'qtd_passenger_way' => new Zend_Db_Expr('CASE WHEN mid_roulette != 0 THEN (((mid_roulette-start_roulette)*gr.gratuity_factor)/gr.turnover_factor) END'),\n\t\t\t'qtd_passenger_back' => new Zend_Db_Expr('CASE WHEN mid_roulette != 0 THEN (((end_roulette-mid_roulette)*gr.gratuity_factor)/gr.turnover_factor) END'),\n\t\t\t'capacity' => new Zend_Db_Expr('(((((vm.width_before_roulette*vm.length_before_roulette)+(vm.width_after_roulette*vm.length_after_roulette))/100)/5)+vm.amount_seats)'),\n\t\t\t'exceed_fp' => new Zend_Db_Expr('IF(((md.amount_passenger*gr.gratuity_factor)/gr.turnover_factor) < (((((vm.width_before_roulette*vm.length_before_roulette)+\n\t\t\t\t(vm.width_after_roulette*vm.length_after_roulette))/100)/5)+vm.amount_seats),0,1)'),\n\t\t\t'exceed_p' => new Zend_Db_Expr('IF(((md.amount_passenger*gr.gratuity_factor)/gr.turnover_factor) < (((((vm.width_before_roulette*vm.length_before_roulette)+\n\t\t\t\t(vm.width_after_roulette*vm.length_after_roulette))/100)/6.5)+vm.amount_seats),0,1)')))\n\t\t->joinInner(array('vh' => 'vehicle_historic'), 'md.vehicle_number=vh.external_number', array())\n\t\t->joinInner(array('vm' => 'vehicle_measures'), 'vm.id=vh.vehicle_id')\n\t\t->joinInner(array('v' => 'vehicle'), 'v.id=vh.vehicle_id')\n\t\t->joinInner(array('vp' => 'vehicle_pattern'), 'v.pattern=vp.id')\n\t\t->joinInner(array('gr' => 'gratuity_turnover'), 'md.line=gr.line')\n\t\t->where('md.start_date >= ?', Application_Model_General::dateToUs($start_date))\n\t\t->where('md.end_date <= ?', Application_Model_General::dateToUs($end_date))\n\t\t->where('substr(md.start_date,1,4) = substr(gr.research_date,1,4)')\n\t\t->where('md.status=1');\n\t\treturn $mcoData->fetchAll($select);\n\t}", "function updateSubscriptionEndDate($subscription_start_date, $timePeriodForService) {\n $subscriptionEndDate = '';\n if ($timePeriodForService == \"1 Month\") {\n $timePeriod = \"1 month\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"3 months\" || $timePeriodForService == \"3 Months\"){ // Added as per discussion with Faizan CCP-5379\n $timePeriod = \"3 months\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"1 Year\" || ($timePeriodForService == '' || $timePeriodForService == null)) {\n $timePeriod = \"365 day\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"2 Years\") {\n $timePeriod = \"730 day\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"3 Years\") {\n $timePeriod = \"1095 day\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n }\n\n return $subscriptionEndDate;\n }", "public function product_sales_supplier_rate($product_id = null, $startdate = null, $enddate = null) {\n\n if ($startdate == null) {\n\n $startdate = date('Y-m-d', strtotime('-30 days'));\n\n }\n\n if ($enddate == null) {\n\n $enddate = date('Y-m-d');\n\n }\n\n $product_id_input = $this->input->post('product_id');\n\n if (!empty($product_id_input)) {\n\n $product_id = $this->input->post('product_id');\n\n $startdate = $this->input->post('from_date');\n\n $enddate = $this->input->post('to_date');\n\n }\n\n\n\n $this->product_id = $product_id;\n\n\n\n $CI = & get_instance();\n\n $this->auth->check_admin_auth();\n\n $CI->load->library('lproduct');\n\n $content = $CI->lproduct->product_sales_supplier_rate($product_id, $startdate, $enddate);\n\n $this->template->full_admin_html_view($content);\n\n }", "function process_target_daily_amount($start,$end,$amount){\n\t$days_diff = cal_days($start, $end);\n\t//Divide the target amount by the set amount\n\t$calculator = $amount/$days_diff;\n\treturn $calculator;\n}", "function erp_check_date_range_in_range_exist( $start_date, $end_date, $user_date_start, $user_date_end ) {\n\n if ( erp_check_date_in_range( $start_date, $end_date, $user_date_start ) ) {\n return true;\n }\n\n if ( erp_check_date_in_range( $start_date, $end_date, $user_date_end ) ) {\n return true;\n }\n\n return false;\n}", "function the_date_range($start_dt,$end_dt, $one_day = false){\r\n\t\r\n\t$duration = $start_dt->diff($end_dt);\r\n\t$start = explode(\" \",$start_dt->format('l F j Y g i a'));\r\n\t$end = explode(\" \",$end_dt->format('l F j Y g i a'));\r\n\t\r\n\t//happening at the same time\r\n\tif($start == $end){\r\n\t\treturn array(\r\n\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\"%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2] //day of month\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\teo_is_all_day() ? 'all day' : time_compact_ap_format($start[4],$start[5],$start[6])\r\n\t\t);\r\n\t}\t\r\n\t//happening on the same day\r\n\telseif($start[2] == $end[2] || ($duration->days < 1 && $duration->h < 24)){\r\n\t\t//Monday, March 4; 9:00 p.m.\r\n\t\treturn array(\r\n\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\"%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2] //day of month\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\teo_is_all_day() ? 'all day' : sprintf(\r\n\t\t\t\t\"%s&ndash;%s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\t //formatted date\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n\t//happening in the same month\r\n\t//check if happening all day; if not, return eo_all_day ? : \r\n\telseif($start[1] == $end[1]){\r\n\t\treturn (eo_is_all_day() || $one_day) ? \r\n\t\tsprintf(\r\n\t\t\t\"%s %s&ndash;%s\",\r\n\t\t\t$start[1], //month\r\n\t\t\t$start[2], //day of month\r\n\t\t\t$end[2]\r\n\t\t)\r\n\t\t: \r\n\t\tarray(\r\n\t\t\t\"date\" => sprintf(\r\n\t\t\t\t\"%s %s&ndash;%s\",\r\n\t\t\t\t$start[1],\r\n\t\t\t\t$start[2],\r\n\t\t\t\t$end[2]\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t\"datetime\" => sprintf(\r\n\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t$start[1],\r\n\t\t\t\t$start[2],\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\t\t\t\t\t\r\n\t\t\t\t),\r\n\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\"time\"\t=>\tsprintf(\r\n\t\t\t\t\"%s&ndash;%s\",\r\n\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t)\r\n\t\t);\r\n\t}\r\n\t//happening in the same year\r\n\telseif($start[3] == $end[3]){\r\n\t\treturn (eo_is_all_day() || $one_day) ?\r\n\t\t\tsprintf(\r\n\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2], //day of month\r\n\t\t\t\t$end[0],\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\r\n\t\t\t)\r\n\t\t\t:\r\n\t\t\tarray(\r\n\t\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s %s&ndash;%s %s\",\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"datetime\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s, %s %s&ndash;%s, %s, %s %s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\t\"time\"\t=>\tsprintf(\"%s&ndash;%s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n\t//just plain happening\r\n\r\n\telse{\r\n\t\treturn (eo_is_all_day() || $one_day) ? \r\n\t\t\tsprintf(\r\n\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\t$start[0], //day of week\r\n\t\t\t\t$start[1], //month\r\n\t\t\t\t$start[2], //day of month\r\n\t\t\t\t$end[0],\r\n\t\t\t\t$end[1],\r\n\t\t\t\t$end[2]\r\n\t\t\t)\r\n\t\t\t:\r\n\t\t\tarray(\r\n\t\t\t\t\"date\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s %s&ndash;%s, %s %s\",\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"datetime\"\t=>\tsprintf(\r\n\t\t\t\t\t\"%s, %s, %s %s&ndash;%s, %s, %s %s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\t$start[0],\r\n\t\t\t\t\t$start[1],\r\n\t\t\t\t\t$start[2],\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6]),\r\n\t\t\t\t\t$end[0],\r\n\t\t\t\t\t$end[1],\r\n\t\t\t\t\t$end[2]\r\n\t\t\t\t),\r\n\t\t\t\t\"duration\"\t=>\t$duration,\r\n\t\t\t\t\"time\"\t=>\tsprintf(\"%s&ndash;%s\",\r\n\t\t\t\t\ttime_compact_ap_format($start[4],$start[5],$start[6]),\r\n\t\t\t\t\ttime_compact_ap_format($end[4],$end[5],$end[6])\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}\r\n}", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$dateRange = \"a.date BETWEEN '$start_date%' AND '$end_date%'\";\n\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,sum(total_price) as total_sale\");\n\t\t$this->db->select('sum(`quantity`*`supplier_rate`) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"(SUM(total_price) - SUM(`quantity`*`supplier_rate`)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function index()\n {\n $user = Auth::user();\n $data['user'] = $user;\n $settings = $user->settings;\n Carbon::setWeekStartsAt(0);\n Carbon::setWeekEndsAt(6);\n\n // TODO: get this from config\n $start_time = '06:30';\n $end_time = '19:30';\n\n $today = new Carbon($this->choose_start);\n $today2 = new Carbon($this->choose_start);\n $today3 = new Carbon($this->choose_start);\n // $today4 = new Carbon($this->choose_start);\n // $today5 = new Carbon($this->choose_start);\n $today6 = new Carbon($this->choose_start);\n\n $data['start'] = $today6->startOfWeek();\n\n $days = array();\n $days_to_add = 7 * ($settings->weeks - 2);\n $end = $today2->startOfWeek()->setDate(\n $today->year,\n $today->month,\n $today->format('d') > 15 ?\n $today3->endOfMonth()->format('d') :\n 15\n )->addDays($days_to_add);\n\n $data['end_of_period'] = $end->copy()->endOfWeek()->format('Y-m-d');\n $data['end'] = $end;\n\n $added_range = false;\n $next_range = array();\n if ((new Carbon)->day >= 13 && (new Carbon)->day <= 15) {\n $added_range = true;\n $next_range['start'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'));\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'))->endOfWeek()->format('Y-m-d');\n } elseif ((new Carbon)->day >= 28 && (new Carbon)->day <= 31) {\n $added_range = true;\n $year = (new Carbon)->year + ((new Carbon)->month == 12?1:0); // Set year as next year if this month is December (12)\n $next_range['start'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15);\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15)->endOfWeek()->format('Y-m-d');\n }\n\n $data['days_a'] = $this->get_days($data);\n $data['days_b'] = $this->get_days($next_range);\n\n $data['days'] = [__('Su'), __('Mo'), __('Tu'), __('We'), __('Th'), __('Fr'), __('Sa')];\n $time_line = [];\n $time = new Carbon($start_time);\n while ($time->format('H:i') <= $end_time) {\n $time_line[] = $time->format('H:i');\n $time->addMinutes(60);\n }\n $data['time_line'] = $time_line;\n\n $user = auth()->user();\n if (isset($user) && isset($user->settings))\n if ($user->settings->is_admin)\n return view('admin.home');\n else\n return view('home', $data);\n }", "function processPartialUpdate(&$viewer) {\n\n global $startDate, $endDate, $viewPortStartDate, $viewPortEndDate;\n\n # Retrieve the overall date range from custom Javascript ChartViewer attributes.\n $startDate = $viewer->getCustomAttr(\"startDate\");\n $endDate = $viewer->getCustomAttr(\"endDate\");\n\n # Now we need to determine the visible date range selected by the user. There are two\n # possibilities. The user may use the zoom/scroll features of the Javascript ChartViewer to\n # select the range, or s/he may use the start date / end date select boxes to select the date\n # range.\n\n if ($viewer->isViewPortChangedEvent()) {\n # Is a view port change event from the Javascript ChartViewer, so we should get the selected\n # date range from the ChartViewer view port settings.\n $duration = $endDate - $startDate;\n $viewPortStartDate = $startDate + (int)(0.5 + $viewer->getViewPortLeft() * $duration);\n $viewPortEndDate = $viewPortStartDate + (int)(0.5 + $viewer->getViewPortWidth() * $duration)\n ;\n } else {\n # The user has changed the selected range by using the start date / end date select boxes.\n # We need to retrieve the selected dates from those boxes. For partial updates, the select\n # box values are sent in as Javascript ChartViewer custom attributes.\n $startYear = (int)($viewer->getCustomAttr(\"StartYear\"));\n $startMonth = (int)($viewer->getCustomAttr(\"StartMonth\"));\n $startDay = (int)($viewer->getCustomAttr(\"StartDay\"));\n $endYear = (int)($viewer->getCustomAttr(\"EndYear\"));\n $endMonth = (int)($viewer->getCustomAttr(\"EndMonth\"));\n $endDay = (int)($viewer->getCustomAttr(\"EndDay\"));\n\n # Note that for browsers that do not support Javascript, there is no validation on the\n # client side. So it is possible for the day to exceed the valid range for a month (eg. Nov\n # 31, but Nov only has 30 days). So we set the date by adding the days difference to the 1\n # day of a month. For example, Nov 31 will be treated as Nov 1 + 30 days = Dec 1.\n $viewPortStartDate = chartTime($startYear, $startMonth, 1) + ($startDay - 1) * 86400;\n $viewPortEndDate = chartTime($endYear, $endMonth, 1) + ($endDay - 1) * 86400;\n }\n\n # Draw the chart\n drawChart($viewer);\n\n #\n # We need to communicate the new start date / end date back to the select boxes on the browser\n # side.\n #\n\n # The getChartYMD function retrives the date as an 8 digit decimal number yyyymmdd.\n $startYMD = getChartYMD($viewPortStartDate);\n $endYMD = getChartYMD($viewPortEndDate);\n\n # Send year, month, day components to the start date / end date select boxes through Javascript\n # ChartViewer custom attributes.\n $viewer->setCustomAttr(\"StartYear\", (int)($startYMD / 10000));\n $viewer->setCustomAttr(\"StartMonth\", (int)($startYMD / 100) % 100);\n $viewer->setCustomAttr(\"StartDay\", $startYMD % 100);\n $viewer->setCustomAttr(\"EndYear\", (int)($endYMD / 10000));\n $viewer->setCustomAttr(\"EndMonth\", (int)($endYMD / 100) % 100);\n $viewer->setCustomAttr(\"EndDay\", $endYMD % 100);\n}", "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}", "public function GetByDate($initialDate, $endDate);", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n\t\t$this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"CAST(SUM(total_price) - SUM(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function f_get_dateWise_vendorPay_record($startDt, $endDt)\n {\n\n $sql = $this->db->query(\" SELECT a.trans_dt, b.district_name, a.order_no, c.order_dt, a.bill_no, d.del_dt, a.price,\n a.cgst, a.sgst, a.amount, a.vendor \n FROM td_dm_vendorPayment a, md_district b, td_dm_work_order c, td_dm_delivery d\n WHERE a.dist_cd = b.district_code AND a.order_no = c.order_no AND a.dist_cd = c.dist_cd\n AND a.order_no = d.order_no AND a.dist_cd = d.dist_cd AND a.bill_no = d.bill_no\n AND a.trans_dt >= '$startDt' AND a.trans_dt <= '$endDt' \");\n return $sql->result();\n }", "public static function adjust_wp_query_vars( &$query ) {\n $qv = wp_parse_args( $query->query_vars, array( 'start_date_after' => '', 'start_date_before' => '' ) );\n // if either the start or end date is present, then ...\n if ( ! empty( $qv['start_date_after'] ) || ! empty( $qv['start_date_before'] ) ) {\n $query->query_vars['meta_query'] = isset( $query->query_vars['meta_query'] ) && is_array( $query->query_vars['meta_query'] ) ? $query->query_vars['meta_query'] : array( 'relation' => 'OR' );\n\n // if both the start and end dates are present, then add a meta query for between\n if ( ! empty( $qv['start_date_after'] ) && ! empty( $qv['start_date_before'] ) ) {\n $query->query_vars['meta_query'][] = array( 'key' => '_start', 'value' => array( $qv['start_date_after'], $qv['start_date_before'] ), 'compare' => 'BETWEEN', 'type' => 'DATETIME' );\n // otherwise, if only the start date is present, then add a rule for that\n } else if ( ! empty( $qv['start_date_after'] ) ) {\n $query->query_vars['meta_query'][] = array( 'key' => '_start', 'value' => $qv['start_date_after'], 'compare' => '>=', 'type' => 'DATETIME' );\n // otherwise, only the end rule can be present, so add a rule for that\n } else {\n $query->query_vars['meta_query'][] = array( 'key' => '_start', 'value' => $qv['start_date_before'], 'compare' => '<=', 'type' => 'DATETIME' );\n }\n }\n }", "public static function calculateEffectiveAmendmentValues($rowData)\n {\n // These are already sorted by ascending source_fiscal\n\n foreach ($rowData as $row) {\n // Fix for situations where the end year is earlier than the start year\n // use whichever is later of the start year or the source year (when it was published).\n if ($row->gen_end_year < $row->gen_start_year) {\n $row->gen_end_year = $row->gen_start_year;\n if ($row->source_year > $row->gen_end_year) {\n $row->gen_end_year = $row->source_year;\n }\n }\n }\n\n // We're using Collection methods here, which are great:\n // https://laravel.com/docs/5.6/collections\n\n // Step 1: find the earliest and latest years of the contract\n $earliestYear = $rowData->min('gen_start_year');\n\n // Update: rather than the maximum end year, it should actually be the end year of the *last* row in the (ordered by source_fiscal) array of amendments.\n // In some cases, the contract gets *shortened* from what was originally planned.\n // $latestYear = $rowData->max('gen_end_year');\n $latestYear = $rowData->last()->gen_end_year;\n\n // Edge cases where the end year is earlier than the start year, use the last one's start year instead:\n if ($rowData->last()->gen_start_year > $rowData->last()->gen_end_year) {\n $latestYear = $rowData->last()->gen_start_year;\n }\n\n $originalValue = $rowData->min('original_value');\n if (! $originalValue) {\n $originalValue = $rowData->min('contract_value');\n }\n\n // Step 2: create an array range of each year in this set, and then match each year with the most updated amendment row ID\n\n $years = range($earliestYear, $latestYear);\n $yearMapping = [];\n\n $firstRow = 1;\n $genAmendmentGroupId = null;\n\n foreach ($rowData as $row) {\n // Store this for error tracking later (it's the same for all rows in rowData)\n if (! $genAmendmentGroupId) {\n $genAmendmentGroupId = $row->gen_amendment_group_id;\n }\n\n foreach ($years as $year) {\n if ($firstRow) {\n // Use the start_year since this is the beginning\n // even if the source_year is later (if it was retroactively published)\n if ($row->gen_start_year <= $year && $row->gen_end_year >= $year) {\n $yearMapping[$year] = $row->id;\n }\n } else {\n // Use the source_year instead of the start_year\n if ($row->source_year <= $year && $row->gen_end_year >= $year) {\n $yearMapping[$year] = $row->id;\n }\n }\n }\n\n $firstRow = 0;\n }\n\n // dd($yearMapping);\n // var_dump($yearMapping);\n // array:3 [\n // 2010 => 1251303\n // 2011 => 1250608\n // 2012 => 1250608\n // ]\n\n // Step 3: loop through rows again and set effective start and end years\n $cumulativeTotal = 0;\n $firstRow = 1;\n $rowIdsToUpdate = [];\n\n foreach ($rowData as $row) {\n $effectiveStartYear = null;\n $effectiveEndYear = null;\n\n foreach ($yearMapping as $year => $rowId) {\n if ($rowId == $row->id) {\n // If they match, update the effective start and end years\n // echo \"Match: \" . $row->id . \" for \" . $year . \"\\n\";\n if ($effectiveStartYear == null || $year < $effectiveStartYear) {\n $effectiveStartYear = $year;\n }\n if ($effectiveEndYear == null || $year > $effectiveEndYear) {\n $effectiveEndYear = $year;\n }\n } else {\n // echo \"No match for: \" . $row->id . \" for \" . $year . \"\\n\";\n }\n }\n\n if ($effectiveStartYear == null || $effectiveEndYear == null) {\n // If this row ID isn't in the yearMapping array, skip to the next row.\n // echo \"Skipping... \\n\";\n continue;\n }\n\n $rowIdsToUpdate[] = $row->id;\n // echo \"here for \" . $row->id . \"\\n\";\n\n $row->gen_effective_start_year = $effectiveStartYear;\n $row->gen_effective_end_year = $effectiveEndYear;\n\n // Effective total value is, the theoretical yearly value of the contract over the originally planned start and end years\n if ($firstRow) {\n $theoreticalYearlyValue = $row->contract_value / ($row->gen_end_year - $row->gen_start_year + 1);\n } else {\n // Update 2021-04-03: Subtract the cumulative total from the latest contract value here, before averaging across the years between the row's end year and source year\n $theoreticalYearlyValue = ($row->contract_value - $cumulativeTotal) / ($row->gen_end_year - $row->source_year + 1);\n }\n \n\n // dd($effectiveEndYear);\n\n $row->gen_effective_total_value = $theoreticalYearlyValue * ($effectiveEndYear - $effectiveStartYear + 1);\n $row->gen_effective_yearly_value = $row->gen_effective_total_value / ($effectiveEndYear - $effectiveStartYear + 1);\n\n $cumulativeTotal += $row->gen_effective_total_value;\n\n $firstRow = 0;\n }\n\n $updatesSaved = 0;\n // Update the rows in the database:\n foreach ($rowData as $index => $row) {\n $isFinalValue = 0;\n if ($index == count($rowData) - 1) {\n $isFinalValue = 1;\n }\n \n\n // Make sure there are actually changes\n if (in_array($row->id, $rowIdsToUpdate)) {\n DB::table('l_contracts')\n ->where('owner_acronym', '=', $row->owner_acronym)\n ->where('id', '=', $row->id)\n ->update([\n 'gen_effective_start_year' => $row->gen_effective_start_year,\n 'gen_effective_end_year' => $row->gen_effective_end_year,\n 'gen_effective_total_value' => $row->gen_effective_total_value,\n 'gen_effective_yearly_value' => $row->gen_effective_yearly_value,\n 'gen_original_value' => $originalValue,\n 'gen_is_most_recent_value' => $isFinalValue,\n ]);\n $updatesSaved = 1;\n // echo \"Updated \" . $row->id . \"\\n\";\n } else {\n // Update the effective total and yearly values, but not the start and end years\n // these are amendments that were overridden by other amendments in the same year.\n DB::table('l_contracts')\n ->where('owner_acronym', '=', $row->owner_acronym)\n ->where('id', '=', $row->id)\n ->update([\n 'gen_effective_total_value' => 0,\n 'gen_effective_yearly_value' => 0,\n ]);\n }\n }\n\n if ($updatesSaved) {\n return true;\n } else {\n echo \"No updates for gen_amendment_group_id \" . $genAmendmentGroupId . \"\\n\";\n return false;\n }\n }", "function getMinMaxForRange($date_start, $date_end) {\n $query = \"SELECT MIN(price) AS minPrice,\n MAX(price) AS maxPrice\n FROM np_data\n WHERE (\n (date BETWEEN '$date_start' AND '$date_end' AND hour != '23')\n OR (date = ($date_start - INTERVAL 1 DAY) AND hour = '23')\n )\";\n if ($result = $this->link->query($query)) {\n /* free result set */\n $row = mysqli_fetch_array($result);\n $result->close();\n $resultArray = array (\n 'min' => $row['minPrice'],\n 'max' => $row['maxPrice']\n );\n return $resultArray;\n }\n }" ]
[ "0.6150124", "0.59819543", "0.5791453", "0.5664614", "0.5641868", "0.56283253", "0.5618191", "0.5590121", "0.5572517", "0.5487203", "0.5468227", "0.5459763", "0.5415616", "0.5408487", "0.5376051", "0.5360661", "0.5350439", "0.5348368", "0.5345787", "0.5341591", "0.5326292", "0.5317333", "0.531609", "0.530172", "0.5291799", "0.5285474", "0.52645504", "0.5261106", "0.52584845", "0.5252033" ]
0.60936487
1
/ Returning the unallocated client payment for a specific client in a given date range if no date range given end date is a current date and start date is the default date according to our logic(getDefaultStartDate function)
function getClientUnAllocatePay($clientId, $startDate = '', $endDate = '', $payerId = '0') { $clientUnAllocPay = 0; if($clientId > 0) { $fromDate = $startDate; $toDate = $endDate; $sqlGetPay = "SELECT SUM(totalAmountRem) AS amtRem FROM clientpayment WHERE clientID = '$clientId' AND isDeleted = 0"; if($payerId != '0' && $payerId != '') { $sqlGetPay .= " AND clientcontact_id = '$payerId' "; } if($fromDate != '') { $sqlGetPay .= " AND paymentDate >= '$fromDate' "; } if($toDate != '') { $sqlGetPay .= " AND paymentDate <= '$toDate'"; } $resGetPay= DB::do_query($sqlGetPay); if(DB::db_fetch_num_rows($resGetPay) > 0) { $rowGetPay = DB::db_fetch_assoc($resGetPay); $clientUnAllocPay = $rowGetPay['amtRem']; } } return $clientUnAllocPay; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getClientAdj($clientId, $startDate = '', $endDate = '') {\n\t\n\t\t$clientAdj = 0;\n\t\t\n\t\tif($clientId > 0) {\n\t\t\t\n\t\t\t$fromDate = $startDate;\n\t\t\t$toDate = $endDate;\n\t\t\t\n\t\t\t$sqlGetAdj = \"SELECT SUM(amount) AS adjAmt\n\t\t\t\t\t\tFROM clientadjustment\n\t\t\t\t\t\tWHERE client_id = '$clientId'\n\t\t\t\t\t\tAND status = 1\";\n\t\t\t\t\t\t\t\t\n\t\t\tif($fromDate != '') {\n\t\t\t\t$sqlGetAdj .= \" AND added_date >= '$fromDate 00:00:00' \";\n\t\t\t}\n\t\t\tif($toDate != '') {\n\t\t\t\t$sqlGetAdj .= \" AND added_date < '$toDate'\";\n\t\t\t}\n\t\t\t\n\t\t\t$resGetAdj = DB::do_query($sqlGetAdj);\n\t\t\t\n\t\t\tif(DB::db_fetch_num_rows($resGetAdj) > 0) {\n\t\t\t\n\t\t\t\t$rowGetAdj = DB::db_fetch_assoc($resGetAdj);\n\t\t\t\t$clientAdj = $rowGetAdj['adjAmt'];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $clientAdj;\n\t}", "function kv_get_recurrent_invoices($date = null)\n{\n // last_sent stores end date of last generated invoice _plus_ 1 (or is empty)\n if ($date) {\n $date = date2sql($date);\n // we can issue invoice after or at last day of covered period\n $sql = \"SELECT *, DATE_ADD(DATE_ADD(IF(`last_sent`='0000-00-00', `begin`, `last_sent`), INTERVAL `monthly` MONTH), INTERVAL `days` DAY) <= '$date'\n AND last_sent < DATE_ADD(`end`, INTERVAL 1 DAY) as overdue\";\n } else\n $sql = \"SELECT * \";\n\n $sql .= \" FROM \" . TB_PREF . \"recurrent_invoices ORDER BY description, group_no, debtor_no\";\n\n return db_query($sql, \"could not get recurrent invoices\");\n}", "function getClientBal($clientId, $providerId, $startDate = '', $endDate = '', $runSesId = '', $incStratup='0', $payerId='') {\n\n\t\t$clientBalInfo = array();\n\t\t$isShowNA = 1;\n\t\ttry {\n\t\t\n\t\t\tif($clientId > 0) {\n\t\t\t\t\n\t\t\t\t$fromDate = $startDate;\n\t\t\t\t$toDate = $endDate;\n\t\t\t\t\n\t\t\t\t$clientBal = 0;\n\t\t\t\t$estimationCopay = $procCopayArray = $clientBalCalMethod = array();\n\n\t\t\t\t$balMethod = new GetBalMethod();\n\t\t\t\n\t\t\t\t$sqlGetSes = \"SELECT cs.id, cs.sessionDate, cs.fee, cs.adj_fee, cs.other_ins_adj, cs.amt_paid, cs.out_of_network_ins_type,\n\t\t\t\t\t\tcs.procedureID, cs.pending_personinsurance_id, pp.code\n\t\t\t\t\t\tFROM clientsession AS cs \n\t\t\t\t\t\tLEFT JOIN providerprocedure AS pp ON cs.procedureID = pp.id\n\t\t\t\t\t\tWHERE cs.clientID = '$clientId'\n\t\t\t\t\t\tAND cs.sessionStatus = 1\";\n\t\t\t\tif($runSesId != '') {\n\t\t\t\t\t$sqlGetSes .= \" AND cs.id='$runSesId'\";\n\t\t\t\t}\n\t\t\t\tif($payerId != '' && $payerId != '0') {\n\t\t\t\t\t$sqlGetSes .= \" AND cs.clientcontact_id= '$payerId'\";\t\n\t\t\t\t}\n\t\t\t\tif($fromDate != '') {\n\t\t\t\t\t$sqlGetSes .= \" AND cs.sessionDate >= '$fromDate' \";\n\t\t\t\t}\n\t\t\t\tif($toDate != '') {\n\t\t\t\t\t$sqlGetSes .= \" AND cs.sessionDate <= '$toDate'\";\n\t\t\t\t}\n\n\t\t\t\t$sqlGetSes .= \" order by sessionDate\";\t\n\t\t\t\t$i = 0;\n\t\t\t\t\n\t\t\t\t$resGetSes = DB::do_query($sqlGetSes);\n\t\t\t\t\n\t\t\t\tif(DB::db_fetch_num_rows($resGetSes)) {\n\t\t\t\t\n\t\t\t\t\twhile($rowGetSes = DB :: db_fetch_array($resGetSes )) {\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t$sesId = $rowGetSes['id'];\n\t\t\t\t\t\t$sesDate = $rowGetSes['sessionDate'];\n\t\t\t\t\t\t$sesProc = $rowGetSes['code'];\n\t\t\t\t\t\t$sesFee = $rowGetSes['fee'];\n\t\t\t\t\t\t$sesAdjFee = $rowGetSes['adj_fee'];\n\t\t\t\t\t\t$sesOthInsAdj = $rowGetSes['other_ins_adj'];\n\t\t\t\t\t\t$sesInsPay = $rowGetSes['amt_paid'];\n\t\t\t\t\t\t$pendingInsId = $rowGetSes['pending_personinsurance_id'];\n\t\t\t\t\t\t$ONNType = $rowGetSes['out_of_network_ins_type'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t//getting the client payment done for each session\n\t\t\t\t\t\t$sqlCPay = \"SELECT SUM(cpa.amt_paid) AS client_amt_paid, SUM(cpa.amt_write_off) AS amt_write_off \n\t\t\t\t\t\t\t\t\tFROM clientpaymentallocation AS cpa\n\t\t\t\t\t\t\t\t\tWHERE cpa.session_id = '$sesId'\n\t\t\t\t\t\t\t\t\tAND cpa.is_erased = 0 \n\t\t\t\t\t\t\t\t\tGROUP BY cpa.session_id\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$resCPay = DB::do_query($sqlCPay);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$clientPayArray = array();\t\t\n\t\t\t\t\t\t$j = 0;\n\t\t\t\t\t\t$sesCPay = 0;\n\t\t\t\t\t\t$sesCAmtWrtOff = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//if client has payments allocated to its sessions\n\t\t\t\t\t\tif(DB::db_fetch_num_rows($resCPay)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$rowCPay = DB::db_fetch_assoc($resCPay);\n\t\t\t\t\t\t\t$sesCPay = $rowCPay['client_amt_paid'];\n\t\t\t\t\t\t\t$sesCAmtWrtOff = $rowCPay['amt_write_off'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sesBal = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//if pending to client or Out of network type insurance, then we need to assign the full remaining amount to client\n\t\t\t\t\t\tif($pendingInsId == 0 || $ONNType) {\n\t\t\t\t\t\t\t$sesBal = $sesAdjFee - ($sesOthInsAdj + $sesInsPay + $sesCPay + $sesCAmtWrtOff);\n\t\t\t\t\t\t\t$isShowNA = 0;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$clientBalCalMethod = $balMethod->checkClientBalCalcMethodToUse(strtotime($sesDate), $clientId, $providerId, $sesProc);\n\t\t\t\t\t\t\t$coPayAmt = 0;\n\t\t\t\t\t\t\tif(count($clientBalCalMethod) && $clientBalCalMethod['method'] == 2) {\n\n\t\t\t\t\t\t\t\tif(array_key_exists($sesProc, $clientBalCalMethod['copay'])) {\n\t\t\t\t\t\t\t\t\t$coPayAmt = $clientBalCalMethod['copay'][$sesProc];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$coPayAmt = $balMethod->getFirstCopayUcrAmount($clientBalCalMethod['balCustId'], $sesProc, 1);\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$estimationCopay[$sesProc] = $sesFee;\n\t\t\t\t\t\t\t\tif($coPayAmt >= $sesFee) {\n\t\t\t\t\t\t\t\t\t$coPayAmt = $sesFee;\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$sesBal = $coPayAmt - ($sesCPay + $sesCAmtWrtOff);\n\t\t\t\t\t\t\t\t$isShowNA = 0;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$isShowNA *= 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$clientBal += $sesBal;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// getting the start up bal and adding it to client bal\n\t\t\tif($runSesId == '') {\n\n\t\t\t\t$startUpBal = 0;\n\t\t\t\t//@$incStratup = 0 we need to add startup balance @$incStratup=1 not to add startup\n\t\t\t\tif($incStratup == '0') {\n\t\t\t\t\t$startUpBal = $this->getClientStartUpBal($clientId);\t\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\t$clientBal += $startUpBal;\n\t\t\t\t$clientAdjFee = $this->getClientAdj($clientId, $fromDate, $toDate, 0);\n\t\t\t\t\n\t\t\t\t$clientUnAllocatedPayment = $this->getClientUnAllocatePay($clientId, $fromDate, $toDate, $payerId);\n\n\t\t\t\t// adding client adjustment and substrcting the unallocated client payment\n\t\t\t\t$clientBal += $clientAdjFee - $clientUnAllocatedPayment;\n\t\t\t\tif($isShowNA == 1) {\n\t\t\t\t\tif($startUpBal > 0 || $clientAdjFee > 0 || $clientUnAllocatedPayment > 0 || $clientBal > 0) {\n\t\t\t\t\t\t$isShowNA = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$finePrintText = '';\n\t\t\t$estimatedFlag = 0;\n\n\t\t\tif(count($estimationCopay)) {\n\t\t\t\t\n\t\t\t\t$finePrintText = \"* Based on an estimated copay of \";\n\t\t\t\t$count = 0;\n\t\t\t\t\n\t\t\t\tforeach($estimationCopay as $key=>$val) {\n\t\t\t\t\t\n\t\t\t\t\tif($count) {\n\t\t\t\t\t\t$finePrintText .= ' and ';\n\t\t\t\t\t}\n\t\t\t\t\t$finePrintText .= '$'.number_format($val, 2).\" for $key\";\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\t$estimatedFlag = 1;\n\t\t\t}\t\n\t\t\t\n\t\t\t$clientBalInfo[] = round($clientBal, 2);\n\t\t\t$clientBalInfo[] = $finePrintText;\n\t\t\t$clientBalInfo[] = $estimatedFlag;\n\t\t\t$clientBalInfo[] = $isShowNA ;\n\t\t\n\t\t}catch(Exception $e) {\n\t\t\tAPP::logErrors($e);\n\t\t}\n\t\t\n\t\treturn $clientBalInfo;\n\t}", "public function f_get_dateWise_vendorPay_record($startDt, $endDt)\n {\n\n $sql = $this->db->query(\" SELECT a.trans_dt, b.district_name, a.order_no, c.order_dt, a.bill_no, d.del_dt, a.price,\n a.cgst, a.sgst, a.amount, a.vendor \n FROM td_dm_vendorPayment a, md_district b, td_dm_work_order c, td_dm_delivery d\n WHERE a.dist_cd = b.district_code AND a.order_no = c.order_no AND a.dist_cd = c.dist_cd\n AND a.order_no = d.order_no AND a.dist_cd = d.dist_cd AND a.bill_no = d.bill_no\n AND a.trans_dt >= '$startDt' AND a.trans_dt <= '$endDt' \");\n return $sql->result();\n }", "public function f_get_dateWise_billPay_record($startDt, $endDt)\n {\n\n // $sql = $this->db->query(\" SELECT a.trans_dt, a.order_no, c.order_dt, b.district_name,\n // a.sdo_memo, a.bill_no, d.del_dt, a.part, a.amount \n // FROM td_dm_bill_payment a, md_district b, td_dm_work_order c, td_dm_delivery d\n // WHERE a.dist_cd = b.district_code AND a.order_no = c.order_no AND a.dist_cd = c.dist_cd\n // AND a.order_no = d.order_no AND a.dist_cd = d.dist_cd AND a.sdo_memo = d.sdo_memo\n // AND a.bill_no = d.bill_no \n // AND a.trans_dt >= '$startDt' AND a.trans_dt <= '$endDt' \");\n\n $sql = $this->db->query(\" SELECT a.mr_no, a.memo_no, a.cr_dt, a.tot_credited, a.commission, a.less, a.tot_payable, b.vendor_name \n FROM td_dm_paymentdtls a, md_sw_vendor b \n WHERE a.vendor = b.sl_no \n AND a.cr_dt >= '$startDt' AND a.cr_dt <= '$endDt' ORDER BY a.cr_dt \");\n\n return $sql->result();\n\n }", "public function findByUserIdAndChargeDates($user_id, $start_date = null, $end_date = null) {\n if ($start_date === null) {\n $start_date = self::MIN_CHARGE_DATE;\n }\n if ($end_date === null) {\n $end_date = self::MAX_CHARGE_DATE;\n }\n $params = [\n \":user_id\" => $user_id,\n \":start_date\" => $start_date,\n \":end_date\" => $end_date,\n ];\n return $this->doManagedQuery(\"findByUserIdAndChargeDates\", $params);\n }", "function getDefaultStartDate($clientId) {\n\t\t\n\t\treturn $this->getClientAddDate($clientId);\n\t}", "public function getActualTotalValues($clientId, $start, $end)\r\n {\r\n /*\r\n WHEN payment_type in (3,6) THEN sum(amount) as payment_sent,\r\n WHEN payment_type in (7) THEN sum(amount) as credit_note_received,\r\n WHEN payment_type in (8) THEN sum(amount) as credit_note_sent,\r\n WHEN payment_type in (9) THEN sum(amount) as ingress_reset,\r\n WHEN payment_type in (11) THEN sum(amount) as debit_note_received,\r\n WHEN payment_type in (12) THEN sum(amount) as debit_note_sent\r\n */\r\n\r\n $sql = <<<SQL\r\nSELECT\r\n(CASE WHEN payment_type in (4,5) THEN sum(amount) END) as payment_received,\r\n(CASE WHEN payment_type in (3,6) THEN sum(amount) END) as payment_sent,\r\n(CASE WHEN payment_type in (7) THEN sum(amount) END) as credit_note_received,\r\n(CASE WHEN payment_type in (8) THEN sum(amount) END) as credit_note_sent,\r\n(CASE WHEN payment_type in (9) THEN sum(amount) END) as ingress_reset,\r\n(CASE WHEN payment_type in (11) THEN sum(amount) END) as debit_note_received,\r\n(CASE WHEN payment_type in (12) THEN sum(amount) END) as debit_note_sent\r\nFROM client_payment\r\nWHERE client_id = {$clientId} AND payment_time BETWEEN '{$start}' AND '{$end}'\r\nGROUP BY payment_type\r\nSQL;\r\n $result = $this->query($sql);\r\n\r\n $startDate = date('Y-m-d', strtotime($start));\r\n $endDate = date('Y-m-d', strtotime($end));\r\n $dateArr = $this->_app_get_date_result_admin($startDate, $endDate, 'cdr_report_detail2%');\r\n $firstSql = '';\r\n $secondSql = '';\r\n\r\n foreach ($dateArr as $value) {\r\n $tableDate = \"cdr_report_detail\" . $value;\r\n $union = \"\";\r\n\r\n if (!empty($firstSql)) {\r\n $union = \" union all \";\r\n }\r\n $firstSql .= \" {$union} SELECT\r\nsum(egress_call_cost) as egress_call_cost\r\nfrom {$tableDate}\r\nwhere report_time between '{$start}' and '{$end}' and egress_client_id = {$clientId}\r\n\";\r\n $secondSql .= \" {$union} SELECT\r\nsum(ingress_call_cost) as ingress_call_cost\r\nfrom {$tableDate}\r\nwhere report_time between '{$start}' and '{$end}' and ingress_client_id = {$clientId}\r\n\";\r\n }\r\n\r\n $sql = <<<SQL\r\nSELECT\r\nsum(egress_call_cost) as egress_call_cost\r\nFROM ({$firstSql}) as t1\r\nSQL;\r\n $res = $this->query($sql);\r\n\r\n if ($res) {\r\n $result[0][0]['egress_call_cost'] = $res[0][0]['egress_call_cost'];\r\n }\r\n $sql = <<<SQL\r\nSELECT\r\nsum(ingress_call_cost) as ingress_call_cost\r\nFROM ({$secondSql}) as t1\r\nSQL;\r\n $res = $this->query($sql);\r\n\r\n if ($res) {\r\n $result[0][0]['ingress_call_cost'] = $res[0][0]['ingress_call_cost'];\r\n }\r\n\r\n return $result;\r\n }", "function getClientStartUpBal($clientId) {\n\t\n\t\t$startUpBal = 0;\n\t\t$startUpBalAlloc = 0;\n\t\t\n\t\tif($clientId > 0) {\n\t\t\n\t\t\t//getting the startup balance for client while client added in our system\n\t\t\t$sqlGetStartUpBal = \"SELECT startupBalance FROM person WHERE id='$clientId'\";\n\t\t\t$resGetStartUpBal = DB::do_query($sqlGetStartUpBal);\n\t\t\t\n\t\t\tif($resGetStartUpBal) {\n\t\t\t\t\n\t\t\t\t$rowGetStartUpBal = DB :: db_fetch_array($resGetStartUpBal);\n\t\t\t\t\n\t\t\t\t$startUpBal = $rowGetStartUpBal['startupBalance'];\n\t\t\t\t\n\t\t\t\t//getting allocation done for this client towards start up balance\n\t\t\t\t$sqlStartBal = \"SELECT csb.amt_paid\n\t\t\t\t\t\t\tFROM clientstartupbalallocation AS csb\n\t\t\t\t\t\t\tWHERE csb.client_id = $clientId\n\t\t\t\t\t\t\tAND is_erased = 0\n\t\t\t\t\t\t\tORDER BY csb.id ASC\";\n\t\t\t\t\t\t\t\n\t\t\t\t$resStartBal = DB::do_query($sqlStartBal);\n\t\t\t\t\n\t\t\t\tif($resStartBal && (DB::db_fetch_num_rows($resStartBal) > 0)) {\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tWhile($rowStartBal = DB :: db_fetch_array($resStartBal)) {\n\t\t\t\t\t\n\t\t\t\t\t\t$startUpBalAlloc += $rowStartBal['amt_paid'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$startUpBal -= $startUpBalAlloc;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $startUpBal;\n\t}", "public static function getStatisticForClients($start, $end)\n {\n $incomeStats = Invoice::find_by_sql(\"SELECT \n company_id as `company_id`, \n SUM(`sum`) AS summary\n FROM\n ((SELECT \n company_id as `company_id`, \n SUM(`sum`) AS `sum`\n FROM\n invoices\n WHERE\n `status` = 'Paid'\n AND \n `estimate` != 1\n AND \n paid_date BETWEEN '$start' AND '$end'\n GROUP BY \n company_id\n ) \n UNION ALL (SELECT \n T4.company_id as `company_id`, \n SUM(T3.`amount`) AS `sum`\n FROM\n invoice_has_payments AS T3\n LEFT JOIN\n invoices AS T4\n ON \n T3.invoice_id = T4.id \n WHERE \n T4.`status` = 'PartiallyPaid' \n AND \n `estimate` != 1\n AND \n T3.`date` BETWEEN '$start' AND '$end' \n GROUP BY \n T4.company_id\n ) )t1 \n GROUP BY \n company_id\n \");\n\n return $incomeStats;\n }", "public function findTotalChargesPerPersonByUserIdForChargeDates($start_date = null, $end_date = null) {\n if ($start_date === null) {\n $start_date = self::MIN_CHARGE_DATE;\n }\n if ($end_date === null) {\n $end_date = self::MAX_CHARGE_DATE;\n }\n $params = [\n \":start_date\" => $start_date,\n \":end_date\" => $end_date,\n ];\n $charges = $this->doManagedQuery(\"findTotalChargesByUserIdForChargeDates\", $params);\n $total_charges_by_user_id = [];\n foreach ($charges as $user_info) {\n $user_id = $user_info[\"user_id\"];\n if ($user_id == 107) {\n $total_charges = $user_info[\"total_charges\"] / 2; // Jamie and Elara\n } else {\n $total_charges = $user_info[\"total_charges\"];\n }\n $total_charges_by_user_id[$user_id] = $total_charges;\n }\n return $total_charges_by_user_id;\n }", "public function getfullavailability($nonavailable_dates=array(), \\DateTime $startDate, \\DateTime $endDate) {\n\n // Add one to the end\n // $endDate->add(new \\DateInterval('P1D'));\n\n $available_dates = array();\n\n $periodInterval = new \\DateInterval('P1D');\n $period = new \\DatePeriod( $startDate, $periodInterval, $endDate );\n\n foreach ($period as $date ) {\n $available_dates[] = array(\n 'date' => $date->format('Y-m-d'),\n 'available' => 1,\n 'property_id' => $this->property_id,\n );\n }\n\n foreach ($available_dates as $k => $availabledate) {\n\n if ( count ( $nonavailable_dates ) > 0 ) {\n foreach ($nonavailable_dates as $nonavailabledate) {\n if ( $nonavailabledate['date'] == $availabledate['date'] ) {\n // unset non available days\n unset($available_dates[$k]);\n }\n }\n }\n }\n\n\n $available_dates = array_merge( $available_dates, $nonavailable_dates);\n\n // Sort by date\n uasort( $available_dates, function ($a, $b) {\n if ($a['date'] == $b['date']) {\n return 0;\n }\n return ($a['date'] < $b['date']) ? -1 : 1;\n });\n\n return $available_dates;\n }", "public function getBalanceReport(Carbon $start, Carbon $end, $shared)\n {\n $repository = App::make('FireflyIII\\Repositories\\Budget\\BudgetRepositoryInterface');\n $tagRepository = App::make('FireflyIII\\Repositories\\Tag\\TagRepositoryInterface');\n $balance = new Balance;\n\n // build a balance header:\n $header = new BalanceHeader;\n\n $accounts = $this->query->getAllAccounts($start, $end, $shared);\n $budgets = $repository->getBudgets();\n foreach ($accounts as $account) {\n $header->addAccount($account);\n }\n\n /** @var BudgetModel $budget */\n foreach ($budgets as $budget) {\n $line = new BalanceLine;\n $line->setBudget($budget);\n\n // get budget amount for current period:\n $rep = $repository->getCurrentRepetition($budget, $start);\n $line->setRepetition($rep);\n\n // loop accounts:\n foreach ($accounts as $account) {\n $balanceEntry = new BalanceEntry;\n $balanceEntry->setAccount($account);\n\n // get spent:\n $spent = $this->query->spentInBudgetCorrected($account, $budget, $start, $end); // I think shared is irrelevant.\n\n $balanceEntry->setSpent($spent);\n $line->addBalanceEntry($balanceEntry);\n }\n // add line to balance:\n $balance->addBalanceLine($line);\n }\n\n // then a new line for without budget.\n // and one for the tags:\n $empty = new BalanceLine;\n $tags = new BalanceLine;\n $diffLine = new BalanceLine;\n\n $tags->setRole(BalanceLine::ROLE_TAGROLE);\n $diffLine->setRole(BalanceLine::ROLE_DIFFROLE);\n\n foreach ($accounts as $account) {\n $spent = $this->query->spentNoBudget($account, $start, $end);\n $left = $tagRepository->coveredByBalancingActs($account, $start, $end);\n bcscale(2);\n $diff = bcsub($spent, $left);\n\n // budget\n $budgetEntry = new BalanceEntry;\n $budgetEntry->setAccount($account);\n $budgetEntry->setSpent($spent);\n $empty->addBalanceEntry($budgetEntry);\n\n // balanced by tags\n $tagEntry = new BalanceEntry;\n $tagEntry->setAccount($account);\n $tagEntry->setLeft($left);\n $tags->addBalanceEntry($tagEntry);\n\n // difference:\n $diffEntry = new BalanceEntry;\n $diffEntry->setAccount($account);\n $diffEntry->setSpent($diff);\n $diffLine->addBalanceEntry($diffEntry);\n\n }\n\n $balance->addBalanceLine($empty);\n $balance->addBalanceLine($tags);\n $balance->addBalanceLine($diffLine);\n\n $balance->setBalanceHeader($header);\n\n return $balance;\n }", "protected function getSubscriptionRevenueRequest($currency_code, $start_date = null, $end_date = null)\n {\n // verify the required parameter 'currency_code' is set\n if ($currency_code === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $currency_code when calling getSubscriptionRevenue');\n }\n\n $resourcePath = '/reporting/revenue/subscription-sales/{currency_code}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start_date !== null) {\n $queryParams['start_date'] = ObjectSerializer::toQueryValue($start_date);\n }\n // query params\n if ($end_date !== null) {\n $queryParams['end_date'] = ObjectSerializer::toQueryValue($end_date);\n }\n\n // path params\n if ($currency_code !== null) {\n $resourcePath = str_replace('{' . 'currency_code' . '}', ObjectSerializer::toPathValue($currency_code), $resourcePath);\n }\n\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\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 // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }", "public function getDueDates(){\n\t\t$startDate = new DateTime($this->Params['start_date']);\n\t\t$monthDay = $startDate->format('d');\n\t\t$periodDueDate = new DateTime($this->Params['due_date']);\n\t\tswitch($this->Params['payment_mode']){\n\t\t\tcase 1: // DAILY\n\t\t\t\tif($this->Params['num'] > 1){\n\t\t\t\t\tif($this->Params['amortization_type'] == 2){ // STRAIGHT-LINE\n\t\t\t\t\t\t$periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t$datePeriodTimeStamp = strtotime($datePeriod);\n\t\t\t\t\t\t$getPeriodDay = date('D', $datePeriodTimeStamp);\n\t\t\t\t\t\tif($getPeriodDay === \"Sun\") $periodDueDate->modify('+1 day');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 2: // WEEKLY\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 3: // SEMI-MONTHLY\n\t\t\t\tswitch($this->Params['dd_type']){\n\t\t\t\t\tcase 3: // 15th and End of the Month\n\t\t\t\t\t\tif($monthDay <= 15){\n\t\t\t\t\t\t\t$dueDateDay = [1 => 15, 2 => 'last_day_month'];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 'last_day_month', 2 => 15];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif(is_int($dueDatePeriod)){\n\t\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$monthName = $periodDueDate->format('F');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of '.$monthName);\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5: // 5th and 20th of the Month\n\t\t\t\t\t\tif($monthDay <= 5){\n\t\t\t\t\t\t\t$dueDateDay = [1 => '05', 2 => 20];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 20, 2 => '05'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif($dueDatePeriod == '05' && $this->Params['num'] > 1) $periodDueDate->modify('+1 month');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6: // 10th and 25th of the Month\n\t\t\t\t\t\tif($monthDay <= 10){\n\t\t\t\t\t\t\t$dueDateDay = [1 => 10, 2 => 25];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 25, 2 => 10];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif($dueDatePeriod == 10 && $this->Params['num'] > 1) $periodDueDate->modify('+1 month');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7: // 15th and 30th of the Month\n\t\t\t\t\t\tif($monthDay <= 15){\n\t\t\t\t\t\t\t$dueDateDay = [1 => 15, 2 => 30];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$dueDateDay = [1 => 30, 2 => 15];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dueDatePeriod = $dueDateDay[$this->Params['count_reset']];\n\t\t\t\t\t\tif($dueDatePeriod == 15 && $this->Params['num'] > 1) $periodDueDate->modify('+28 days');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$monthName = $periodDueDate->format('F');\n\t\t\t\t\t\tif($monthName == \"February\"){\n\t\t\t\t\t\t\tif($dueDatePeriod == 15){\n\t\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$periodDueDate->modify('last day of '.$monthName);\n\t\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$dueDatePeriod);\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 4: // MONTHLY\n\t\t\t\tswitch($this->Params['dd_type']){\n\t\t\t\t\tcase 2: // END OF THE MONTH\n\t\t\t\t\t\tif($this->Params['num'] > 1){\n\t\t\t\t\t\t\t$periodDueDate->modify('+28 days');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of this month');\n\t\t\t\t\t\t}else{ // ALLOWANCE OF 15 DAYS\n\t\t\t\t\t\t\t$periodDueDate->modify('-1 month');\n\t\t\t\t\t\t\t$periodDueDate->modify('+15 days');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of this month');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4: // SAME DAY OF EACH MONTH\n\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('next month');\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($this->Params['isFebruary']) && $this->Params['isFebruary']){\n\t\t\t\t\t\t\t$startDate = new DateTime($this->Params['due_date']);\n\t\t\t\t\t\t\t$periodDueDate->modify('-1 month');\n\t\t\t\t\t\t\t$periodDueDate->modify('last day of this month');\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\t\t\tunset($this->Params['isFebruary']);\n\t\t\t\t\t\t\t$this->Params['isFebruary'] = false;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$startDate = new DateTime($this->Params['start_date']);\n\t\t\t\t\t\t\t$monthDay = $startDate->format('d');\n\t\t\t\t\t\t\t$periodDueDate->format($monthDay);\n\t\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-'.$monthDay);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$monthName = $periodDueDate->format('F');\n\t\t\t\t\t\t$isLeapYear = $periodDueDate->format('L'); // CHECK IF LEAPYEAR\n\t\t\t\t\t\t$leapDays = ($isLeapYear > 0) ? 29 : 28;\n\t\t\t\t\t\tif($monthName == \"January\" && $monthDay > $leapDays){ // TO SET ON FEBRUARY\n\t\t\t\t\t\t\t$this->Params['isFebruary'] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['number_days'].' day');\n\t\t\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\tbreak;\n\t\t\tcase 5: // QUARTERLY\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['monthly_terms'].' month');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 6: // SEMESTRAL\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+'.$this->Params['monthly_terms'].' month');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 7: // YEARLY\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('+1 year');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t\tcase 9: // LUMPSUM\n\t\t\t\tif($this->Params['num'] > 1) $periodDueDate->modify('next month');\n\t\t\t\t$datePeriod = $periodDueDate->format('Y-m-d');\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $datePeriod;\n\t}", "public static function get_designation_for_report($user_id, $start_date, $end_date){\n\t\t\n\t\t$user_designation = UserDesignationModel::where('user_id',$user_id)->get();\n\n\t\t// dd($user_designation);\n\n\t\t$designation_id = 0;\n\n\t\tforeach ($user_designation as $designation) {\n\n\t\t\t$old_designation_start_date = date_create($designation->start_date);\n\n\t\t\t$old_designation_start_date = date_format($old_designation_start_date, \"d-m-Y\");\n\n\t\t\t$old_designation_end_date = date_create($designation->end_date);\n\n\t\t\t$old_designation_end_date = date_format($old_designation_end_date, \"d-m-Y\");\n\n\t\t\tif($designation->valid == 0){\n\t\t\t\tif(strtotime($start_date)>= strtotime($old_designation_start_date) && strtotime($start_date)<strtotime($old_designation_end_date)){\n\t\t\t\t\t\t\n\t\t\t\t\tif(strtotime($end_date)>strtotime($old_designation_start_date) && strtotime($end_date)<=strtotime($old_designation_end_date)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$designation_id = $designation->designation_id;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tif(strtotime($start_date)>= strtotime($old_designation_start_date)){\n\t\t\t\t\t$designation_id = $designation->designation_id;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\n\t\t$designation = Designation::where(\"id\",$designation_id)->first();\n\t\treturn $designation;\n\n\n\t}", "function getGuardCharge($guardid,$startdate,$enddate){\n\t$result = mysql_query(\"SELECT * FROM guardschedule\");\n\t$scheduledays = 0;\n\t\n\t//Put all data into arrays if they are in between those dates specified\n\twhile($line = mysql_fetch_array($result, MYSQL_ASSOC)){\n\t\t//Set payment dates if they are not set\n\t\tif(trim($startdate) == \"\"){\n\t\t\t$datearray = getRowAsArray(\"SELECT lastpaymentdate, dateofemployment FROM guards WHERE guardid='\".$guardid.\"'\");\n\t\t\tif($datearray['lastpaymentdate'] != \"\"){\n\t\t\t\t$startdate = $datearray['lastpaymentdate'];\n\t\t\t} else {\n\t\t\t\t$startdate = $datearray['dateofemployment'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Give it the current date if it has not been set yet\n\t\tif(trim($enddate) == \"\"){\n\t\t\t$enddate = date(\"d-M-Y\");\n\t\t}\n\t\t\n\t\tif((strtotime($line['dateentered']) >= strtotime(trim($startdate,\"'\"))) && (strtotime($line['dateentered']) <= strtotime(trim($enddate,\"'\")))){\n\t\t\t$schedulearray = split(\",\",$line['schedule']);\n\t\t\t//Get all known guard statuses\n\t\t\t$statusarr = getAllScheduleStatus();\n\t\t\t\n\t\t\tfor($i=0;$i<count($schedulearray);$i++){\n\t\t\t\t$assgnarr = split(\"=\",$schedulearray[$i]);\n\t\t\t\tif(!in_array($assgnarr[1],$statusarr) && $assgnarr[0] == $guardid && $assgnarr[1] != \"\"){\n\t\t\t\t\t$scheduledays++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//Return the amount to be paid to the guard for regular work done\n\t$guard = getRowAsArray(\"SELECT rate FROM guards WHERE guardid='\".$guardid.\"'\");\n\t\n\treturn $scheduledays*$guard['rate'];\n}", "public function GetByDate($initialDate, $endDate);", "public function getSharesByRangeDate($type, $startDate='', $endDate='')\r\n\t{\r\n\t\t$em = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');\r\n\r\n\t\t$startDateTime = \\DateTime::createFromFormat('d/m/Y', $startDate);\r\n\t\t$endDateTime = \\DateTime::createFromFormat('d/m/Y', $endDate);\r\n\r\n\t\tswitch ($type){\r\n\t\t\tcase 'sponsoredMembers' :\r\n\t\t\t\t$filter = \"e.action=20\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'shares' :\r\n\t\t\t\t$filter = \"e.action IN (13,14,15,16,17)\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'profilShares' :\r\n\t\t\t\t$filter = \"e.action IN (13,14,15,16,17) AND e.label like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'fbInvit' :\r\n\t\t\t\t$filter = \"e.action IN (14,15) AND e.label NOT like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'twInvit' :\r\n\t\t\t\t$filter = \"e.action=16 AND e.label NOT like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'glInvit' :\r\n\t\t\t\t$filter = \"e.action=17 AND e.label NOT like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'mailInvit' :\r\n\t\t\t\t$filter = \"e.action=13 AND e.label NOT like '%espace client%'\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif ($startDate != '' && $endDate != '') {\r\n\t\t\t$dateRange = \"(e.createdAt >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0' AND e.createdAt <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0')\";\r\n\t\t} elseif ($startDate == '' && $endDate != '') {\r\n\t\t\t$dateRange = \"e.createdAt <= '\" . $endDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} elseif ($startDate != '' && $endDate == '') {\r\n\t\t\t$dateRange = \"e.createdAt >='\" . $startDateTime->format('Y-m-d') . \" 0:0:0'\";\r\n\t\t} else {\r\n\t\t\t$dateRange = \"e.createdAt IS NOT NULL\";\r\n\t\t}\r\n\r\n\t\t$query = $em->createQuery('\r\n\t\t\tSELECT COUNT(e.id) FROM PlaygroundReward\\Entity\\Event e\r\n\t\t\tWHERE ' . $dateRange . '\r\n\t\t\tAND ' . $filter . '\r\n\t\t');\r\n\t\t$count = $query->getSingleScalarResult();\r\n\t\treturn $count;\r\n\t}", "protected function getRefundRevenueRequest($currency_code, $start_date = null, $end_date = null)\n {\n // verify the required parameter 'currency_code' is set\n if ($currency_code === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $currency_code when calling getRefundRevenue');\n }\n\n $resourcePath = '/reporting/revenue/refunds/{currency_code}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start_date !== null) {\n $queryParams['start_date'] = ObjectSerializer::toQueryValue($start_date);\n }\n // query params\n if ($end_date !== null) {\n $queryParams['end_date'] = ObjectSerializer::toQueryValue($end_date);\n }\n\n // path params\n if ($currency_code !== null) {\n $resourcePath = str_replace('{' . 'currency_code' . '}', ObjectSerializer::toPathValue($currency_code), $resourcePath);\n }\n\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\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 // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }", "protected function getItemRevenueRequest($currency_code, $start_date = null, $end_date = null)\n {\n // verify the required parameter 'currency_code' is set\n if ($currency_code === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $currency_code when calling getItemRevenue');\n }\n\n $resourcePath = '/reporting/revenue/item-sales/{currency_code}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($start_date !== null) {\n $queryParams['start_date'] = ObjectSerializer::toQueryValue($start_date);\n }\n // query params\n if ($end_date !== null) {\n $queryParams['end_date'] = ObjectSerializer::toQueryValue($end_date);\n }\n\n // path params\n if ($currency_code !== null) {\n $resourcePath = str_replace('{' . 'currency_code' . '}', ObjectSerializer::toPathValue($currency_code), $resourcePath);\n }\n\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\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 // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\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 return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }", "public function get_first_rate_list_between_date($start_date = '', $end_date = '')\n {\n if ('' == strval($start_date)\n || '' == strval($end_date))\n {\n return FALSE;\n }\n\n // check date format\n $format = 'Ymd';\n $start_date = date($format, strtotime($start_date));\n $end_date = date($format, strtotime($end_date));\n if (empty($start_date)\n || empty($end_date))\n {\n return FALSE;\n }\n\n $i = 1;\n $rs = array();\n do\n {\n $date_rs = $this->get_rate_change_list($start_date);\n if (!is_array($date_rs))\n {\n //set log?\n $rs[$start_date] = $this->field_list;\n }\n else\n {\n $rs[$start_date] = array_shift($date_rs);\n }\n\n $start_date = date($format, strtotime($start_date . ' +1 days'));\n }while ($start_date <= $end_date);\n\n return $rs;\n }", "function statRiskChargeBackPaymentMethod()\n{\n $post = getPostInfo();\n $startTime= isset($post['startdate'])?$post['startdate']:'2016-12-19';//'2016-08-01';//'2016-12-23';\n $endTime = isset($post['enddate'])?$post['enddate']:'2017-01-23';//'2017-01-01';//'2017-01-22';\n $duration = isset($post['granularity'])?$post['granularity']:'week';//'month';//'day'; // day month week\n\n $condition = '';\n if (isset($post['paymentMethod']) && trim($post['paymentMethod']))\n {\n $paymentMethod = trim($post['paymentMethod']);\n if (!empty($condition)) {\n $condition .= \" AND `PaymentMethod`='{$paymentMethod}' \";\n } else {\n $condition = \" `PaymentMethod`='{$paymentMethod}' \";\n }\n }\n if (isset($post['shopperInteraction']) && trim($post['shopperInteraction']))\n {\n $shopperInteraction = trim($post['shopperInteraction']);\n if (!empty($condition)) {\n $condition .= \" AND `Shopper`='{$shopperInteraction}' \";\n } else {\n $condition = \" `Shopper`='{$shopperInteraction}' \";\n }\n }\n if (isset($post['countryFilter']) && trim($post['countryFilter']))\n {\n $countryFilter = trim($post['countryFilter']);\n if (!empty($condition)) {\n $condition .= \" AND `Country`='{$countryFilter}' \";\n } else {\n $condition = \" `Country`='{$countryFilter}' \";\n }\n }\n\n if ($duration == 'day') {\n $endTime = date('Y-m-d', strtotime(\"$endTime -1 day\"));\n $dateArr = parseDate($startTime, $endTime);\n }\n if ($duration == 'month') {\n $endTime = date('Y-m-d', strtotime(\"$endTime -1 day\"));\n $dateArr = parseDate($startTime, $endTime);\n }\n if ($duration == 'week') {\n $dateArr = parseDate($startTime, $endTime);\n }\n\n if (!empty($condition)) {\n $condition .= \" AND `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n } else {\n $condition = \" `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n }\n\n $sql = \"\n SELECT DISTINCT `PaymentMethod` as PaymentMethod\n FROM `risk`\n WHERE $condition\n \";\n $pageInfo = DB::fetchAll(DB_NUMBER, $sql);\n $payments = [];\n if ($pageInfo)\n {\n foreach($pageInfo as $item)\n {\n if(isset($item['PaymentMethod']) && $item['PaymentMethod'])\n {\n $payments[] = $item['PaymentMethod'];\n }\n }\n }\n return $payments;\n}", "public function getExistingInvoicesForClientCase($client_id, $client_case_id, $display_type)\n {\n if($display_type=='Itemized') {\n\t\t$sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = $client_case_id AND display_by = 1 AND is_closed=0 ORDER BY id DESC\";\n }\n else {\n $sql = \"SELECT id, created_date FROM tbl_invoice_final WHERE client_id = $client_id AND client_case_id = 0 AND display_by = 2 AND is_closed=0 ORDER BY id DESC\";\n }\n\n \n $invoice_data = InvoiceFinal::findBySql($sql)->all();\n\n \t\t return $invoice_data;\n\t }", "public function returnPaymentType($start_date,$end_date){\n\t\t$mcoCash = new Application_Model_DbTable_McoCash();\n\t\t$select = $mcoCash->select()->setIntegrityCheck(false);\n\t\t$select ->from(array(\"mc\" => \"mco_cash\"), array('type','amount' => new Zend_Db_Expr('SUM(amount)'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'full_composition' => new Zend_Db_Expr('CAST(SUM(value*amount) as DECIMAL(11,3))'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'liquid_composition' => new Zend_Db_Expr('(SUM(CASE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IOM\" THEN \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t CAST((((value- 1.449)*amount)-(((value- 1.449)*amount)*0.0037)) as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IMO\" THEN \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t CAST((((value- 1.449)*amount)-(((value- 1.449)*amount)*0.0037)) as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ELSE CAST((value*amount)-((value*amount)*0.0037) as DECIMAL(11,2)) END))'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'cbtu_transfer' => new Zend_Db_Expr('SUM(CASE \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IOM\" THEN CAST(1.449*amount as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHEN type = \"IMO\" THEN CAST(1.449*amount as DECIMAL(11,2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ELSE 0 END)')))\n\t\t->joinInner(array('m' => 'mco'), 'm.id=mc.mco_id')\n\t\t->where('date_operation >= ?', Application_Model_General::dateToUs($start_date))\n\t\t->where('date_operation <= ?', Application_Model_General::dateToUs($end_date))\n\t\t->where('status=1')\n\t\t->group('type');\n\t\treturn $mcoCash->fetchAll($select);\n\t}", "function cpay_GetRevise($start,$end) {\r\n $start= strtotime($start);\r\n $start=date('Y:m:d H:i:s',$start);\r\n $end= strtotime($end);\r\n $end=date('Y:m:d H:i:s',$end);\r\n $payments='';\r\n $query=\"SELECT * from `op_transactions` WHERE `paysys` = 'CITYPAY' AND `date` BETWEEN '\".$start.\"' AND '\".$end.\"';\";\r\n $rawData= simple_queryall($query);\r\n if (!empty($rawData)) {\r\n foreach ($rawData as $io=>$each) {\r\n if (cpay_ispos($each['note'], 'date:')) {\r\n $tmpDate=explode('date:',$each['note']);\r\n $transDate=trim($tmpDate[1]);\r\n } else {\r\n $transDate= strtotime($each['date']);\r\n $transDate= date(\"YmdHis\",$transDate);\r\n }\r\n $cleanHash= str_replace('CPAY_', '', $each['hash']);\r\n \r\n $payments.='\r\n <Payment>\r\n <TransactionId>'.$cleanHash.'</TransactionId>\r\n <Account>'.$each['customerid'].'</Account>\r\n <TransactionDate>'.$transDate.'</TransactionDate>\r\n <Amount>'.$each['summ'].'</Amount>\r\n </Payment>\r\n ';\r\n }\r\n }\r\n \r\n $result='\r\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <Response>\r\n '.$payments.'\r\n </Response>\r\n ';\r\n $result=trim($result);\r\n print($result);\r\n}", "function getMinMaxForRange($date_start, $date_end) {\n $query = \"SELECT MIN(price) AS minPrice,\n MAX(price) AS maxPrice\n FROM np_data\n WHERE (\n (date BETWEEN '$date_start' AND '$date_end' AND hour != '23')\n OR (date = ($date_start - INTERVAL 1 DAY) AND hour = '23')\n )\";\n if ($result = $this->link->query($query)) {\n /* free result set */\n $row = mysqli_fetch_array($result);\n $result->close();\n $resultArray = array (\n 'min' => $row['minPrice'],\n 'max' => $row['maxPrice']\n );\n return $resultArray;\n }\n }", "public function reportsInPeriodScope($dateStart, $dateEnd);", "public function calculateRangeKwhCosts($beginDate, $endDate){\n \t \n\t\treturn $this->calculateTimeRangeKwhCosts(date (\"Y-m-d 00:00:00\", strtotime($beginDate)),date (\"Y-m-d 00:00:00\", strtotime (\"+1 day\", strtotime($endDate))) );\n\n }", "public function getPaymentsByClientId($clientId)\n {\n //prevent mysql injection\n $clientId = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $clientId);\n $payments = $this->getDB()\n ->query(\"SELECT transactions.date, package_client.total_price AS price, transactions.type,\n package_client.start_date, package_client.end_date, packages.package_name AS name\n FROM package_client\n INNER JOIN transactions \n ON package_client.id = transactions.sell_id \n LEFT JOIN packages ON package_client.package_id = packages.package_id\n WHERE transactions.type='package' AND package_client.client_id='$clientId'\n UNION \n SELECT transactions.date, personal_trainings.price, \n transactions.type , personal_trainings.date, personal_trainings.date, users.user_name \n FROM personal_trainings \n INNER JOIN transactions \n ON personal_trainings.personal_training_id= transactions.sell_id \n LEFT JOIN users ON personal_trainings.user_id = users.user_id\n WHERE transactions.type='personalTraining' AND personal_trainings.client_id='$clientId'\n ORDER BY date;\n \")\n ->fetch_all(MYSQLI_ASSOC);\n if ($payments) {\n return $payments;\n } else {\n return $this->getDB()->error;\n }\n }" ]
[ "0.6074739", "0.58969605", "0.58338386", "0.570886", "0.5595405", "0.5531513", "0.5483084", "0.5465305", "0.5407477", "0.53821605", "0.5380832", "0.5369813", "0.5303247", "0.52979195", "0.5279763", "0.52792704", "0.5277143", "0.52698785", "0.5247954", "0.5237246", "0.5231648", "0.522422", "0.521458", "0.52097195", "0.5182263", "0.5180412", "0.51380646", "0.51220685", "0.51168084", "0.50935555" ]
0.741907
0
/ Return an array of 2 elements 1 : Copay Amount 2: Copay seted place(0: set from custoizaion tool, 1 from Insurance)
function getSesCopay($sesId) { $sesCopayAmt = array("amount"=>0, "place"=>0); try { if($sesId > 0) { $sqlGetSes = "SELECT cs.clientID, cs.providerID, cs.sessionDate, cs.fee, cs.adj_fee, cs.other_ins_adj, cs.amt_paid, cs.out_of_network_ins_type, cs.client_copay, cs.procedureID, cs.pending_personinsurance_id, pp.code FROM clientsession AS cs LEFT JOIN providerprocedure AS pp ON cs.procedureID = pp.id WHERE cs.id = '$sesId' AND cs.sessionStatus = 1"; $resGetSes = DB::do_query($sqlGetSes); if(DB::db_fetch_num_rows($resGetSes) > 0) { $rowGetSes = DB::db_fetch_assoc($resGetSes); $clientId = $rowGetSes['clientID']; $providerId = $rowGetSes['providerID']; $sesDate = $rowGetSes['sessionDate']; $sesProc = $rowGetSes['code']; $sesFee = $rowGetSes['fee']; $sesAdjFee = $rowGetSes['adj_fee']; $sesOthInsAdj = $rowGetSes['other_ins_adj']; $sesInsPay = $rowGetSes['amt_paid']; $sesInsCopay = $rowGetSes['client_copay']; $pendingInsId = $rowGetSes['pending_personinsurance_id']; $ONNType = $rowGetSes['out_of_network_ins_type']; if($ONNType == 1) { $sesCopayAmt['amount'] = 0; $sesCopayAmt['place'] = 0; }else if($pendingInsId == 0){ $sesCopayAmt['amount'] = 0; $sesCopayAmt['place'] = 0; }else { if($sesInsCopay > 0) { // if copay set by insurance, we have to this as priority $sesCopayAmt["amount"] = $sesInsCopay; $sesCopayAmt["place"] = 1; }else { $balMethod = new GetBalMethod(); $clientBalCalMethod = array(); $clientBalCalMethod = $balMethod->checkClientBalCalcMethodToUse(strtotime($sesDate), $clientId, $providerId, $sesProc); if(count($clientBalCalMethod) && $clientBalCalMethod['method'] == 2) { if(array_key_exists($sesProc, $clientBalCalMethod['copay'])) { $sesCopayAmt['amount'] = $clientBalCalMethod['copay'][$sesProc]; } else { $sesCopayAmt['amount'] = $balMethod->getFirstCopayUcrAmount($clientBalCalMethod['balCustId'], $sesProc, 1); } $sesCopayAmt['place'] = 0; } } } } } }catch(Exception $e) { APP::logErrors($e); } return $sesCopayAmt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChange(): array\n {\n $change = array();\n $coinsToPayBack = array();\n $amountToReturn = (ceil(($this->purchaseTransaction->getPaidAmount()*100)) - $this->getTotalAmount()*100)/100;\n $coins = array_reverse(self::$coins);\n foreach ($coins as $coin)\n {\n\n // multiplying by 100 to avoid computing floating numbers\n while (($coin*100 <= $amountToReturn*100))\n {\n $amountToReturn = ($amountToReturn*100 - $coin*100)/100;\n $coinsToPayBack [] = sprintf('%.2f', $coin);\n }\n }\n //count occurrences and map them as key => value\n $keyValueChange = array_count_values($coinsToPayBack);\n foreach ($keyValueChange as $value => $count){\n $change [] = [$value, $count];\n }\n return $change;\n }", "function sincCxP(){\n $data=array();\n $this->query=\"SELECT ('T'||trim(cve_prov)) as cve_prov, p.* from paga_m03 p where ref_sist is null\";\n $res=$this->EjecutaQuerySimple();\n while ($tsarray=ibase_fetch_object($res)){\n $data[]=$tsarray;\n }\n $this->query=\"UPDATE paga_m03 set ref_sist = 'T'\";\n $this->EjecutaQuerySimple();\n return $data;\n }", "public function getShippingInvoiced();", "public function getCompleteResumePosDailyCash()\n {\n return [\n 'opening_timestamp' => date('d/m/Y H:i:s', strtotime($this->oPosDailyCash->opening_timestamp)),\n 'opening_user' => $this->oPosDailyCash->gUserOpeningCashierPos->getFullName(),\n 'ingress_total' => $this->calculateIngressTotal(),\n 'egress_total' => $this->calculateEgressTotal(),\n 'estimated_cash_total' => $this->calculateEstimatedCashTotal(),\n 'ingress_total_detail' => [\n 'initial_amount_cash' => $this->calculateInitialAmountCash(),\n 'ingress_cash_movement_total' => $this->calculateIngressCashMovementTotal(),\n 'sales_total' => $this->calculateCustomerSalesTotal(),\n 'sales_total_detail' => [\n 'sale_cash_total' => $this->calculateCustomerSales_ByTypePaymentTotal(self::POS_SALE_PAYMENT_TYPE_CASH),\n 'sale_debit_total' => $this->calculateCustomerSales_ByTypePaymentTotal(self::POS_SALE_PAYMENT_TYPE_DEBIT_CARD),\n 'sale_credit_total' => $this->calculateCustomerSales_ByTypePaymentTotal(self::POS_SALE_PAYMENT_TYPE_CREDIT_CARD),\n ],\n ],\n 'egress_total_detail' => [\n 'egress_cash_movement_total' => $this->calculateEgressCashMovementTotal()\n ],\n ];\n }", "public function getPCS() {}", "public function getDiscounts(): array;", "public function get_circulation_info($ocn) {\n $holdings = array();\n $found = FALSE;\n if ($this->ocn == $ocn) {\n $found = ($this->avail !== null);\n } \n else {\n $found = $this->get_availabilty_of_ocn($ocn);\n }\n if ($found) {\n //check?\n $holdings = $this->avail['searchRetrieveResponse'][0]['records'][0]['record'][0]['recordData'][0]['opacRecord'][0]['holdings'];\n }\n return $holdings;\n }", "public function comboView()\n {\n $bcgoal = new BCgoal($this->db);\n $bcdaily = new BCdaily($this->dbbc);\n\n $niceViewA = $bcgoal->niceView();\n $actualNet = $bcdaily->last7();\n\n $result = [];\n foreach ($actualNet as $key => $value) {\n foreach ($niceViewA as $v) {\n if ($value['dow'] == $v['dow']) {\n $result[$value['dow']] \n = array_merge($value, ['goalamount' => $v['goalamount']]);\n }\n }\n }\n\n return $result;\n }", "public function acuityArray()\n {\n return array(\n \t\t\t '0'=>'Not recorded',\n '93'=>'6/5',\n '89'=>'6/6',\n '80'=>'6/9',\n '74'=>'6/12',\n '65'=>'6/18',\n '59'=>'6/24',\n '50'=>'6/36',\n '39'=>'6/60',\n '30'=>'3/60',\n '4'=>'CF',\n '3'=>'HM',\n '2'=>'PL',\n '1'=>'NPL');\n }", "public function getInstallments()\r\n\t{\r\n \t// pega dados de parcelamento\r\n \t$maxInstallments = intval(Mage::getStoreConfig('payment/Query_Cielo_Cc/max_parcels_number'));\r\n \t$minInstallmentValue = floatval(Mage::getStoreConfig('payment/Query_Cielo_Cc/min_parcels_value'));\r\n\t\t\r\n\t\t$minInstallmentValue = ($minInstallmentValue <= 5.01) ? 5.01 : $minInstallmentValue;\r\n\t\t\r\n\t\t// atualiza taxa de juros para 0,\r\n\t\t// caso o usuario tenha voltado na navegacao\r\n\t\t$quote = Mage::getSingleton('checkout/cart')->getQuote();\r\n\t\t$quote->setInterest(0.0);\r\n\t\t$quote->setBaseInterest(0.0);\r\n\t\t\r\n\t\t$quote->setTotalsCollectedFlag(false)->collectTotals();\r\n\t\t$quote->save();\r\n\t\t\r\n\t\t// pega dados de juros\r\n\t\t$withoutInterest = intval(Mage::getStoreConfig('payment/Query_Cielo_Cc/installment_without_interest'));\r\n\t\t$interestValue = floatval(Mage::getStoreConfig('payment/Query_Cielo_Cc/installment_interest_value'));\r\n\t\t\r\n\t\t// pega valores do pedido\r\n\t\t$total = Mage::getSingleton('checkout/cart')->getQuote()->getSubtotal();\r\n\t\t\r\n\t\t$installments = array();\r\n\t\t\r\n\t\tfor($i = 1; $i <= $maxInstallments; $i++)\r\n\t\t{\r\n\t\t\t// caso nao haja juros na parcela\r\n\t\t\tif($i <= $withoutInterest)\r\n\t\t\t{\r\n\t\t\t\t$orderTotal = $total;\r\n\t\t\t\t$installmentValue = round($orderTotal / $i, 2);\r\n\t\t\t}\r\n\t\t\t// caso haja juros\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$installmentValue = round(Mage::helper('Query_Cielo')->calcInstallmentValue($total, $interestValue / 100, $i), 2);\r\n\t\t\t\t$orderTotal = $i * $installmentValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// confere se a parcela nao estah abaixo do minimo\r\n\t\t\tif($minInstallmentValue >= 0 && $installmentValue < $minInstallmentValue)\r\n\t\t\t{\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// monta o texto da parcela\r\n\t\t\tif($i == 1)\r\n\t\t\t{\r\n\t\t\t\t$label = \"à vista (\" . Mage::helper('core')->currency(($total), true, false) . \")\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif($i <= $withoutInterest)\r\n\t\t\t\t{\r\n\t\t\t\t\t$label = $i . \"x sem juros (\" . Mage::helper('core')->currency(($installmentValue), true, false) . \" cada)\";\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$label = $i . \"x (\" . Mage::helper('core')->currency(($installmentValue), true, false) . \" cada)\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// adiciona no vetor de parcelas\r\n\t\t\t$installments[] = array(\"num\" => $i, \"label\" => $this->htmlEscape($label));\r\n\t\t}\r\n\t\t\r\n\t\t// caso o valor da parcela minima seja maior do que o valor da compra,\r\n\t\t// deixa somente opcao a vista\r\n\t\tif($minInstallmentValue > $total)\r\n\t\t{\r\n\t\t\t$label = \"à vista (\" . Mage::helper('core')->currency(($total), true, false) . \")\";\r\n\t\t\t$installments[] = array(\"num\" => 1, \"label\" => $this->htmlEscape($label));\r\n\t\t}\r\n\t\t\r\n\t\treturn $installments;\r\n\t}", "private function getArrayOpenIngressPosCashMovement()\n {\n $arrOpenPosCashMovement = PosCashDeskMovementPos::where('pos_cash_desk_id', $this->oPosDailyCash->pos_cash_desk_id)\n ->where('created_at', '>=', $this->oPosDailyCash->opening_timestamp)\n ->where('created_at', '<=', $this->timestampNow)\n ->whereNotNull('pos_movement_ingress_type_id')\n ->whereNull('pos_movement_egress_type_id')\n ->where('flag_delete', false)\n ->get();\n return $arrOpenPosCashMovement;\n }", "protected function armaColeccionZpCarac() {\n $arrayRet = array();\n $dao = new PGDAO();\n $where = $this->strZpTprop();\n if ($where != '') {\n $arrayRet = $this->leeDBArray($dao->execSql($this->COLECCIONZPCARAC . \" where tipoprop in (\" . $where . \")\"));\n } else {\n $arrayRet = $this->leeDBArray($dao->execSql($this->COLECCIONZPCARAC));\n }\n return $arrayRet;\n }", "public function getCreditos()\n {\n return $this->creditos;\n }", "public function costInstallments(){\n\n\n for($x = 1; $x<=12; $x++){\n\n if($x == 1){\n $cost[$x] = 0;\n }\n $cost[$x] = Mage::getStoreConfig(self::XPATH_CONFIG_INSTALMENT_COST.$x);\n }\n\n\n return $cost;\n }", "private function getArrayOpenEgressPosCashMovement()\n {\n $arrOpenPosCashMovement = PosCashDeskMovementPos::where('pos_cash_desk_id', $this->oPosDailyCash->pos_cash_desk_id)\n ->where('created_at', '>=', $this->oPosDailyCash->opening_timestamp)\n ->where('created_at', '<=', $this->timestampNow)\n ->whereNotNull('pos_movement_egress_type_id')\n ->whereNull('pos_movement_ingress_type_id')\n ->where('flag_delete', false)\n ->get();\n return $arrOpenPosCashMovement;\n }", "function getListPriceOfCourt($input){\n $list_price = [];\n $hour_start = 0;\n $hour_end = 0;\n\n if($input['type'] == 'contract'){\n if($input['hour_start'] >= 0){\n $limit_hour = $input['hour_start'] + $input['hour_length'] <24 ? 4: (int)(24 - $input['hour_start']- 4);\n $hour_start = $input['hour_start'];\n $hour_end = $input['hour_start'] + $limit_hour;\n }else{\n $limit_hour = $input['hour_start'] + $input['hour_length'] <24 ? 4: (int)(24 - $input['hour_start']- 4);\n $hour_start = $input['hour_start'];\n $hour_end = $input['hour_start'] + $limit_hour;\n }\n }else\n {\n $limit_hour = $input['hour_start'] + $input['hour_length'] <= 24 ? 4 : (int)(24 - $input['hour_start']- 4);\n $hour_start = $input['hour_start'];\n $hour_end = $input['hour_start'] + $limit_hour;\n }\n\n for($i = $hour_start; $i<= $hour_end; $i++) {\n $input['hour_start'] = $i;\n $calPrice = getPriceForBooking($input);\n $calPrice['hour_start'] = $i;\n $calPrice['hour_length'] = $input['hour_length'];\n $list_price[] = $calPrice;\n }\n return $list_price;\n }", "private function get_pricerange_array() {\n\t\t\t$pricerange = [\n\t\t\t\t'' => __( 'Select your price indication', 'yoast-local-seo' ),\n\t\t\t\t'$' => '$',\n\t\t\t\t'$$' => '$$',\n\t\t\t\t'$$$' => '$$$',\n\t\t\t\t'$$$$' => '$$$$',\n\t\t\t\t'$$$$$' => '$$$$$',\n\t\t\t];\n\n\t\t\treturn $pricerange;\n\t\t}", "function arrayColaEstudiantes (){\n\t\t\t$host = \"localhost\";\n\t\t\t$usuario = \"root\";\n\t\t\t$password = \"\";\n\t\t\t$BaseDatos = \"pide_turno\";\n\n\t $link=mysql_connect($host,$usuario,$password);\n\n\t\t\tmysql_select_db($BaseDatos,$link);\n\t\t\t$retorno = array();\n\t\t\t$consultaSQL = \"SELECT turnos.codigo, turnos.nombre, turnos.carrera FROM turnos WHERE turnos.estado='No atendido' ORDER BY guia;\";\n\t\t\tmysql_query(\"SET NAMES utf8\");\n\t\t\t$result = mysql_query($consultaSQL);\n\t\t\tfor($i=0;$fila= mysql_fetch_assoc($result); $i++) {\n\t\t\t\tfor($a= 0;$a<mysql_num_fields($result);$a++){\n\t\t\t\t\t$campo = mysql_field_name($result,$a);\n\t\t\t\t\t$retorno[$i][$campo] = $fila[$campo];\n\t\t\t\t}\n\t\t\t};\n\t\t\tmysql_close($link);\n\n\t\t\treturn $retorno;\n\t\t}", "function getReportofTotal(){\r\n $inx = 0;\r\n $arrpack = array();\r\n $conn = getConnection();\r\n\r\n $stmt = $conn->prepare(\"SELECT B.idreservations, B.datebkd, G.gs_name, P.price, B.totalAmount, B.discount from packages P, booking B, guests G where B.idreservations = G.reservations_idreservations and B.packages_idpackages = P.idpackages\");\r\n \r\n $stmt->execute();\r\n\r\n $result = $stmt->get_result();\r\n\r\n if($result->num_rows > 0){\r\n while($row = $result->fetch_assoc()){\r\n\r\n $dte = $row['datebkd'];\r\n $pieces = explode(\"-\", $dte);\r\n $id = $row['idreservations'];\r\n $totString = $pieces[0] . $pieces[1] . $pieces[2] . \"-o-\" . $id;\r\n $arrpack[$inx][0] = $totString;\r\n $arrpack[$inx][1] = $row['gs_name'];\r\n $down = $row['price'];\r\n $second = $row['totalAmount'];\r\n $dic = $row['discount'];\r\n\r\n $totality = ($down*0.5) + ($second*((100 - $dic)/100));\r\n\r\n $arrpack[$inx][2] = $totality;\r\n $inx++;\r\n }\r\n }\r\n $conn->close(); \r\n\r\n return $arrpack;\r\n }", "public function getCurrencies();", "public function calculateLoanAmountsArray()\n\t{\n\t\tif(! is_a($this->biz_rules, 'Business_Rules'))\n\t\t{\n\t\t\trequire_once('/virtualhosts/lib/business_rules.class.php');\n\t\t\t$this->biz_rules = new Business_Rules($this->db);\n\t\t}\n\t\t\n\t\tif(empty($this->rule_set))\n\t\t{\n\t\t\tif(empty($this->rule_set_id))\n\t\t\t{\n\t\t\t\t$this->_Get_Application_Info($this->application_id, TRUE);\n\t\t\t}\n\t\t\t\n\t\t\t$this->rule_set = $this->biz_rules->Get_Rule_Set_Tree($this->rule_set_id);\n\t\t}\n\t\t\n\t\t$data = new stdClass;\n\t\t$data->business_rules = $this->rule_set;\n\t\t$data->income_monthly = $this->income_monthly;\n\t\t$data->is_react = $this->is_react;\n\t\t\n\t\trequire_once('loan_amount_calculator.class.php');\n\n\t\t$loan_amount_calc = LoanAmountCalculator::Get_Instance($this->company_short);\n\t\treturn $loan_amount_calc->calculateLoanAmountsArray($data);\n\t\t\n\t}", "public function getCurrencies(): array\n {\n $out = $this->request('getCurrencies');\n return $out['result'];\n }", "public function getCurrencies() {\n\t\treturn array(\"CNY\");\n\t}", "public function getCurrencies()\n {\n return array(\"PLN\");\n }", "public function calcul_com($palier, $montant_vnt_ht, $ca, $niveau)\n{\n\n $commission = 0;\n $tab = array();\n \n // on retire l'encaissé actuel parcequ'il fait déjà partir du ca encaissé\n $ca -= $montant_vnt_ht;\n // dd($montant_vnt_ht);\n // à partir du niveau actuel, on avance sur le palier\n for ($i=$niveau; $i<count($palier);$i++){\n if ($ca + $montant_vnt_ht <= ($palier[$i])[3] || $i == count($palier) - 1){\n $commission += ($montant_vnt_ht / 100) * ($palier[$i])[1];\n $tab[] = array($montant_vnt_ht,($palier[$i])[1]);\n break;\n }\n else {\n $diff = ($palier[$i])[3] - $ca;\n $commission += ($diff / 100) * ($palier[$i])[1];\n $montant_vnt_ht -= $diff;\n\n $tab[] = array($diff,($palier[$i])[1]);\n \n // echo(\"Ajout à la commission:\". ($diff / 100) * ($palier[$i])[1]);\n // echo(\"reste:\". $montant_vnt_ht);\n $ca += $diff;\n }\n }\n\n $tabs = array($tab,$commission);\n return $tabs;\n}", "public function getDiscountTaxCompensationInvoiced();", "public function calculatedCommissionFee()\n {\n $output = [];\n try {\n if (!array_key_exists('error', $this->data)) {\n for ($i = 0; $i < count($this->data); ++$i) {\n //Assign value to array via keys\n if (count($this->data[$i]) === 6) {\n $userType =\n (string) $this->data[$i][2];\n $operationType =\n (string) $this->data[$i][3];\n $operationAmt =\n (float) $this->data[$i][4];\n $currency =\n (string) $this->data[$i][5];\n $convertedAmount =\n $this\n ->_setTotalAmt($currency, $operationAmt);\n\n //Get converted amount, operation type, user type and currency then get the final result.\n $output[] =\n $this\n ->_result($convertedAmount, $operationType, $userType, $currency);\n continue;\n }\n }\n }\n } catch (\\Exception $e) {\n $output =\n ['error' => [\n $e->getCode(), $e->getMessage(),\n ],\n ];\n }\n\n return $output;\n }", "public function buckleArray()\n {\n return array(\n '1'=>'Other',\n '2'=>'3mm sponge',\n '3'=>'4mm sponge',\n '4'=>'5mm sponge',\n '5'=>'7mm sponge',\n '6'=>'276',\n '7'=>'277',\n '8'=>'279',\n '9'=>'280',\n '10'=>'40 band',\n '11'=>'240 band',\n '12'=>'Encircling buckle');\n }", "public function getSubtotalInvoiced();", "public function getBillingData(): array\n {\n return [\n 'billing.street1' => 'Wilaya center, Avenue Ali Yaeta, étage 3, n 31, Tétouan',\n 'billing.city' => 'TETOUAN',\n 'billing.state' => 'TETOUAN',\n 'billing.country' => 'MA',\n 'billing.postcode' => '35000',\n ];\n }" ]
[ "0.61343807", "0.6008945", "0.5653423", "0.562718", "0.5592017", "0.5579181", "0.5574656", "0.5568964", "0.55438536", "0.5534851", "0.55308074", "0.5517324", "0.5478943", "0.54652596", "0.54526097", "0.54379624", "0.5429601", "0.54239774", "0.54170793", "0.54064655", "0.54030406", "0.53883153", "0.5387494", "0.53682756", "0.53629315", "0.5362414", "0.5361348", "0.53569126", "0.53407204", "0.53316224" ]
0.615416
0
getDescription Return module uninstallation message
function getUninstallMessage() { return lang('Module will be deactivated. (No)/(All) data will be deleted'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUninstallMessage() {\n return lang('Module will be deactivated. Data inserted using this module will not be deleted');\n }", "function UninstallPreMessage() {\n\t\treturn $this->Lang('really_uninstall');\n\t}", "function UninstallPreMessage()\n {\n return $this->Lang('really_uninstall');\n }", "function UninstallPostMessage() {\n\t\treturn $this->Lang('postuninstall');\n\t}", "function UninstallPostMessage()\n {\n return $this->Lang('postuninstall');\n }", "public function getDescription() {\n return 'Remove config item';\n }", "public function uninstallAction()\n {\n $id = _get('id', 'int');\n $name = _get('name', 'regexp',\n array('regexp' => '/^[a-z0-9_]+$/i'));\n\n $result = false;\n $error = '';\n $message = '';\n $details = array();\n $row = null;\n\n if (!$id && !$name) {\n $error = __('Module is not specified.');\n }\n if (!$error) {\n if ($id) {\n $row = Pi::model('module')->find($id);\n } else {\n $row = Pi::model('module')->find($name, 'name');\n }\n if (!$row) {\n $error = __('Module is not found.');\n } elseif ('system' == $row->name) {\n $error = __('System module is protected.');\n } else {\n $installer = new ModuleInstaller;\n $result = $installer->uninstall($row);\n $details = $installer->getResult();\n }\n }\n if ($result) {\n $message = sprintf(__('Module \"%s\" is uninstalled successfully.'),\n $row->title);\n } elseif ($row) {\n $message = sprintf(__('Module \"%s\" is not uninstalled.'),\n $row->title);\n } elseif ($id || $name) {\n $message = sprintf(__('Module \"%s\" is not uninstalled.'),\n $name ?: $id);\n } else {\n $message = __('Module is not uninstalled.');\n }\n\n $data = array(\n 'title' => __('Module uninstallation'),\n 'result' => $result,\n 'error' => $error,\n 'message' => $message,\n 'details' => $details,\n 'url' => $this->url('', array('action' => 'index')),\n );\n $this->view()->assign($data);\n $this->view()->setTemplate('module-operation');\n }", "public function uninstall()\n {\n $registeredPlugin=GPCCore::getRegistered();\n if(count($registeredPlugin)>0)\n {\n return(l10n(\"Some plugins are dependent on Grum Plugin Classes: before uninstall, you must first uninstall the plugins dependent\"));\n }\n else\n {\n $this->deleteConfig();\n GPCCore::deleteConfig();\n GPCRequestBuilder::deleteConfig();\n $result=GPCRequestBuilder::deleteTables();\n return($result);\n }\n }", "public function getDescription() {\n\t\t\treturn $this->MODULE_DESCRIPTION;\t\n\t\t}", "private function pageUninstall() {\r\n\t\t//Test if the module has a valid name and is a valid plugin and can uninstall\n\t\tif (empty ( $_POST ['uninstall'] ) || strlen ( $_POST ['uninstall'] ) < 1 || ! ereg ( \"[a-zA-Z]+\", $_POST ['uninstall'] )) {\r\n\t\t\tthrow new Exception ( \"Invalid plugin name {$_POST['uninstall']} or could not uninstall module.\" );\r\n\t\t}\r\n\t\t\r\n\t\t//Get the plugin and check if it is possible to uninstall.\r\n\t\t$plugin = $this->data->xpath ( \"plugin[@name='{$_POST ['uninstall']}']\" );\r\n\t\t\r\n\t\t//Check if there where any plugins found with that name and can be uninstalled\r\n\t\tif (sizeof($plugin) < 1 || empty ( $plugin [0] ) || empty ( $plugin [0] ['can_uninstall'] ) || ( string ) $plugin [0] ['can_uninstall'] != \"true\") {\r\n\t\t\tthrow new Exception ( \"The plugin {$_POST ['uninstall']} may not be uninstalled.\" );\r\n\t\t}\r\n\t\t\r\n\t\tLogger::getRootLogger ()->info ( \"Uninstalling plugin {$plugin [0] ['name']}\" );\r\n\t\t\r\n\t\t/*\r\n\t\t//Stop the plugin, if possible\r\n\t\t//move to uninstall scripts?\r\n\t\t$plugin_obj = $this->framework->getPlugin ( (string)$plugin [0] ['name'] );\r\n\t\tif (isset ( $plugin_obj )) {\r\n\t\t\tLogger::getRootLogger ()->info ( \"Stopping plugin for uninstall\" );\r\n\t\t\t$plugin_obj->stop ();\r\n\t\t\tunset ( $plugin_obj );\r\n\t\t}*/\r\n\t\t\r\n\t\t$result = \"uninstalled\"; //default\r\n\r\n\t\t//Call uninstall.php, if exists, to perform additional uninstall instructions\r\n\t\tif (file_exists ( PluginFramework::MODULE_PATH.\"/\" . ( string ) $plugin [0] ['name'] . \"/uninstall.php\" )) {\r\n\t\t\t//run uninstall class in Modules/$module/uninstall.php\r\n\t\t\tLogger::getRootLogger ()->info ( \"Calling {$plugin [0] ['name']}/uninstall.php\" );\r\n\t\t\trequire_once PluginFramework::MODULE_PATH.\"/\" . ( string ) $plugin [0] ['name'] . \"/uninstall.php\";\r\n\t\t\t\r\n\t\t\t$menu = new Config ( PluginFramework::MENU_PATH );\r\n\t\t\t$uninstall = new Uninstall ( $this->framework, $this->config, $plugin [0], $menu );\r\n\t\t\t$result = $uninstall->getResult ();\r\n\t\t}\r\n\t\t\r\n\t\t//remove plugin config\r\n\t\tif ($result == \"uninstalled\") { // && empty ( $_POST ['keep_data'] )\r\n\t\t\tLogger::getRootLogger ()->info ( \"Removing plugin configuration\" );\r\n\t\t\t\r\n\t\t\t$this->config->deleteElement ( $plugin [0] );\r\n\t\t\t\r\n\t\t\t//safe the config and remove the plugin directory\r\n\t\t\tif ($this->config->saveConfig ()) {\r\n\t\t\t\t//Remove plugin location. rmdir() does not do it recursively, so do it using the shell.\r\n\t\t\t\tLogger::getRootLogger ()->info ( \"Removing plugin files\" );\r\n\t\t\t\tFunctions::shellCommand ( \"rm -r \".PluginFramework::MODULE_PATH.\"/\" . ( string ) $plugin [0] ['name'] );\r\n\t\t\t\t\r\n\t\t\t\techo \"<reply action=\\\"ok\\\"/>\";\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Exception ( \"Error, could not save configuration file.\" );\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthrow new Exception ( \"Could not uninstall the plugin. Reason given: {$result}\" );\r\n\t\t}\r\n\t}", "function uninstall($parent) \n\t{\n\t\t// $parent is the class calling this method\n\t\techo '<p>' . JText::_('COM_HELLOWORLD_UNINSTALL_TEXT') . '</p>';\n\t\t\n\t}", "function getDescription() {\n\t\treturn __('plugins.themes.ufrn-theme.description');\n\t}", "public function uninstallAction()\r\n\t{\r\n\t try {\r\n \t // run the upgrade command\r\n \t $packageName = $this->_runCommand(\r\n \t $command = Faett_Core_Interfaces_Service::COMMAND_UNINSTALL\r\n \t );\r\n // attach a message to the session\r\n \t\tMage::getSingleton('adminhtml/session')->addSuccess(\r\n \t\t Mage::helper('adminhtml')->__(\r\n \t\t '201.success.package-uninstall', $packageName\r\n \t\t )\r\n \t\t);\r\n\t } catch(Faett_Manager_Exceptions_InvalidCommandException $ice) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t $ice->getMessage()\r\n \t\t);\r\n\t } catch(Exception $e) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t Mage::helper('manager')->__(\r\n \t\t '900.pear.exception',\r\n \t\t $e->getMessage()\r\n \t\t )\r\n \t\t);\r\n\t }\r\n // redirect to the licence overview\r\n $this->_redirect('*/*/');\r\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->getContext()->getI18n()->dt( 'controller/jobs', 'Deletes unfinished orders an makes their products and coupon codes available again' );\n\t}", "function uninstall($moduleName);", "function remove() {\r\n global $db;\r\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key LIKE 'MODULE\\_PAYMENT\\_NOCHEX%'\");\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_UNINSTALLED');\r\n }", "protected function getUnpublishDescription(): string {\n $date = $this->getScheduledDate('unpublish');\n\n if ($date) {\n return $this->t('Scheduled unpublish date: <span>@date</span>', [\n '@date' => $this->dateFormatter->format($date, 'tieto_date'),\n ]);\n }\n\n return '';\n }", "public function getUninstall()\n {\n return str_replace(['{sap}', '{version}'], [$this->getSap(), $this->getBaseVersion()->getRaw()], self::UNINSTALL);\n }", "function getDescription()\n {\n $description = '\n\t\tThis is the template installation type. Change this text within the file for this installation type.';\n return $description;\n }", "function uninstall($parent) \n { \n echo '<p>' . JText::_('COM_ACTIVATEGRID_UNINSTALL_TEXT') . '</p>';\n }", "function ui_description() {\n if (isset($this->plugin['ui_description'])) {\n return check_plain($this->plugin['ui_description']);\n }\n }", "public function uninstall()\n {\n //throw new Box_Exception(\"Throw exception to terminate module uninstallation process with a message\", array(), 124);\n return true;\n }", "function GetAdminDescription()\n {\n return $this->Lang('moddescription');\n }", "public function register_uninstall();", "function uninstall($parent)\n\t{\n\t\techo '<p>'. JText::_('COM_BDGALLERY_UNINSTALL_TEXT') .'</p>';\n\t}", "function ispapissl_addon_deactivate(): array\n{\n return ['status' => 'success','description' => 'Uninstalled'];\n}", "function InstallPostMessage()\n {\n return $this->Lang('postinstall');\n }", "function InstallPostMessage() {\n\t\treturn $this->Lang('postinstall');\n\t}", "public function getDescription()\n {\n return $this->getNodeText('/p:package/p:description');\n }", "public function getDescription(): string\n {\n return 'Se crea el campo anexos del sistema';\n }" ]
[ "0.84049964", "0.7180951", "0.7143661", "0.7110559", "0.7046943", "0.66744494", "0.654629", "0.62587106", "0.6253436", "0.6242564", "0.6161561", "0.61471224", "0.6121639", "0.60970557", "0.60054845", "0.5977775", "0.5966751", "0.5965148", "0.5950362", "0.59383667", "0.59313655", "0.59247506", "0.59121466", "0.5891809", "0.58808696", "0.58540577", "0.5841483", "0.5820212", "0.58173037", "0.5806587" ]
0.8340212
1
Logs one or several messages into daemon log file.
public function log($messages) { if (!is_array($messages)) { $messages = [$messages]; } foreach ($messages as $message) { file_put_contents($this->logFile, date('d.m.Y H:i:s') . ' - ' . $message . PHP_EOL, FILE_APPEND | LOCK_EX); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function write()\n\t{\n\t\t// Set the log threshold\n\t\t$threshold = Config::item('log.threshold');\n\n\t\t// Don't log if there is nothing to log to\n\t\tif ($threshold < 1 OR count(self::$messages) === 0) return;\n\n\t\t// Set the log filename\n\t\t$filename = self::$log_directory.date('Y-m-d').'.log'.EXT;\n\n\t\t// Compile the messages\n\t\t$messages = '';\n\t\tforeach(self::$messages as $type => $data)\n\t\t{\n\t\t\tif (array_search($type, self::$types) > $threshold)\n\t\t\t\tcontinue;\n\n\t\t\tforeach($data as $date => $text)\n\t\t\t{\n\t\t\t\tlist($date, $message) = $text;\n\t\t\t\t$messages .= $date.' -- '.$type.': '.$message.\"\\r\\n\";\n\t\t\t}\n\t\t}\n\n\t\t// No point in logging nothing\n\t\tif ($messages == '')\n\t\t\treturn;\n\n\t\t// Create the log file if it doesn't exist yet\n\t\tif ( ! file_exists($filename))\n\t\t{\n\t\t\ttouch($filename);\n\t\t\tchmod($filename, 0644);\n\n\t\t\t// Add our PHP header to the log file to prevent URL access\n\t\t\t$messages = \"<?php defined('SYSPATH') or die('No direct script access.'); ?>\\r\\n\\r\\n\".$messages;\n\t\t}\n\n\t\t// Append the messages to the log\n\t\tfile_put_contents($filename, $messages, FILE_APPEND) or trigger_error\n\t\t(\n\t\t\t'The log file could not be written to. Please correct the permissions and refresh the page.',\n\t\t\tE_USER_ERROR\n\t\t);\n\t}", "function log()\n\t{\n\t\tcall_user_func_array(array($this->server, 'log'), func_get_args());\n\t}", "public function log_feed( $ids ) {\n\t\tif ( false === $ids || empty( $ids ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( $ids as $id ) {\n\t\t\tfile_put_contents( $this->log, \"$id\\n\", FILE_APPEND );\n\t\t}\n\t}", "private static function logging()\n {\n $files = ['Handler', 'Exception', 'Log'];\n $folder = static::$root.'Logging'.'/';\n\n self::call($files, $folder);\n }", "public function write(array $messages)\n\t{\n\t\tforeach ($messages as $message)\n\t\t{\n\t\t\t$message['level'] = $this->_log_levels[$message['level']];\n\n\t\t\t$this->_mongo->insert($this->_collection_name, $message);\n\t\t\t// Write each message into the log file\n\t\t\t// Format: time --- level: body\n//\t\t\tfile_put_contents($filename,\n//\t\t\t\tPHP_EOL . $message['time'] . ' --- ' . $this->_log_levels[$message['level']] . ': ' . $message['body'],\n//\t\t\t\tFILE_APPEND);\n\t\t}\n\t}", "private function send_log() {\n MessageLogger::add_log($this->log);\n $this->log = \"\";\n }", "public function log($entries) {\n\n date_default_timezone_set('Europe/Madrid');\n\n if(is_string($entries)) {\n fwrite($this->handle, \"Error: [\" . date($this->dateFormat) . \"] \" . $entries);\n $this->addIpClient();\n\n return;\n }\n\n if(is_array($entries)) {\n $firstLine = true;\n foreach($entries as $value) {\n if($firstLine) {\n fwrite($this->handle, \"Error: [\" . date($this->dateFormat) . \"] \" . $value);\n $firstLine = false;\n continue;\n }\n fwrite($this->handle, $value);\n }\n\n $this->addIpClient();\n }\n }", "public function write(array $messages)\n {\n // Descriptive array\n $info = array\n (\n 'host' => Request::$client_ip,\n 'agent' => Request::$user_agent,\n 'user' => User::active_user()->id,\n 'url' => Text::plain(Request::initial()->uri()),\n );\n\n // Message to log\n $logs = array();\n\n foreach ($messages as $message)\n {\n if(isset($message))\n {\n $message['type'] = $this->_log_levels[$message['level']];\n $message['time'] = new MongoDate(strtotime($message['time']));\n\n // Merging descriptive array and the current message\n $logs[] = array_merge($info, $message);\n }\n }\n\n if(! empty($logs))\n {\n // Record to a collection\n Mango::instance($this->_name)->batch_insert($this->_collection, $logs);\n }\n }", "public function log()\n {\n $this->appendLog('log', \\func_get_args());\n }", "public function log( $message = '' ) {\r\n\t\t$message = date( 'Y-n-d H:i:s' ) . ' - ' . $message . \"\\r\\n\";\r\n\t\t$this->write_to_log( $message );\r\n\r\n\t}", "public static function log_save()\n {\n if (empty(self::$log) or self::$configuration['core']['log_threshold'] < 1) {\n return;\n }\n\n // Filename of the log\n $filename = self::log_directory().date('Y-m-d').'.log'.EXT;\n\n if (! is_file($filename)) {\n // Write the SYSPATH checking header\n file_put_contents($filename,\n '<?php defined(\\'SYSPATH\\') or die(\\'No direct script access.\\'); ?>'.PHP_EOL.PHP_EOL);\n\n // Prevent external writes\n chmod($filename, 0644);\n }\n\n // Messages to write\n $messages = array();\n\n do {\n // Load the next mess\n list($date, $type, $text) = array_shift(self::$log);\n\n // Add a new message line\n $messages[] = $date.' --- '.$type.': '.$text;\n } while (! empty(self::$log));\n\n // Write messages to log file\n file_put_contents($filename, implode(PHP_EOL, $messages).PHP_EOL, FILE_APPEND);\n }", "protected function log($data) {\n $time = date('Y-m-d h:i:s a', time());\n $line = $time.\" \".$data.PHP_EOL;\n echo $line;\n file_put_contents($this->_directories[\"communication.log\"], $line,FILE_APPEND);\n }", "public function log()\n {\n $output = new Output(Output::MODE_FILE, $this->getLogPath());\n $output->open();\n foreach (func_get_args() as $argument) {\n $output->dump($argument);\n }\n $output->close();\n }", "private function _log($data)\n {\n file_put_contents($this->_logfile, print_r($data, true) . PHP_EOL, FILE_APPEND);\n error_log(print_r($data, true));\n }", "function logger() {\n $args = func_get_args();\n foreach( $args as $arg) {\n file_put_contents('php://stderr', print_r( $arg, true) . \"\\n\");\n }\n}", "function _log($message)\n{\n\tfwrite($GLOBALS['logfile'], date(\"Y-m-d H:i:s :: \", time()) . $message . \"\\n\");\n}", "function log1($msg)\n{\n if(WRITE_LOG == false)\n return;\n date_default_timezone_set('Europe/Vienna');\n $now = date(\"Y-m-d H:i:s\");\n $line = sprintf(\"%s => %s\\r\\n\", $now, $msg);\n file_put_contents(LOG_FILE, $line, FILE_APPEND);\n}", "public function write()\n {\n echo 'file log write...';\n }", "public function logs() {\n\t\t$this->out('Deleting logs:');\n\t\tif (!empty($this->args)) {\n\t\t\tforeach ($this->args as $arg) {\n\t\t\t\tif (!is_dir(LOGS . $arg)) {\n\t\t\t\t\t$this->err('No log dir \\'' . $arg . '\\'');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$this->out('\\'' . $arg . '\\' emptied');\n\t\t\t\t$this->_empty(LOGS . $arg);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->_empty(LOGS);\n\t\t\t$this->out('All log files deleted');\n\t\t}\n\t}", "public static function log()\n {\n dmContext::getInstance()->getLogger()->err(self::formatAsString(func_get_args()));\n }", "public function log($message) {\n fwrite(STDOUT, $message . \"\\n\");\n }", "public function log ( $msg )\n {\n if ( $this->file_handle == null) {\n $this->openFile();\n }\n\n fwrite($this->file_handle, \"[\" . date(\"H:i:s\") . \"] \" . $msg . \"\\n\");\n }", "function dokan_log( $message ) {\n $message = sprintf( \"[%s] %s\\n\", date( 'd.m.Y h:i:s' ), $message );\n error_log( $message, 3, DOKAN_DIR . '/debug.log' );\n}", "public function logs()\n {\n $this->_display('logs');\n }", "abstract public function log( $message );", "public function log( $message ) {\n\t\tif ( edd_get_option( 'eddeet_debug_mode' ) ) {\n\t\t\t$logger = $GLOBALS['edd_logs'];\n\t\t\t$message = ( is_array( $message ) ? print_r( $message, 1 ) : $message ) . PHP_EOL;\n\t\t\t$logger->log_to_file( $message );\n\t\t}\n\t}", "public function writeLog()\n {\n $redis = self::getClient();\n $redis ->lPush('admin_log',$this->data);\n }", "public function write($messages);", "protected function log($msg, $file = 'log', $newline = true)\n\t{\n\t\tif ($newline) {\n\t\t\t$msg = date('D, j M H:i:s') . ' ' . $msg . \"\\n\";\n\t\t}\n\t\techo $msg;\n\t\tfile_put_contents(LOG_DIR . $file, $msg, FILE_APPEND);\n\t}", "public function log($data){\n $logger = new LogToFile;\n $logger->log($data);\n }" ]
[ "0.65168196", "0.63853097", "0.62027436", "0.6175546", "0.6170096", "0.6102754", "0.6078396", "0.6051437", "0.5949021", "0.5940268", "0.5926393", "0.5910094", "0.5863999", "0.58120394", "0.57443136", "0.57404274", "0.57107013", "0.56841874", "0.56251913", "0.56055385", "0.5604327", "0.55995876", "0.5592774", "0.55898106", "0.5581752", "0.5571991", "0.55713147", "0.55682766", "0.5539136", "0.55364585" ]
0.69757974
0
This function will caluclate and return all possible combinations of button presses on a mechanical lock given the following restrictions: each button can only be used maximum of once in a combination a combination must have a length of at least 1
function combinations(array $buttons) { $return = array(); foreach ($buttons as $key => $button) { $newbuttons = $buttons; unset($newbuttons[$key]); $combinations = combinations($newbuttons); $return[] = $button; foreach($combinations as $combination) { // do combinations that include this button $return[] = $button . ' ' . $combination; // do combinations that don't include this button $return[] = $combination; } // do combinations that include multi button $newbuttons2 = $newbuttons; foreach ($newbuttons2 as $key2 => $button2) { // combinations should always be listed with the lower number first if ($button2 < $button) { continue; } unset($newbuttons2[$key2]); $combinations = combinations($newbuttons2); $return[] = $button . '-' . $button2; foreach($combinations as $combination) { $return[] = $button . '-' . $button2 . ' ' . $combination; } } } // remove duplicates return array_unique($return); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function getButtons() {}", "protected function generateButtons() {}", "public function getButtons() {}", "public function getButtons() {}", "public function getButtons() {}", "public function getButtons() {}", "public function getButtonOptions()\r\n {\r\n $out = array();\r\n\r\n// if ($this->getChatHelper()->getButtonShow() || $this->getForceButtonDisplay()) {\r\n// $out[] = \"\\$zopim.livechat.button.show()\";\r\n// } else {\r\n// $out[] = \"\\$zopim.livechat.button.hide()\";\r\n// }\r\n\r\n if (strlen($this->getChatHelper()->getButtonPosition()) > 0) {\r\n $out[] = \"\\$zopim.livechat.button.setPosition('\" . $this->getChatHelper()->getButtonPosition() . \"')\";\r\n $out[] = \"\\$zopim.livechat.window.setPosition('\" . $this->getChatHelper()->getButtonPosition() . \"')\";\r\n }\r\n\r\n if (strlen($this->getChatHelper()->getButtonPositionMobile()) > 0) {\r\n $out[] = \"\\$zopim.livechat.button.setPositionMobile('\" . $this->getChatHelper()->getButtonPositionMobile() . \"')\";\r\n }\r\n\r\n if ($this->getChatHelper()->getButtonHideOffline()) {\r\n $out[] = \"\\$zopim.livechat.button.setHideWhenOffline(1)\";\r\n }\r\n\r\n// if (($this->getChatHelper()->getWidgetApi() == 'new')) {\r\n// if (strlen($this->getChatHelper()->getButtonOffsetVertical()) > 0) {\r\n// $out[] = \"\\$zopim.livechat.button.setOffsetVertical('\" . $this->getChatHelper()->getButtonOffsetVertical() . \"')\";\r\n// }\r\n//\r\n// if (strlen($this->getChatHelper()->getButtonOffsetHorizontal()) > 0) {\r\n// $out[] = \"\\$zopim.livechat.button.setOffsetHorizontal('\" . $this->getChatHelper()->getButtonOffsetHorizontal() . \"')\";\r\n// }\r\n// }\r\n\r\n if (count($out) > 0) {\r\n return implode(';' . \"\\n\", $out). ';' . \"\\n\";\r\n }\r\n return null;\r\n }", "function process_button() {\n\n global $order, $_POST, $HTTP_SERVER_VARS;\n global $db;\n\n $myOptions = array();\n $buttonArray = array();\n\n\t\t // A.NET INVOICE NUMBER FIX\n\t\t // find the next order_id to pass as x_Invoice_Num\n\t\t $next_inv = '';\n\t\t $inv_id = $db->Execute(\"select orders_id from \" . TABLE_ORDERS . \" order by orders_id DESC limit 1\");\n\t\t $last_inv = $inv_id->fields['orders_id'];\n\t\t $next_inv = $last_inv+1;\n\t\t // END A.NET INVOICE NUMBER FIX\n\n $check_query1 = $db->Execute(\"SELECT configuration_key,configuration_value FROM `configuration` WHERE `configuration_key` LIKE 'MODULE\\_PAYMENT\\_CCBILL\\_%'\");\n while(!$check_query1->EOF)\n {\n\n switch($check_query1->fields['configuration_key']){\n case 'MODULE_PAYMENT_CCBILL_ClientAccountNo': \t\t\t$this->ClientAccountNo \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_ClientSubAccountNo': \t\t\t$this->ClientSubAccountNo \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_FormName': \t\t\t$this->FormName \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_IsFlexForm': \t $this->IsFlexForm \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_Currency': \t\t\t$this->Currency \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_Salt': \t\t\t$this->Salt \t\t= $check_query1->fields['configuration_value'];\n break;\n case 'MODULE_PAYMENT_CCBILL_ORDER_STATUS_ID':\t\t\t\t\t$this->order_status\t\t\t\t= $check_query1->fields['configuration_value'];\n break;\n }// end switch\n\n $check_query1->MoveNext();\n }// end while\n\n $this->setCurrencyCode();\n\n $isFlexForm = $this->IsFlexForm == 'True' ? true : false;\n\n $this->TransactionAmount = number_format($order->info['total'], 2, '.', '');\n $billingPeriodInDays = 2;\n\n\n \t\t$priceVarName = 'formPrice';\n \t\t$periodVarName = 'formPeriod';\n\n $stringToHash = '' . $this->TransactionAmount\n \t . $billingPeriodInDays\n \t . $this->CurrencyCode\n \t . $this->Salt;\n\n \t $this->Hash = md5($stringToHash);\n\n $ccbill_addr = 'http://www.goolge.com';//$this->form_action_url;\n\n if($isFlexForm) {\n $ccbill_addr = $this->flexform_base_url . $this->FormName;\n \t\t$priceVarName = 'initialPrice';\n \t\t$periodVarName = 'initialPeriod';\n }// end if\n\n\n $myOptions['clientAccnum'] = $this->ClientAccountNo;\n $myOptions['clientSubacc'] = $this->ClientSubAccountNo;\n $myOptions['formName'] = $this->FormName;\n $myOptions[$priceVarName] = $this->TransactionAmount;\n $myOptions[$periodVarName] = $billingPeriodInDays;\n $myOptions['currencyCode'] = $this->CurrencyCode;\n $myOptions['customer_fname'] = $order->customer['firstname'];\n $myOptions['customer_lname'] = $order->customer['lastname'];\n $myOptions['email'] = $order->customer['email_address'];\n $myOptions['zipcode'] = $order->billing['postcode'];\n $myOptions['country'] = $order->billing['country']['iso_code_2'];\n $myOptions['city'] = $order->billing['city'];\n $myOptions['state'] = $this->getStateCodeFromName($order->billing['state']);\n $myOptions['address1'] = $order->billing['street_address'];\n $myOptions['zc_orderid'] = $next_inv;\n $myOptions['MyCount'] = $_SESSION['MYCOUNT'];\n $myOptions['formDigest'] = $this->Hash;\n\n $_SESSION['CCBILL_AMOUNT'] = $this->TransactionAmount;\n\n // build the button fields\n foreach ($myOptions as $name => $value) {\n // remove quotation marks\n $value = str_replace('\"', '', $value);\n // check for invalid characters\n if (preg_match('/[^a-zA-Z_0-9]/', $name)) {\n //ipn_debug_email('datacheck - ABORTING - preg_match found invalid submission key: ' . $name . ' (' . $value . ')');\n break;\n }// end if\n\n $buttonArray[] = zen_draw_hidden_field($name, $value);\n }// end foreach\n\n $process_button_string = \"\\n\" . implode(\"\\n\", $buttonArray) . \"\\n\";\n\n $_SESSION['ccbill_transaction_info'] = array($this->transaction_amount, $this->transaction_currency);\n\n return $process_button_string;\n\n }", "function buildButtons($disable = null, $commands = null)\r\n {\r\n $buttons = array('back', 'next', 'cancel', 'reset',\r\n 'dump', 'apply', 'process');\r\n if (isset($commands)) {\r\n $buttons = array_merge($buttons, $commands);\r\n }\r\n\r\n if (!isset($disable)) {\r\n $disable = array();\r\n } elseif (!isset($disable[0])) {\r\n $disable = array($disable);\r\n }\r\n\r\n $attributes = array('class' => 'cmdButton');\r\n $confirm = array('class' => 'cmdButton',\r\n 'onclick' => \"return(confirm('Are you sure ?'));\");\r\n $prevnext = array();\r\n\r\n foreach ($buttons as $event) {\r\n switch ($event) {\r\n case 'cancel':\r\n $type = 'submit';\r\n $attrs = $confirm;\r\n break;\r\n case 'reset':\r\n $type = 'reset';\r\n $attrs = $confirm;\r\n break;\r\n default :\r\n $type = 'submit';\r\n $attrs = $attributes;\r\n break;\r\n }\r\n if (in_array($event, $disable)) {\r\n $attrs['disabled'] = 'true';\r\n }\r\n if ($event == 'dump') {\r\n $dump = $this->controller->_act[$event];\r\n if ($dump === false) {\r\n continue;\r\n }\r\n $opts = array('1' => 'Progress2 dump info',\r\n '2' => 'Forms values container',\r\n '3' => 'Included Files',\r\n '4' => 'Declared Classes',\r\n '5' => 'Declared Actions');\r\n\r\n $prevnext[] =&HTML_QuickForm::createElement('select',\r\n 'dumpOption',\r\n '', $opts);\r\n }\r\n $prevnext[] =&HTML_QuickForm::createElement($type,\r\n $this->getButtonName($event),\r\n ucfirst($event),\r\n HTML_Common::_getAttrString($attrs));\r\n }\r\n $this->addGroup($prevnext, 'buttons', '', '&nbsp;', false);\r\n }", "public function sum_possibilitis() {\n // initialize by adding the empty set\n $UnblockedNums=$this->getUnblockedNums();\n $allcombinations=$this->getallcombinations($UnblockedNums);\n\n $sums = array();\n foreach ($allcombinations as $result){\n array_push($sums,array_sum($result));\n }\n return array_unique($sums);\n }", "function combinations($items, $num) {\n $returnArray = array();\n if (sizeof($items) == $num) { // required = remaining --> return that array\n return array($items); // make sure this is a copy\n }\n if ($num == 0) { // number of items required has been reached -> return empty array\n return array();\n }\n // otherwise\n $item = array(array_shift($items));\n $temp = combinations($items, $num-1);\n $partA = array();\n if (sizeof($temp) == 0) {\n $partA = array($item);\n }\n foreach ($temp as $t) {\n if (is_array($t)) {\n $partA[] = array_merge($item, $t);\n } else {\n $partA[] = array_merge($item, array($t));\n }\n }\n $partB = combinations($items, $num);\n echo(\"Boop\" . rand(1,100) . \"\\n\");\n return array_merge($partA, $partB);\n}", "public function combinations() : array\n {\n $combinations = [[]];\n\n foreach ($this->grid as $i => $params) {\n $append = [];\n\n foreach ($combinations as $product) {\n foreach ($params as $param) {\n $product[$i] = $param;\n $append[] = $product;\n }\n }\n\n $combinations = $append;\n }\n\n return $combinations;\n }", "function checkOptionCombination($optionInfo, $addMsg)\n{\n global $combinationCheckList;\n global $optionList;\n\n /* If the option is specified, check combination with the combinationCheckList */\n foreach ($optionInfo as $currentOption => $status) {\n\n /* check whether option is specified */\n if (isset($status) && !($status === false)) {\n\n /* check whether option that can not be specified at the same time is specified */\n foreach ($combinationCheckList[$currentOption] as $val) {\n if (isset($optionInfo[$val]) && !($optionInfo[$val] === false)) {\n\n /* get string of short option */\n /* if short option do not exist, exclude from error message */\n $tmpOpt = array_search($currentOption, $optionList);\n $forwardOpt = ($tmpOpt ? \"-\" . $tmpOpt . \", \" : \"\") . \"--\" . $currentOption;\n $tmpOpt = array_search($val, $optionList);\n $backwardOpt = ($tmpOpt ? \"-\" . $tmpOpt . \", \" : \"\") . \"--\" . $val;\n elog(ERROR, \"Exclusive options: '%s' and '%s'\" . $addMsg, $forwardOpt, $backwardOpt);\n }\n }\n }\n }\n}", "private function get_possibilities($k, $kk) {\n $values = array();\n if ($k <= 2) {\n $row_num = 1;\n }\n if ($k > 2 && $k <= 5) {\n $row_num = 2;\n }\n if ($k > 5 && $k <= 8) {\n $row_num = 3;\n }\n if ($kk <= 2) {\n $col_num = 1;\n }\n if ($kk > 2 && $kk <= 5) {\n $col_num = 2;\n }\n if ($kk > 5 && $kk <= 8) {\n $col_num = 3;\n }\n for ($n = 1; $n <= 9; $n++) {\n if (!in_array($n, $this->comming_arr[$k]) && !in_array($n, $this->columns_begining[$kk + 1]) && !in_array($n, $this->grids[$row_num][$col_num])) {\n $values[] = $n;\n }\n }\n shuffle($values);\n return $values;\n }" ]
[ "0.51232463", "0.51232463", "0.51232463", "0.51232463", "0.51232463", "0.51229566", "0.51229566", "0.51229566", "0.51229566", "0.51229566", "0.51229566", "0.51229566", "0.51229566", "0.51216924", "0.51216924", "0.51216924", "0.51216924", "0.50939745", "0.4889067", "0.4889067", "0.4889067", "0.48878643", "0.4868819", "0.47250172", "0.46988752", "0.46541443", "0.46489352", "0.45738828", "0.45733297", "0.44399527" ]
0.6407747
0
Move to the next row in the file
protected function _moveNext() { if ($nextRow = $this->_getNextRow()) { $this->_currentRow = $this->_formatRow($nextRow); } else { $this->_currentRow = array(); } if (!$this->_currentRow) { fclose($this->_handle); $this->_valid = false; $this->_handle = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveToNextRow();", "public function next(): void\n {\n $this->values = [];\n $row = fgetcsv($this->fp, 0, $this->delimiter, $this->enclosure);\n\n if ($row) { // Is het einde (eof) nog niet bereikt?\n if ($row === array(null)) { // Empty row?\n $this->next(); // Skip row\n return;\n }\n ++$this->index;\n foreach ($this->keys as $index => $key) {\n if (isset($row[$index])) { // Is er voor deze kolom een waarde?\n $this->values[$key] = $row[$index];\n } else {\n $filename = (strpos($this->filename, \\Sledgehammer\\PATH) === 0) ? substr($this->filename, strlen(\\Sledgehammer\\PATH)) : $this->filename; // Waar mogelijk het PATH er van af halen\n \\Sledgehammer\\notice('Row too short, missing column #' . ($index + 1) . ': \"' . $this->keys[$index] . '\" in ' . $filename . ' on line ' . ($this->index + 2), $row); // @todo Calculate line offset compared to the index ()\n }\n }\n } else {\n $this->index = null;\n }\n }", "public function next() {\n\t\t$this->_currentRow++;\n\t}", "function moveNext() {\r\n\r\n $row = $this->result->fetchRow( MDB2_FETCHMODE_ASSOC );\r\n $this->EOF = !is_array( $row );\r\n $this->fields = $row;\r\n\r\n }", "public function next()\n {\n try {\n $this->_moveNext();\n } catch (TwitterImport_FormattingException $e) {\n if ($this->_skipInvalidRows) {\n $this->_skippedRowCount++;\n $this->next();\n } else {\n throw $e;\n }\n }\n }", "function getNextRow()\r\n\t{\r\n\t\t$this->node_priority = false;\r\n\t\t\r\n\t\t// set mapping array\r\n\t\t$this->first_field = true;\r\n\t\treset( $this->mapping );\r\n\r\n\t\tif( $this->ignore_first_row )\r\n\t\t{\r\n\t\t\t$this->ignore_first_row = false;\r\n\t\t\tfgetcsv( $this->m_aData , 100000, $this->delimiter, $this->enclosure ); // nirvana\r\n\t\t}\r\n\r\n\t\t$this->row = fgetcsv( $this->m_aData , 100000, $this->delimiter, $this->enclosure);\r\n\r\n\t\treturn $this->row;\r\n\t}", "protected function _getNextRow()\n {\n $currentRow = array();\n $handle = $this->_getFileHandle();\n while (($row = fgets($handle)) !== FALSE) {\n $this->_currentRowNumber++;\n return $row;\n }\n }", "public function next()\n {\n $this->fileObject->next();\n }", "public function next()\n {\n $this->position++;\n $this->fileIterator->seek($this->position);\n }", "function next()\n {\n if(!$this->buffer_row){\n $this->z->next('TABLE');\n }\n\n $this->position++ ;\n }", "public function next()\n\t{\n\t\t$this->j++;\n\t\t$this->c += $this->grid->getRowCount();\n\t}", "public function moveToStartOfNextLine() {}", "public function moveToStartOfNextLine() {}", "function MoveNext() \r\n\t{\r\n\t\tif (!$this->EOF) {\r\n\t\t\t$this->_currentRow++;\r\n\t\t\tif ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {\r\n\t\t\t\t$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);\r\n\t\t\t\r\n\t\t\t\tif (is_array($this->fields)) {\r\n\t\t\t\t\tif (isset($this->_blobArr)) $this->_fixblobs();\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->fields = false;\r\n\t\t\t$this->EOF = true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function next()\n {\n fseek($this->resource, 1, SEEK_CUR);\n }", "function MoveNext()\n\t{\n\t\tif (!$this->EOF) {\n\t\t\t$this->_currentRow++;\n\t\t\tif ($this->_numOfRows < 0 || $this->_numOfRows > $this->_currentRow) {\n\t\t\t\t$this->fields = @pg_fetch_array($this->_queryID,$this->_currentRow,$this->fetchMode);\n\t\t\t\tif (is_array($this->fields) && $this->fields) {\n\t\t\t\t\tif (isset($this->_blobArr)) $this->_fixblobs();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->fields = false;\n\t\t\t$this->EOF = true;\n\t\t}\n\t\treturn false;\n\t}", "public function next()\n\t{\n\t\t$this->pointer++;\n\t\t$this->row = $this->result->get($this->pointer);\n\t}", "public function next(): void\n {\n if (count($this->data) > 0) {\n array_shift($this->data);\n }\n ++$this->position;\n\n if ($this->position > $this->numberOfRecords()) {\n return;\n }\n\n if (count($this->data) == 0) {\n $this->fetchMore();\n }\n }", "public function next()\n {\n $this->_currentElement = fgets($this->_handle, self::LINE_LENGTH);\n $this->_currentIndex++;\n }", "public function next()\n {\n $row = $this->getRow($this->pointer);\n if($row){\n $this->pointer++;\n }\n return $row;\n }", "public function next() {\n\t\tif ($this->rowIndex++ < count($this->rows)) {\n\t\t\treturn true;\n\t\t}\n\t}", "public function next(): void {\n if (fseek($this->fileHandle,\n ($this->position + $this->blockSize)) === 0) {\n // Set new location\n $this->updatePosition();\n $this->readBlock();\n } else {\n // Otherwise mark the position invalid and throw an exception\n $this->isValid = false;\n throw new OutOfBoundsException();\n }\n }", "public function next()\n {\n $this->dataSource->next();\n $this->position++;\n }", "public function next(): void\n {\n $this->position++;\n if (null === $this->generator || !$this->generator->valid()) {\n return;\n }\n\n if (contains_key($this->entries, $this->position + 1)) {\n return;\n }\n\n $this->progress();\n $this->saved = false;\n if ($this->generator) {\n $this->generator->next();\n }\n\n $this->progress();\n }", "public function next() {\n\t\t$this->position ++;\n\t}", "public function next()\n {\n $this->cursor++;\n }", "function next() {\n $this->position++;\n }", "public function next()\n {\n $this->position++;\n }", "public function next()\n {\n $this->position++;\n }", "abstract public function nextRow($result = false);" ]
[ "0.7762486", "0.746502", "0.72060305", "0.71865386", "0.70487857", "0.70300806", "0.6871013", "0.6768138", "0.67641014", "0.67326576", "0.6723983", "0.6722316", "0.6722316", "0.6678585", "0.6660867", "0.66349834", "0.662171", "0.6619982", "0.6454831", "0.6410091", "0.6389095", "0.6326409", "0.62978685", "0.6289604", "0.62853897", "0.6273831", "0.624481", "0.62296486", "0.62296486", "0.62279207" ]
0.8280732
0
Returns the number of rows that were skipped since the last time the function was called. Skipped count is reset to 0 after each call to getSkippedCount(). This makes it easier to aggregate the number over multiple job runs.
public function getSkippedCount() { $skipped = $this->_skippedRowCount; $this->_skippedRowCount = 0; return $skipped; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSkipped(): int\n {\n return $this->skipped;\n }", "public function getSkipped(): int\n {\n return $this->skipped;\n }", "public function getNumberOfSkips()\r\n {\r\n return $this->number_of_skips;\r\n }", "public function getNumberOfSkips()\n {\n return $this->number_of_skips;\n }", "public function getNumShardsSkipped()\n {\n return (int)$this->data['numShardsSkipped'];\n }", "public function getDuplicatesSkippedCount()\n {\n return $this->duplicates_skipped_count;\n }", "public function getNumRows()\n {\n \treturn $this->previouslyExecuted->num_rows;\n }", "public function getRowsCountBeforeLimitFilter()\n {\n $toReturn = $this->rowsCountBeforeLimitFilter;\n if ($toReturn == 0) {\n return $this->getRowsCount();\n }\n return $toReturn;\n }", "public function incrementRowsSkipped(): void\n {\n $this->rowsSkipped++;\n }", "public function getImportedRowsCount()\n {\n return $this->importedRowsCount;\n }", "public function getSkipped();", "function getRowCounter()\n {\n $this->getRows();\n return $this->row_counter;\n }", "public function getSkipRate(): int\n {\n // Fix for division by zero error\n if ($this->getTestsSum() === 0) {\n return 0;\n }\n\n return (int)round(($this->skipped / $this->getTestsSum()) * 100, 0);\n }", "public function getSkips()\n {\n return $this->skips;\n }", "function numRows()\n {\n $this->getRows();\n return $this->row_counter;\n }", "public function getProcessedRowsCount()\n {\n return $this->_processedRowsCount;\n }", "public function getRowsCount()\n {\n if (is_null($this->summaryRow)) {\n return count($this->rows);\n } else {\n return count($this->rows) + 1;\n }\n }", "public function getNumRows(): int\n {\n if (is_int($this->numRows)) {\n return $this->numRows;\n }\n if ($this->resultArray !== []) {\n return $this->numRows = count($this->resultArray);\n }\n if ($this->resultObject !== []) {\n return $this->numRows = count($this->resultObject);\n }\n\n return $this->numRows = count($this->getResultArray());\n }", "public function getDataExtractionInProgressCount() : int\n {\n return $this->dataExtractionInProgressCount;\n }", "public function getRecordsLeft()\n\t{\n\t\t$recordsLeft = $this->getTotalRecords()\n\t\t\t\t\t - $this->_offset\n\t\t\t\t\t - count($this->_data)\n\t\t;\n\n\t\treturn $recordsLeft;\n\t}", "public function getNumberOfRows() {\n return count($this->rows);\n }", "public function getNumberOfRows();", "public function getNumberOfRows()\r\n {\r\n return count($this->data);\r\n }", "public function rows(): int\n {\n return $this->rows;\n }", "function getNumRows() {\r\n\t\t\tif($this->privateVars['resultset']) {\r\n\t\t\t\tif(@mysql_num_rows($this->privateVars['resultset']))\r\n\t\t\t\t\treturn mysql_num_rows($this->privateVars['resultset']);\r\n\t\t\t}\r\n\t\t\treturn -1;\r\n\t\t}", "public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}", "public function getSkip()\n {\n return $this->skip;\n }", "public function count()\n\t{\n\t\tif ($this->limited_count_cache === null) {\n\t\t\tif ($this->trust_row_count === false) {\n\t\t\t\t$this->limited_count_cache = $this->query->runTotalRowsCount();\n\t\t\t} else {\n\t\t\t\t$this->limited_count_cache = $this->getStatement()\n\t\t\t\t\t\t\t\t\t\t\t\t ->rowCount();\n\t\t\t}\n\t\t}\n\n\t\treturn $this->limited_count_cache;\n\t}", "public function countRows()\n {\n return count($this->rows);\n }", "public function getSkipped()\n {\n if (is_null($this->Skipped)) {\n /** @psalm-var ?float $data */\n $data = $this->raw(self::FIELD_SKIPPED);\n if (is_null($data)) {\n return null;\n }\n $this->Skipped = (float) $data;\n }\n\n return $this->Skipped;\n }" ]
[ "0.77461714", "0.77461714", "0.7511988", "0.7488802", "0.70076495", "0.6961285", "0.6919842", "0.6853091", "0.6779903", "0.66321754", "0.64713377", "0.63641965", "0.6334542", "0.62789416", "0.6240237", "0.6237384", "0.6199614", "0.60699356", "0.6058912", "0.6057507", "0.60450065", "0.60434085", "0.6035245", "0.6033061", "0.6024185", "0.60212713", "0.6006765", "0.5997583", "0.5994015", "0.59892035" ]
0.85684216
0
Sets whether to skip invalid rows
public function skipInvalidRows($flag) { $this->_skipInvalidRows = (boolean)$flag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setInvalid();", "public function incrementRowsSkipped(): void\n {\n $this->rowsSkipped++;\n }", "public function testGetDataTableInvalidQuery() {\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 // Write data to the database\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$query = 'invalid sql query';\r\n $this->setExpectedException('Exception', 'Error in query: '.$query);\r\n\t\t$this->getPersistenceAdapter()->getDataTable($query);\r\n\t}", "public function testRowSkipWithoutMessage() {\n $configuration = [\n 'index' => 'some_key',\n ];\n $process = new SkipRowIfNotSet($configuration, 'skip_row_if_not_set', []);\n $this->expectException(MigrateSkipRowException::class);\n $process->transform('', $this->migrateExecutable, $this->row, 'destination_property');\n }", "public function skip(/* ... */)\n {\n if ($this->getTestResult() !== self::FAIL) {\n $this->setTestResult(self::SKIP);\n }\n }", "public function valid() {\n // TODO: Check numProcessed against itemlimit\n return !is_null($this->currentRow);\n }", "public function setIterateOnlyExistingCells($value = true)\n {\n $this->_onlyExistingCells = $value;\n }", "public function testEmptyCols(): void\n {\n $file_path = base_path('tests/data/expenses_empty_rows.csv');\n $status = $this->importSvc->importExpenses($file_path);\n $this->assertCount(8, $status['success']);\n $this->assertCount(0, $status['errors']);\n }", "public function valid() {\n if ($valid=isset($this->__rows__[$this->__rowsi__])) {\n $this->__iterate__ = true;\n } else {\n unset($this->__iterate__);\n }\n return $valid;\n }", "public function setSkip($skip) {\n\t$this->parseQuery->setSkip($skip);\n }", "public function testGetDataTableNoResult() {\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 // Write data to the database\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$query = 'delete from POTEST';\r\n $this->setExpectedException('Exception', 'Multiple result statement seems to be a no result statement.');\r\n\t\t$this->getPersistenceAdapter()->getDataTable($query);\r\n\t}", "public function setSkip($skip = true)\n {\n $this->skip = (bool) $skip;\n }", "public function isValid($_throwExceptionOnInvalidData = false);", "public function shouldBeSkipped();", "private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}", "public function skip($_count=1) {\n\t\tif ($this->dry()) {\n\t\t\ttrigger_error(self::TEXT_AxonEmpty);\n\t\t\treturn;\n\t\t}\n\t\t$this->load($this->criteria,$this->order,$this->offset+$_count);\n\t}", "public function next()\n {\n try {\n $this->_moveNext();\n } catch (TwitterImport_FormattingException $e) {\n if ($this->_skipInvalidRows) {\n $this->_skippedRowCount++;\n $this->next();\n } else {\n throw $e;\n }\n }\n }", "public function testValidateThrowMissingColumnException()\n {\n $this->job->setCsvData([['Id'], ['test', 'test2']]);\n\n try {\n $this->job->validate();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), EntityException::MGS_CSV_ROW_COUNT_MISMATCH);\n }\n }", "public function valid() {\n\t\t$this->checkResultSet();\n\n\t\tif ($this->index >= 0 && $this->index < $this->indexMax) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function getInvalidRowsCount()\n {\n return count($this->_invalidRows);\n }", "public function testRowSkipWithMessage() {\n $configuration = [\n 'index' => 'some_key',\n 'message' => \"The 'some_key' key is not set\",\n ];\n $process = new SkipRowIfNotSet($configuration, 'skip_row_if_not_set', []);\n $this->expectException(MigrateSkipRowException::class);\n $this->expectExceptionMessage(\"The 'some_key' key is not set\");\n $process->transform('', $this->migrateExecutable, $this->row, 'destination_property');\n }", "public function setLinesToSkip($number){\n $this->linesToSkip=intval($number);\n }", "public function valid() {\n\t\tif( ! isset( $this->_recordset[ $this->_currentRow ] ) ) {\n\t\t\t$this->_currentRow--;\n\t\t\treturn( false );\n\t\t}\n\t\treturn( true );\n\t}", "public function valid() : bool\n {\n return !($this->key() >= count($this->currentRecordSet) && count($this->currentRecordSet) != $this->pageSize);\n }", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "public function skipOperation(bool $skip): void;", "public function shouldBeSkipped() {\n\t\treturn !$this->countItems();\n\t}", "public function ignoreValidationErrors()\n {\n $this->ignoreValidationErrors = true;\n }", "private static function setInvalidFlag($flag) {\n self::$_elements[self::$_inputElement]['inValid'] = $flag;\n }", "public function skip($skip){\r\n if(!is_integer($skip)){\r\n throw new \\Exception(\"Offset must be an integer.\");\r\n return;\r\n }\r\n $this->offset=$skip;\r\n return $this;\r\n }" ]
[ "0.63697135", "0.62628", "0.60221076", "0.5854457", "0.57778436", "0.55660194", "0.5538043", "0.54678357", "0.5466176", "0.5441718", "0.54219913", "0.537941", "0.5374913", "0.53339624", "0.5278156", "0.5261444", "0.52497613", "0.5236025", "0.523025", "0.51990896", "0.51764673", "0.51381963", "0.51087356", "0.5106733", "0.5098606", "0.5093282", "0.5084743", "0.50671107", "0.5065363", "0.50609004" ]
0.7802997
0
Returns the next row in the JSON file
protected function _getNextRow() { $currentRow = array(); $handle = $this->_getFileHandle(); while (($row = fgets($handle)) !== FALSE) { $this->_currentRowNumber++; return $row; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function next() {\n migrate_instrument_start('MigrateJSONReader::next');\n\n $this->currentElement = $this->currentId = NULL;\n\n // Open the file and position it if necessary\n if (!$this->fileHandle) {\n $this->fileHandle = fopen($this->url, 'r');\n if (!$this->fileHandle) {\n Migration::displayMessage(t('Could not open JSON file !url',\n array('!url' => $this->url)));\n return;\n }\n\n // We're expecting an array of characters, so the first character should be [.\n $char = $this->getNonBlank();\n // Ning exports are wrapped in bogus (), so skip a leading (\n if ($char == '(') {\n $char = $this->getNonBlank();\n }\n if ($char != '[') {\n Migration::displayMessage(t('!url is not a JSON file containing an array of objects',\n array('!url' => $this->url)));\n return;\n }\n }\n\n // We expect to be positioned either at an object (beginning with {) or\n // the end of the file (we should see a ] indicating this). Or, an\n // object-separating comma, to be skipped. Note that this treats\n // commas as optional between objects, which helps with processing\n // malformed JSON with missing commas (as in Ning exports).\n $c = $this->getNonBlank();\n if ($c == ',') {\n $c = $this->getNonBlank();\n }\n // Ning sometimes emits a ] where there should be a comma.\n elseif ($c == ']') {\n $c = $this->getNonBlank();\n if ($c != '{') {\n $c = NULL;\n }\n }\n // We expect to be at the first character of an object now.\n if ($c == '{') {\n // Start building a JSON string for this object.\n $json = $c;\n // Look for the closing }, ignoring brackets in strings, tracking nested\n // brackets. Watch out for escaped quotes, but also note that \\\\\" is not\n // an escaped quote.\n $depth = 1;\n $in_string = FALSE;\n $in_escape = FALSE;\n while (($c = fgetc($this->fileHandle)) !== FALSE) {\n $json .= $c;\n if ($in_string) {\n // Quietly accept an escaped character\n if ($in_escape) {\n $in_escape = FALSE;\n }\n else {\n switch ($c) {\n // Unescaped \" means end of string\n case '\"':\n $in_string = FALSE;\n break;\n // Unescaped \\\\ means start of escape\n case '\\\\':\n $in_escape = TRUE;\n break;\n }\n }\n }\n else {\n // Outside of strings, recognize {} as depth changes, \" as start of\n // string.\n switch ($c) {\n case '{':\n $depth++;\n break;\n case '}':\n $depth--;\n break;\n case '\"':\n $in_string = TRUE;\n break;\n }\n // We've found our match, exit the loop.\n if ($depth < 1) {\n break;\n }\n }\n }\n\n // Turn the JSON string into an object.\n $this->currentElement = json_decode($json);\n $this->currentId = $this->currentElement->{$this->idField};\n }\n else {\n $this->currentElement = NULL;\n $this->currentId = NULL;\n }\n migrate_instrument_stop('MigrateJSONReader::next');\n }", "public function getNextRow() {\n $next_call_count = $this->currentPage * $this->pagination;\n if ($this->currentCount == $this->totalCount) {\n return NULL;\n }\n if ($this->currentCount == $next_call_count && $next_call_count < $this->totalCount) {\n $start = $this->currentPage * $this->pagination;\n if ($str = elis_consumer_http_request($this->url_pattern . '&rows=' . $this->pagination . '&start=' . $start, array('Accept' => 'application/json'))) {\n if ($json = json_decode($str)) {\n $this->data = $json->response->docs;\n $this->currentPage++;\n }\n }\n }\n // TODO Messages in case of empty data / failed call etc.\n $item = NULL;\n if (count($this->data)) {\n $item = current($this->data);\n next($this->data);\n $this->currentCount++;\n }\n return $item;\n }", "function getNextRow()\r\n\t{\r\n\t\t$this->node_priority = false;\r\n\t\t\r\n\t\t// set mapping array\r\n\t\t$this->first_field = true;\r\n\t\treset( $this->mapping );\r\n\r\n\t\tif( $this->ignore_first_row )\r\n\t\t{\r\n\t\t\t$this->ignore_first_row = false;\r\n\t\t\tfgetcsv( $this->m_aData , 100000, $this->delimiter, $this->enclosure ); // nirvana\r\n\t\t}\r\n\r\n\t\t$this->row = fgetcsv( $this->m_aData , 100000, $this->delimiter, $this->enclosure);\r\n\r\n\t\treturn $this->row;\r\n\t}", "public function next()\n {\n $row = $this->getRow($this->pointer);\n if($row){\n $this->pointer++;\n }\n return $row;\n }", "protected function _getNextRow()\n {\n $key = $this->key();\n $this->_index = $this->getIndex($key);\n\n if ($key > $this->_limit) {\n return false;\n }\n return $this->_pattern->getRow($this->_index, $key);\n }", "public function readNextLine() {\n\t\tif ($this->data->rows >= $this->linepointer) {\n\t\t\t$newdata = array();\n\t\t\t$newdata = $this->data->_data[$this->linepointer];\n\t\t\t$this->linepointer++;\n\t\t\treturn $newdata;\n\t\t}\n\t\telse return false;\n\t}", "public function next()\n\t{\n\t\t$this->pointer++;\n\t\t$this->row = $this->result->get($this->pointer);\n\t}", "public function next() {\n\t\t$this->_currentRow++;\n\t}", "public function next()\n {\n return next( $this->data );\n }", "public function getNextRow() {\n $row = mssql_fetch_object($this->result);\n\n // Might be totally out of data, or just out of this batch - request another\n // batch and see\n if (!is_object($row)) {\n mssql_fetch_batch($this->result);\n $row = mssql_fetch_object($this->result);\n }\n if (is_object($row)) {\n return $row;\n }\n else {\n return NULL;\n }\n }", "function getNextRow() {\n\t\tglobal $LANG, $TYPO3_CONF_VARS;\n\t\t\n\t\tif (!empty($this->conf['dontUsePHPFunction'])) {\n\t\t\treturn next($this->rows);\n\t\t}\n\t\t\n\t\t// if there is no enclosure set, the parameter has to be omited\n\t\tif(strlen(trim($this->conf['enclosure'])) > 0) {\n\t\t\twhile (($arrayLine = fgetcsv($this->resource, 10000, $this->conf['delimiter'], trim($this->conf['enclosure']))) !== FALSE) {\n\t\t\t\t$imploded = trim(implode($arrayLine));\n\t\t\t\tif (strlen($imploded) > 1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\twhile (($arrayLine = fgetcsv($this->resource, 10000, $this->conf['delimiter'])) !== FALSE) {\n\t\t\t\t$imploded = trim(implode($arrayLine));\n\t\t\t\tif (strlen($imploded) > 1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// return values from array with increased key-ids\n\t\tif($arrayLine !== FALSE) {\n\t\t\tforeach($arrayLine as $key => $value){\n\t\t\t\tif(substr(trim($value), - 1) == '\"') {\n\t\t\t\t\t$value = str_replace('\"', '', $value);\n\t\t\t\t\t// if the first characted becomes a \"?\", this means, it is related to this bug: https://bugs.php.net/bug.php?id=63433\n\t\t\t\t\tif(utf8_decode($value[0]) == '?') {\n\t\t\t\t\t\t// so strip the quotes in the beginning\n\t\t\t\t\t\t$value = substr($value, 3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$arrayLine[$key+1] = $value;\n\t\t\t}\n\t\t\treturn $arrayLine;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function next()\n {\n\t\tnext($this->_data);\n $this->_index++;\n\t}", "function getNextRow()\n {\n $this->current_row_index++;\n if ( $this->current_row_index > ( $this->offset + $this->limit - 1 ) )\n {\n $this->current_row = false;\n $this->current_row_hash = false;\n $this->mapping = false;\n return $this->current_row;\n }\n\n $result = $this->mysqli->query( 'SELECT * FROM ' . $this->table .\n ' LIMIT 1 OFFSET ' . $this->current_row_index );\n if ( $result->num_rows == 1 )\n {\n $this->current_row = $result->fetch_row();\n $this->current_row_hash = array();\n $this->mapping = array();\n foreach ( $result->fetch_fields() as $key => $field )\n {\n $this->current_row_hash[$field->name] = $this->current_row[$key];\n $this->mapping[$key] = $field->name;\n }\n $this->current_field = current( $this->mapping );\n }\n else\n {\n $this->current_row = false;\n $this->current_row_hash = false;\n $this->mapping = false;\n }\n $result->free();\n\n return $this->current_row;\n }", "public function next()\n {\n next($this->data);\n }", "public function next()\n {\n next($this->data);\n }", "public function next()\n {\n next($this->data);\n }", "public function next() {\n next($this->data);\n }", "public function next() {\n next($this->data);\n }", "function next()\n {\n if(!$this->buffer_row){\n $this->z->next('TABLE');\n }\n\n $this->position++ ;\n }", "public function next(){\n\t\treturn (is_array($this->data) ? next($this->data) : null);\n\t}", "public function next() {\n\t\tnext($this->_data);\n\t}", "public function next()\n {\n return next($this->data);\n }", "public function next()\n {\n return next($this->data);\n }", "public function next()\n\t{\n\t\t$this->databaseResult->next();\n\t}", "public function next() {\n $this->currentRow = $this->result->fetchObject();\n $this->currentKey = array();\n if (!is_object($this->currentRow)) {\n $this->currentRow = NULL;\n }\n else {\n foreach ($this->sourceKeyMap as $map_field) {\n $this->currentKey[$map_field] = $this->currentRow->$map_field;\n // Leave only destination fields\n unset($this->currentRow->$map_field);\n }\n }\n }", "function next() {\n\n return $this->skip(1);\n }", "public function next(): void\n {\n if (count($this->data) > 0) {\n array_shift($this->data);\n }\n ++$this->position;\n\n if ($this->position > $this->numberOfRecords()) {\n return;\n }\n\n if (count($this->data) == 0) {\n $this->fetchMore();\n }\n }", "public function next()\n {\n fseek($this->resource, 1, SEEK_CUR);\n }", "public function next()\n {\n try {\n $this->_moveNext();\n } catch (TwitterImport_FormattingException $e) {\n if ($this->_skipInvalidRows) {\n $this->_skippedRowCount++;\n $this->next();\n } else {\n throw $e;\n }\n }\n }", "public function next()\n {\n if (isset($this->data[$this->i])) {\n $data = $this->data[$this->i];\n $this->i++;\n return $data;\n } else {\n return false;\n }\n }" ]
[ "0.74718684", "0.7043297", "0.702209", "0.68716687", "0.66748947", "0.6635483", "0.65464205", "0.6538825", "0.6468964", "0.6459863", "0.6399895", "0.63797206", "0.63687325", "0.63625544", "0.63625544", "0.63625544", "0.6358669", "0.6358669", "0.63523865", "0.63464296", "0.6333535", "0.6313486", "0.6313486", "0.6309366", "0.63061035", "0.62909335", "0.62868524", "0.6176843", "0.61585724", "0.6146931" ]
0.7069386
1
Returns the base URL to the gateway.
public static function getBaseGatewayUrl() { $url = Configuration::getGlobalValue(PostFinanceCheckoutBasemodule::CK_BASE_URL); if ($url) { return rtrim($url, '/'); } return 'https://app-wallee.com'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBaseUrl() : string\n {\n return $this->base;\n }", "public function getBaseUrl()\n {\n return $this->getScheme() . $this->getBasicAuth() . $this->getHost() . \":\" . $this->getPort() . $this->getEndpoint();\n }", "public function getProxyBaseUrl()\n {\n return $this->getProxyUrl(array(), RouterInterface::ABSOLUTE_PATH);\n }", "public function getBaseUrl() {\n return self::_getBaseUrl($this->user->getId(), $this->game->getId());\n }", "public function get_base_url()\r\n\t\t{\r\n\t\t\t$url = \"http\";\r\n \t\t\tif ( isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] == \"on\" ) $url .= \"s\";\r\n\t\t\t$url .= \"://\";\r\n \t\t\tif ( $_SERVER[ 'SERVER_PORT' ] != \"80\" )\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ]. \":\" . $_SERVER[ 'SERVER_PORT' ] . $_SERVER[ 'REQUEST_URI' ];\r\n\t\t\telse\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ] . \"/\";\r\n\t\t\t\r\n\t\t\treturn $url . self::HOME_DIR;\r\n\t\t}", "public function getBaseUrl() {\n $storeManager = $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' );\n\n return $storeManager->getStore ()->getBaseUrl ();\n }", "public function getBaseUrl()\n\t\t{\n\t\t\treturn $this->base_url;\n\t\t}", "public function getBaseUrl()\n {\n $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';\n return sprintf(\"%s://%s\", $protocol, $_SERVER['SERVER_NAME']);\n }", "public static function getProxiedBaseUrl() {\n return empty(self::$warehouse_proxy) ? self::$base_url : self::$warehouse_proxy;\n }", "public function getBaseUrl() {\r\n\t\treturn $this->_storeManager->getStore()->getBaseUrl();\r\n\t}", "public function getBaseUrl ()\n {\n return $this->base_url;\n }", "public function getBaseUrl()\n {\n return $this->base_url;\n }", "public function getBaseUrl()\n {\n return $this->base_url;\n }", "public static function getBaseUrl()\n {\n if (Configuration::get(self::TEST_MODE)) {\n return self::TEST_URL;\n }\n\n return self::URL;\n }", "public function getBaseUrl() {\r\n\t\treturn home_url();\r\n\t}", "private static function getUrlBase() {\n\t\tif(!isset(self::$usrBbase)) {\n\t\t\tself::$urlBase =\n\t\t\t\tself::getScheme()\n\t\t\t\t. '://'\n\t\t\t\t. self::getHost()\n\t\t\t\t. ((self::getPort() == 80 || self::getPort() == 443)\n\t\t\t\t\t? ''\n\t\t\t\t\t: ':'.self::getPort())\n\t\t\t\t. self::getBasePath();\n\t\t}\n\t\treturn self::$urlBase;\n\t}", "protected function getBaseUrl()\n {\n return self::BASE_URL;\n }", "public function getBaseUrl()\n {\n return self::BASE_URL;\n }", "public function getBaseUrl();", "public function getBaseUrl();", "public function getBaseUrl();", "public function getBaseUrl();", "public function getBaseUrl();", "function base_url() {\n return Micro::get(Config::class)->get('app.base_url');\n }", "public function getGatewayUrl() {\n\t\t\tif(Mage::getStoreConfig('payment/acimpro/checkout_mode'))\n\t\t\t{\n\t\t\t\treturn 'https://api.authorize.net/xml/v1/request.api';\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 'https://apitest.authorize.net/xml/v1/request.api';\n\t\t\t}\n\t\t}", "public function getBaseUrl()\n {\n return $this->detectBaseUrl();\n }", "private function buildBaseUrl()\n {\n return $this->scheme() . $this->host;\n }", "function get_base_url() {\n return $this->base_url;\n }", "public function getBaseUrl()\n {\n return $this->config->getBaseUrl();\n }", "public function base_url()\n\t{\n\t\treturn URL::base();\n\t}" ]
[ "0.78125393", "0.78063303", "0.77910346", "0.7770298", "0.7756329", "0.7749639", "0.7734923", "0.7730289", "0.7724469", "0.77170384", "0.77126527", "0.77086747", "0.77086747", "0.7697613", "0.7681355", "0.76726484", "0.76722634", "0.7648983", "0.76436484", "0.76436484", "0.76436484", "0.76436484", "0.76436484", "0.7638891", "0.7637638", "0.7636311", "0.76275015", "0.7620203", "0.76041955", "0.7603746" ]
0.86089313
0
Returns the fraction digits of the given currency.
public static function getCurrencyFractionDigits($currencyCode) { /* @var PostFinanceCheckoutProviderCurrency $currency_provider */ $currencyProvider = PostFinanceCheckoutProviderCurrency::instance(); $currency = $currencyProvider->find($currencyCode); if ($currency) { return $currency->getFractionDigits(); } else { return 2; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_currency_fraction_digits( $currency_code ) {\n\t\treturn WC_PostFinanceCheckout_Helper::instance()->get_currency_fraction_digits( $currency_code );\n\t}", "private function getDecimalFactor(Currency $currency)\n {\n $subunitSize = $this->isoCurrencies->subunitFor($currency);\n return pow(10, $subunitSize);\n }", "function decimal_to_fraction($number)\n{\n list($whole, $numerator) = explode ('.', $number);\n\n if ($numerator==0)\n {\n return $whole;\n }\n $denominator = 1 . str_repeat(0, strlen($numerator));\n $GCD = GCD($numerator, $denominator);\n\n $numerator /= $GCD;\n $denominator /= $GCD;\n\n if ($denominator>8)\n {\n //return $whole;\n }\n if(!$whole)\n {\n $whole = \"\";\n }\n\n return sprintf ('%s %d/%d', $whole, $numerator, $denominator);\n}", "public static function getDecimalDigitsFor($currency)\n {\n if (in_array($currency, static::$zeroDecimalCurrencies))\n {\n return 0;\n } elseif (in_array($currency, static::$singleDecimalCurrencies))\n {\n return 1;\n }\n\n return 2;\n }", "function acadp_currency_decimal_count( $decimals = 2, $currency = 'USD' ) {\n\n\tswitch( $currency ) {\n\t\tcase 'RIAL' :\n\t\tcase 'JPY' :\n\t\tcase 'TWD' :\n\t\tcase 'HUF' :\n\t\t\t$decimals = 0;\n\t\t\tbreak;\n\t}\n\n\treturn apply_filters( 'acadp_currency_decimal_count', $decimals, $currency );\n\n}", "public function fraction($value)\n {\n // Only Numeric Values Accepted\n if (!is_numeric($value)) {\n return $value;\n }\n list ($num, $dec) = explode('.', (float) $value);\n if (!empty($dec)) {\n $dec = rtrim($dec, 0);\n $frac = false;\n if ($dec === '25') {\n $frac = '&frac14;';\n }\n if ($dec === '5') {\n $frac = '&frac12;';\n }\n if ($dec === '75') {\n $frac = '&frac34;';\n }\n $dec = !empty($frac) ? $frac : '.' . $dec;\n }\n if ($num == 0) {\n $num = '';\n }\n return $num . $dec;\n }", "function convertToDollar($localAmount, $rate){\n return round ($localAmount/$rate, 3);\n //return number_format(round ($localAmount/$rate, 3), 3, \".\", \",\");\n\n}", "function frac($frac){\n\t$frac = explode(\"/\",trim($frac));\n\treturn $frac[0]/$frac[1];\n}", "public function get_fraction($grade, $cid, $decimals) {\n global $CFG;\n //TODO: use my own function other than grade_get_setting because when we start using multiple DBs \n //then $DB would be the incorrect database or we need to set $DB to the database being used\n if (fmod($grade, 1)) {\n if (is_null($decimals)) {\n $decima = grade_get_setting($cid, 'decimalpoints', $CFG->grade_decimalpoints);\n if ($decima) {\n return number_format($grade, $decima);\n }\n }\n return number_format($grade, $decimals);\n }\n return number_format($grade, 0);\n }", "function fumseck_frac_string_to_dec( $fraction ) {\n\tlist($num, $denum ) = explode( '/', $fraction );\n\tif ($denum) {\n\t\treturn ($num / $denum);\n\t}\n}", "function getExchangeRate($currency);", "public function getRate(Currency $currency);", "public function getExchangeRate($currency)\n {\n \tswitch ($currency) {\n \t\tcase 'EUR':\n \t\t\treturn 1.0;\n \t\tcase 'GBP':\n \t\t\treturn 0.90233;\n \t\tcase 'USD':\n \t\t\treturn 1.1079;\n \t\tdefault:\n \t\t\treturn 0.0;\n \t}\n }", "public static function decimal() {}", "public static function fractional($decimalDollar = null, $fraction = 0)\n {\n if (is_array($decimalDollar) || is_array($fraction)) {\n return self::evaluateArrayArguments([self::class, __FUNCTION__], $decimalDollar, $fraction);\n }\n\n try {\n $decimalDollar = FinancialValidations::validateFloat(\n Functions::flattenSingleValue($decimalDollar) ?? 0.0\n );\n $fraction = FinancialValidations::validateInt(Functions::flattenSingleValue($fraction));\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n // Additional parameter validations\n if ($fraction < 0) {\n return ExcelError::NAN();\n }\n if ($fraction == 0) {\n return ExcelError::DIV0();\n }\n\n $dollars = ($decimalDollar < 0.0) ? ceil($decimalDollar) : floor($decimalDollar);\n $cents = fmod($decimalDollar, 1);\n $cents *= $fraction;\n $cents *= 10 ** (-ceil(log10($fraction)));\n\n return $dollars + $cents;\n }", "public function getAmountAsPercentage();", "public function getCurrentBalanceInDollars()\n {\n return $this->getCurrentBalance()->getAmount() / 100;\n }", "public static function getDecimal()\n {\n return Currency::get('decimal', '.');\n }", "function convertirDobleFraciones ($fdouble) {\n\t$valor = \"\";\n\tswitch ($fdouble) {\n\t\tcase 1:\n\t\t\t$valor = \"1\";\n\t\t\tbreak;\n\t\tcase 0.875:\n\t\t\t$valor = \"7/8\";\n\t\t\tbreak;\n\t\tcase 0.750:\n\t\t\t$valor = \"3/4\";\n\t\t\tbreak;\n\t\tcase 0.625:\n\t\t\t$valor = \"5/8\";\n\t\t\tbreak;\n\t\tcase 0.5:\n\t\t\t$valor = \"1/2\";\n\t\t\tbreak;\n\t\tcase 0.375:\n\t\t\t$valor = \"3/8\";\n\t\t\tbreak;\n\t\tcase 0.250:\n\t\t\t$valor = \"1/4\";\n\t\t\tbreak;\n\t\tcase 0.125:\n\t\t\t$valor = \"1/8\";\n\t\t\tbreak;\n\t\tcase 0.0625:\n\t\t\t$valor = \"1/16\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$valor = \"Ad honorem\";\n\t\t\tbreak;\n\t}\n\treturn $valor;\n}", "public static function decimal($fractionalDollar = null, $fraction = 0)\n {\n if (is_array($fractionalDollar) || is_array($fraction)) {\n return self::evaluateArrayArguments([self::class, __FUNCTION__], $fractionalDollar, $fraction);\n }\n\n try {\n $fractionalDollar = FinancialValidations::validateFloat(\n Functions::flattenSingleValue($fractionalDollar) ?? 0.0\n );\n $fraction = FinancialValidations::validateInt(Functions::flattenSingleValue($fraction));\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n // Additional parameter validations\n if ($fraction < 0) {\n return ExcelError::NAN();\n }\n if ($fraction == 0) {\n return ExcelError::DIV0();\n }\n\n $dollars = ($fractionalDollar < 0) ? ceil($fractionalDollar) : floor($fractionalDollar);\n $cents = fmod($fractionalDollar, 1.0);\n $cents /= $fraction;\n $cents *= 10 ** ceil(log10($fraction));\n\n return $dollars + $cents;\n }", "public function getPerDec() {\n return $this->perDec;\n }", "function currency( $c_f_x )\t\r\n {\r\n \t$c_f_x = round($c_f_x, 2);\t//THIS WILL ROUND THE ACCEPTED PARAMETER TO THE \r\n \t\t\t\t\t\t\t //PRECISION OF 2\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n \t$temp_c_f_variable = strstr(round($c_f_x,2), \".\");\t//THIS WILL ASSIGN THE \".\" AND WHAT EVER \r\n \t\t\t\t\t\t\t\t//ELSE COMES AFTER IT. REMEMBER DUE TO \r\n \t\t\t\t\t\t\t\t//ROUNDING THERE ARE ONLY THREE THINGS\r\n \t\t\t\t\t\t\t\t//THIS VARIABLE CAN CONTAIN, A PERIOD \r\n \t\t\t\t\t\t\t\t//WITH ONE NUMBER, A PERIOD WITH TWO NUMBERS,\r\n \t\t\t\t\t\t\t\t//OR NOTHING AT ALL\r\n \t\t\t\t\t\t\t\t//EXAMPLE : \".1\",\".12\",\"\"\r\n\t\t\t\t\t\t\t\t\t\r\n \tif (strlen($temp_c_f_variable) == 2)\t//THIS IF STATEMENT WILL CHECK TO SEE IF \r\n \t\t\t\t\t\t//LENGTH OF THE VARIABLE IS EQUAL TO 2. IF\r\n \t\t\t\t\t\t//IT IS, THEN WE KNOW THAT IT LOOKS LIKE \r\n \t\t\t\t\t\t//THIS \".1\" SO YOU WOULD ADD A ZERO TO GIVE IT \r\n \t\t\t\t\t\t// A NICE LOOKING FORMAT \r\n \t{\r\n \t\t$c_f_x = $c_f_x . \"0\";\r\n \t}\r\n\t\t\r\n \tif (strlen($temp_c_f_variable) == 0)\t//THIS IF STATEMENT WILL CHECK TO SEE IF \r\n \t\t\t\t\t\t//LENGTH OF THE VARIABLE IS EQUAL TO 2. IF\r\n \t\t\t\t\t\t//IT IS, THEN WE KNOW THAT IT LOOKS LIKE \r\n \t\t\t\t\t\t//THIS \"\" SO YOU WOULD ADD TWO ZERO'S TO GIVE IT \r\n \t\t\t\t\t\t// A NICE LOOKING FORMAT\r\n \t{\r\n \t\t$c_f_x = $c_f_x . \".00\";\r\n \t}\r\n\t\t\r\n\t\t$c_f_x = \"$\" . $c_f_x;\t//THIS WILL ADD THE \"$\" TO THE FRONT \r\n\r\n \treturn $c_f_x;\t//THIS WILL RETURN THE VARIABLE IN A NICE FORMAT\r\n \t\t\t\t\t//BUT REMEMBER THIS NEW VARIABLE WILL BE A STRING \r\n \t\t\t\t\t//THEREFORE CAN BE USED IN ANY FURTHER CALCULATIONS\r\n \t\t\r\n }", "public function getAmount(Currency|string|int $currency) : BigRational\n {\n if (is_int($currency)) {\n $currencyCode = (string) Currency::of($currency);\n } else {\n $currencyCode = (string) $currency;\n }\n\n return $this->amounts[$currencyCode] ?? BigRational::zero();\n }", "public function dollars($symbol = '$'): static\n {\n return $this->currency($symbol);\n }", "public static function get_conversion_rate($used_currency)\n {\n $fromCurrency = get_woocommerce_currency();\n $toCurrency = $used_currency;\n\n return WC_WooMercadoPagoSplit_Helpers_CurrencyConverter::getInstance()->loadRatio($fromCurrency, $toCurrency);\n }", "public function getDecimalDigits(): int\n {\n return $this->decimalDigits;\n }", "public function gformCurrency($currency)\n {\n return $currency;\n }", "public static function microToBase($amount): float\n {\n return $amount ? $amount / 1000000.0 : 0.0;\n }", "public function getCurrency();", "public function getCurrency();" ]
[ "0.70546865", "0.66970634", "0.6616109", "0.6341911", "0.597783", "0.593612", "0.5904722", "0.57921547", "0.5726606", "0.57215226", "0.5705257", "0.56868035", "0.55883735", "0.5527605", "0.5415788", "0.5412087", "0.53948575", "0.5316766", "0.5292235", "0.5275166", "0.5258919", "0.5237031", "0.52067286", "0.5206667", "0.5181827", "0.51750183", "0.5160049", "0.51340455", "0.5132872", "0.5132872" ]
0.7095405
0
Returns the total amount including tax of the given line items.
public static function getTotalAmountIncludingTax(array $lineItems) { $sum = 0; foreach ($lineItems as $lineItem) { $sum += $lineItem->getAmountIncludingTax(); } return $sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotalTaxAmount();", "public function getTaxTotal() {\n $total = 0;\n\n // Calculate total from items in the list\n foreach($this->Items() as $item) {\n $total += $item->getTaxTotal();\n }\n\n // Add any tax from postage\n $total += $this->PostageTax;\n\n return $total;\n }", "public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }", "private function get_total_tax() {\n\n\t\t$taxes = $this->order->getCombinedTax();\n\n\t\t$tax = 0;\n\n\t\tif ( empty( $taxes ) ) {\n\t\t\treturn $tax;\n\t\t}\n\n\t\tforeach( $taxes as $name => $amount ) {\n\t\t\t$tax += $amount;\n\t\t}\n\n\t\treturn $tax;\n\t}", "public function itemTotal(): float;", "public function calculateOrderTotal($items)\n {\n $total = 0;\n foreach ($items as $key => $item) {\n $total += $item['quoted_price'];\n }\n return $total;\n }", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "public function calculateTotalPrice($items){\n $total = 0;\n foreach($items as $item){\n $total += $item['subtotal'];\n }\n return $total;\n }", "public function getTaxAmount();", "function getTotalTax(){\n\t\t$data = $this->_collectShippingInfo();\n\t\treturn $data->getTotalTax();\n\t}", "public function getTotal()\n {\n return ($this->amount + $this->tax_amount)* $this->currency_converter;\n }", "public function getTaxAmount() {\n return $this->item->getTaxAmount();\n }", "function fix_order_amount_item_total( $price, $order, $item, $inc_tax = false, $round = true ) {\n $qty = ( ! empty( $item[ 'qty' ] ) && $item[ 'qty' ] != 0 ) ? $item[ 'qty'] : 1;\n if( $inc_tax ) {\n $price = ( $item[ 'line_total' ] + $item[ 'line_tax' ] ) / $qty;\n } else {\n $price = $item[ 'line_total' ] / $qty;\n }\n $price = $round ? round( $price, 2 ) : $price;\n return $price;\n}", "public function getTotalTaxesAmountAttribute()\n {\n $taxAmount = 0;\n\n if($this->taxes) {\n foreach($this->taxes as $tax) {\n $taxAmount += $tax->amount;\n }\n }\n\n return Money::ofMinor($taxAmount, $this->purchase_order->currency)->getAmount();\n }", "public function getTotal(){\n\t\t$total = parent::getTotal();\n\t\t$total->setValue(Mage::helper('utils/discount')->getDiscountData($this->getQuote())->getDiscountInclTax());\n\t\treturn $total;\n\t}", "public function getTaxCost()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->TotalTax) {\n $total += $item->TotalTax;\n }\n }\n\n if ($this->postage && $this->postage->Cost && $this->postage->Tax) {\n $total += ($this->postage->Cost / 100) * $this->postage->Tax;\n }\n \n return $total;\n }", "public function getTotalPrice()\n\t{\n\t\t$total = 0.0;\n\n\t\tforeach ($this->items as $item)\n\t\t{\n $total += $item->getPrice() + $item->getExtrasPrice();\n }\n\n\t\treturn $total;\n\t}", "public function __subTotal($items) {\n\n $price = 0.0;\n\n foreach ($items as $item) {\n\n// if ($item['currency_id'] == 2)\n// $currency = 1;\n//\n// if ($item['currency_id'] == 1)\n// $currency = 4.17;\n//\n// if ($item['currency_id'] == 3)\n// $currency = 4.50;\n\n //$price += $this->__lineItemTotal($item['qty'], $item['price'], $item['taxRate'], $item['currency_id']);\n //$price += $item['qty'] * $item['price'] * $currency;\n $price += $item['qty'] * $item['price'] * $item['rate'];\n }\n\n return $price;\n }", "public function total(): float\n {\n return $this->itemsPrice()->sum(fn (array $item) => $item['price']);\n }", "public function getTotalAmount($item)\n {\n $totalAmount = $item->getRowTotal()\n - $item->getDiscountAmount()\n + $item->getTaxAmount()\n + $item->getDiscountTaxCompensationAmount();\n\n return $totalAmount;\n }", "public function getLineTotalAmount()\n {\n return $this->lineTotalAmount;\n }", "public function get_total_tax() {\n\t\treturn apply_filters( 'woocommerce_cart_' . __FUNCTION__, $this->get_totals_var( 'total_tax' ) );\n\t}", "public function getBaseTotal()\n {\n return ($this->amount + $this->tax_amount) ;\n }", "function __lineItemTotal($qty, $price, $rate) {\n\n\n\n\n\n\n\n// if ($curency_id == 2)\n// $currency = 1;\n//\n// if ($curency_id == 1)\n// $currency = 4.17;\n//\n// if ($curency_id == 3)\n// $currency = 4.50;\n\n\n\n $line_total = $qty * $price * $rate;\n\n //$line_total = $line_total + (($line_total * $taxRate) / 100);\n\n\n\n return $line_total;\n }", "public function getRowTotalInclTax()\n {\n return $this->quoteItem->getRowTotalInclTax();\n }", "public function getTotalAmountInclTax(\\Magento\\Quote\\Model\\Quote\\Item $item)\n {\n $tierItem = $item->getCurrentTierItem();\n if (isset($tierItem)) {\n return $item->getCurrentTierItem()->getRowTotal()\n - $item->getCurrentTierItem()->getDiscountAmount()\n + $item->getCurrentTierItem()->getTaxAmount()\n + $item->getCurrentTierItem()->getBaseDiscountTaxCompensationAmount();\n }\n\n return 0.00;\n }", "public function getTotalAmount()\n {\n return $this->subtotal() + $this->shippingCost() + $this->tax() - $this->discounts();\n }", "public function getTotalTaxes(): Money\n {\n // Total taxes:\n $taxes = new Money(\"0.00\", $this->_currency);\n\n foreach ($this->_items as $item) {\n $taxes = $taxes->add($item->getTaxes());\n }\n\n return $taxes;\n }", "protected function calculate_item_totals() {\n\t\t$this->get_items_from_cart();\n\t\t$this->calculate_item_subtotals();\n\t\t$this->calculate_discounts();\n\n\t\tforeach ( $this->items as $item_key => $item ) {\n\t\t\t$item->total = $this->get_discounted_price_in_cents( $item_key );\n\t\t\t$item->total_tax = 0;\n\n\t\t\tif ( has_filter( 'woocommerce_get_discounted_price' ) ) {\n\t\t\t\t/**\n\t\t\t\t * Allow plugins to filter this price like in the legacy cart class.\n\t\t\t\t *\n\t\t\t\t * This is legacy and should probably be deprecated in the future.\n\t\t\t\t * $item->object is the cart item object.\n\t\t\t\t * $this->cart is the cart object.\n\t\t\t\t */\n\t\t\t\t$item->total = wc_add_number_precision(\n\t\t\t\t\tapply_filters( 'woocommerce_get_discounted_price', wc_remove_number_precision( $item->total ), $item->object, $this->cart )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( $this->calculate_tax && $item->product->is_taxable() ) {\n\t\t\t\t$total_taxes = WC_Tax::calc_tax( $item->total, $item->tax_rates, $item->price_includes_tax );\n\t\t\t\t$item->taxes = $total_taxes;\n\t\t\t\t$item->total_tax = array_sum( array_map( array( $this, 'round_line_tax' ), $item->taxes ) );\n\n\t\t\t\tif ( $item->price_includes_tax ) {\n\t\t\t\t\t// Use unrounded taxes so we can re-calculate from the orders screen accurately later.\n\t\t\t\t\t$item->total = $item->total - array_sum( $item->taxes );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax_data']['total'] = wc_remove_number_precision_deep( $item->taxes );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_total'] = wc_remove_number_precision( $item->total );\n\t\t\t$this->cart->cart_contents[ $item_key ]['line_tax'] = wc_remove_number_precision( $item->total_tax );\n\t\t}\n\n\t\t$this->set_total( 'items_total', array_sum( array_map( 'round', array_values( wp_list_pluck( $this->items, 'total' ) ) ) ) );\n\t\t$this->set_total( 'items_total_tax', array_sum( array_values( wp_list_pluck( $this->items, 'total_tax' ) ) ) );\n\n\t\t$this->cart->set_cart_contents_total( $this->get_total( 'items_total' ) );\n\t\t$this->cart->set_cart_contents_tax( array_sum( $this->get_merged_taxes( false, 'items' ) ) );\n\t\t$this->cart->set_cart_contents_taxes( $this->get_merged_taxes( false, 'items' ) );\n\t}", "static public function get_shipping_line_total_tax( $order ){\n\n \t\t$version = toret_check_wc_version();\n\n \tif( $version === false ){\n\n \t$tax = $order->get_shipping_tax(); \n \n \t}else{\n\n\t $shippings = $order->get_items( 'shipping' );\n\t\t\t\tforeach( $shippings as $shipping ){\n \t\t\t\t\t\n \t\t\t\t$tax = $shipping->get_total_tax();\n \t\t\t\t\t\n\t\t\t\t} \t\n\n \t}\n\n \treturn $tax;\n\n \t}" ]
[ "0.750475", "0.73711866", "0.72676843", "0.7264367", "0.70415986", "0.70236295", "0.700792", "0.6974921", "0.69731504", "0.69599974", "0.6834039", "0.6804235", "0.6793307", "0.6786204", "0.6780825", "0.6736188", "0.67250806", "0.6722792", "0.6719641", "0.6686309", "0.66849947", "0.6680067", "0.6672578", "0.6665033", "0.6654703", "0.66524935", "0.6647341", "0.6632861", "0.66311383", "0.66176057" ]
0.8340673
0
Cleans the given line items by ensuring uniqueness and introducing adjustment line items if necessary.
public static function cleanupLineItems(array &$lineItems, $expectedSum, $currencyCode) { $effectiveSum = self::roundAmount(self::getTotalAmountIncludingTax($lineItems), $currencyCode); $roundedExpected = self::roundAmount($expectedSum, $currencyCode); $diff = $roundedExpected - $effectiveSum; if ($diff != 0) { if ((int) Configuration::getGlobalValue(PostFinanceCheckoutBasemodule::CK_LINE_ITEM_CONSISTENCY)) { throw new PostFinanceCheckoutExceptionInvalidtransactionamount($effectiveSum, $roundedExpected); } else { $diffAmount = self::roundAmount($diff, $currencyCode); $lineItem = (new \PostFinanceCheckout\Sdk\Model\LineItemCreate()) ->setName(self::getModuleInstance()->l('Adjustment LineItem', 'helper')) ->setUniqueId('Adjustment-Line-Item') ->setSku('Adjustment-Line-Item') ->setQuantity(1); /** @noinspection PhpParamsInspection */ $lineItem->setAmountIncludingTax($diffAmount)->setType(($diff > 0) ? \PostFinanceCheckout\Sdk\Model\LineItemType::FEE : \PostFinanceCheckout\Sdk\Model\LineItemType::DISCOUNT); if (!$lineItem->valid()) { throw new \Exception('Adjustment LineItem payload invalid:' . json_encode($lineItem->listInvalidProperties())); } $lineItems[] = $lineItem; } } return self::ensureUniqueIds($lineItems); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 cleanup_reformat($change) {\n\t\tif (!array_key_exists('add_lines', $change) && !array_key_exists('remove_lines', $change))\n\t\t\treturn $change;\n\t\t\n\t\tif (array_key_exists('remove_lines', $change))\n\t\tforeach($change['remove_lines'] as $key => $removed) {\n\t\t\t$removed = cleanup_line_reformat($removed);\n\t\t\t$found = empty($removed);\n\t\t\tif (!$found && array_key_exists('add_lines', $change)) {\n\t\t\t\tforeach($change['add_lines'] as $key2 => $added) {\n\t\t\t\t\t$added = cleanup_line_reformat($added);\n\t\t\t\t\tif (empty($added)) {\n\t\t\t\t\t\tunset($change['add_lines'][$key2]);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ($removed == $added) {\n\t\t\t\t\t\tunset($change['add_lines'][$key2]);\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($found) unset($change['remove_lines'][$key]);\n\t\t}\n\t\t\n\t\t// Clean empty added lines\n\t\tif (array_key_exists('add_lines', $change))\n\t\tforeach($change['add_lines'] as $key2 => $added) {\n\t\t\t$added = cleanup_line_reformat($added);\n\t\t\tif (empty($added))\n\t\t\t\tunset($change['add_lines'][$key2]);\n\t\t}\n\t\treturn $change;\n\t}", "protected static function cleanup(&$items)\n\t{\n\t\t$b = true;\n\n\t\tforeach ($items as $k => &$item)\n\t\t{\n\t\t\tif ($item->type == 'separator')\n\t\t\t{\n\t\t\t\tif ($b)\n\t\t\t\t{\n\t\t\t\t\t$item = false;\n\t\t\t\t}\n\n\t\t\t\t$b = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$b = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($b)\n\t\t{\n\t\t\t$item = false;\n\t\t}\n\n\t\t$items = array_filter($items);\n\t}", "public static function ensureUniqueIds(array $lineItems)\n {\n $uniqueIds = array();\n foreach ($lineItems as $lineItem) {\n $uniqueId = $lineItem->getUniqueId();\n if (empty($uniqueId)) {\n $uniqueId = preg_replace(\"/[^a-z0-9]/\", '', Tools::strtolower($lineItem->getSku()));\n }\n if (empty($uniqueId)) {\n throw new Exception(\"There is an invoice item without unique id.\");\n }\n if (isset($uniqueIds[$uniqueId])) {\n $backup = $uniqueId;\n $uniqueId = $uniqueId . '_' . $uniqueIds[$uniqueId];\n $uniqueIds[$backup] ++;\n } else {\n $uniqueIds[$uniqueId] = 1;\n }\n $lineItem->setUniqueId($uniqueId);\n }\n return $lineItems;\n }", "private function prepareArray()\n {\n $tempItems = trim(Input::get('items'));\n $items = explode(PHP_EOL, $tempItems);\n $badItemsToTest = ['shp#', 'totals', 'total', 'shipment', 'shipment#', ''];\n\n $finalArray = array();\n\n foreach ($items as $item) {\n\n if (in_array(strtolower(trim($item)), $badItemsToTest) == false) {\n array_push($finalArray, trim($item));\n }\n\n }\n return $finalArray;\n\n\n }", "public function sanitiseData(): void\n {\n $this->firstLine = self::sanitiseString($this->firstLine);\n self::validateExistsAndLength($this->firstLine, 1000);\n $this->secondLine = self::sanitiseString($this->secondLine);\n self::validateExistsAndLength($this->secondLine, 1000);\n $this->town = self::sanitiseString($this->town);\n self::validateExistsAndLength($this->town, 255);\n $this->postcode = self::sanitiseString($this->postcode);\n self::validateExistsAndLength($this->postcode, 10);\n $this->county = self::sanitiseString($this->county);\n self::validateExistsAndLength($this->county, 255);\n $this->country = self::sanitiseString($this->country);\n self::validateExistsAndLength($this->country, 255);\n }", "function uc_order_pane_line_items_remove($form, &$form_state) {\n $order = &$form_state['order'];\n $line_item_id = intval($form_state['triggering_element']['#return_value']);\n\n uc_order_delete_line_item($line_item_id);\n $order->line_items = uc_order_load_line_items($order);\n\n $form_state['rebuild'] = TRUE;\n}", "public static function cleanOrderedAddress(&$orderedAddressField){\n foreach ($orderedAddressField as &$line) {\n $cleanedLine = '';\n if (($keyList = preg_split(self::_CLEANING_REGEX_, $line, -1, PREG_SPLIT_NO_EMPTY))){\n foreach ($keyList as $key)\n $cleanedLine .= $key.' ';\n $cleanedLine = trim($cleanedLine);\n $line = $cleanedLine;\n }\n }\n }", "public function populateLineItem(Commerce_LineItemModel $lineItem);", "public function saveLineItems(array $line_items);", "public function setLineItems(array $line_items);", "private function delete_existing_lines(){\n\n\t\tLine::where('event_id', '=', $this->event->id)->delete();\n\n\t}", "public function deleteLineItems(array $ids);", "public function cleanDuplicates( );", "public function removeLineItem(LineItemInterface $line_item);", "protected function cleanData(&$lines) {\n\n if (empty($lines)) return;\n\n // Currently, we only need to strip a BOM if it exists.\n // Thanks to Derik Badman (http://madinkbeard.com/) for finding the\n // bug and suggesting this fix:\n // http://blog.philipp-michels.de/?p=32\n $first = $lines[0];\n if (substr($first, 0, 3) == pack('CCC', 0xef, 0xbb, 0xbf)) {\n $lines[0] = substr($first, 3);\n }\n }", "private static function cleanEmptyLines($code_lines, $remove_line_code)\n {\n $removed = 0;\n $cleaning = false;\n for($i=2; $i < count($code_lines); $i++) {\n if ($cleaning) {\n if ((trim($code_lines[$i]) == '') || ($code_lines[$i] == $remove_line_code)) {\n $code_lines[$i] = $remove_line_code;\n $removed++;\n }\n else {\n $cleaning = false;\n }\n }\n else if (((trim($code_lines[$i-2]) == '') || ($code_lines[$i-2] == $remove_line_code)) && \n ((trim($code_lines[$i-1]) == '') || ($code_lines[$i-1] == $remove_line_code)) &&\n ((trim($code_lines[$i ]) == '') || ($code_lines[$i ] == $remove_line_code))) {\n $code_lines[$i-1] = $remove_line_code;\n $code_lines[$i ] = $remove_line_code;\n $removed++;\n $removed++;\n $cleaning = true;\n }\n }\n\n return $code_lines;\n }", "protected function _cleanOrderOfMultipleRowsOfSameItem($apiOrder) {\n $temp = array();\n\n foreach ($apiOrder->itemsOrdered as $orderItem) {\n // check if an item uses more than one row\n if(array_key_exists($orderItem->article->id, $temp)) {\n // add the additonal row to the first one\n $temp[$orderItem->article->id]->quantityOrdered += $orderItem->quantityOrdered;\n $temp[$orderItem->article->id]->costsTotal->net += $orderItem->costsTotal->net;\n\t\t\t\t$temp[$orderItem->article->id]->costsTotal->gross += $orderItem->costsTotal->gross;\n\t\t\t\t$temp[$orderItem->article->id]->costsTotal->net += $orderItem->costsTotal->net;\n\t\t\t\t\n $apiOrder->summary->totalSumItems->net = $temp[$orderItem->article->id]->costsTotal->net;\n $apiOrder->summary->totalSumItems->gross = $temp[$orderItem->article->id]->costsTotal->gross;\n $apiOrder->summary->totalSumItems->tax = $temp[$orderItem->article->id]->costsTotal->tax;\n \n } else {\n $temp[$orderItem->article->id] = $orderItem;\n }\n }\n\n $orderItems = array();\n foreach($temp as $item) {\n $orderItems[] = $item;\n }\n\n // save the cleaned order items\n $apiOrder->itemsOrdered = $orderItems;\n\n return $apiOrder;\n }", "private function addLineItemsToInvoice($data){\n $lineItems = [];\n $counter = 1;\n foreach($data as $lineData) {\n $lineItem = [];\n $lineItem['LineNum'] = $counter;\n $lineItem['Description'] = IndexSanityCheckHelper::indexSanityCheck('description', $lineData);\n\n if (array_key_exists('item_id', $lineData)) {\n $lineItem['Amount'] = IndexSanityCheckHelper::indexSanityCheck('amount', $lineData);\n $lineItem['DetailType'] = 'SalesItemLineDetail';\n $lineItem['SalesItemLineDetail'] = [];\n $lineItem['SalesItemLineDetail']['Qty'] = IndexSanityCheckHelper::indexSanityCheck('quantity', $lineData);\n $lineItem['SalesItemLineDetail']['UnitPrice'] = IndexSanityCheckHelper::indexSanityCheck('unit_amount', $lineData);\n $lineItem['SalesItemLineDetail']['ItemRef']['value'] = IndexSanityCheckHelper::indexSanityCheck('item_id', $lineData);\n $lineItem['SalesItemLineDetail']['TaxCodeRef']['value'] = IndexSanityCheckHelper::indexSanityCheck('tax_id', $lineData);\n $lineItem['SalesItemLineDetail']['DiscountRate'] = IndexSanityCheckHelper::indexSanityCheck('discount_rate', $lineData);\n $lineItem['SalesItemLineDetail']['TaxInclusiveAmt'] = IndexSanityCheckHelper::indexSanityCheck('tax_inclusive_amount', $lineData);\n } else {\n $lineItem['Amount'] = IndexSanityCheckHelper::indexSanityCheck('amount', $lineData);\n $lineItem['DetailType'] = 'SalesItemLineDetail';\n $lineItem['SalesItemLineDetail'] = [];\n $lineItem['SalesItemLineDetail']['Qty'] = IndexSanityCheckHelper::indexSanityCheck('quantity', $lineData);\n $lineItem['SalesItemLineDetail']['UnitPrice'] = IndexSanityCheckHelper::indexSanityCheck('unit_amount', $lineData);\n $lineItem['SalesItemLineDetail']['TaxCodeRef']['value'] = IndexSanityCheckHelper::indexSanityCheck('tax_id', $lineData);\n $lineItem['SalesItemLineDetail']['DiscountRate'] = IndexSanityCheckHelper::indexSanityCheck('discount_rate', $lineData);\n $lineItem['SalesItemLineDetail']['TaxInclusiveAmt'] = IndexSanityCheckHelper::indexSanityCheck('tax_inclusive_amount', $lineData);\n }\n $counter++;\n array_push($lineItems, $lineItem);\n }\n if ($this->getDiscountRate()) {\n if ($this->getDiscountRate() > 0) {\n $discountLineItem = [];\n $discountLineItem['LineNum'] = $counter;\n $discountLineItem['Description'] = '';\n $discountLineItem['Amount'] = $this->getDiscountAmount();\n $discountLineItem['DetailType'] = 'DiscountLineDetail';\n $discountLineItem['DiscountLineDetail']['PercentBased'] = true;\n $discountLineItem['DiscountLineDetail']['DiscountPercent'] = $this->getDiscountRate();\n array_push($lineItems, $discountLineItem);\n }\n }\n else if ($this->getDiscountAmount()) {\n if ($this->getDiscountAmount() > 0) {\n $discountLineItem = [];\n $discountLineItem['LineNum'] = $counter;\n $discountLineItem['Description'] = '';\n $discountLineItem['Amount'] = $this->getDiscountAmount();\n $discountLineItem['DetailType'] = 'DiscountLineDetail';\n $discountLineItem['DiscountLineDetail']['PercentBased'] = false;\n array_push($lineItems, $discountLineItem);\n }\n }\n return $lineItems;\n }", "public function batchClean(Import $import, $lineNum);", "public static function clean($dirty_items) {\n $clean = [];\n if (is_array($dirty_items)) {\n foreach ($dirty_items as $item_id => $qty) {\n $clean[(int)$item_id] = (int)$qty;\n }\n }\n return $clean;\n }", "private function _deleteExtraLines()\n {\n foreach ($this->_currentLines as $lineId => $lineModel) {\n if (in_array($lineId, $this->_newLineIds) === true) {\n continue;\n }\n\n $lineModel->delete();\n unset($this->_currentLines[$lineId]);\n }\n\n return $this;\n }", "public function clean() {\n\t\tglobal $warnings;\n\n\t\t// it's not at CBW\n\t\tif ($this->location != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as being at HQ\";\n\t\t\t$this->location = 1;\n\t\t}\n\t\t// it had beer in it\n\t\tif ($this->beer != 0) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as empty\";\n\t\t\t$this->beer = 0;\n\t\t}\n\t\t// it's not dirty\n\t\tif ($this->status != 1) {\n\t\t\t$warnings[2][] = \"keg \" . $this->id . \"_\" . $this->size . \" was not marked as dirty\";\n\t\t}\n\n\t\t$this->status = 2;\n\t\t$this->update();\n\t}", "function scrub_row (&$row) {\n\t\t//\twith people filling in fields with things like\n\t\t//\t\"N/A\" or \"XX\".\n\t\t//\n\t\t//\tFix this\n\t\tforeach ($row as &$value) {\n\t\t\n\t\t\tif (is_null($value)) continue;\n\t\t\n\t\t\tif (\n\t\t\t\t//\tMatch \"N/A\" and variants\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*n\\/?a\\\\s*$/ui',\n\t\t\t\t\t$value\n\t\t\t\t)!==0) ||\n\t\t\t\t//\tAt least one column in one\n\t\t\t\t//\trow just has the content\n\t\t\t\t//\t\"a\"\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*a\\\\s*$/ui',\n\t\t\t\t\t$value\n\t\t\t\t)!==0) ||\n\t\t\t\t//\tThere are rows in columns with\n\t\t\t\t//\t\"XX\" or \"xx\" or \"xxcx\".\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*(?:x|c)+\\\\s*$/ui',\n\t\t\t\t\t$value\n\t\t\t\t)!==0) ||\n\t\t\t\t//\tWhile we're at it let's clobber\n\t\t\t\t//\tentries that are just whitespace\n\t\t\t\t(preg_match(\n\t\t\t\t\t'/^\\\\s*$/u',\n\t\t\t\t\t$value\n\t\t\t\t)!==0)\n\t\t\t) $value=null;\t//\tThe proper way to do things\n\t\t\t//\tFor sanity's sake let's just make\n\t\t\t//\tsure all the data is trimmed\n\t\t\telse $value=preg_replace(\n\t\t\t\t'/^\\\\s+|\\\\s+$/u',\n\t\t\t\t'',\n\t\t\t\t$value\n\t\t\t);\n\t\t\n\t\t}\n\t\n\t}", "public function clean()\n\t{\n\t\tforeach ($this->dirtyFields AS $field)\n\t\t\t$this->cleanField($field);\n\t}", "public function __construct($line_items)\n {\n $this->line_items = $line_items;\n }", "public function uniqueListUnifiesCommaSeparatedListDataProvider() {}", "function tidy_clean_repair(tidy $object) {}", "private function calculate_lines_mixed_singles_only(){\n\n\t\t$this->total_lines = min($this->female_count, $this->male_count);\n\t\t$extra_women = $this->female_count - $this->total_lines;\n\t\t$extra_men = $this->male_count - $this->total_lines;\n\t\t$this->per_team_lines = array(array(\n\t\t\t'total_teams' => 1,\n\t\t\t'women_lines' => '-',\n\t\t\t'men_lines' => '-',\n\t\t\t'additional_women' => $extra_women,\n\t\t\t'additional_men' => $extra_men,\n\t\t\t'comb_lines' => '-',\n\t\t\t'total_lines' => $this->total_lines,\n\t\t\t'additional_players' => $extra_women + $extra_men,\n\t\t\t'mixed_singles' => $this->total_lines,\n\t\t\t'mixed_doubles' => 0\n\t ), array(\n\t \t'total_teams' => 2\n\t\t), array(\n\t \t'total_teams' => 4\n\t\t), array(\n\t \t'total_teams' => 6\n\t\t), array(\n\t \t'total_teams' => 8\n\t\t), array(\n\t \t'total_teams' => 9\n\t\t), array(\n\t \t'total_teams' => 16\n\t\t), array(\n\t \t'total_teams' => 25\n\t\t));\n\n\t}", "public function validateItem($orderLine)\n {\n $this->validateData(\n $orderLine,\n 'total_amount',\n - $this->formatAsInt( // Discount is transferred to Klarna as negative value\n $this->formatPrice(\n $this->oItem->dDiscount)\n )\n );\n }" ]
[ "0.6180485", "0.6147365", "0.5989515", "0.5820394", "0.56804925", "0.5440469", "0.5383951", "0.5340748", "0.5276194", "0.5252985", "0.5244315", "0.52019316", "0.5183831", "0.5153494", "0.5151517", "0.5125046", "0.5096254", "0.50238246", "0.49430054", "0.49400324", "0.49381796", "0.49230245", "0.4907736", "0.48892316", "0.48641643", "0.48502403", "0.48501444", "0.4842887", "0.48079285", "0.478895" ]
0.61572003
1
Ensures uniqueness of the line items.
public static function ensureUniqueIds(array $lineItems) { $uniqueIds = array(); foreach ($lineItems as $lineItem) { $uniqueId = $lineItem->getUniqueId(); if (empty($uniqueId)) { $uniqueId = preg_replace("/[^a-z0-9]/", '', Tools::strtolower($lineItem->getSku())); } if (empty($uniqueId)) { throw new Exception("There is an invoice item without unique id."); } if (isset($uniqueIds[$uniqueId])) { $backup = $uniqueId; $uniqueId = $uniqueId . '_' . $uniqueIds[$uniqueId]; $uniqueIds[$backup] ++; } else { $uniqueIds[$uniqueId] = 1; } $lineItem->setUniqueId($uniqueId); } return $lineItems; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForDuplicateUnique(){\n $_ufields_arr = explode(\",\", $this->listSettings->GetItem(\"MAIN\", \"UNIQUE_FIELDS\"));\n $check_fields = true;\n for ($i = 0; $i < sizeof($_ufields_arr); $i ++) {\n list ($_field[$i], $_value[$i]) = explode(\"=\", $_ufields_arr[$i]);\n if (strlen($_value[$i])) {\n $check_fields = false;\n $_query_arr[$_field[$i]] = $_value[$i];\n if ($this->_data[$_field[$i]] == $_value[$i]) {\n $check_fields = true;\n }\n }\n else {\n $_query_arr[$_field[$i]] = $this->_data[$_field[$i]];\n }\n }\n if ($check_fields) {\n $_data = $this->Storage->GetByFields($_query_arr, null);\n }\n else {\n $_data = array();\n }\n if (! empty($_data)) {\n if (($this->item_id != $_data[$this->key_field])) {\n if ($this->Kernel->Errors->HasItem($this->library_ID, \"RECORD_EXISTS\")) {\n $_error_section = $this->library_ID;\n }\n else {\n $_error_section = \"GlobalErrors\";\n }\n $this->validator->SetCustomError($_ufields_arr, \"RECORD_EXISTS\", $_error_section);\n }\n }\n }", "public function checkRefDuplication() {\n $refArray = array();\n foreach ($this->elementData as $data) {\n $value = trim($data['ref']);\n if ($value) {\n array_push($refArray, $value);\n }\n }\n\n $refError = array_diff_assoc($refArray, array_unique($refArray));\n foreach ($refError as $key => $value) {\n $this->error[$key+1][]['message'] = 'Internal Reference duplication. Please check your CSV file.';\n }\n }", "public function cleanDuplicates( );", "public function unique();", "public function unique();", "public function isUnique();", "public function check_duplicate()\n {\n }", "function rest_validate_array_contains_unique_items($input_array)\n {\n }", "public function newLine()\n {\n\n $stock = $this->getStock();\n $randomIndexStock = mt_rand(0, (count($stock)-1));\n $this->line = array_values(array_slice($stock, $randomIndexStock, 1, true));\n unset($stock[$randomIndexStock]);\n $this->stock = array_values($stock);\n }", "public function saveLineItems(array $line_items);", "private function delete_existing_lines(){\n\n\t\tLine::where('event_id', '=', $this->event->id)->delete();\n\n\t}", "protected function checkUrlKeyDuplicates()\n {\n $resource = $this->getResource();\n foreach ($this->urlKeys as $storeId => $urlKeys) {\n $urlKeyDuplicates = $this->_connection->fetchAssoc(\n $this->_connection->select()->from(\n ['url_rewrite' => $resource->getTable('url_rewrite')],\n ['request_path', 'store_id']\n )->joinLeft(\n ['cpe' => $resource->getTable('catalog_product_entity')],\n \"cpe.entity_id = url_rewrite.entity_id\"\n )->where('request_path IN (?)', array_keys($urlKeys))\n ->where('store_id IN (?)', $storeId)\n ->where('cpe.sku not in (?)', array_values($urlKeys))\n );\n foreach ($urlKeyDuplicates as $entityData) {\n $rowNum = $this->rowNumbers[$entityData['store_id']][$entityData['request_path']];\n $message = sprintf(\n $this->retrieveMessageTemplate(ValidatorInterface::ERROR_DUPLICATE_URL_KEY),\n $entityData['request_path'],\n $entityData['sku']\n );\n $this->addRowError(ValidatorInterface::ERROR_DUPLICATE_URL_KEY, $rowNum, 'url_key', $message);\n }\n }\n }", "private function addLineItemsToInvoice($data){\n $lineItems = [];\n $counter = 1;\n foreach($data as $lineData) {\n $lineItem = [];\n $lineItem['LineNum'] = $counter;\n $lineItem['Description'] = IndexSanityCheckHelper::indexSanityCheck('description', $lineData);\n\n if (array_key_exists('item_id', $lineData)) {\n $lineItem['Amount'] = IndexSanityCheckHelper::indexSanityCheck('amount', $lineData);\n $lineItem['DetailType'] = 'SalesItemLineDetail';\n $lineItem['SalesItemLineDetail'] = [];\n $lineItem['SalesItemLineDetail']['Qty'] = IndexSanityCheckHelper::indexSanityCheck('quantity', $lineData);\n $lineItem['SalesItemLineDetail']['UnitPrice'] = IndexSanityCheckHelper::indexSanityCheck('unit_amount', $lineData);\n $lineItem['SalesItemLineDetail']['ItemRef']['value'] = IndexSanityCheckHelper::indexSanityCheck('item_id', $lineData);\n $lineItem['SalesItemLineDetail']['TaxCodeRef']['value'] = IndexSanityCheckHelper::indexSanityCheck('tax_id', $lineData);\n $lineItem['SalesItemLineDetail']['DiscountRate'] = IndexSanityCheckHelper::indexSanityCheck('discount_rate', $lineData);\n $lineItem['SalesItemLineDetail']['TaxInclusiveAmt'] = IndexSanityCheckHelper::indexSanityCheck('tax_inclusive_amount', $lineData);\n } else {\n $lineItem['Amount'] = IndexSanityCheckHelper::indexSanityCheck('amount', $lineData);\n $lineItem['DetailType'] = 'SalesItemLineDetail';\n $lineItem['SalesItemLineDetail'] = [];\n $lineItem['SalesItemLineDetail']['Qty'] = IndexSanityCheckHelper::indexSanityCheck('quantity', $lineData);\n $lineItem['SalesItemLineDetail']['UnitPrice'] = IndexSanityCheckHelper::indexSanityCheck('unit_amount', $lineData);\n $lineItem['SalesItemLineDetail']['TaxCodeRef']['value'] = IndexSanityCheckHelper::indexSanityCheck('tax_id', $lineData);\n $lineItem['SalesItemLineDetail']['DiscountRate'] = IndexSanityCheckHelper::indexSanityCheck('discount_rate', $lineData);\n $lineItem['SalesItemLineDetail']['TaxInclusiveAmt'] = IndexSanityCheckHelper::indexSanityCheck('tax_inclusive_amount', $lineData);\n }\n $counter++;\n array_push($lineItems, $lineItem);\n }\n if ($this->getDiscountRate()) {\n if ($this->getDiscountRate() > 0) {\n $discountLineItem = [];\n $discountLineItem['LineNum'] = $counter;\n $discountLineItem['Description'] = '';\n $discountLineItem['Amount'] = $this->getDiscountAmount();\n $discountLineItem['DetailType'] = 'DiscountLineDetail';\n $discountLineItem['DiscountLineDetail']['PercentBased'] = true;\n $discountLineItem['DiscountLineDetail']['DiscountPercent'] = $this->getDiscountRate();\n array_push($lineItems, $discountLineItem);\n }\n }\n else if ($this->getDiscountAmount()) {\n if ($this->getDiscountAmount() > 0) {\n $discountLineItem = [];\n $discountLineItem['LineNum'] = $counter;\n $discountLineItem['Description'] = '';\n $discountLineItem['Amount'] = $this->getDiscountAmount();\n $discountLineItem['DetailType'] = 'DiscountLineDetail';\n $discountLineItem['DiscountLineDetail']['PercentBased'] = false;\n array_push($lineItems, $discountLineItem);\n }\n }\n return $lineItems;\n }", "protected function removeDuplicates(): void\n {\n $this->startTiming();\n\n $this->logInfo('Removing duplicates...');\n\n $this->list = array_unique($this->list);\n\n $this->endTiming();\n }", "public function unique(): self\n {\n return Factory::create(array_unique($this->items));\n }", "public function hasLineItems();", "public function lineKeys()\n {\n $this->items = array_values($this->items);\n\n return $this;\n }", "protected function _checkForDupe()\n\t{\n\t\t$this->_oldPre = $this->_pdo->queryOneRow(sprintf('SELECT category, size FROM predb WHERE title = %s', $this->_pdo->escapeString($this->_curPre['title'])));\n\t\tif ($this->_oldPre === false) {\n\t\t\t$this->_insertNewPre();\n\t\t} else {\n\t\t\t$this->_updatePre();\n\t\t}\n\t\t$this->_resetPreVariables();\n\t}", "protected function checkUniqueItems($value)\n {\n if ($this->schemaAccessor->getUniqueItems()) {\n if (count($value) !== count(array_unique($value))) {\n throw new InvalidArrayValueException('Arrays with duplicate values are not allowed when \"uniqueItems\" is true.');\n }\n }\n }", "protected function checkUniqueItems($value)\n {\n if ($this->schemaAccessor->getUniqueItems()) {\n if (count($value) !== count(array_unique($value, SORT_REGULAR))) {\n throw new InvalidArrayValueException('Arrays with duplicate values are not allowed when \"uniqueItems\" is true.');\n }\n }\n }", "public function unique()\n {\n $this->items = array_unique($this->items);\n $this->measure();\n\n return $this;\n }", "function RemoveDuplicatedLinesByString($Lines, $IgnoreCase=false, $NewLine=\"\\n\"){\n if (is_array($Lines))\n $Lines = implode($NewLine, $Lines);\n $Lines = explode($NewLine, $Lines);\n $LineArray = array();\n $Duplicates = 0;\n // Go trough all lines of the given file\n for ($Line=0; $Line < count($Lines); $Line++){\n // Trim whitespace for the current line\n $CurrentLine = trim($Lines[$Line]);\n // Skip empty lines\n if ($CurrentLine == '')\n continue;\n // Use the line contents as array key\n $LineKey = $CurrentLine;\n if ($IgnoreCase)\n $LineKey = strtolower($LineKey);\n // Check if the array key already exists,\n // if not add it otherwise increase the counter\n if (!isset($LineArray[$LineKey]))\n $LineArray[$LineKey] = $CurrentLine; \n else \n $Duplicates++;\n }\n // Sort the array\n //asort($LineArray);\n // Return how many lines got removed\n return implode($NewLine, array_values($LineArray)); \n}", "public function mergeUnique() {}", "public function populateLineItem(Commerce_LineItemModel $lineItem);", "public static function cleanupLineItems(array &$lineItems, $expectedSum, $currencyCode)\n {\n $effectiveSum = self::roundAmount(self::getTotalAmountIncludingTax($lineItems), $currencyCode);\n $roundedExpected = self::roundAmount($expectedSum, $currencyCode);\n $diff = $roundedExpected - $effectiveSum;\n if ($diff != 0) {\n if ((int) Configuration::getGlobalValue(PostFinanceCheckoutBasemodule::CK_LINE_ITEM_CONSISTENCY)) {\n throw new PostFinanceCheckoutExceptionInvalidtransactionamount($effectiveSum, $roundedExpected);\n } else {\n $diffAmount = self::roundAmount($diff, $currencyCode);\n $lineItem = (new \\PostFinanceCheckout\\Sdk\\Model\\LineItemCreate())\n ->setName(self::getModuleInstance()->l('Adjustment LineItem', 'helper'))\n ->setUniqueId('Adjustment-Line-Item')\n ->setSku('Adjustment-Line-Item')\n ->setQuantity(1);\n /** @noinspection PhpParamsInspection */\n $lineItem->setAmountIncludingTax($diffAmount)->setType(($diff > 0) ? \\PostFinanceCheckout\\Sdk\\Model\\LineItemType::FEE : \\PostFinanceCheckout\\Sdk\\Model\\LineItemType::DISCOUNT);\n\n if (!$lineItem->valid()) {\n throw new \\Exception('Adjustment LineItem payload invalid:' . json_encode($lineItem->listInvalidProperties()));\n }\n $lineItems[] = $lineItem;\n }\n }\n\n return self::ensureUniqueIds($lineItems);\n }", "public function uniqueListUnifiesCommaSeparatedListDataProvider() {}", "public function validateTestCaseIdTitleUniqueness()\n {\n $dupes = [];\n foreach ($this->testCaseToTitleMappings as $newTitle => $files) {\n if (count($files) > 1) {\n $dupes[$newTitle] = \"'\" . implode(\"', '\", $files) . \"'\";\n }\n }\n if (!empty($dupes)) {\n $message = \"TestCaseId and Title pairs must be unique:\\n\\n\";\n foreach ($dupes as $newTitle => $tests) {\n $testCaseTitleArray = explode(\": \", $newTitle);\n $testCaseId = $testCaseTitleArray[0];\n $title = $testCaseTitleArray[1];\n $message .= \"TestCaseId: '{$testCaseId}' Title: '{$title}' in Tests {$tests}\\n\\n\";\n }\n throw new XmlException($message);\n }\n }", "function countAddedLines()\n {\n }", "protected function handleDuplicateItems(Collection $duplicates): void {\n\n // keep the first item, to swap with characters who have the other items.\n $questItemToKeep = $duplicates->shift();\n\n foreach ($duplicates as $duplicate) {\n InventorySlot::where('item_id', $duplicate->id)->update([\n 'item_id' => $questItemToKeep->id,\n ]);\n\n $this->line('Replaced item (if needed): ' . $duplicate->name . '. Deleted duplicate item.');\n\n $duplicate->delete();\n }\n }", "private function hasConflictInLine( array $currentLine ) {\n\t\tif ( count( $currentLine ) < 2 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $currentLine[0]['action'] === 'delete' &&\n\t\t\t$currentLine[1]['action'] === 'add';\n\t}" ]
[ "0.60758406", "0.58338296", "0.5713227", "0.5564107", "0.5564107", "0.5522689", "0.5496896", "0.548084", "0.54321766", "0.53874487", "0.535245", "0.53087145", "0.52484304", "0.5240146", "0.5206341", "0.5187462", "0.5142243", "0.51250255", "0.51210046", "0.5111042", "0.5109101", "0.50937796", "0.5092628", "0.50837415", "0.50690436", "0.50666046", "0.5065859", "0.5061786", "0.50527465", "0.5023558" ]
0.7170114
0
Returns the amount of the line item's reductions.
public static function getReductionAmount(array $lineItems, array $reductions) { $lineItemMap = array(); foreach ($lineItems as $lineItem) { $lineItemMap[$lineItem->getUniqueId()] = $lineItem; } $amount = 0; foreach ($reductions as $reduction) { $lineItem = $lineItemMap[$reduction->getLineItemUniqueId()]; $amount += $lineItem->getUnitPriceIncludingTax() * $reduction->getQuantityReduction(); $amount += $reduction->getUnitPriceReduction() * ($lineItem->getQuantity() - $reduction->getQuantityReduction()); } return $amount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotalQty()\n {\n $qty = 0;\n foreach ($this->lineItems as $item) {\n $qty += $item->qty;\n }\n\n return $qty;\n }", "public function getAmountAttribute()\n {\n return $this->lines()->get()->reduce(function($carry, $line) {\n return $carry + $line->cost * $line->quantity;\n }, 0);\n }", "public function totalWithDependentItems()\n {\n $depItemTotal = $this->dependentItems()->sum('total');\n return $this->total + $this->dependentItems()->sum('total');\n\n }", "public function sumItems(): float\n\t{\n\t\treturn $this->storage->sum();\n\t}", "public function getTotalItems()\n {\n $total = 0;\n \n foreach ($this->items as $item) {\n $total += ($item->Quantity) ? $item->Quantity : 1;\n }\n\n return $total;\n }", "public function getTotalCost()\n {\n $this->loadItems();\n return $this->calculator->getCost($this->items);\n }", "public function getTotalCount()\n {\n $this->loadItems();\n return $this->calculator->getCount($this->items);\n }", "function line_demand_total($line_orders) {\n $line_demand_total = array_reduce(\n $line_orders,\n function ($sum, $line) {\n return $sum + intval($line[QUANTITY]);\n },\n 0);\n return $line_demand_total;\n}", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "function getTotalWeight()\n { $total = 0 ;\n if (count($this->items) > 0) \n { \n for ($p=0; $p<count($this->items); $p++) \n {\n $total = $total + $this->items[$p];\n }\n }\n return $total;\n }", "public function qty()\n {\n return $this->getCartItemCollection()->sum(function (CartItem $item) {\n return $item->getQty();\n });\n }", "public function getTotalAttribute() {\n return $this->cartItems->map(function ($item, $key) {\n return $item->subtotal;\n })->sum();\n }", "public function weight()\n {\n return $this->getCartItemCollection()->sum(function ($item) {\n return $item->getTotalWeight();\n });\n }", "public function itemTotal(): float;", "protected function getTotalWeight() {\n\t\t$totalWeight = array_reduce($this->items, function($total, $current) {\n\t\t\t$total += $current->getWeight();\n\n\t\t\treturn $total;\n\t\t});\n\n\t\treturn $totalWeight;\n\t}", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "public function totalQuantity(): int\n {\n return $this->items->sum(function ($item) {\n return $item->quantity;\n });\n }", "public function totalUniqueItems()\n {\n return $this->totalItems(true);\n }", "public function getTotalReduction($original = 'BasePrice')\n {\n $reduction = $this->owner->{$original} - $this->owner->sellingPrice();\n //keep it above 0;\n $reduction = $reduction < 0 ? 0 : $reduction;\n return $reduction;\n }", "public function TotalItems()\n {\n return $this->getTotalItems();\n }", "public function amount(): float\n {\n return $this->items->sum(function ($item) {\n return $item->amount * $item->quantity;\n });\n }", "public function getTotalBilled() {\n\t\t$total = 0;\n\t\t\n\t\tforeach($this->invoice->all as $invoice) {\n\t\t\tforeach($invoice->lineitem->get()->all as $lineitem) {\n\t\t\t\t$total += $lineitem->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t}", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }", "public function getLineTotalAmount()\n {\n return $this->lineTotalAmount;\n }", "public function getUsedAttribute()\n {\n return $this->requisitionLines()\n ->whereDoesntHave('requisition', function ($query) {\n $query->whereIn('state', ['Draft', 'Pending Approval']);\n })->get()\n ->sum('amount');\n }", "public function getTotalQuantity()\n {\n $items = $this->getContent();\n\n if ($items->isEmpty()) return 0;\n\n $count = array_reduce($items->all(), function ($a, ItemCollection $item) {\n return $a += $item->quantity;\n }, 0);\n\n return $count;\n }", "public function getTotalWeight()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->Weight && $item->Quantity) {\n $total = $total + ($item->Weight * $item->Quantity);\n }\n }\n \n return $total;\n }", "private function getTotalFrequentRenterPoints() {\n $result = 0;\n\n foreach ($this->rentals as $rental){\n $result += $rental->getFrequentRenterPoints();\n }\n return $result;\n }", "public function getTotalEstimated() {\n\t\t$total = 0;\n\t\t$this->costitem->get();\n\t\tforeach($this->costitem->all as $item) {\n\t\t\tif ($item->item_type == 'price') {\n\t\t\t\t$total += $item->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t\t\n\t}", "public function get_total_number_of_units(){\n return $this->unit_count;\n }" ]
[ "0.68862826", "0.6518084", "0.6379273", "0.6266357", "0.62382287", "0.62178177", "0.6179445", "0.61621004", "0.6146307", "0.6140768", "0.6120444", "0.6118574", "0.6098771", "0.60921395", "0.6084218", "0.6070371", "0.60564095", "0.6033297", "0.60213417", "0.60154074", "0.6008902", "0.5959753", "0.59448326", "0.5942793", "0.59418786", "0.59397453", "0.5931169", "0.5924391", "0.59082603", "0.58726037" ]
0.7106966
0
Get the Module instance
public static function getModuleInstance() { return Module::getInstanceByName('postfinancecheckout'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_instance() {\n\n\t\t\t$module = get_called_class();\n\n\t\t\tif ( ! isset( self::$instances[ $module ] ) ) {\n\t\t\t\tself::$instances[ $module ] = new $module();\n\t\t\t}\n\n\t\t\treturn self::$instances[ $module ];\n\t\t}", "public function getModule()\n\t{\n\t\treturn $this->get('module');\n\t}", "protected function getModule()\n {\n return $this->mod;\n }", "protected function getInstance()\n {\n if ($this->modx) {\n return $this->modx;\n }\n\n $path = $this->getCorePath();\n require_once \"{$path}/model/modx/modx.class.php\";\n\n $this->modx = \\modX::getInstance('setup');\n $this->modx->initialize('mgr');\n $this->modx->getService('error', 'error.modError');\n\n return $this->modx;\n }", "public function getModule()\n\t{\n\t\treturn $this->_module;\n\t}", "public function getModule()\n {\n return $this->module;\n }", "public function getModule() {\n\t\treturn $this->module;\n\t}", "public function getModule() {\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->module;\n\t}", "public function getModule()\n\t{\n\t\treturn $this->module;\n\t}", "public function module() {\n return $this->module;\n }", "public function getModule() {\n return $this->call->getModule();\n }", "public function getModule();", "public function getModule();", "public function getModuleInstance($module, $auth = false) {\n if ($auth) {\n self::auth();\n }\n \n $zcrmModuleIns = ZCRMModule::getInstance($module);\n return $zcrmModuleIns; \n }", "public function getModule()\n\t{\n\t\treturn $this->module; \n\n\t}", "public static function get_instance() {\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\t\treturn self::$instance;\n\t}", "public function fetchModule()\n {\n return $this->module;\n }", "public static function instance() {\n return self::$instance;\n }", "public static function instance() {\r\n return self::$instance;\r\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance() {\n\t\treturn $this->instance;\n\t}", "public static function instance()\n {\n global $container;\n return $container->getByType(self::class);\n }", "public static function instance() {\n\t\treturn static::$instance;\n\t}", "public function getInstance()\n {\n return self::$instance;\n }", "public function getModule(){\n return $this->module;\n }" ]
[ "0.81133544", "0.7374263", "0.7274672", "0.7237482", "0.72253644", "0.72185606", "0.71658164", "0.71658164", "0.7162345", "0.7162345", "0.71217006", "0.71172625", "0.7113797", "0.7113797", "0.7088", "0.7070349", "0.70060056", "0.70060056", "0.690664", "0.6886677", "0.6883395", "0.6865815", "0.6865815", "0.6865815", "0.6865815", "0.68487316", "0.68146414", "0.6805893", "0.6791956", "0.67915493" ]
0.7795575
1
Sorts an array of PostFinanceCheckoutModelMethodconfiguration by their sort order
public static function sortMethodConfiguration(array $configurations) { usort( $configurations, function ($a, $b) { if ($a->getSortOrder() == $b->getSortOrder()) { return $a->getConfigurationName() > $b->getConfigurationName(); } return $a->getSortOrder() > $b->getSortOrder(); } ); return $configurations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sortAdaptors()\n {\n $this->sorted = [];\n\n if (isset($this->adaptors)) {\n krsort($this->adaptors);\n $this->sorted = array_merge(...$this->adaptors);\n }\n }", "public function sort()\n {\n foreach (array_keys($this->betTypes) as $type) {\n ksort($this->betTypes[$type]);\n }\n }", "public function sort_shipping_methods() {\n\n\t\t$sorted_shipping_methods = array();\n\n\t\t// Get order option\n\t\t$ordering \t= (array) get_option('woocommerce_shipping_method_order');\n\t\t$order_end \t= 999;\n\n\t\t// Load shipping methods in order\n\t\tforeach ( $this->shipping_methods as $method ) {\n\n\t\t\tif ( isset( $ordering[ $method->id ] ) && is_numeric( $ordering[ $method->id ] ) ) {\n\t\t\t\t// Add in position\n\t\t\t\t$sorted_shipping_methods[ $ordering[ $method->id ] ][] = $method;\n\t\t\t} else {\n\t\t\t\t// Add to end of the array\n\t\t\t\t$sorted_shipping_methods[ $order_end ][] = $method;\n\t\t\t}\n\t\t}\n\n\t\tksort( $sorted_shipping_methods );\n\n\t\t$this->shipping_methods = array();\n\n\t\tforeach ( $sorted_shipping_methods as $methods )\n\t\t\tforeach ( $methods as $method ) {\n\t\t\t\t$id = empty( $method->instance_id ) ? $method->id : $method->instance_id;\n\t\t\t\t$this->shipping_methods[ $id ] = $method;\n\t\t\t}\n\n\t\treturn $this->shipping_methods;\n\t}", "protected function applySorting()\n\t{\n\t\t$i = 1;\n\t\tparse_str($this->order, $list);\n\t\tforeach ($list as $field => $dir) {\n\t\t\t$this->dataSource->sort($field, $dir === 'a' ? IDataSource::ASCENDING : IDataSource::DESCENDING);\n\t\t\t$list[$field] = array($dir, $i++);\n\t\t}\n\t\treturn $list;\n\t}", "public function asort() {}", "private function sortOptions()\r\n {\r\n $pageActions = array(); // For the result\r\n // Sort changes by file\r\n usort($this->changeAr, \"cmp\");\r\n\r\n foreach ($this->changeAr as $line) {\r\n $file = $line['file'];\r\n $action = $line['action'];\r\n if (array_key_exists($file, $pageActions)) {\r\n continue;\r\n }\r\n $pageActions[$file] = $action;\r\n }\r\n// print_r($pageActions);\r\n return $pageActions;\r\n }", "public function sortStrategy();", "protected function orderList()\n {\n return ksort($this->callbackList, \\SORT_REGULAR);\n }", "function SetUpSortOrder() {\n\n\t\t// Check for \"order\" parameter\n\t\tif (@$_GET[\"order\"] <> \"\") {\n\t\t\t$this->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\n\t\t\t$this->CurrentOrderType = @$_GET[\"ordertype\"];\n\t\t\t$this->UpdateSort($this->id); // id\n\t\t\t$this->UpdateSort($this->name); // name\n\t\t\t$this->UpdateSort($this->_email); // email\n\t\t\t$this->UpdateSort($this->companyname); // companyname\n\t\t\t$this->UpdateSort($this->servicetime); // servicetime\n\t\t\t$this->UpdateSort($this->country); // country\n\t\t\t$this->UpdateSort($this->phone); // phone\n\t\t\t$this->UpdateSort($this->skype); // skype\n\t\t\t$this->UpdateSort($this->website); // website\n\t\t\t$this->UpdateSort($this->linkedin); // linkedin\n\t\t\t$this->UpdateSort($this->facebook); // facebook\n\t\t\t$this->UpdateSort($this->twitter); // twitter\n\t\t\t$this->UpdateSort($this->active_code); // active_code\n\t\t\t$this->UpdateSort($this->identification); // identification\n\t\t\t$this->UpdateSort($this->link_expired); // link_expired\n\t\t\t$this->UpdateSort($this->isactive); // isactive\n\t\t\t$this->UpdateSort($this->google); // google\n\t\t\t$this->UpdateSort($this->instagram); // instagram\n\t\t\t$this->UpdateSort($this->account_type); // account_type\n\t\t\t$this->UpdateSort($this->logo); // logo\n\t\t\t$this->UpdateSort($this->profilepic); // profilepic\n\t\t\t$this->UpdateSort($this->mailref); // mailref\n\t\t\t$this->UpdateSort($this->deleted); // deleted\n\t\t\t$this->UpdateSort($this->deletefeedback); // deletefeedback\n\t\t\t$this->UpdateSort($this->account_id); // account_id\n\t\t\t$this->UpdateSort($this->start_date); // start_date\n\t\t\t$this->UpdateSort($this->end_date); // end_date\n\t\t\t$this->UpdateSort($this->year_moth); // year_moth\n\t\t\t$this->UpdateSort($this->registerdate); // registerdate\n\t\t\t$this->UpdateSort($this->login_type); // login_type\n\t\t\t$this->UpdateSort($this->accountstatus); // accountstatus\n\t\t\t$this->UpdateSort($this->ispay); // ispay\n\t\t\t$this->UpdateSort($this->profilelink); // profilelink\n\t\t\t$this->UpdateSort($this->source); // source\n\t\t\t$this->UpdateSort($this->agree); // agree\n\t\t\t$this->UpdateSort($this->balance); // balance\n\t\t\t$this->UpdateSort($this->job_title); // job_title\n\t\t\t$this->UpdateSort($this->projects); // projects\n\t\t\t$this->UpdateSort($this->opportunities); // opportunities\n\t\t\t$this->UpdateSort($this->isconsaltant); // isconsaltant\n\t\t\t$this->UpdateSort($this->isagent); // isagent\n\t\t\t$this->UpdateSort($this->isinvestor); // isinvestor\n\t\t\t$this->UpdateSort($this->isbusinessman); // isbusinessman\n\t\t\t$this->UpdateSort($this->isprovider); // isprovider\n\t\t\t$this->UpdateSort($this->isproductowner); // isproductowner\n\t\t\t$this->UpdateSort($this->states); // states\n\t\t\t$this->UpdateSort($this->cities); // cities\n\t\t\t$this->UpdateSort($this->offers); // offers\n\t\t\t$this->setStartRecordNumber(1); // Reset start position\n\t\t}\n\t}", "public function sort()\n {\n $this->repository->sort(Input::all());\n }", "private static function sort()\n\t{\n\t\t//Setup order of importantance\n\t\t$changefreqs = array(\n\t\t\t'hourly' => 5,\n\t\t\t'daily' => 4,\n\t\t\t'weekly' => 3,\n\t\t\t'monthly' => 2,\n\t\t\t'yearly' => 1,\n\t\t\t'never' => 0\n\t\t);\n\n\t\t//Setup invidual arrays to sort by\n\t\tforeach(static::$links as $index => $link)\n\t\t{\n\t\t\t$priority[$index] = $link->priority ? $link->priority : 0;\n\t\t\t$changefreq[$index] = $link->changefreq ? $changefreqs[$link->changefreq] : 0;\n\t\t\t$loc[$index] = $link->loc;\n\t\t}\n\n\t\tarray_multisort($priority, SORT_DESC, $changefreq, SORT_DESC, $loc, SORT_ASC, static::$links);\n\t}", "private function getSortOrder()\n {\n return [\n $this->sortOrderBuilder\n ->setDirection(SortOrder::SORT_ASC)\n ->setField(JobConfig::SCHEMA_JOB_FIELD_PRIORITY)\n ->create(),\n $this->sortOrderBuilder\n ->setDirection(SortOrder::SORT_ASC)\n ->setField(JobConfig::SCHEMA_JOB_FIELD_CREATED)\n ->create()\n ];\n }", "public function sortOptions() {\n $options = array();\n\n foreach($this->options as $key => $option) {\n $optionTitle = $option['optionTitle'];\n $options[$optionTitle] = $option;\n }\n\n ksort($options);\n reset($options);\n\n $this->options = $options;\n }", "protected function getAllAvailableSortDescendingOptions() {}", "function SetUpSortOrder() {\n\t\tglobal $scholarship_package;\n\n\t\t// Check for \"order\" parameter\n\t\tif (@$_GET[\"order\"] <> \"\") {\n\t\t\t$scholarship_package->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\n\t\t\t$scholarship_package->CurrentOrderType = @$_GET[\"ordertype\"];\n\t\t\t$scholarship_package->UpdateSort($scholarship_package->scholarship_package_id); // scholarship_package_id\n\t\t\t$scholarship_package->UpdateSort($scholarship_package->start_date); // start_date\n\t\t\t$scholarship_package->UpdateSort($scholarship_package->end_date); // end_date\n\t\t\t$scholarship_package->UpdateSort($scholarship_package->status); // status\n\t\t\t$scholarship_package->UpdateSort($scholarship_package->annual_amount); // annual_amount\n\t\t\t$scholarship_package->UpdateSort($scholarship_package->grant_package_grant_package_id); // grant_package_grant_package_id\n\t\t\t$scholarship_package->UpdateSort($scholarship_package->sponsored_student_sponsored_student_id); // sponsored_student_sponsored_student_id\n\t\t\t$scholarship_package->UpdateSort($scholarship_package->scholarship_type); // scholarship_type\n\t\t\t$scholarship_package->UpdateSort($scholarship_package->scholarship_type_scholarship_type); // scholarship_type_scholarship_type\n\t\t\t$scholarship_package->setStartRecordNumber(1); // Reset start position\n\t\t}\n\t}", "public function asort()\n {\n }", "public function sort();", "protected function getAllAvailableSortOrderOptions() {}", "function customcert_perform_asort(&$fields) {\n if (class_exists('core_collator')) {\n core_collator::asort($fields);\n } else {\n collatorlib::asort($fields);\n }\n}", "function SetUpSortOrder() {\n\n\t\t// Check for Ctrl pressed\n\t\t$bCtrl = (@$_GET[\"ctrl\"] <> \"\");\n\n\t\t// Check for \"order\" parameter\n\t\tif (@$_GET[\"order\"] <> \"\") {\n\t\t\t$this->CurrentOrder = ew_StripSlashes(@$_GET[\"order\"]);\n\t\t\t$this->CurrentOrderType = @$_GET[\"ordertype\"];\n\t\t\t$this->UpdateSort($this->tgl, $bCtrl); // tgl\n\t\t\t$this->UpdateSort($this->no_spp, $bCtrl); // no_spp\n\t\t\t$this->UpdateSort($this->jns_spp, $bCtrl); // jns_spp\n\t\t\t$this->UpdateSort($this->kd_mata, $bCtrl); // kd_mata\n\t\t\t$this->UpdateSort($this->urai, $bCtrl); // urai\n\t\t\t$this->UpdateSort($this->jmlh, $bCtrl); // jmlh\n\t\t\t$this->UpdateSort($this->jmlh1, $bCtrl); // jmlh1\n\t\t\t$this->UpdateSort($this->jmlh2, $bCtrl); // jmlh2\n\t\t\t$this->UpdateSort($this->jmlh3, $bCtrl); // jmlh3\n\t\t\t$this->UpdateSort($this->jmlh4, $bCtrl); // jmlh4\n\t\t\t$this->UpdateSort($this->nm_perus, $bCtrl); // nm_perus\n\t\t\t$this->UpdateSort($this->alamat, $bCtrl); // alamat\n\t\t\t$this->UpdateSort($this->npwp, $bCtrl); // npwp\n\t\t\t$this->UpdateSort($this->pimpinan, $bCtrl); // pimpinan\n\t\t\t$this->UpdateSort($this->bank, $bCtrl); // bank\n\t\t\t$this->UpdateSort($this->rek, $bCtrl); // rek\n\t\t\t$this->UpdateSort($this->nospm, $bCtrl); // nospm\n\t\t\t$this->UpdateSort($this->tglspm, $bCtrl); // tglspm\n\t\t\t$this->UpdateSort($this->ppn, $bCtrl); // ppn\n\t\t\t$this->UpdateSort($this->ps21, $bCtrl); // ps21\n\t\t\t$this->UpdateSort($this->ps22, $bCtrl); // ps22\n\t\t\t$this->UpdateSort($this->ps23, $bCtrl); // ps23\n\t\t\t$this->UpdateSort($this->ps4, $bCtrl); // ps4\n\t\t\t$this->UpdateSort($this->kodespm, $bCtrl); // kodespm\n\t\t\t$this->UpdateSort($this->nambud, $bCtrl); // nambud\n\t\t\t$this->UpdateSort($this->nppk, $bCtrl); // nppk\n\t\t\t$this->UpdateSort($this->nipppk, $bCtrl); // nipppk\n\t\t\t$this->UpdateSort($this->prog, $bCtrl); // prog\n\t\t\t$this->UpdateSort($this->prog1, $bCtrl); // prog1\n\t\t\t$this->UpdateSort($this->bayar, $bCtrl); // bayar\n\t\t\t$this->setStartRecordNumber(1); // Reset start position\n\t\t}\n\t}", "public function sortBy(){\n global $SnickerPlugin;\n\n if($SnickerPlugin->getValue(\"frontend_order\") === \"date_asc\"){\n uasort($this->db, function($a, $b){\n return $a[\"date\"] > $b[\"date\"];\n });\n } else if($SnickerPlugin->getValue(\"frontend_order\") === \"date_desc\"){\n uasort($this->db, function($a, $b){\n return $a[\"date\"] < $b[\"date\"];\n });\n }\n return true;\n }", "public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}", "function filter_rules_sort() {\n\tinit_config_arr(array('filter', 'rule'));\n\t$rules = config_get_path('filter/rule', []);\n\n\t/* mark each rule with the sequence number (to retain the order while sorting) */\n\tfor ($i = 0; isset($rules[$i]); $i++) {\n\t\t$rules[$i]['seq'] =$i;\n\t}\n\tusort($rules, \"filter_rules_compare\");\n\n\t/* strip the sequence numbers again */\n\tfor ($i = 0; isset($rules[$i]); $i++) {\n\t\tunset($rules[$i]['seq']);\n\t}\n\n\t/* commit changes */\n\tconfig_set_path('filter/rule', $rules);\n}", "public function dataForTestSort()\n {\n return [\n ['id', 'posts.id'],\n ['body', 'posts.body'],\n ];\n }", "protected function sortDataArray() {}", "public function getSortOrder();", "public function getSortOrder();", "public function getSortOrder();", "protected function _sortByArray($array) {}", "abstract public function prepareSort();" ]
[ "0.6229606", "0.6221692", "0.620066", "0.6032348", "0.59218735", "0.57754344", "0.5757803", "0.5685629", "0.56688017", "0.5663916", "0.56196105", "0.5607014", "0.5559387", "0.55459315", "0.5530682", "0.55260897", "0.5525444", "0.551741", "0.5505577", "0.5480691", "0.54709715", "0.5397956", "0.53827506", "0.537892", "0.5378575", "0.5373395", "0.5373395", "0.5373395", "0.53690666", "0.53430957" ]
0.63644147
0
Returns the URL to the transaction detail view in PostFinance Checkout.
public static function getTransactionUrl(PostFinanceCheckoutModelTransactioninfo $info) { return self::getBaseGatewayUrl() . '/s/' . $info->getSpaceId() . '/payment/transaction/view/' . $info->getTransactionId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_transaction_url( $order ) {\r\n \r\n $this->view_transaction_url = MDL_COINCHECK_API_BASE. '?cmd=_view-a-trans&id=%s';\r\n \r\n return parent::get_transaction_url( $order );\r\n }", "public function getCheckoutUrl()\n {\n return $this->helper('checkout/url')->getCheckoutUrl();\n }", "public function getPostUrl()\n {\n return $this->scopeConfig->getValue(\n 'payment/eurobank/post_url',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function getWholesalePostActionUrl()\n {\n return $this->helper('customer')->getWholesaleRegisterPostUrl();\n }", "public function getReturnUrl() {\n return Url::fromRoute('entity.commerce_order.edit_form', ['commerce_order' => $this->order->id()]);\n }", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "abstract public function getPaymentPageUrl();", "public function getActionUrl()\n {\n return Mage::getUrl('supplier/plan/buy');\n }", "public function getCheckoutUrl() {\n\t\tif(Mage::helper('core')->isModuleEnabled('Idev_OneStepCheckout')) {\n\t\t\tif ($this->helper('onestepcheckout')->isRewriteCheckoutLinksEnabled()) return $this->getUrl('onestepcheckout', array('_secure'=>true));\n\t\t}\n\t\t\n\t\tif(Mage::helper('core')->isModuleEnabled('Ecom_KlarnaCheckout')) {\n\t\t\tif ($this->helper('klarnacheckout')->isRewriteCheckoutLinksEnabled()) return $this->getUrl('klarnacheckout', array('_secure'=>true));\n\t\t}\n\t\treturn parent::getCheckoutUrl();\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('postfinancecheckout/transaction/redirect', array(\n '_secure' => true\n ));\n }", "public function getDetailViewUrl()\n\t{\n\t\treturn 'index.php?module=TreesManager&parent=Settings&view=Edit&record=' . $this->getId();\n\t}", "public function transactionFormGetActionURI ();", "public function getCheckoutRedirectUrl()\n {\n return Mage::getUrl('radial_paypal_express/checkout/start');\n }", "public function getUrlForCheckoutButton()\n {\n if ($this->getQuote()) {\n /** @var Quote $quote */\n $quote = $this->getQuote();\n $route = $this->getRoute($quote);\n $params = ['quote_id' => $quote->getQuoteId()];\n\n if ($this->isAutoLoginEnabled()) {\n $params['hash'] = $quote->getUrlHash();\n }\n\n return $this->url->getUrl($route, $params);\n }\n\n return \"#\";\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('pagseguro/payment/request');\n }", "public function getTransactionDetailLink($transactionId) {\n \n }", "public function getReturnUrl()\n {\n return Mage::getUrl('payulite/processing/return', array('_secure' => true, 'order' => '{{ORDER_ID}}'));\n }", "public function getOkUrl()\n {\n return $this->url('./receipt');\n }", "public function getMytripUrl() {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ()->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ();\n return $objectManager->getUrl('booking/mytrip/currenttrip/');\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('paynovapayment/processing/payment');\n }", "public function getReturnUrl()\n {\n return $this->_urlBuilder->getUrl('dilmah_payments/ntb/return');\n }", "public function getOrderPlaceRedirectUrl()\n {\n if (Mage::getStoreConfig('payment/bitcoin/fullscreen')) {\n if(Mage::helper(\"bitcoin\")->doesTheStoreHasSSL()){\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => true));\n }else{\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => false));\n }\n return $target_url;\n } else {\n return '';\n }\n }", "public function getSubmitUrl()\n {\n \treturn $this->getUrl('Purchase/Misc/Savepayment');\n }", "public static function checkout_url() {\n\n\t\tif ( self::$_cache['environment'] == 'sandbox' ) {\n\t\t\tif ( self::$_cache['mobile_url'] == 'yes' ) {\n\t\t\t\t$url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout-mobile&token=';\n\t\t\t} elseif( self::$_cache['incontext_url'] == 'yes' ) {\n\t\t\t\t$url = 'https://www.sandbox.paypal.com/incontext?token=';\n\t\t\t} else {\n\t\t\t\t$url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=';\n\t\t\t}\n\t\t} else {\n\t\t\tif ( self::$_cache['mobile_url'] == 'yes' ) {\n\t\t\t\t$url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout-mobile&token=';\n\t\t\t} elseif( self::$_cache['incontext_url'] == 'yes' ) {\n\t\t\t\t$url = 'https://www.paypal.com/incontext?token=';\n\t\t\t} else {\n\t\t\t\t$url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=';\n\t\t\t}\n\t\t}\n\n\t\treturn $url;\n\t}", "function getViewUrl() {\n \treturn assemble_url('reminder_view', array('reminder_id' => $this->getId()));\n }", "public function getUrl()\n\t{\n\t\treturn '/akce/' . $this->getActionId();\n\t}", "public function getPostActionUrl()\n {\n return $this->helper('customer')->getRegisterPostUrl();\n }", "public function getOneClickUrl()\n {\n $store = Mage::getSingleton('adminhtml/session_quote')->getStore();\n\n return Zend_Json::encode($this->escapeUrl(Mage::getStoreConfig('oyst/oneclick/payment_url', $store->getId())));\n }", "public function getOrderPlaceRedirectUrl()\n\t{\n return Mage::getUrl('hostedpayments/processing/pay');\n\t}", "public function getAboutPaypalPageUrl()\n {\n return $this->_getConfig()->getPaymentMarkWhatIsPaypalUrl($this->_localeResolver);\n }" ]
[ "0.7323596", "0.68892527", "0.6855693", "0.6695057", "0.66135955", "0.65409815", "0.65202546", "0.6460198", "0.6419573", "0.6396437", "0.6352841", "0.6349341", "0.6328401", "0.6315023", "0.62494856", "0.62242836", "0.62109375", "0.6114902", "0.6103458", "0.6097773", "0.6095201", "0.6083907", "0.60727084", "0.602667", "0.60241497", "0.6018989", "0.5999343", "0.59987605", "0.59806323", "0.5977253" ]
0.7119928
1
Returns the URL to the refund detail view in PostFinance Checkout.
public static function getRefundUrl(PostFinanceCheckoutModelRefundjob $refundJob) { return self::getBaseGatewayUrl() . '/s/' . $refundJob->getSpaceId() . '/payment/refund/view/' . $refundJob->getRefundId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function view_refund()\n\n {\n $itemData['item'] = Product::getrefundItem();\n\n $data = ['itemData' => $itemData];\n\n return view('admin.refund')->with($data);\n }", "public function getRechargeUrl()\n {\n return $this->get(self::_RECHARGE_URL);\n }", "public function getReturnUrl() {\n return Url::fromRoute('entity.commerce_order.edit_form', ['commerce_order' => $this->order->id()]);\n }", "public function show(Refund $refund)\n {\n //\n }", "public function get_company_invoice_payment_refund() {\n $invoice = $this->input->post('invoice');\n $data = $this->classtraineemodel->company_invoice($invoice);\n if ($data->company_id[0] == 'T') {\n $tenant_details = fetch_tenant_details($data->company_id);\n $data->company_name = $tenant_details->tenant_name;\n } else {\n $company_details = $this->company->get_company_details($this->tenant_id, $data->company_id);\n $data->company_name = $company_details[0]->company_name;\n }\n $data->discount_label = rtrim($this->course->get_metadata_on_parameter_id($data->discount_type), ', ');\n $gst_label = ($data->total_gst > 0) ? 'GST ON, ' : 'GST OFF ';\n if ($data->total_gst > 0) {\n $gst_label .= rtrim($this->course->get_metadata_on_parameter_id($data->gst_rule), ', ');\n }\n $data->gst_label = $gst_label;\n $data->inv_date = date('d/m/Y', strtotime($data->inv_date));\n $data->amount_refund = round($data->amount_refund, 2);\n $refund_details = $refund_details = $this->classtraineemodel->get_refund_paid_details($invoice);\n foreach ($refund_details as $k => $row) {\n if ($row->refnd_reason != 'OTHERS') {\n $refund_details[$k]->refnd_reason = $this->course->get_metadata_on_parameter_id($row->refnd_reason);\n } else {\n $refund_details[$k]->refnd_reason = 'Others (' . $row->refnd_reason_ot . ')';\n }\n\n $refund_details[$k]->refund_on = date('d/m/Y', strtotime($row->refund_on));\n $refund_details[$k]->mode_of_refund = $this->course->get_metadata_on_parameter_id($row->mode_of_refund);\n }\n $res = array('data' => $data, 'refund' => $refund_details);\n echo json_encode($res);\n exit();\n }", "function it_exchange_refund_url_for_authorizenet( $url ) {\n\t$settings = it_exchange_get_option( 'addon_authorizenet' );\n\t$url = $settings['authorizenet-sandbox-mode'] ? AUTHORIZE_NET_AIM_API_SANDBOX_URL : AUTHORIZE_NET_AIM_API_LIVE_URL;\n\n\treturn $url;\n}", "public function getPostUrl()\n {\n return $this->scopeConfig->getValue(\n 'payment/eurobank/post_url',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function getEndpoint()\n {\n return $this->getRefundId()\n ? parent::getEndpoint() . \"payments/{$this->getPaymentId()}/refunds/{$this->getRefundId()}/capture\"\n : parent::getEndpoint() . \"payments/{$this->getPaymentId()}/refunds\";\n }", "public function getRefundId()\n {\n return $this->getParameter('refundId');\n }", "public function getWholesalePostActionUrl()\n {\n return $this->helper('customer')->getWholesaleRegisterPostUrl();\n }", "public function refund_data() {\n $data['header'] = $this->header;\n $this->load->view('report_refund_v', $data);\n }", "public function getRefunds() {\n $orders = Order::where('status', 'refund')->with('orderitems', 'shippings')->get();\n return view('backend.admin.order.refund')->with('orders', $orders);\n }", "public function refund($url, $orderUUID, $amount);", "public function refund();", "function getViewUrl() {\n \treturn assemble_url('reminder_view', array('reminder_id' => $this->getId()));\n }", "public function getOkUrl()\n {\n return $this->url('./receipt');\n }", "public function getRefundID()\n {\n return $this->refundID;\n }", "public function getRefundsNotificationUrl(): ?string\n {\n return $this->configuration[ConfigurationInterface::REFUNDS_NOTIFICATION_URL] ?? null;\n }", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "function getDismissUrl() {\n \treturn assemble_url('reminder_dismiss', array('reminder_id' => $this->getId()));\n }", "public function index()\n {\n //\n return view('admin.refund.index');\n }", "public function transactionFormGetActionURI ();", "public function getURL()\n {\n return $this->site->getURL() . 'unl_progress/edit/';\n\n }", "public function getReturnUrl()\n {\n return Mage::getUrl('payulite/processing/return', array('_secure' => true, 'order' => '{{ORDER_ID}}'));\n }", "public function get_transaction_url( $order ) {\r\n \r\n $this->view_transaction_url = MDL_COINCHECK_API_BASE. '?cmd=_view-a-trans&id=%s';\r\n \r\n return parent::get_transaction_url( $order );\r\n }", "public function returnUrl(): string\n {\n return Request::url() . '?' . http_build_query([\n 'return' => 'return',\n 'oc-mall_payment_id' => $this->getPaymentId(),\n ]);\n }", "public function url()\n {\n return '/end-borrowing';\n }", "public function url()\n {\n return backpack_url(\"/page/{$this->id}/edit\");\n }", "public function renderBuyerRefundOverviewAction(Request $request)\r\n {\r\n $payoutId = (int) $request->get('payout', null);\r\n\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $payout = $em->find('YilinkerCoreBundle:Payout', $payoutId);\r\n\r\n if (!$payout) {\r\n throw $this->createNotFoundException('Sorry not existing');\r\n }\r\n\r\n return $this->render('YilinkerBackendBundle:Transaction:buyer_refund_overview.html.twig', compact('payout'));\r\n }", "public function getRefundDetails($requestParameters = array());" ]
[ "0.6758808", "0.6312987", "0.62457216", "0.60535026", "0.6017673", "0.60042673", "0.6003827", "0.5956296", "0.5945483", "0.58808774", "0.58642256", "0.58626497", "0.5770481", "0.5719233", "0.5699205", "0.5660667", "0.5615093", "0.5587667", "0.5545493", "0.5524771", "0.55070746", "0.5503959", "0.5478753", "0.54533386", "0.54218465", "0.53896415", "0.5359822", "0.5355247", "0.5351976", "0.5349793" ]
0.7165884
0
Returns the URL to the completion detail view in PostFinance Checkout.
public static function getCompletionUrl(PostFinanceCheckoutModelCompletionjob $completion) { return self::getBaseGatewayUrl() . '/s/' . $completion->getSpaceId() . '/payment/completion/view/' . $completion->getCompletionId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReturnUrl() {\n return Url::fromRoute('entity.commerce_order.edit_form', ['commerce_order' => $this->order->id()]);\n }", "public function getURL()\n {\n return $this->site->getURL() . 'unl_progress/edit/';\n\n }", "public function getCheckoutUrl()\n {\n return $this->helper('checkout/url')->getCheckoutUrl();\n }", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "public function url()\n {\n return '/end-borrowing';\n }", "public function getExecuteUrl()\r\n\t{\r\n\t\treturn $this->payment->links[2]->getHref();\r\n\t}", "function getViewUrl() {\n return assemble_url('people_company', array('company_id' => $this->getId()));\n }", "public function getPostUrl()\n {\n return $this->scopeConfig->getValue(\n 'payment/eurobank/post_url',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function getWholesalePostActionUrl()\n {\n return $this->helper('customer')->getWholesaleRegisterPostUrl();\n }", "public function getContinueUrl()\n {\n return $this->getUrl(\n 'adminhtml/*/*',\n ['_current' => true, 'code' => '<%- data.code %>', 'theme_id' => '<%- data.theme_id %>']\n );\n }", "protected function _generateOpauthCompleteUrl()\n {\n $url = Configure::read('Opauth.complete_url');\n if (!is_array($url)) {\n $url = Router::parse($url);\n }\n $url['?'] = ['social' => $this->request->query('code')];\n return Router::url($url, true);\n }", "public function getDispatchesPageUrl()\n {\n return $this->getUrl('temando/dispatch/index');\n }", "abstract public function getPaymentPageUrl();", "public function getSubmitUrl()\n {\n \treturn $this->getUrl('Purchase/Misc/Savepayment');\n }", "public function getCheckoutUrl() {\n\t\tif(Mage::helper('core')->isModuleEnabled('Idev_OneStepCheckout')) {\n\t\t\tif ($this->helper('onestepcheckout')->isRewriteCheckoutLinksEnabled()) return $this->getUrl('onestepcheckout', array('_secure'=>true));\n\t\t}\n\t\t\n\t\tif(Mage::helper('core')->isModuleEnabled('Ecom_KlarnaCheckout')) {\n\t\t\tif ($this->helper('klarnacheckout')->isRewriteCheckoutLinksEnabled()) return $this->getUrl('klarnacheckout', array('_secure'=>true));\n\t\t}\n\t\treturn parent::getCheckoutUrl();\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('pagseguro/payment/request');\n }", "public function getFetchUrl()\n {\n return $this->getUrl(\"afbt/fetch/index\");\n }", "function getViewUrl() {\n \treturn assemble_url('reminder_view', array('reminder_id' => $this->getId()));\n }", "public function getContinueUrl()\n {\n return $this->getUrl('*/*/*', array(\n '_current' => true,\n 'model' => '{{model}}'\n ));\n }", "public function getCheckoutRedirectUrl()\n {\n return Mage::getUrl('radial_paypal_express/checkout/start');\n }", "public function getOkUrl()\n {\n return $this->url('./receipt');\n }", "function get_checkout_url() {\n\t\t\t$checkout_page_id = get_option('cmdeals_checkout_page_id');\n\t\t\tif ($checkout_page_id) :\n\t\t\t\tif (is_ssl()) return str_replace('http:', 'https:', get_permalink($checkout_page_id));\n\t\t\t\treturn get_permalink($checkout_page_id);\n\t\t\tendif;\n\t\t}", "function getViewUrl() {\n \treturn assemble_url('people_company_user', array(\n \t 'company_id' => $this->getCompanyId(),\n \t 'user_id' => $this->getId(),\n \t));\n }", "public function getActionUrl()\n {\n return Mage::getUrl('supplier/plan/buy');\n }", "public function returnUrl(): string\n {\n return Request::url() . '?' . http_build_query([\n 'return' => 'return',\n 'oc-mall_payment_id' => $this->getPaymentId(),\n ]);\n }", "public function getRedirectUrl()\n {\n return $this->request->getTestMode()\n ? 'https://sslpayment.cathaybkdev.com.tw/EPOSService/Payment/OrderInitial.aspx'\n : 'https://sslpayment.uwccb.com.tw/EPOSService/Payment/OrderInitial.aspx';\n }", "public function SubmitLandPageUrl()\n {\n $url = $this->URL;\n $page = Director::get_current_page();\n $res = $page->getManyManyComponents(\"Companies\", \"CompanyID={$this->ID}\", \"ID\")->First();\n $submit_url = $res->SubmitPageUrl;\n if (isset($submit_url) && $submit_url != '') {\n return $submit_url;\n }\n\n return $url;\n }", "public function getPaymentFormUrl()\r\n {\r\n return self::HPF_URL;\r\n }", "public function getFormActionUrl() {\r\n return $this->_urlBuilder->getRouteUrl('checkout_com/cards/store');\r\n }", "public function url()\n\t{\n\t\treturn Url::to($this->id);\n\t}" ]
[ "0.64211696", "0.6261794", "0.61925775", "0.6170745", "0.6152904", "0.61524445", "0.61149454", "0.6026059", "0.6005421", "0.5947173", "0.593462", "0.5932911", "0.5932135", "0.58955806", "0.5829262", "0.5803963", "0.579336", "0.57803035", "0.5764308", "0.5760007", "0.5755791", "0.57194215", "0.57171845", "0.5704017", "0.56891876", "0.5685033", "0.568487", "0.5674979", "0.5671623", "0.5669717" ]
0.7650836
0
Returns the URL to the void detail view in PostFinance Checkout.
public static function getVoidUrl(PostFinanceCheckoutModelVoidjob $void) { return self::getBaseGatewayUrl() . '/s/' . $void->getSpaceId() . '/payment/void/view/' . $void->getVoidId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getPaymentPageUrl();", "public function getPostUrl()\n {\n return $this->scopeConfig->getValue(\n 'payment/eurobank/post_url',\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function getCheckoutUrl()\n {\n return $this->helper('checkout/url')->getCheckoutUrl();\n }", "public function url()\n {\n return '/end-borrowing';\n }", "public function getUrlForCheckoutButton()\n {\n if ($this->getQuote()) {\n /** @var Quote $quote */\n $quote = $this->getQuote();\n $route = $this->getRoute($quote);\n $params = ['quote_id' => $quote->getQuoteId()];\n\n if ($this->isAutoLoginEnabled()) {\n $params['hash'] = $quote->getUrlHash();\n }\n\n return $this->url->getUrl($route, $params);\n }\n\n return \"#\";\n }", "public function getWholesalePostActionUrl()\n {\n return $this->helper('customer')->getWholesaleRegisterPostUrl();\n }", "public function getCheckoutUrl() {\n\t\tif(Mage::helper('core')->isModuleEnabled('Idev_OneStepCheckout')) {\n\t\t\tif ($this->helper('onestepcheckout')->isRewriteCheckoutLinksEnabled()) return $this->getUrl('onestepcheckout', array('_secure'=>true));\n\t\t}\n\t\t\n\t\tif(Mage::helper('core')->isModuleEnabled('Ecom_KlarnaCheckout')) {\n\t\t\tif ($this->helper('klarnacheckout')->isRewriteCheckoutLinksEnabled()) return $this->getUrl('klarnacheckout', array('_secure'=>true));\n\t\t}\n\t\treturn parent::getCheckoutUrl();\n }", "public function getActionUrl()\n {\n return Mage::getUrl('supplier/plan/buy');\n }", "public function getOkUrl()\n {\n return $this->url('./receipt');\n }", "public function getPaymentUrl(){\n\t\t$order = $this->getOrder();\n\t\t$hostedpayment = Mage::getModel('hostedpayments/hostedpayment');\n\t\t$hostedpayment->load($order->getRealOrderId(), 'order_id');\n\t\t\n\t\t$paymentUrl = $hostedpayment->getUrl();\n\t\t\t\t\n\t\tif(!isset($paymentUrl) || trim($paymentUrl) == '' ){\n\t\t\t$paymentUrl = EvoSnapApi::getCheckoutUrl($this->_getOrderCheckout(),\n\t\t\t\t\t$this->getTrigger3ds(), $this->getHostedPaymentsConfiguration());\n\t\t\t\t\n\t\t\t$order->addStatusToHistory($order->getStatus(), Mage::helper('hostedpayments')->__('Customer was redirected to the Snap* Hosted Payments Checkout for payment.'));\n\t\t\t$order->save();\n\t\t\t\n\t\t\t$hostedpayment = Mage::getModel('hostedpayments/hostedpayment');\n\t\t\t$hostedpayment->setOrderId($order->getRealOrderId());\n\t\t\t$hostedpayment->setUrl($paymentUrl);\n\t\t\t$hostedpayment->setPrefix($this->getConfigData('order_prefix'));\n\t\t\t$hostedpayment->setDataChanges(true);\n\t\t\t$hostedpayment->save();\n\t\t}\n\t\t\n\t\treturn $paymentUrl;\n\t}", "public function getSubmitUrl()\n {\n \treturn $this->getUrl('Purchase/Misc/Savepayment');\n }", "public function getReturnUrl()\n {\n return Mage::getUrl('payulite/processing/return', array('_secure' => true, 'order' => '{{ORDER_ID}}'));\n }", "public function url()\n\t{\n\t\treturn Url::to($this->id);\n\t}", "public function getExecuteUrl()\r\n\t{\r\n\t\treturn $this->payment->links[2]->getHref();\r\n\t}", "public function getReturnUrl() {\n return Url::fromRoute('entity.commerce_order.edit_form', ['commerce_order' => $this->order->id()]);\n }", "function get_checkout_url() {\n\t\t\t$checkout_page_id = get_option('cmdeals_checkout_page_id');\n\t\t\tif ($checkout_page_id) :\n\t\t\t\tif (is_ssl()) return str_replace('http:', 'https:', get_permalink($checkout_page_id));\n\t\t\t\treturn get_permalink($checkout_page_id);\n\t\t\tendif;\n\t\t}", "public function get_url()\r\n\t{\r\n\t\treturn $this->dropin_url;\r\n\t}", "public function get_transaction_url( $order ) {\r\n \r\n $this->view_transaction_url = MDL_COINCHECK_API_BASE. '?cmd=_view-a-trans&id=%s';\r\n \r\n return parent::get_transaction_url( $order );\r\n }", "function getUnarchiveUrl() {\n return assemble_url('people_company_archive', array('company_id' => $this->getId(), 'set_value' => false));\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('postfinancecheckout/transaction/redirect', array(\n '_secure' => true\n ));\n }", "public function getURL()\n {\n return $this->site->getURL() . 'unl_progress/edit/';\n\n }", "public function getUrl()\n {\n if ((bool)$this->_action) {\n return $this->_vendorUrlModel->getUrl(\n (string)$this->_action,\n ['_cache_secret_key' => true]\n );\n }\n return '#';\n }", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "public function returnUrl(): string\n {\n return Request::url() . '?' . http_build_query([\n 'return' => 'return',\n 'oc-mall_payment_id' => $this->getPaymentId(),\n ]);\n }", "public function getOrderPlaceRedirectUrl()\n\t{\n return Mage::getUrl('hostedpayments/processing/pay');\n\t}", "public function getOrderPlaceRedirectUrl()\n {\n if (Mage::getStoreConfig('payment/bitcoin/fullscreen')) {\n if(Mage::helper(\"bitcoin\")->doesTheStoreHasSSL()){\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => true));\n }else{\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => false));\n }\n return $target_url;\n } else {\n return '';\n }\n }", "public function getCheckoutRedirectUrl()\n {\n return Mage::getUrl('radial_paypal_express/checkout/start');\n }", "public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('paynovapayment/processing/payment');\n }", "public static function url()\n {\n return base_url(static::action());\n }", "public function getPaymentFormUrl()\r\n {\r\n return self::HPF_URL;\r\n }" ]
[ "0.6189274", "0.6130922", "0.6012734", "0.5983876", "0.59617263", "0.58708996", "0.5848268", "0.5783517", "0.57715493", "0.5755201", "0.57438993", "0.57233167", "0.5720057", "0.57132626", "0.56995314", "0.5690432", "0.5671443", "0.563122", "0.5628281", "0.5618418", "0.5610052", "0.55814725", "0.5575075", "0.5568553", "0.5567228", "0.5566625", "0.5566001", "0.5550484", "0.5544438", "0.55291426" ]
0.7265928
0
Returns the charge attempt's labels by their groups.
public static function getGroupedChargeAttemptLabels(PostFinanceCheckoutModelTransactioninfo $info) { try { $labelDescriptionProvider = PostFinanceCheckoutProviderLabeldescription::instance(); $labelDescriptionGroupProvider = PostFinanceCheckoutProviderLabeldescription::instance(); $labelsByGroupId = array(); foreach ($info->getLabels() as $descriptorId => $value) { $descriptor = $labelDescriptionProvider->find($descriptorId); if ($descriptor && $descriptor->getCategory() == \PostFinanceCheckout\Sdk\Model\LabelDescriptorCategory::HUMAN) { $labelsByGroupId[$descriptor->getGroup()][] = array( 'descriptor' => $descriptor, 'translatedName' => PostFinanceCheckoutHelper::translate($descriptor->getName()), 'value' => $value ); } } $labelsByGroup = array(); foreach ($labelsByGroupId as $groupId => $labels) { $group = $labelDescriptionGroupProvider->find($groupId); if ($group) { usort( $labels, function ($a, $b) { return $a['descriptor']->getWeight() - $b['descriptor']->getWeight(); } ); $labelsByGroup[] = array( 'group' => $group, 'id' => $group->getId(), 'translatedTitle' => PostFinanceCheckoutHelper::translate($group->getName()), 'labels' => $labels ); } } usort($labelsByGroup, function ($a, $b) { return $a['group']->getWeight() - $b['group']->getWeight(); }); return $labelsByGroup; } catch (Exception $e) { return array(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGroupLabel()\n\t{\n\t\t$personContextLevel = $this->getContext()->getPersonContextLevel();\n\t\tif ($personContextLevel == 'none')\n\t\t{\n\t\t\tthrow new Exception('Person level of context is ' . $personContextLevel . '. Cannot get current Group Label.');\n\t\t}\n\t\telseif ($personContextLevel == 'group')\n\t\t{\n\t\t\treturn $this->getContext()->groupLabel;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->getContext()->getApi('group')->translateLabel('%current%');\n\t\t}\n\t}", "public function getLabels();", "public function getLabels();", "public function getLabels();", "public function listLabels()\n {\n $this->authenticate();\n $labels = $this->client->api('projects')->labels($this->issueIntegrator->getProjectName());\n\n return $this->mapLabels($labels);\n }", "public function labels()\n {\n return array();\n }", "public function getGroupSequence()\n {\n $groups = [self::class];\n\n if ($this->request === null) {\n $groups = ['Strict'];\n }\n\n return $groups;\n }", "public function format()\n {\n $result = array();\n\n foreach ($this->groups as $group) {\n $result[] = array(\n 'id' => $group->getInternalId(),\n 'external_id' => $group->getExternalId(),\n 'value' => $group->getName(),\n 'label' => $group->getName(),\n );\n }\n\n return $result;\n }", "public function getGroupNames()\n {\n $groups = deserialize( $this->groups );\n if ( ! count( $groups ) )\n {\n return array();\n }\n\n $query = 'select name from ' . $this->group_table . ' where ';\n $params = array();\n foreach ( $groups as $group )\n {\n $query .= 'id = ? or ';\n $params[] = $group;\n }\n\n $query = substr( $query, 0, strlen( $query ) - 4 );\n\n $records = $this->Database->prepare( $query )\n ->execute( $params );\n\n $group_names = array();\n while ( $records->next() )\n {\n $group_names[] = $records->name;\n }\n\n return $group_names;\n }", "public function getLabels()\n {\n return array_values(array_unique($this->labels));\n }", "public static function getLabels($tableNames, $varian_group=\"\"){\n\t\t$label = array();\n\t\t\n\t\t//Label\n\t\t/*\n\t\t$datas= AppFieldConfig::find()\n ->where(['classname' => $tableNames])\n\t\t\t\t->all();\n\t\t*/\n\t\tif($varian_group == \"\"){\n\t\t\t$datas= AppFieldConfig::find()\n ->where(['classname' => $tableNames, 'varian_group'=>\"\"])\n\t\t\t\t->orderBy(['no_order'=>SORT_ASC])\n\t\t\t\t->all();\n\t\t}else{\n\t\t\t$datas= AppFieldConfig::find()\n ->where(['classname' => $tableNames, 'varian_group'=>$varian_group])\n\t\t\t\t->orderBy(['no_order'=>SORT_ASC])\n\t\t\t\t->all();\n\t\t}\n\t\tforeach($datas as $data){\n\t\t\t//echo $data->fieldname.\"<br>\";\n\t\t\tif($data->label != \"\"){\n\t\t\t\t$label[$data->fieldname] = $data->label;\n\t\t\t}else{\n\t\t\t\t$label[$data->fieldname] = $data->fieldname;\n\t\t\t}\n\t\t}\n\t\t//var_dump($label);\n\n\t\treturn $label;\n\t}", "public function getLabels()\n\t{\n\t\t// Check for existence of a model\n\t\tif (NULL === ($model = $this->getModel())) {\n\t\t\tthrow new Scil_Services_Model_Decorator_Exception(__METHOD__.' no model available to process!');\n\t\t}\n\n\t\t// Get the fields\n\t\t$fields = $model->getFieldsAsContainer();\n\t\t$labels = array();\n\n\t\tforeach ($fields as $key => $value) {\n\t\t\t$labels[$key] = isset($this->_labels[$key]) ? $this->_labels[$key] : $key;\n\t\t}\n\n\t\treturn $this->_labels;\n\t}", "public function getGroupSequence()\n {\n $groups = ['Message'];\n $groups[] = $this->action;\n\n return $groups;\n }", "protected function getGroups() {\n return DB::table('translation_identifiers')->select('group')->groupBy(['group'])->get()->pluck('group');\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }" ]
[ "0.6288325", "0.6015285", "0.6015285", "0.6015285", "0.5944791", "0.5857152", "0.58282167", "0.57581615", "0.5747983", "0.5705196", "0.5691351", "0.5688932", "0.5681446", "0.56804127", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907", "0.5666907" ]
0.6511563
0
Returns the transaction info for the given orderId. If the order id is not associated with a PostFinance Checkout transaciton it returns null
public static function getTransactionInfoForOrder($order) { if (! $order->module == 'postfinancecheckout') { return null; } $searchId = $order->id; $mainOrder = self::getOrderMeta($order, 'postFinanceCheckoutMainOrderId'); if ($mainOrder !== null) { $searchId = $mainOrder; } $info = PostFinanceCheckoutModelTransactioninfo::loadByOrderId($searchId); if ($info->getId() == null) { return null; } return $info; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_transaction_details( $order_id ) {\n\t\t$order = new WC_Order( $order_id );\n\t\t$request = $this->prepare_request( self::TXN_TYPE_REPORT_TXN_DETAILS, $order );\n\t\t$response = $this->submit_request( $request );\n\n\t\treturn $response;\n\t}", "protected function _get_transaction_id( $order_id ) {\n\t\t\treturn get_post_meta( $order_id, '_transaction_id', true );\n\t\t}", "function getPaytmTxnDetails($OrderID) {\n $PaytmParams[\"MID\"] = PAYTM_MERCHANT_ID;\n $PaytmParams[\"ORDERID\"] = $OrderID;\n $PaytmParams['CHECKSUMHASH'] = urlencode($this->generatePaytmCheckSum($PaytmParams, PAYTM_MERCHANT_KEY));\n $Connection = curl_init();\n curl_setopt($Connection, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($Connection, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($Connection, CURLOPT_URL, \"https://\" . PAYTM_DOMAIN . \"/merchant-status/getTxnStatus\");\n curl_setopt($Connection, CURLOPT_POST, true);\n curl_setopt($Connection, CURLOPT_POSTFIELDS, \"JsonData=\" . json_encode($PaytmParams, JSON_UNESCAPED_SLASHES));\n curl_setopt($Connection, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($Connection, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n return json_decode(curl_exec($Connection), true);\n }", "public function get_transaction_id_from_order_id ($order_id)\n\t{\n\t\t$query = tep_db_query(\"SELECT payment_id FROM \" . self::DB_PAYMENTS_TABLE . \" WHERE osc_order_id = '\".tep_db_input($order_id).\"'\");\n\t\t$row = tep_db_fetch_array($query);\n\n\t\treturn $row ? $row['payment_id'] : 0;\n\t}", "private function getDbTransactionsByOrderId($idOrder)\n {\n\n $query = 'SELECT * FROM ' . _DB_PREFIX_ . PayViaEpul::MODULE_NAME . '_transactions WHERE id_order = ' . pSQL($idOrder);\n $result = Db::getInstance()->executeS($query);\n\n if (!isset($result) || count($result) === 0 || !isset($result[0])) {\n return null;\n }\n\n return $result[0];\n }", "public function get_transaction_from_order( WC_Order $order ) {\n\n\t\tif ( ! isset( self::$transaction_cache[ $order->get_id() ] ) || is_null( self::$transaction_cache[ $order->get_id() ] ) ) {\n\t\t\t$existing_transaction = WC_PostFinanceCheckout_Entity_Transaction_Info::load_by_order_id( $order->get_id() );\n\t\t\t$configured_space_id = get_option( WooCommerce_PostFinanceCheckout::CK_SPACE_ID );\n\t\t\tif ( is_null( $existing_transaction->get_id() ) || is_null( $existing_transaction->get_space_id() ) || $existing_transaction->get_space_id() != $configured_space_id ) {\n\t\t\t\tWC_PostFinanceCheckout_Helper::instance()->start_database_transaction();\n\t\t\t\ttry {\n\t\t\t\t\t$transaction = $this->create_transaction_by_order( $order );\n\t\t\t\t\tWC_PostFinanceCheckout_Helper::instance()->commit_database_transaction();\n\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\tWC_PostFinanceCheckout_Helper::instance()->rollback_database_transaction();\n\t\t\t\t\tthrow $e;\n\t\t\t\t}\n\t\t\t} elseif ( $existing_transaction->get_state() == \\PostFinanceCheckout\\Sdk\\Model\\TransactionState::PENDING ) {\n\t\t\t\t$transaction = $this->load_and_update_transaction_for_order( $order, $existing_transaction );\n\t\t\t} else {\n\t\t\t\t$transaction = $this->get_transaction( $existing_transaction->get_space_id(), $existing_transaction->get_transaction_id() );\n\t\t\t}\n\t\t\tself::$transaction_cache[ $order->get_id() ] = $transaction;\n\t\t}\n\t\t\treturn self::$transaction_cache[ $order->get_id() ];\n\n\t}", "public function get_order( $order_id ) {\n\t\treturn $this->request( \"orders/{$order_id}\" );\n\t}", "public function getOrderTrackNTransID($orderid)\n {\n $selOrder = 'SELECT ordr.reference, ordr.shipping_number,ordr.invoice_number, paymt.transaction_id';\n $selOrder .= ' FROM ' . _DB_PREFIX_ . 'orders as ordr';\n $selOrder .= ' LEFT JOIN ' . _DB_PREFIX_ . 'order_payment as paymt';\n $selOrder .= ' ON paymt.order_reference = ordr.reference';\n $selOrder .= ' WHERE ordr.id_order = \"' . (int)$orderid . '\"';\n $selOrder .= ' order by paymt.id_order_payment desc';\n $getOrderTrack = Db::getInstance()->ExecuteS($selOrder);\n return $getOrderTrack;\n }", "public function getOrder(string $order_id): \\GDAX\\Types\\Response\\Authenticated\\Order;", "public function getTransactionDetails($transactionId) {\n return $this->getService()->detailTransaction($transactionId);\n }", "protected function findTransactionId(OrderInterface $order) {\n $uri = $this->prepareFindRequestUri($order);\n $response = $this->httpClient->get($uri);\n if ($response->getStatusCode() == 200) {\n $data = Json::decode($response->getBody());\n if (!empty($data['response']['data'])) {\n $transaction_data = reset($data['response']['data']);\n return $transaction_data['Conversion']['id'];\n }\n }\n else {\n // TODO - logging request fail?.\n }\n return NULL;\n }", "public static function getTransactionsByOrder($order_id)\n {\n global $db;\n\n $query = $db->Execute(\"SELECT * FROM `\" . static::$table_name . \"`\n WHERE `order_id` = '\" . abs(intval($order_id)) . \"'\");\n\n if ($query->RecordCount() > 0) {\n $transactions = array();\n\n while (!$query->EOF) {\n $transactions[] = $query->fields;\n $query->MoveNext();\n }\n }\n\n return false;\n }", "public function getInfoPaymentByOrder($order_id)\n {\n $order = $this->_getOrder($order_id);\n $payment = $order->getPayment();\n $info_payments = [];\n $fields = [\n [\"field\" => \"cardholderName\", \"title\" => \"Card Holder Name: %1\"],\n [\"field\" => \"trunc_card\", \"title\" => \"Card Number: %1\"],\n [\"field\" => \"payment_method\", \"title\" => \"Payment Method: %1\"],\n [\"field\" => \"expiration_date\", \"title\" => \"Expiration Date: %1\"],\n [\"field\" => \"installments\", \"title\" => \"Installments: %1\"],\n [\"field\" => \"statement_descriptor\", \"title\" => \"Statement Descriptor: %1\"],\n [\"field\" => \"payment_id\", \"title\" => \"Payment id (Mercado Pago): %1\"],\n [\"field\" => \"status\", \"title\" => \"Payment Status: %1\"],\n [\"field\" => \"status_detail\", \"title\" => \"Payment Detail: %1\"],\n [\"field\" => \"activation_uri\", \"title\" => \"Generate Ticket\"],\n [\"field\" => \"payment_id_detail\", \"title\" => \"Mercado Pago Payment Id: %1\"],\n [\"field\" => \"id\", \"title\" => \"Collection Id: %1\"],\n ];\n\n foreach ($fields as $field) {\n if ($payment->getAdditionalInformation($field['field']) != \"\") {\n $text = __($field['title'], $payment->getAdditionalInformation($field['field']));\n $info_payments[$field['field']] = [\n \"text\" => $text,\n \"value\" => $payment->getAdditionalInformation($field['field'])\n ];\n }\n }\n\n if ($payment->getAdditionalInformation('payer_identification_type') != \"\") {\n $text = __($payment->getAdditionalInformation('payer_identification_type'));\n $info_payments[$payment->getAdditionalInformation('payer_identification_type')] = [\n \"text\" => $text . ': ' . $payment->getAdditionalInformation('payer_identification_number')\n ];\n }\n\n return $info_payments;\n }", "private function getTransactionDetails($transactionId)\n {\n // The refId is a Merchant-assigned reference ID for the request.\n // If included in the request, this value is included in the response.\n // This feature might be especially useful for multi-threaded applications.\n $refId = 'ref' . time();\n\n $request = new GetTransactionDetailsRequest();\n $request->setMerchantAuthentication($this->config);\n $request->setTransId($transactionId);\n\n $controller = new GetTransactionDetailsController($request);\n\n $response = $controller->executeWithApiResponse(ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\")) {\n return $response->getTransaction();\n }\n\n $errorMessages = $response->getMessages()->getMessage();\n $this->addErrorToLog(\n $this->payment->user,\n ['error' => $errorMessages[0]->getText(), 'code' => $errorMessages[0]->getCode()]\n );\n }", "public function getOrderInfoById($orderId)\n {\n $ordersQuery = DB::table('orders')\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_destination'),\n 'location_destination.id',\n '=',\n 'orders.location_destination_id'\n )\n ->leftJoin(\n DB::raw('(SELECT locations.id, locations.full_address, locations.longitude, locations.latitude FROM locations) as location_arrival'),\n 'location_arrival.id',\n '=',\n 'orders.location_arrival_id'\n )\n ->leftJoin('vehicle', 'orders.vehicle_id', '=', 'vehicle.id')\n ->where([\n ['orders.id', '=', $orderId],\n ['orders.del_flag', '=', '0'],\n ['vehicle.del_flag', '=', '0']\n ]);\n $order = $ordersQuery->get([\n 'orders.id as order_id', 'order_code', 'orders.status as status',\n 'orders.ETD_date', 'orders.ETD_time', 'location_destination.full_address as location_destination', 'location_destination.longitude as location_destination_longitude', 'location_destination.latitude as location_destination_latitude',\n 'orders.ETA_date', 'orders.ETA_time', 'location_arrival.full_address as location_arrival', 'location_arrival.longitude as location_arrival_longitude', 'location_arrival.latitude as location_arrival_latitude',\n 'vehicle.latitude as current_latitude', 'vehicle.longitude as current_longitude', 'vehicle.current_location as current_location'\n ])->first();\n return $order;\n }", "public function getCapturedTransaction($orderId)\n {\n /* @var $transactionCollection Mage_Sales_Model_Resource_Order_Payment_Transaction_Collection */\n $transactionCollection = Mage::getModel('sales/order_payment_transaction')\n ->getCollection();\n return $transactionCollection\n ->addOrderIdFilter($orderId)\n ->addTxnTypeFilter(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE)\n ->getFirstItem();\n }", "public function actionGetOut($order_id=999)\n {\n $obj = $this->c->getOrderObj($order_id);\n \n $ret = '';\n if ($obj) {\n foreach ($obj->houseContract->contracts as $contract)\n $ret .= $contract->getContractText();\n } else {\n echo 'no obj ';\n }\n $ret = iconv('utf-8', 'gbk', $ret);\n print_r($ret);\n echo 'job done!';\n }", "public static function getInfo( $id )\n {\n return OrderInfoGetter :: get( $id );\n }", "protected function findOrder($order_id)\n\t{\n\t\t$order = false;\n\t\tforeach($this->json_object->transactions as $transaction)\n\t\t{\n\t\t\tforeach($transaction->related_resources as $resource)\n\t\t\t{\n\t\t\t\tforeach($resource as $type => $resource_data)\n\t\t\t\t{\n\t\t\t\t\tif($type == 'order' && $resource_data->id == $order_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$order = $resource_data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($order === false)\n\t\t{\n\t\t\t$text = MainFactory::create('PayPalText');\n\t\t\tthrow new Exception($text->get_text('invalid_order_id'));\n\t\t}\n\t\treturn $order;\n\t}", "function getTransactionResult($transactionId)\n{\n $soap = resolve(SoapWrapper::class);\n\n return $soap->call('placeToPay.getTransactionInformation', array(\n new GetTransactionInformation( \n resolve(Authentication::class), $transactionId ) \n ));\n}", "public function getOrderDetails($orderId) {\n\n try {\n return $this->getService()->detailRecurringPaymentsProfile($orderId);\n } catch (Exception $e) {\n echo $e;\n }\n\n try {\n return $this->getTransactionDetails($orderId);\n } catch (Exception $e) {\n echo $e;\n }\n\n return false;\n }", "protected function checkTransactionInfo(Mage_Sales_Model_Order $order)\n {\n /* @var PostFinanceCheckout_Payment_Model_Entity_TransactionInfo $info */\n $info = Mage::getModel('postfinancecheckout_payment/entity_transactionInfo')->loadByTransaction(\n $order->getPostfinancecheckoutSpaceId(), $order->getPostfinancecheckoutTransactionId());\n if ($info->getId() && $info->getOrderId() != $order->getId()) {\n return false;\n } else {\n return true;\n }\n }", "function getOrderDetails($id)\n {\n $dataService = new OrderDataService();\n\n return $dataService->getOrderDetails($id);\n }", "public function getTransaction($id){\n\n $gateway = $this->getGateway();\n \n $transaction = $gateway->transaction()->find($id);\n\n return $transaction;\n\n }", "public function getDetails($id, $order){\r\n $so = $this->soap->GetStandingOrderDetails($this->licence, $id, $order);\r\n return isset($so)? $so->orderdetails: array( 0 => array('ORDERNO' => -1));\r\n }", "public function getTransaction($txId)\n {\n return $this->getData('gettransaction', array(\n $txId\n ));\n }", "public function get_order( $order_id ) {\n\n\t\t$order = parent::get_order( $order_id );\n\n\t\t$order->payment->check_type = ( 'corporate' === SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-check-type' ) ) ? 'C' : 'P';\n\n\t\t$order->payment->customer_id_number = SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-customer-id-number' );\n\t\t$order->payment->customer_id_type = (int) SV_WC_Helper::get_post( 'wc-' . $this->get_id_dasherized() . '-customer-id-type' );\n\n\t\treturn $order;\n\t}", "static public function getOrderById($order_id) {\n $order = DB::table('orders')->where('id', $order_id)->get();\n return $order;\n }", "public function getDetails($id){\n return $this->slc(\"*\", \"orders\", array(\"order_id\" => $id), TRUE)[0];\n }", "private function getOrderDetails($order_id)\n {\n $order_id = ctype_digit($order_id) ? $order_id : null;\n if($order_id != null)\n {\n try\n {\n $this->db->openConnection();\n $connection = $this->db->getConnection();\n $statement = $connection->prepare(\"CALL GetOrderById(:order_id)\");\n $statement->bindParam(\":order_id\", $order_id, PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT);\n if($statement->execute())\n {\n $this->result = $statement->fetchAll(PDO::FETCH_ASSOC);\n return true;\n }\n } catch (PDOException $ex)\n {\n $this->db->showError($ex, false);\n } finally\n {\n $this->db->closeConnection();\n }\n }\n }" ]
[ "0.70938325", "0.6761827", "0.659704", "0.63722247", "0.63223505", "0.626975", "0.6109078", "0.6092337", "0.6004047", "0.59378433", "0.5888913", "0.585912", "0.58361655", "0.58176637", "0.57769305", "0.5671771", "0.5665433", "0.5659779", "0.56496733", "0.5634253", "0.5616684", "0.5611331", "0.5600316", "0.55970705", "0.55821246", "0.5546539", "0.554539", "0.55442786", "0.5536798", "0.5531708" ]
0.7846453
0
Demonstrate an optional login. Remember to add "examples/optional_login_test" to the allowed_pages_for_login array in config/authentication.php. Notice that we are using verify_min_level to check if a user is already logged in.
public function optional_login_test() { if( $this->verify_min_level(1) ) { $page_content = '<p>Although not required, you are logged in!</p>'; } elseif( $this->tokens->match && $this->optional_login() ) { // Let Community Auth handle the login attempt ... } else { // Notice parameter set to TRUE, which designates this as an optional login $this->setup_login_form(TRUE); $page_content = '<p>You are not logged in, but can still see this page.</p>'; // Form helper needed $this->load->helper('form'); $page_content .= $this->load->view('examples/login_form', '', TRUE); } echo $this->load->view('examples/page_header', '', TRUE); echo $page_content; echo $this->load->view('examples/page_footer', '', TRUE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loginWhenNotLoggedIn()\n {\n /* @var $helper MagentoComponents_Helper*/\n $helper = Menta_ComponentManager::get('MagentoComponents_Helper');\n // open homepage\n $this->getSession()->open($this->getConfiguration()->getValue('testing.maindomain'));\n $this->assertTrue($this->getHelperCommon()->isVisible($helper->getLoginLinkPath()));\n $this->assertTrue($this->getHelperCommon()->isVisible($helper->getAccountLinkPath()));\n }", "public function testLoginExample()\n {\n $this->visit('/login')\n ->type('[email protected]', 'email')\n ->type('1234567', 'password')\n ->press('Login')\n ->seePageIs('/admin');\n }", "public function tests_if_user_can_login()\n {\n $this->visit('/')\n ->see('Login')\n ->click('Login')\n\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->press('Sign in')\n\n ->seePageIs('/backend')\n ->see('Welcome to SocietyCMS');\n }", "public function loginUserConditionMatchIfUserIsNotLoggedIn() {}", "public function isLoginRequired()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function testLoginValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => ''])\n ->see('Please enter a valid username.')\n ->see('Please enter a valid password.');\n }", "function segments_login_demo_user() {\n if ( empty( $_GET['login-demo-user'] ) ) {\n return;\n }\n\n $login = get_theme_mod( 'segments_demo_login', null );\n $password = get_theme_mod( 'segments_demo_password', null );\n $dashboard = get_theme_mod( 'workforce_pages_dashboard', null );\n\n if ( is_user_logged_in() ) {\n wp_logout();\n }\n\n if ( ! empty( $login ) && ! empty( $password ) && defined( 'WORKFORCE_ACTIVE' ) ) {\n Workforce\\Controller\\UserController::login_user( $login, $password );\n }\n\n if ( is_user_logged_in() && ! empty( $dashboard ) ) {\n wp_redirect( get_permalink( $dashboard ) );\n exit();\n }\n}", "public function test_login7()\n {\n $this->visit('login')\n ->type('', 'email')\n ->type('','password')\n ->press('Login')\n ->see('The password field is required.' &&'The password field is required.');\n }", "public function testLoginWithoutUserDetails() :void\n {\n $res = self::$dataService->login(\"login\", null, $this->userEmpty[\"user\"], $this->userEmpty[\"pass\"], [] );\n\n $this->assertIsArray( $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('status', $res, 'testLoginWithoutUserDetails' );\n $this->assertArrayHasKey('msg', $res, 'testLoginWithoutUserDetails' );\n $this->assertCount(2, $res, 'testLoginWithoutUserDetails' );\n $this->assertEquals( [ \"status\" => false, \"msg\" => \"Please enter username.\" ], $res, 'testLoginWithoutUserDetails' );\n }", "public function testViewLogin() {\n $this->visit('http://londonce.lan/login')\n ->see('Login');\n }", "public function testLoginValidationPass() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => '', 'password' => 'sfaff'])\n ->see('Please enter a valid username.');\n }", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId() {}", "public function test_default_login()\n {\n $data = ['email' => '[email protected]', 'password' => 'default'];\n\n $response = $this->post('/login', $data);\n\n $response->assertStatus(302);\n\n $response->assertRedirect('/home');\n }", "public function test_login8()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('1','password')\n ->press('Login')\n ->see('These credentials do not match our records.');\n }", "public function testLoginValidationLog() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => 'aaaaa', 'password' => ''])\n ->see('Please enter a valid password.');\n }", "private function compare_with_login()\n {\n }", "public function test_login6()\n {\n $this->visit('login')\n ->type('[email protected]', 'email')\n ->type('','password')\n ->press('Login')\n ->see('The password field is required.');\n }", "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 loginUserConditionDoesNotMatchSingleLoggedInUser() {}", "public function requireLogin(){\n if( ! Authentifiacation::isLoggedIn()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to login to view this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "protected function loginIfRequested() {}", "public function loginUserConditionMatchesAnyLoggedInUser() {}", "public function loginUserConditionMatchesAnyLoggedInUser() {}", "protected function require_login()\n {\n return false;\n }", "function pu_blank_login( $user ){\n\t \t$referrer = $_SERVER['HTTP_REFERER'];\n\n\t \t$error = false;\n\n\t \tif($_POST['log'] == '' || $_POST['pwd'] == '')\n\t \t{\n\t \t\t$error = true;\n\t \t}\n\n\t \t// check that were not on the default login page\n\t \tif ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') && $error ) {\n\n\t \t\t// make sure we don't already have a failed login attempt\n\t \tif ( !strstr($referrer, '?login=failed') ) {\n\t \t\t// Redirect to the login page and append a querystring of login failed\n\t \twp_redirect( $referrer . '?login=failed' );\n\t \t} else {\n\t \twp_redirect( $referrer );\n\t \t}\n\n\t exit;\n\n\t \t}\n\t}", "public function testLogin()\n {\n $this->loginHelper('dummy', 'foo', 'http://localhost/login', 200);\n $this->loginHelper('dummy', 'dummy', 'http://localhost/jury', 200);\n }", "public function test_user_is_able_to_login()\n {\n \n $this->browse(function (Browser $browser) {\n $user = factory (User::class)->create();\n $browser->visit(new LoginPage)\n ->loginAsUser($user)\n ->assertSee(\"Welcome {$user->name}\");\n });\n }" ]
[ "0.6491781", "0.6026042", "0.59709626", "0.5966912", "0.59227395", "0.5887675", "0.58729565", "0.5865954", "0.57619065", "0.57522243", "0.57394016", "0.56969285", "0.56969285", "0.56969285", "0.5687839", "0.56640273", "0.5649894", "0.5608717", "0.5607039", "0.5604024", "0.5601753", "0.5592466", "0.5591196", "0.5581375", "0.5579505", "0.55792", "0.5578103", "0.55575085", "0.55492604", "0.5533446" ]
0.82115334
0
Custom URL search page Redirects to a custom URL search page
function dl_custom_search_url() { if ( is_search() && ! empty( $_GET['s'] ) ) { wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) ); exit(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function material_press_nice_search_redirect() {\n \tglobal $wp_rewrite;\n \tif ( ! isset( $wp_rewrite ) || ! is_object( $wp_rewrite ) || ! $wp_rewrite->using_permalinks() ) {\n \t\treturn;\n \t}\n\n \tif ( isset( $_SERVER['REQUEST_URI'] ) ) {\n \t\t$request_uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );\n \t\t$search_base = $wp_rewrite->search_base;\n \t\tif ( is_search() && ! is_admin() && strpos( $request_uri, \"/{$search_base}/\" ) === false && strpos( $request_uri, '&' ) === false ) {\n \t\t\twp_safe_redirect( get_search_link(), 301 );\n \t\t\texit();\n \t\t}\n \t} else {\n \t\twp_safe_redirect( get_home_url(), 301 );\n \t\texit();\n \t}\n }", "function cosmos_search_redirect() {\n\n\tglobal $wp_rewrite;\n\n\tif ( $wp_rewrite->using_permalinks() && is_search() && !empty($_GET['s']) ) {\n\n\t\twp_redirect(home_url('/search/' . str_replace(array(' ', '%20'), array('+', '+'), urlencode(get_query_var('s')))), 301);\n\t\texit();\n\t}\n}", "function redirect() {\n\tglobal $wp_rewrite;\n\tif ( ! isset( $wp_rewrite ) || ! is_object( $wp_rewrite ) || ! $wp_rewrite->get_search_permastruct() ) {\n\t\treturn;\n\t}\n\n\t$search_base = $wp_rewrite->search_base;\n\tif ( is_search() && ! is_admin() && strpos( $_SERVER['REQUEST_URI'], \"/{$search_base}/\" ) === false && strpos($_SERVER['REQUEST_URI'], '&') === false ) {\n\t\twp_redirect( get_search_link() );\n\t\texit;\n\t}\n}", "function fs_nice_search_redirect() {\r\n\tif ( is_search() && strpos( $_SERVER['REQUEST_URI'], '/wp-admin/' ) === false && strpos( $_SERVER['REQUEST_URI'], '/search/' ) === false ) {\r\n\t\twp_redirect( home_url( '/search/' . str_replace( array( ' ', '%20' ), array( '+', '+' ), urlencode( get_query_var( 's' ) ) ) ), 301 );\r\n\t\texit();\r\n\t}\r\n}", "function fabric_nice_search_redirect() {\n global $wp_rewrite;\n if (!isset($wp_rewrite) || !is_object($wp_rewrite) || !$wp_rewrite->using_permalinks()) {\n return;\n }\n\n $search_base = $wp_rewrite->search_base;\n if (is_search() && !is_admin() && strpos($_SERVER['REQUEST_URI'], \"/{$search_base}/\") === false) {\n wp_redirect(home_url(\"/{$search_base}/\" . urlencode(get_query_var('s'))));\n exit();\n }\n}", "function redirect() {\n\tglobal $wp_rewrite;\n\n\tif ( no_rewrite_set( $wp_rewrite ) ) {\n\t\treturn;\n\t}\n\n\t$search_base = $wp_rewrite->search_base;\n\tif ( is_search_permalink( $search_base ) ) {\n\t\twp_redirect( get_search_link() );\n\t\texit();\n\t}\n}", "function wpb_change_search_url() {\n if ( is_search() && ! empty( $_GET['s'] ) ) {\n wp_redirect( home_url( \"/search/\" ) . urlencode( get_query_var( 's' ) ) . \"/\");\n exit();\n }\n}", "public function search()\n {\n $query = Purifier::clean(Input::get('q'));\n return Redirect::away('https://www.google.com/search?q=site:www.apcow.com' . $query, 301);\n }", "function fb_change_search_url_rewrite() {\n if ( is_search() && ! empty( $_GET['s'] ) ) {\n wp_redirect( home_url( \"/search/\" ) . urlencode( get_query_var( 's' ) ) );\n exit();\n } \n}", "function pwb_search_form_submit($form, &$form_state) {\n $form_state['redirect'] = array('search/personaleweb' . '/' . $form_state['values']['pwb_custom_search']);\n}", "public function search()\n {\n auth_admin();\n $s_title = myUrlEncode(trim($this->input->post('s_title')));\n redirect($this->path_uri . '/main/a' . $s_title);\n }", "protected function getSearchFormActionURL() {}", "function culturefeed_search_ui_redirect_cnapi_urls() {\n\n $new_query = array();\n\n // Check if we are on a searchable page.\n $current_search_page = culturefeed_get_searchable_type_by_path();\n if (!$current_search_page) {\n return;\n }\n\n // Regio is now location.\n if (isset($_GET['regio'])) {\n $region = db_query('SELECT name FROM {culturefeed_search_terms} WHERE tid = :tid', array(':tid' => 'reg.' . $_GET['regio']))->fetchField();\n if ($region) {\n $new_query['location'] = $region;\n }\n }\n\n // City id is now location.\n if (isset($_GET['cityid'])) {\n $result = db_query('SELECT name, zip FROM {culturefeed_search_cities} WHERE cid = :cityid', array(':cityid' => $_GET['cityid']))->fetchObject();\n if ($result) {\n $new_query['location'] = $result->zip . ' ' . $result->name;\n }\n }\n\n // City can be mapped to location.\n if (isset($_GET['city'])) {\n $query = $_GET['city'];\n $new_query['location'] = $query;\n }\n\n // Query is now search.\n if (isset($_GET['query'])) {\n $query = $_GET['query'];\n $new_query['search'] = $query;\n }\n\n // K is now keyword.\n if (isset($_GET['k'])) {\n $k = $_GET['k'];\n $new_query['keyword'] = $k;\n }\n\n // Datetype is now facet[datetype][0].\n if (isset($_GET['datetype'])) {\n $datetype = $_GET['datetype'];\n $new_query['facet']['datetype'][0] = $datetype;\n }\n\n // Date is now date_range.\n if (isset($_GET['date'])) {\n $date = $_GET['date'];\n $new_date = date(\"d/m/Y\", strtotime($date));\n $new_query['date_range'] = $new_date;\n }\n\n // Headings are now a combination of facets.\n if (isset($_GET['heading'])) {\n\n if (strpos($_GET['heading'], ';') !== false) {\n $heading = explode(';', $_GET['heading']);\n if ($heading[0] !== '') {\n $heading = $heading[0];\n }\n else {\n $heading = $heading[1];\n }\n }\n else {\n $heading = $_GET['heading'];\n }\n\n $mapping = culturefeed_search_ui_get_headings_mapping($heading);\n\n // Voor kinderen is not a facet\n if (isset($mapping['voor_kinderen'])) {\n $new_query['voor-kinderen'] = '1';\n unset($mapping['voor_kinderen']);\n }\n foreach ($mapping as $category => $id) {\n $new_query['facet'][$category][0] = $id;\n }\n }\n\n if (!empty($new_query)) {\n drupal_goto(current_path(), array('query' => $new_query), 301);\n }\n\n}", "function filter() {\n // the page we will redirect to\n $url['action'] = 'index';\n\n // build a URL will all the search elements in it\n // the resulting URL will be\n // example.com/cake/posts/index/Search.keywords:mykeyword/Search.tag_id:3\n foreach ($this->data as $k => $v) {\n foreach ($v as $kk => $vv) {\n $url[$k . '.' . $kk] = $vv;\n }\n }\n // redirect the user to the url\n $this->redirect($url, null, true);\n }", "function searchRequestFilter( $query_vars ) {\n if( isset( $_GET['s']) && $_GET['s'] == '' ) {\n wp_redirect( site_url() );\n exit;\n }\n return $query_vars;\n}", "public function search()\n {\n auth_admin();\n $s_news = myUrlEncode(trim($this->input->post('s_news')));\n redirect($this->path . '/main/a' . $s_news);\n }", "function culturefeed_pages_search_user_form_submit($form, &$form_state) {\n\n $form_state['redirect'] = array(\n $_GET['q'],\n array('query' => array('search' => $form_state['values']['search'])),\n );\n\n}", "public function admin_search() {\n $url['action'] = 'index';\n \n // build a URL will all the search elements in it\n // the resulting URL will be\n // example.com/cake/posts/index/Search.keywords:mykeyword/Search.tag_id:3\n foreach ($this->data as $k=>$v){\n foreach ($v as $kk=>$vv){\n $url[$k.'.'.$kk]=$vv;\n }\n }\n \n // redirect the user to the url\n $this->redirect($url, null, true);\n }", "public function public_search_page_protect(){\n\n\n\t\t\tif (!isset($_POST['submit_search'])) {\n\t\t\t\t# code...\n\t\t\t\t$this->redirect_to('index.php');\n\t\t\t}\n\t}", "public function search()\n\t{\n\t\t$search = $this->input->post('search_item');\n\t\t\n\t\tif(!empty($search))\n\t\t{\n\t\t\tredirect('products/search/'.$search);\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\tredirect('products/all-products');\n\t\t}\n\t}", "private function get_search_page() {\n\t\tif ( ! $this->is_template_supported( 'is_search' ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn add_query_arg( 's', 'example', home_url( '/' ) );\n\t}", "public function redirect() {\n\t\tif ( is_404() ) {\n\t\t\t$redirects = $this->get_rewrite_rules();\n\t\t\t$matched_rule = false;\n\t\t\t$request = $this->get_request();\n\t\t\tforeach ( (array) $redirects as $match => $query ) {\n\t\t\t\tif ( preg_match(\"#^$match#\", $request, $matches) ||\n\t\t\t\t\tpreg_match(\"#^$match#\", urldecode($request), $matches) ) {\n\n\t\t\t\t\t// Got a match.\n\t\t\t\t\t$matched_rule = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $matched_rule ) {\n\t\t\t\t$query = preg_replace(\"!^.+\\?!\", '', $query);\n\t\t\t\t$redirect = addslashes(WP_MatchesMapRegex::apply($query, $matches));\n\t\t\t\tif ( $redirect ) {\n\t\t\t\t\twp_redirect( $this->clean_url( home_url( \"?$redirect\" ) ), 301 );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function bing_for_wordpress_template_redirect() {\n\tif ( (stripos($_SERVER['REQUEST_URI'], '?s=') === FALSE) && (stripos($_SERVER['REQUEST_URI'], '/search/') === FALSE) && (!is_search()) ) {\n\t\treturn;\n\t}\n\t$s = apply_filters('the_search_query', get_search_query());\n\t\t\n\t// change status code to 200 OK since /search/ returns status code 404\n\t@header(\"HTTP/1.1 200 OK\",1);\n\t@header(\"Status: 200 OK\", 1);\n\t\n\t// If there is a template file then we use it\n\t$exists = file_exists(get_stylesheet_directory() . '/bing-for-wordpress-template.php');\n\tif ($exists) {\n\t\tinclude_once(get_stylesheet_directory() . '/bing-for-wordpress-template.php');\n\t\texit;\n\t}\n\tget_header(); ?> \n\t<div id=\"content\" class=\"bing_for_wordpress_results_page hentry article\">\n\t\t<h1 class=\"page-title\"><a href=\"<?php echo home_url(); ?>/?<?php echo $s; ?>\">Search Results for: <span><?php echo $s; ?></span></a></h1>\n\n\t\t<?php \n\t\t$results = bing_for_wordpress_search($s);\n\t\tforeach($results as $r) { ?>\n\t\t\t<?php if ( !preg_match('/\\/feed\\/$/', $r->Url) ) { ?>\n\t\t\t\t<div class=\"hentry story result\">\n\t\t\t\t\t<h2 class=\"entry-title\"><a href=\"<?php echo $r->Url; ?>\"><?php echo $r->Title; ?></a></h2>\n\t\t\t\t\t<p><?php echo $r->Description; ?></p>\n\t\t\t\t</div>\n\t\t\t<?php } \n\t\t } ?>\n\t</div>\n\t</div>\n\t</div>\n\t<?php get_sidebar(); ?>\n\t<?php get_footer();\n\texit;\n}", "function opensky_redirect_to_search_view ($pid) {\n // dsm('opensky_redirect_to_search_view redirecting to search: '. $pid);\n $options = array('query' => array(\n 'type'=>'dismax',\n 'collection'=>$pid\n ));\n drupal_goto('/islandora/search/',$options);\n}", "public function searchAction() {\n parent::searchAction();\n }", "function am2_redirect_empty_page(){\n\tif(is_404()){\n $paged = get_query_var('paged');\n if(!empty($paged) && $paged > 1){\n $uri = $_SERVER['REQUEST_URI'];\n $has_page_pos = strpos($uri,'page');\n $final = substr($uri,0,$has_page_pos);\n $link = get_bloginfo('url').$final;\n wp_redirect($link, '302'); //-> OVO RIJEŠITI$target_id->post_id);\n }\n }\n\t$vanity_urls = get_option('am2_vanity_urls');\n\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t\n\tforeach($vanity_urls as $vanity):\n\t\t$construct_check_uri = '/'.$vanity['context'].'/'.$vanity['original_slug'].'/';\n\t\tif($uri == $construct_check_uri){\n\t\t\t$link = site_url().'/'.$vanity['url'].'/';;\n\t\t\twp_redirect($link, '302');\n\t\t}\n\t\t\n\tendforeach;\n\t\n}", "abstract protected function get_redirect_page();", "public function updatingSearch()\n {\n $this->gotoPage(1);\n }", "private function setNotFoundPage()\n {\n $this->design->setRedirect(\n Uri::get(\n 'newsletter',\n 'admin',\n 'browse'\n ),\n null,\n null,\n self::REDIRECTION_DELAY_IN_SEC\n );\n $this->displayPageNotFound(t('Sorry, Your search returned no results!'));\n }", "public function addSearchPageAction()\r\n\t{\r\n\t\t$firstLanguageDocument = $this->getFirstLanguageDocument();\r\n\r\n\t\t// Create document in tree for search\r\n\t\t$document = $this->createDocument('search', 'search', 'search', '', $firstLanguageDocument, 'Zoeken', true);\r\n\r\n\t\t// Add Document to website config\r\n\t\t$this->addWebsiteSetting('search_document', 'document', $document->getId());\r\n\r\n\t\t$this->_helper->json(\r\n\t\t\tarray(\r\n\t\t\t\t\"success\" => true,\r\n\t\t\t),\r\n\t\t\tfalse\r\n\t\t);\r\n\t}" ]
[ "0.78023285", "0.7679668", "0.76776993", "0.7641091", "0.7528591", "0.7454234", "0.7429974", "0.7067294", "0.7063761", "0.6846027", "0.6845695", "0.67413765", "0.6740215", "0.6529868", "0.65059566", "0.6503312", "0.6430324", "0.64294505", "0.6348132", "0.63353163", "0.62769234", "0.62743723", "0.62206125", "0.6193212", "0.6162089", "0.61493075", "0.6132904", "0.6116097", "0.6070786", "0.60621744" ]
0.76981515
1
Register the token `guard.
protected function registerGuard() { Auth::extend('passport', function ($app, $name, array $config) { return tap($this->makeGuard($config), function ($guard) { $this->app->refresh('request', $guard, 'setRequest'); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(Guard $guard)\n {\n $this->guard = $guard;\n }", "public function __construct(Guard $guard)\n {\n $this->guard = $guard;\n }", "public function __construct(Guard $guard)\n {\n $this->guard = $guard;\n }", "public function register(): void\n {\n /* @phpstan-ignore-next-line */\n $this->app->configure('auth');\n /* @phpstan-ignore-next-line */\n $this->app->configure('remote-token-auth');\n\n config([\n 'auth.guards.rta' => array_merge([\n 'driver' => 'remote-token-auth',\n ], config('auth.guards.rta', [])),\n ]);\n\n $this->registerAdapter();\n }", "public function register()\n {\n //token注册\n $this->app->singleton('Token',function ($app){\n return new Token($app->request);\n });\n\n //config\n $this->app->singleton('admin_config',function(){\n return new AdminConfigService();\n });\n }", "public function guard()\n {\n $this->guard = true;\n }", "public function register()\n {\n $this->app->singleton('Illuminate\\Contracts\\Auth\\Guard', function () {\n $hasher = $this->app->make('Illuminate\\Contracts\\Hashing\\Hasher');\n $session = $this->app->make('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface');\n\n $provider = new EloquentUserProvider($hasher, 'FluxBB\\Models\\User');\n $guard = new Guard($provider, $session);\n\n $guard->setCookieJar($this->app->make('Illuminate\\Contracts\\Cookie\\QueueingFactory'));\n $guard->setDispatcher($this->app->make('Illuminate\\Contracts\\Events\\Dispatcher'));\n $guard->setRequest($this->app->make('Symfony\\Component\\HttpFoundation\\Request'));\n\n return $guard;\n });\n\n if (Core::isInstalled()) {\n $this->app->extend('view', function ($view) {\n $view->share('user', $this->app->make('Illuminate\\Contracts\\Auth\\Guard')->user());\n\n return $view;\n });\n }\n }", "public function register()\n {\n API::error(function (\\Illuminate\\Database\\Eloquent\\ModelNotFoundException $exception) {\n abort(404);\n });\n API::error(function (\\Illuminate\\Auth\\Access\\AuthorizationException $exception) {\n abort(403, 'Forbidden action.');\n });\n API::error(function (\\Symfony\\Component\\HttpKernel\\Exception\\UnauthorizedHttpException $exception) {\n if ($exception->getPrevious() instanceof \\Tymon\\JWTAuth\\Exceptions\\TokenExpiredException) {\n return response()->json([\n 'login_again' => true, // 代表需要重新登录\n 'message' => 'Token has expired.'\n ])->setStatusCode(401);\n }\n });\n }", "private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n }", "protected function guard()\n {\n return Auth::guard('jwt');\n }", "protected function configureGuard()\n {\n Auth::resolved(function ($auth) {\n $auth->viaRequest('sanctum', new Guard($auth, config('sanctum.expiration')));\n });\n }", "public function setToken($token);", "public function guard($guard = 'api')\n {\n return Auth::guard($guard);\n }", "public function setToken(string $token): void;", "public function register()\n {\n LumenPassport::routes($this->app->router, [\n // 'prefix' => 'v1/oauth',\n ]);\n LumenPassport::tokensExpireIn(Carbon::now()->addMinutes(config('setting.api.token.access_token_expire')));\n Passport::refreshTokensExpireIn(Carbon::now()->addMinutes(config('setting.api.token.refresh_token_expire')));\n }", "function registerToken()\n {\n $query = \"select fnc_registro_token_diario(?, ?, ?, ?)\";\n\n $umail = $this->_object->getEmail();\n $token = token_gen();\n $from = quote_content($_SERVER['REMOTE_ADDR']);\n $itok = __INTERNAL_TOKEN_HASH__;\n\n $q = $this->_con->prepare($query);\n $q->bindParam(1, $umail);\n $q->bindParam(2, $token);\n $q->bindParam(3, $from);\n $q->bindParam(4, $itok);\n\n if($q->execute()){\n $r = $q->fetch(PDO::FETCH_NUM);\n\n $this->_object->setToken($r[0]);\n\n if(__SEND_TOKENS__ && $this->_object->getToken() == $token):\n if(!$this->_object->sendToken()){\n error_log(\"New token sent.\");\n return 2;\n }\n endif;\n\n return $this->_object;\n }\n return false;\n }", "public function registerToken($token)\n\t{\n\t\tsession(['teachme_register_token' => $token]);\n\n\t\treturn redirect()->to('register');\n\t}", "public function register()\n {\n $wechat = $this->royalcms['wechat'];\n \n $wechat->singleton('encryptor', function($wechat)\n {\n return new Encryptor(\n $wechat['config']['app_id'],\n $wechat['config']['token'],\n $wechat['config']['aes_key']\n );\n });\n \n $wechat->singleton('server', function($wechat)\n {\n $server = new Guard($wechat['config']['token']);\n\n $server->debug($wechat['config']['debug']);\n\n $server->setEncryptor($wechat['encryptor']);\n\n return $server;\n });\n }", "public function register()\n {\n //token注册\n $this->app->singleton('Token',function ($app){\n return new Token($app->request);\n });\n\n //Api\n $this->app->singleton('api',function(){\n return new ApiService();\n });\n\n //promo\n $this->app->singleton('promo',function(){\n return new PromoService();\n });\n\n //config\n $this->app->singleton('admin_config',function(){\n return new AdminConfigService();\n });\n }", "public function register()\n {\n Auth::extend('sso', function ($app, $name, array $config) {\n // 返回一个 Illuminate\\Contracts\\Auth\\Guard 实例...\n return new OaGuard(Auth::createUserProvider($config['provider']),$app->make('request'));\n });\n\n Auth::provider('sso', function ($app, array $config) {\n return new OaUserProvider();\n });\n }", "public function register()\n {\n $this->registerGuard();\n $this->registerBladeDirectives();\n }", "public function create(Token $token): void;", "public function register() {}", "public function enterToken(string $token): void;", "public function register()\n {\n // $this->app->bind(DebitPament::class, function () {\n\n // if (request()->routeIs('withDraw')) {\n\n // return new DebitPament(request()->cardId);\n // }\n // });\n\n\n $this->app->singleton(Visitor::class, function () {\n\n return new Visitor(Location::get()->countryCode, Location::get()->regionCode);\n });\n }", "public function register()\n {\n $this->app\n\t ->when(\\Tymon\\JWTAuth\\Providers\\Storage\\Illuminate::class)\n\t ->needs(\\Illuminate\\Contracts\\Cache\\Repository::class)\n\t ->give(function () {\n\t\t return cache()->store('jwt');\n\t });\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }" ]
[ "0.6138799", "0.6138799", "0.6138799", "0.5967774", "0.58309287", "0.580087", "0.5786317", "0.5767813", "0.5732042", "0.57262385", "0.57065004", "0.56937426", "0.5666204", "0.56615865", "0.56593627", "0.56569093", "0.56536365", "0.56527907", "0.5646147", "0.5646008", "0.56111014", "0.5598541", "0.5560251", "0.5559", "0.5554822", "0.5551554", "0.5531603", "0.5531603", "0.5531603", "0.5531603" ]
0.66968817
0
Get province by region Id.
public function getByRegion($regionId) { return $this->repository->getProvinceByRegion($regionId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show($id)\n {\n $region = $this->model->show($id);\n\n return response($region->load(['provinces']));\n }", "public function show($id)\n\t{\n\t\t//\n\t\t$province = Province::find($id);\n\t\treturn $province;\n\t}", "public function getProvince($id = NULL)\n {\n $sql = \"SELECT * from $this->province order by _name asc\";\n\n if ($id != NULL) {\n $sql = \"SELECT * from $this->province where id = $id\";\n return $this->fetch($sql);\n }\n return $this->fetchArray($sql);\n }", "public static function find($id) {\n\t\treturn Doctrine::getTable ( 'Regions' )->findOneBy ( 'region_id', $id );\n\t}", "public static function find($id) {\n\t\t$regionDb = Yadda_Db_Table::getInstance('region');\n\t\t$select = $regionDb\n\t\t\t->select()\n\t\t\t->from('region')\n\t\t\t->where('status = ?', 'active')\n\t\t\t->where('id = ?', $id);\n\t\t$region = $regionDb->fetchRow($select);\n\t\tif ($region === null) {\n\t\t\tthrow new Yadda_Model_Exception('There is no region with the supplied ID.');\n\t\t}\n\t\treturn self::toArray($region);\n\t}", "public function getProvince()\n {\n return $this->hasOne(Province::class, ['id' => 'province_id']);\n }", "public function getRegion()\n {\n return $this->hasOne(Regions::class, ['id' => 'region_id']);\n }", "public function getOneProvince($id)\n\t{\n\t\tif($id > 0)\n\t\t{\n\t\t\t$zones = $this->getAllProvince();\n\t\t\treturn $zones[$id];\n\t\t}\n\t\treturn array();\n\t}", "public function getCitiesOfAProvince($id)\n {\n\n $province = Province::where('is_deleted', false)->find($id);\n if ($province != null) {\n return (new ProvinceCollection($province->cities))->additional([\n 'errors' => null,\n ])->response()->setStatusCode(200);\n }\n return (new ProvinceResource($province))->additional([\n 'errors' => [\"province\" => [\"Province not found!\"]],\n ])->response()->setStatusCode(404);\n }", "public function getProvinceId()\n {\n return $this->province_id;\n }", "public function getProvinceid()\n {\n return $this->provinceid;\n }", "public function getRegion($regionId)\r\n\t{\r\n $regionService = new Base_Model_ObtorLib_App_Core_Catalog_Service_Region();\r\n $regionInfo = $regionService->getRegion($regionId); \r\n return $regionInfo;\r\n\t}", "public function getProvince()\n {\n return $this->hasOne(Province::className(), ['id' => 'province_id']);\n }", "public function getProvince()\n {\n return $this->hasOne(Provinces::className(), ['id' => 'province_id']);\n }", "public function show($id)\n {\n\n $province = Province::where('is_deleted', false)->find($id);\n if ($province != null) {\n return (new ProvinceResource($province))->additional([\n 'errors' => null,\n ])->response()->setStatusCode(200);\n }\n return (new ProvinceResource($province))->additional([\n 'errors' => ['province' => ['Province not found!']],\n ])->response()->setStatusCode(404);\n }", "public function getRegion()\n {\n return $this->hasOne(Region::className(), ['id' => 'region_id']);\n }", "public function getRegion()\n {\n return $this->hasOne(Region::className(), ['id' => 'region_id']);\n }", "public function getProvince() {\n return $this->hasOne(Provinces::className(), ['id' => 'province_id']);\n }", "public static function getRegion($region_id)\n {\n $database = DatabaseFactory::getFactory()->getConnection();\n\n $sql = \"SELECT region_id, region_name FROM region WHERE region_id = :region_id LIMIT 1\";\n $query = $database->prepare($sql);\n $query->execute(array(':region_id' => $region_id));\n\n // fetch() is the PDO method that gets a single result\n return $query->fetch();\n }", "public function getRegiones($id){ //id del pais\n return Region::where('codPais','=',$id)->get();\n \n }", "public function getProvincias($id){\n return Provincia::where('codRegion','=',$id)->get();\n \n }", "function getDetail($provinceId){\n\t\t$this->db->where('province_id', $provinceId);\n\t\treturn $this->db->get('master_provinces');\n\t}", "public function show($countryId)\n {\n //$this->authorize('view', $province);\n $provinces = Province::where('country_id',$countryId)->get();\n return new ProvinceResource($provinces);\n }", "public function codeByProvinceId() {\n return $this->belongsTo('App\\Code', 'province_id', 'id')->select('id', 'txt');\n }", "public function getProvince($cod_regione)\n\t{\n\t\t//Avendo già specificato una regione, scegli tutte le provincie che\n\t\t//appartengono a quella regione (avendo il cod_regione)\n\t\t$query = \"SELECT * FROM province WHERE cod_regione = '\".$cod_regione.\"'\";\n\t\tif($result = parent::query($query))\n\t\t{\n\t\t\t//Se il risultato non è vuoto\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t//Crea un array associativo delle provincie\n\t\t\t\t\t//due campi, codice della provincia e il nome\n\t\t\t\t\t$province[] = array(\n\t\t\t\t\t\t'codice' => $row['cod_provincia'],\n\t\t\t\t\t\t'nome' => $row['provincia']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//Ritorna il risultato\n\t\t\t\treturn $province;\n\t\t\t}\n\t\t}\n\t}", "public function getProvince()\n {\n return $this->send('POST', 'getProvince');\n }", "public function getCprovinceid()\n {\n return $this->cprovinceid;\n }", "public function region()\n {\n return $this->hasOne('App\\Region','id', 'region_id');\n }", "public function getProvince()\r\n {\r\n return $this->province;\r\n }", "public function get_city($province_id)\n {\n $data = MasterCity::where('province_code',$province_id)->groupby('city')->get();\n return json_encode($data);\n }" ]
[ "0.7725263", "0.75204045", "0.70549524", "0.68785125", "0.6852365", "0.67928666", "0.67492104", "0.67265993", "0.6703975", "0.6698038", "0.66915715", "0.66812646", "0.66632116", "0.6656786", "0.66452324", "0.6638419", "0.6638419", "0.6630982", "0.66031617", "0.66009563", "0.6527072", "0.6376607", "0.63557804", "0.6285158", "0.62551486", "0.6208118", "0.6203763", "0.619602", "0.61860585", "0.61430085" ]
0.7537685
1
Register a new adapter in the list
public function registerAdapter($name, $class) { $this->validateAdapterName($name); $this->validateAdapterClass($class); $this->list[$name] = $class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAdapter(\\Tecnocreaciones\\Bundle\\BoxBundle\\Model\\Adapter\\AdapterInterface $adapter)\n {\n if($this->adapters === null){\n $this->adapters = array();\n }\n $adapter->setContainer($this->container);\n $this->adapters[] = $adapter;\n }", "public function registerAdapter(SyncAdapterInterface $adapter)\n {\n $this->adapters[$adapter->getName()] = $adapter;\n }", "abstract protected function createAdapter();", "public function createAdapter() : AdapterInterface;", "protected function registerAdapterFactory()\n {\n $this->app->singleton('digitalocean.adapterfactory', function () {\n return new AdapterFactory();\n });\n\n $this->app->alias('digitalocean.adapterfactory', AdapterFactory::class);\n }", "public function getAdapter();", "public function getAdapter();", "protected function bindAdapter($name)\n {\n $alias = static::CONTAINER_ADAPTER_PREFIX . $name;\n $this->container->singleton(\n $alias,\n $this->list[$name]\n );\n }", "abstract protected function getAdapter();", "abstract protected function getAdapter();", "public function setAdapter(AdapterInterface $adapter);", "public function adapter(string $name): AdapterInterface;", "public function getAdapter()\r\n {\r\n }", "public function setAdapterMethod($adapter);", "public function registerAdapterService($name, $callable)\n {\n $key = 'adapter.'.$name;\n $this->adapterServices[] = $key;\n $this->container[$key] = $this->container->share($callable);\n }", "protected function _getDatabaseAdapter()\n {\n // initialize the Adapter\n $adapter = new TDProject_Core_Model_Auth_Adapter_Database(\n $this->getUsername(),\n $this->getPassword()\n );\n // add it to the internal array\n $this->_adapters[] = $adapter->setContainer($this->getContainer());\n }", "public function hasAdapter();", "public function add(\\Phalcon\\Logger\\Item $item): AdapterInterface;", "function register($item)\n {\n if (is_a($item, 'DVD') || is_a($item, 'Magazine') || is_a($item, 'Book')) {\n $item->setID(sizeof($this->collection) + 1);\n array_push($this->collection, $item);\n }\n }", "public function addAdapterConfig(string $name, string $class, array $options);", "public function loadAdapter(string $name, string $adapter, array $options): AdapterInterface\n {\n $adapter = $this->adapterFactory->buildStorageAdapter(\n $adapter,\n $options\n );\n\n $this->adapterCollection->add($name, $adapter);\n\n return $adapter;\n }", "public function setDefaultAdapter() {\n\t\t$this->setAdapter(new Client());\n\t}", "public function _register()\n {\n }", "protected function _setAclAdapter() {\n\t\tlist($plugin, $name) = pluginSplit(Configure::read('Visualisation.Acl.classname'));\n\t\t$this->Acl->adapter($name);\n\t}", "public function setAdapter(AdapterInterface $adapter)\r\n {\r\n\r\n }", "public function setAdapter(Adapter $adapter) : void\n {\n $this->adapter = $adapter;\n }", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function getAdapter()\n\t{\n\t\treturn $this->adapter;\n\t}", "public function register()\n {\n app()->singleton(MusicAdapterInterface::class,function (){\n return new MetAdapter();\n });\n app()->bind(MusicInterface::class,function (){\n return new Music();\n });\n\n }", "public function getAdapter() : Adapter\n {\n return $this->adapter;\n }" ]
[ "0.6431934", "0.6372714", "0.63690394", "0.6291852", "0.6238928", "0.6195809", "0.6195809", "0.5992499", "0.5974061", "0.5974061", "0.596373", "0.59258455", "0.58873475", "0.5840291", "0.56824034", "0.5542132", "0.5402965", "0.5358974", "0.5357411", "0.53451765", "0.53427464", "0.53413194", "0.531688", "0.531362", "0.5301029", "0.529988", "0.52468693", "0.52468693", "0.5220753", "0.5209494" ]
0.6561467
0
Bind an adapter to the container
protected function bindAdapter($name) { $alias = static::CONTAINER_ADAPTER_PREFIX . $name; $this->container->singleton( $alias, $this->list[$name] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function bindContainer()\n {\n parent::setInstance($this);\n \n $this->instance('container', $this);\n $this->instance(BaseContainer::class, $this);\n }", "public function register()\n {\n foreach ($this->bindings as $abstract => $concrete) {\n $this->app->bind($abstract, $concrete);\n }\n }", "public function register()\n {\n foreach ($this->getBindings() as $interface => $class) {\n $this->app->bind($interface, $class);\n }\n }", "protected function registerAdapterFactory()\n {\n $this->app->singleton('digitalocean.adapterfactory', function () {\n return new AdapterFactory();\n });\n\n $this->app->alias('digitalocean.adapterfactory', AdapterFactory::class);\n }", "public function setAdapter(AdapterInterface $adapter);", "public function register()\n {\n foreach ($this->simpleBindings as $contract => $service) {\n $this->app->bind($contract, $service);\n }\n }", "public function adapter(string $name): AdapterInterface;", "abstract protected function createAdapter();", "public function createAdapter() : AdapterInterface;", "protected function bind()\n {\n if (!isset($this->di)) {\n return false;\n }\n foreach ($this->di as $contract => $object) {\n $this->app->bind($contract, $object);\n }\n }", "public function getAdapter();", "public function getAdapter();", "protected function bindings()\n\t{\n\t\t$this->app->singleton('anodyne', function ($app) {\n\t\t\treturn new \\App\\Anodyne;\n\t\t});\n\n\t\t// Bind the avatar class into the container\n\t\t$this->app->bind('avatar', function ($app) {\n\t\t\treturn new \\App\\Avatar;\n\t\t});\n\n\t\t// Bind the flash notifier class into the container\n\t\t$this->app->bind('flash', function ($app) {\n\t\t\treturn new \\App\\FlashNotifier;\n\t\t});\n\t}", "abstract protected function getAdapter();", "abstract protected function getAdapter();", "private function bindImplementations(): void\n {\n $this->app->bind(RestaurantRepositoryInterface::class, function () {\n return new FileRestaurantRepository(\n storage_path('data/restaurants.json'), Restaurant::class\n );\n });\n\n $this->app->bind(UserFavoriteRestaurantRepositoryInterface::class, function () {\n return new FileUserFavoriteRestaurantRepository(\n storage_path('data/user_favorite_restaurants.json'), UserFavoriteRestaurant::class\n );\n });\n }", "public function register() {\n\t\t$this->app->bind('holder', 'T20n\\Holder\\Holder');\n\t}", "function addAdapter(\\Tecnocreaciones\\Bundle\\BoxBundle\\Model\\Adapter\\AdapterInterface $adapter)\n {\n if($this->adapters === null){\n $this->adapters = array();\n }\n $adapter->setContainer($this->container);\n $this->adapters[] = $adapter;\n }", "public function register()\n {\n app()->singleton(MusicAdapterInterface::class,function (){\n return new MetAdapter();\n });\n app()->bind(MusicInterface::class,function (){\n return new Music();\n });\n\n }", "protected static function bind() {}", "public function add(Bind $bind): void\n {\n $dependency = $bind->getBound();\n $dependency->register($this->container, $bind);\n }", "public function register()\n {\n $this->app->bind('App\\Repositories\\CollectionRepository', 'App\\Repositories\\CollectionRepositoryJSONImpl');\n }", "private function bindRepository($item)\n\t{\n\t\t$abstract = \"{$item}RepositoryInterface\";\n\t\t$concrete = \"{$item}Repository\";\n\n\t\t// Bind to the container\n\t\t$this->app->bind(\n\t\t\t[$abstract => $this->aliases[$abstract]], \n\t\t\t$this->aliases[$concrete]\n\t\t);\n\t}", "private function registerBinding()\n {\n /**\n * bind Tax Repository to its Eloquent implementation\n */\n $this->app->bind(\n \\Innovate\\Repositories\\Tax\\TaxContract::class,\n \\Innovate\\Repositories\\Tax\\EloquentTaxRepository::class\n );\n /**\n * bind BankTransferInfoContract to its elquent implementation EloquentBankTransferInfoRepository\n */\n $this->app->bind(\n \\Innovate\\Repositories\\StaticPages\\BankTransferInfo\\BankTransferInfoContract::class,\n \\Innovate\\Repositories\\StaticPages\\BankTransferInfo\\EloquentBankTransferInfoRepository::class\n );\n\n /**\n *\n */\n $this->app->bind(\n \\Innovate\\Repositories\\StaticPages\\CheckOutAgreement\\CheckOutAgreementContract::class,\n \\Innovate\\Repositories\\StaticPages\\CheckOutAgreement\\EloquentCheckOutAgreementRepository::class\n );\n\n $this->eavAttributeBindings();\n $this->eavAttributeCategoryBindings();\n }", "public function register()\n\t{\n\t\t$this->app->bind('azure-blob-storage', function($app){\n\t\t\t$url = $app['config']->get('azure-blob-storage::url');\n\t\t\t$accountName = $app['config']->get('azure-blob-storage::account_name');\n\t\t\t$key = $app['config']->get('azure-blob-storage::access_key');\n\n\t\t\treturn new BlobClient($url, $accountName, $key);\n\t\t});\n\t}", "protected function registerBaseBindings()\n {\n static::setInstance($this);\n\n $this->instance('app', $this);\n\n $this->instance(Container::class, $this);\n }", "protected function registerBaseBindings()\n {\n $container = $this->getContainer();\n\n $container->share(Parser::class, Parser::class);\n }", "public function adapters(): AdapterCollectionInterface;", "private function bindAliasesToContainer()\n {\n foreach (static::$aliasMap as $alias => $classes)\n {\n foreach ($classes as $class)\n {\n $this->alias($alias, $class);\n }\n }\n }", "public function bind($interface)\n {\n $bind = new Sabel_Container_Bind($interface);\n $this->binds[$interface][] = $bind;\n \n return $bind;\n }" ]
[ "0.7108157", "0.6044877", "0.60300255", "0.60287076", "0.59847844", "0.5961734", "0.59490806", "0.59390754", "0.5927526", "0.5861765", "0.5852985", "0.5852985", "0.5849179", "0.584611", "0.584611", "0.5836517", "0.57421136", "0.57403713", "0.5725945", "0.568838", "0.56848466", "0.56830794", "0.566481", "0.56375265", "0.5630692", "0.56244934", "0.56207246", "0.5597772", "0.5595722", "0.5594811" ]
0.699578
1
Validate an adapter by its name and check if available for usage
protected function validateAdapter($name) { $this->validateAdapterName($name); $this->validateAdapterRegistered($name); $this->validateAdapterAllowed($name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasAdapter();", "protected function _checkAdapter()\n {\n $notDefined = !is_object($this->_adapter);\n $isAdapter = $this->_adapter instanceof AdapterInterface;\n\n if ($notDefined || !$isAdapter) {\n throw new InvalidArgumentException(\n \"You need to set the database adapter for this schema loader.\"\n );\n }\n }", "public function adapter(string $name): AdapterInterface;", "public function isValidAdapter($adapterType)\n {\n $adapterType = ucwords(strtolower($adapterType));\n $adapterPath = __DIR__.'/'.$this->adapterPath.$adapterType.'.php';\n\n return (is_file($adapterPath)) ? true : false;\n }", "public function hasAdapter()\n {\n return $this->sm->has('Zend\\Db\\Adapter\\Adapter');\n }", "abstract protected function getAdapter();", "abstract protected function getAdapter();", "public function hasAdapter($identifier)\n {\n return array_key_exists($identifier, $this->adapters);\n }", "protected function _getDatabaseAdapter($name)\n {\n if (class_exists($name)) {\n $adapter = $name;\n } else {\n $adapter = '\\Engine\\Db\\Adapter\\\\' . ucfirst($name);\n if (!class_exists($adapter)) {\n $adapter = '\\Phalcon\\Db\\Adapter\\\\' . ucfirst($name);\n if (!class_exists($adapter)) {\n return false;\n }\n }\n }\n\n return $adapter;\n }", "function getAdapterName();", "public function has($name)\n {\n return isset($this->adapters[$name]);\n }", "public static function getAdapter($adapterName)\n {\n $adaptersList = self::$adaptersList;\n $result = false;\n\n if (!empty(self::$registeredAdapters[$adapterName]))\n $result = self::$registeredAdapters[$adapterName];\n else if (isset($adaptersList[$adapterName]))\n {\n try {\n $dsn = isset($adaptersList[$adapterName]['dsn']) ? $adaptersList[$adapterName]['dsn'] : '';\n $login = isset($adaptersList[$adapterName]['user']) ? $adaptersList[$adapterName]['user'] : '';\n $password = isset($adaptersList[$adapterName]['password']) ? $adaptersList[$adapterName]['password'] : '';\n\n self::$registeredAdapters[$adapterName] = new PDO($dsn, $login, $password);\n self::$registeredAdapters[$adapterName]->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n self::$registeredAdapters[$adapterName]->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $result = self::$registeredAdapters[$adapterName];\n }\n catch (Exception $e)\n {\n throw new Db_Exception('Cannot open connection to DSN '.$adaptersList[$adapterName]['dsn'] .\n ' : ' . $e->getMessage());\n }\n }\n else\n throw new Db_Exception('Database adapter \"'.$adapterName.'\" not found');\n\n if (!$result || !is_a($result, 'PDO'))\n throw new Db_Exception('Cannot open connection with database adapter \"'.$adapterName.'\"');\n\n return $result;\n }", "public function adaptersAvailable()\n {\n return count($this->getAdapters()) > 0;\n }", "protected function findValidAdapters()\n {\n $adapterLocation = $this->getAdapterLocation();\n $finder = new Finder();\n $finder->files()->in($adapterLocation);\n $result = [];\n\n foreach ($finder as $file) {\n if ($file->getExtension() != 'php')\n continue;\n\n $fileName = $file->getBasename('.php');\n $className = $this->getAdapterNamespace() . '\\\\' . $fileName;\n\n $potentialAdapter = new $className(); // For some reason without instantiating, class_exists() sometimes fails\n if (!class_exists($className, false))\n continue;\n\n if (!is_subclass_of($className, BaseAdapterInterface::class))\n continue;\n\n // Class looks valid\n $result[] = $className;\n }\n\n return $result;\n }", "public static function factory($adapter, $host=null, $params)\n {\n if (empty($host)) {\n /**\n * @see Asker\\Exception\n */\n require_once 'Exception.php';\n throw new Asker_Exception('You must be precize an host');\n }\n\n /**\n * Apply adapter config\n */\n $params = unserialize($params);\n $params['host'] = $host;\n\n /**\n * Verify that adapter parameters are in an array.\n */\n if (!is_array($params)) {\n /**\n * @see Asker\\Exception\n */\n require_once 'Exception.php';\n throw new Asker_Exception('Adapter parameters must be in an array');\n }\n\n /**\n * Verify that an adapter name has been specified.\n */\n if (empty($adapter)) {\n /**\n * @see Asker\\Exception\n */\n require_once 'Exception.php';\n throw new Asker_Exception('Adapter name must be specified');\n }\n\n /**\n * Create an instance of the adapter ask.\n * Pass the config to the adapter.\n */\n switch ($adapter) {\n\n case self::ADAPTER_SNMP:\n $askerAdapter = new Adapter\\Snmp($params);\n break;\n\n case self::ADAPTER_SSH:\n $askerAdapter = new Adapter\\Ssh($params);\n break;\n\n case self::ADAPTER_SSH_PUBKEY:\n $askerAdapter = new Adapter\\SshPubkey($params);\n break;\n\n case self::ADAPTER_HTTP:\n $askerAdapter = new Adapter\\Http($params);\n break;\n\n\n default:\n /**\n * @see Asker\\Adapter\\Exception\n */\n require_once 'Adapter/Exception.php';\n throw new Asker_Adapter_Exception(\"ERROR: Adapter not exist !\");\n }\n\n /**\n * Verify that the object created is a descendent of the abstract adapter type.\n */\n if (!$askerAdapter instanceof Adapter\\Base) {\n /**\n * @see Asker_Exception\n */\n require_once 'Exception.php';\n throw new Asker_Exception(\"Adapter class '$adapterName' does not extend Asker\\Adapter\\Base\");\n }\n\n return $askerAdapter;\n }", "public function hasAdapterSet(): bool\n {\n return $this->adapter !== null;\n }", "private static function filterByAvailability(array $adapters)\n {\n return array_filter($adapters, function (AvailabilityInterface $adapter) {\n return $adapter->isSupported();\n });\n }", "abstract public function getAdapterSpecs();", "static public function proper_adapter_name($adapter_name)\n {\n $adapter_name = strtolower($adapter_name);\n \n switch ($adapter_name) {\n case 'mysql':\n return 'MySql';\n break;\n \n case 'sqlite':\n return 'Sqlite';\n break;\n \n default:\n return $adapter_name;\n break;\n }\n }", "public function getAdapter();", "public function getAdapter();", "public function getAdapter(string $name, $disabledAlso = false)\n {\n if ($name == null || strlen($name) < 1)\n return null;\n\n foreach ($this->adapters as $class) {\n $id = $class::getId();\n if ($id == $name) {\n // Adapter found - does it need to be enabled?\n if (!$disabledAlso) {\n $metadata = $this->getMetadata($id);\n if ($metadata == null || $metadata->getEnabled()) {\n return $class;\n }\n } else {\n return $class;\n }\n }\n }\n\n return null;\n }", "abstract protected function createAdapter();", "public function testCreateWillThrowFactoryExceptionIfProvidedAdapterIsInvalid(): void\r\n {\r\n $factory = new ContainerFactory();\r\n\r\n $config = [\r\n 'adapter' => 123, // invalid adapter!\r\n ];\r\n\r\n $this->expectException(FactoryException::class);\r\n $this->expectExceptionMessage(sprintf(\r\n 'The \\'adapter\\' configuration option must be a object of type \\'%s\\'; \\'%s\\' provided in \\'%s\\'',\r\n ContainerAdapterInterface::class,\r\n gettype($config['adapter']),\r\n ContainerFactory::class\r\n ));\r\n\r\n $factory->create($config);\r\n }", "public function loadAdapter(string $name, string $adapter, array $options): AdapterInterface\n {\n $adapter = $this->adapterFactory->buildStorageAdapter(\n $adapter,\n $options\n );\n\n $this->adapterCollection->add($name, $adapter);\n\n return $adapter;\n }", "public function createAdapter() : AdapterInterface;", "protected function _getMetaDataAdapter($name)\n {\n $adapter = '\\Engine\\Mvc\\Model\\MetaData\\\\'.ucfirst($name);\n if (!class_exists($adapter)) {\n $adapter = '\\Phalcon\\Mvc\\Model\\MetaData\\\\'.ucfirst($name);\n if (!class_exists($adapter)) {\n return false;\n }\n }\n\n return $adapter;\n }", "abstract protected function getDefaultAdapter(): AdapterInterface;", "public function testInvalidTypeException() {\n\t\t$options = array(\n\t\t\t'adapter' => 'foo'\n\t\t);\n\t\t$this->expectException('/Could not find adapter `Foo`/');\n\t\tFixture::load('models/Posts', $options);\n\t}", "public function get($name)\n {\n if (!isset($this->adapters[$name])) {\n throw new \\InvalidArgumentException(sprintf('No Adapter with name \"%s\" is registered.', $name));\n }\n\n return $this->adapters[$name];\n }" ]
[ "0.6907021", "0.65931267", "0.63644654", "0.60824513", "0.57387215", "0.5715412", "0.5715412", "0.5709304", "0.56969106", "0.5673118", "0.5671687", "0.56000155", "0.55983406", "0.54881895", "0.54277956", "0.542774", "0.5368808", "0.53528243", "0.53432506", "0.5316862", "0.5316862", "0.5315254", "0.53064775", "0.5288475", "0.52682406", "0.52677375", "0.52677095", "0.52673674", "0.52594346", "0.5242922" ]
0.78797907
0
Gets a list of Content Entity Example revision IDs for a specific Content Entity Example.
public function revisionIds(ContentEntityExampleInterface $entity);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function revisionIds(EventContentInterface $entity);", "public function revisionIds(ExoAssetInterface $entity);", "public function revisionIds(MentorInterface $entity);", "public function revisionIds(APIParamItemInterface $entity);", "public function revisionIds(SemillaInterface $entity);", "public function revisionIds(QizQuizInterface $entity);", "public function getRevisions(): array;", "public function countDefaultLanguageRevisions(ContentEntityExampleInterface $entity);", "public function revisionIds(LocationInterface $entity);", "public static function getIds($contents)\n { \n $return = [];\n foreach ($contents as $value) \n {\n $return[] = $value->id;\n }\n return $return;\n }", "public function getExamples()\n {\n return $this->examples;\n }", "public function getExamples()\n {\n return $this->examples;\n }", "public function getRevisions(): array\n {\n return $this->revs;\n }", "function listRevisions($bugid, $patch)\n\t{\n\t\t$query = '\n\t\t\tSELECT revision FROM bugdb_patchtracker\n\t\t\tWHERE bugdb_id = ? AND patch = ?\n\t\t\tORDER BY revision DESC\n\t\t';\n\t\treturn $this->_dbh->prepare($query)->execute([$bugid, $patch])->fetchAll(PDO::FETCH_NUM);\n\t}", "public function revisionIds(CategoryInterface $entity);", "public function getExampleAction($eid)\r\n {\r\n // retrieve example\r\n $example = $this->getDoctrine()\r\n ->getRepository('MensaBattleAPIBundle:Example')\r\n ->find($eid);\r\n if (!$example)\r\n throw $this->createNotFoundException('No example found for id '.$eid);\r\n\r\n // respond\r\n $response = new JsonResponse();\r\n $response->setData($example->toArray());\r\n return $response;\r\n }", "public static function getList($highlight = null)\n {\n return static::pluck('version_number', 'id')\n ->map(function ($version) use ($highlight) {\n return $version.($version == $highlight ? ' (current)' : '');\n })->toArray();\n }", "public static function getRevisionArray($json){\n\t\t\treturn MWJsonDecoder::getArray(MWJsonDecoder::jsonDecodeRevision($json), \"revid\");\n\t\t}", "public function getAffectedEntityVersions($entity)\n {\n $ret = [];\n\n if ($this->isManaged(get_class($entity))) {\n foreach ($this->affectedVersions as list($affectedEntity, $version)) {\n if (get_class($entity) === get_class($affectedEntity)) {\n $ret[]= $version;\n }\n }\n }\n\n return $ret;\n }", "private function get_latest_approved_revisions()\n\t{\n\t\t$revisions = [];\n\n\t\t// Start transaction\n\t\t$this->db->sql_transaction('begin');\n\n\t\t$sql = 'SELECT *\n\t\t\t\tFROM ' . $this->contribs_table . '\n\t\t\t\tWHERE contrib_type = ' . ext::TITANIA_TYPE_EXTENSION;\n\n\t\t$result = $this->db->sql_query($sql);\n\n\t\twhile ($row = $this->db->sql_fetchrow($result))\n\t\t{\n\t\t\t// For every extension, get the latest approved revision\n\t\t\t$revision_sql = 'SELECT r.*, a.*\n\t\t\t\tFROM ' . $this->revisions_table . ' r\n\t\t\t\t\tLEFT JOIN ' . $this->attachments_table . ' a\n\t\t\t\t\t\tON a.attachment_id = r.attachment_id\n\t\t\t\tWHERE r.contrib_id = ' . (int) $row['contrib_id'] . '\n\t\t\t\tAND r.revision_status = ' . ext::TITANIA_REVISION_APPROVED . '\n\t\t\t\tORDER BY r.revision_id DESC';\n\n\t\t\t$revision_result = $this->db->sql_query_limit($revision_sql, 1);\n\t\t\t$revision_row = $this->db->sql_fetchrow($revision_result);\n\n\t\t\tif ($revision_row)\n\t\t\t{\n\t\t\t\t// Only bother if the contribution has approved revisions\n\t\t\t\t$revision_row['contrib_name'] = $row['contrib_name'];\n\t\t\t\t$revisions[] = $revision_row;\n\t\t\t}\n\t\t}\n\n\t\t// End transaction\n\t\t$this->db->sql_freeresult($result);\n\t\t$this->db->sql_transaction('commit');\n\n\t\treturn $revisions;\n\t}", "public function getReferenceIdsList(){\n return $this->_get(2);\n }", "function post_ids() {\n\n\t\t$media_location = $this->media_location();\n\n\t\tif ( ! $media_location )\n\t\t\treturn array();\n\n\t\t$media_files = $media_location->media_files();\n\n\t\tif ( ! count( $media_files ) )\n\t\t\treturn array();\n\n\t\t// fetch releases\n\t\t$episode_ids = array_map( function ( $v ) { return $v->episode_id; }, $media_files );\n\t\t$episodes = Episode::find_all_by_where( \"id IN (\" . implode( ',', $episode_ids ) . \")\" );\n\n\t\treturn array_map( function ( $v ) { return $v->post_id; }, $episodes );\n\t}", "protected function getReferences()\n {\n $extensions = $this->extensionRepository->findByHasSphinxDocumentation();\n $references = array();\n foreach ($extensions as $extension) {\n $typeLabel = $this->translate('extensionType_' . $extension->getInstallType());\n $references[$typeLabel]['EXT:' . $extension->getExtensionKey()] = sprintf('[%2$s] %1$s', $extension->getTitle(), $extension->getExtensionKey());\n }\n\n $this->signalSlotDispatcher->dispatch(\n __CLASS__,\n 'afterInitializeReferences',\n array(\n 'references' => &$references,\n )\n );\n\n foreach (array_keys($references) as $key) {\n asort($references[$key]);\n }\n\n return $references;\n }", "public function getExample() {\n return $this->example;\n }", "public function examples() {\n $examples = array();\n $examples[] = array('http://localhost/sites/all/modules/extern/cxn.php', FALSE);\n $examples[] = array('http://civicrm.org/sites/civicrm.org/modules/extern/cxn.php', TRUE);\n return $examples;\n }", "public static function getRevisions($options = [])\n {\n return static::instantiateRecords(static::getRevisionRecords($options));\n }", "public function getExperimentInfosList(){\n return $this->_get(2);\n }", "public function getRevision();", "public function getLatestTranslationAffectedRevisionId($entity_id, $langcode);", "public function revisionOverview(EventContentInterface $event_content) {\n $account = $this->currentUser();\n $langcode = $event_content->language()->getId();\n $langname = $event_content->language()->getName();\n $languages = $event_content->getTranslationLanguages();\n $has_translations = (count($languages) > 1);\n $event_content_storage = $this->entityManager()->getStorage('event_content');\n\n $build['#title'] = $has_translations ? $this->t('@langname revisions for %title', ['@langname' => $langname, '%title' => $event_content->label()]) : $this->t('Revisions for %title', ['%title' => $event_content->label()]);\n $header = [$this->t('Revision'), $this->t('Operations')];\n\n $revert_permission = (($account->hasPermission(\"revert all event content revisions\") || $account->hasPermission('administer event content entities')));\n $delete_permission = (($account->hasPermission(\"delete all event content revisions\") || $account->hasPermission('administer event content entities')));\n\n $rows = [];\n\n $vids = $event_content_storage->revisionIds($event_content);\n\n $latest_revision = TRUE;\n\n foreach (array_reverse($vids) as $vid) {\n /** @var \\Drupal\\event_content\\EventContentInterface $revision */\n $revision = $event_content_storage->loadRevision($vid);\n // Only show revisions that are affected by the language that is being\n // displayed.\n if ($revision->hasTranslation($langcode) && $revision->getTranslation($langcode)->isRevisionTranslationAffected()) {\n $username = [\n '#theme' => 'username',\n '#account' => $revision->getRevisionUser(),\n ];\n\n // Use revision link to link to revisions that are not active.\n $date = \\Drupal::service('date.formatter')->format($revision->getRevisionCreationTime(), 'short');\n if ($vid != $event_content->getRevisionId()) {\n $link = $this->l($date, new Url('entity.event_content.revision', ['event_content' => $event_content->id(), 'event_content_revision' => $vid]));\n }\n else {\n $link = $event_content->link($date);\n }\n\n $row = [];\n $column = [\n 'data' => [\n '#type' => 'inline_template',\n '#template' => '{% trans %}{{ date }} by {{ username }}{% endtrans %}{% if message %}<p class=\"revision-log\">{{ message }}</p>{% endif %}',\n '#context' => [\n 'date' => $link,\n 'username' => \\Drupal::service('renderer')->renderPlain($username),\n 'message' => ['#markup' => $revision->getRevisionLogMessage(), '#allowed_tags' => Xss::getHtmlTagList()],\n ],\n ],\n ];\n $row[] = $column;\n\n if ($latest_revision) {\n $row[] = [\n 'data' => [\n '#prefix' => '<em>',\n '#markup' => $this->t('Current revision'),\n '#suffix' => '</em>',\n ],\n ];\n foreach ($row as &$current) {\n $current['class'] = ['revision-current'];\n }\n $latest_revision = FALSE;\n }\n else {\n $links = [];\n if ($revert_permission) {\n $links['revert'] = [\n 'title' => $this->t('Revert'),\n 'url' => $has_translations ?\n Url::fromRoute('entity.event_content.translation_revert', ['event_content' => $event_content->id(), 'event_content_revision' => $vid, 'langcode' => $langcode]) :\n Url::fromRoute('entity.event_content.revision_revert', ['event_content' => $event_content->id(), 'event_content_revision' => $vid]),\n ];\n }\n\n if ($delete_permission) {\n $links['delete'] = [\n 'title' => $this->t('Delete'),\n 'url' => Url::fromRoute('entity.event_content.revision_delete', ['event_content' => $event_content->id(), 'event_content_revision' => $vid]),\n ];\n }\n\n $row[] = [\n 'data' => [\n '#type' => 'operations',\n '#links' => $links,\n ],\n ];\n }\n\n $rows[] = $row;\n }\n }\n\n $build['event_content_revisions_table'] = [\n '#theme' => 'table',\n '#rows' => $rows,\n '#header' => $header,\n ];\n\n return $build;\n }" ]
[ "0.5991585", "0.5550569", "0.55501366", "0.5497475", "0.5284753", "0.5217138", "0.5183089", "0.5147222", "0.5140979", "0.5125251", "0.50689626", "0.50689626", "0.4970834", "0.48416618", "0.4822509", "0.47809434", "0.47065514", "0.46989286", "0.46363926", "0.46238685", "0.4598421", "0.45535728", "0.45329085", "0.44982314", "0.44911134", "0.44904104", "0.44879997", "0.44755855", "0.44691253", "0.44559756" ]
0.7678849
0
Get product price after some filters like currency switcher
function ppom_get_product_price( $product ) { $product_price = $product->get_price(); if( has_filter('woocs_exchange_value') ) { global $WOOCS; if($WOOCS->current_currency != $WOOCS->default_currency ) { if($WOOCS->is_multiple_allowed) { $product_price = apply_filters('woocs_raw_woocommerce_price', $product_price); } else { $product_price = apply_filters('woocs_exchange_value', $product_price); } } } return apply_filters('ppom_product_price', $product_price, $product); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductPrice()\n {\n }", "function tep_get_productPrice($product_id){\n\tif ($product_id){\n\t\tglobal $languages_id,$pf;\n\t\t$product_query = tep_db_query(\"select p.products_id,p.products_price,products_discount from \" . TABLE_PRODUCTS . \" p where p.products_id=\".(int)$product_id );\n\t\tif (tep_db_num_rows($product_query)) {\n\t\t\t$product = tep_db_fetch_array($product_query);\n\t\t\t$product_price = $product['products_price'];\n\t\t\t$rata = $product['products_discount'] > 0 ? number_format((1/(1-$product['products_discount']/100)),2,'.','') : PRODUCTS_RATE;//( $product['products_discount'] > 0 )? number_format( (1 - ($product['products_discount'] / 100)) , 2) : PRODUCTS_RATE;\n\t\t\t//$retail_price = $product['products_price'] * PRODUCTS_RATE;// * $rata;//\n\t\t\t//echo $rata;\n\t\t\t$pf -> loadProduct($product['products_id'],$languages_id);\n\t\t\t$result = array();\n\t\t\t$result['rsPrice'] = $pf -> getRetailSinglePrice($rata);\n\t\t\t$result['sPrice'] = $pf -> getSinglePrice();\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}else{\n\t\treturn false;\n\t}\n}", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function get_price() {\n\n\t\t$price = null;\n\t\tif ( $this->is_on_sale() ) {\n\t\t\tif ( strstr($this->sale_price,'%') ) {\n\t\t\t\t$price = round($this->regular_price * ( (100 - str_replace('%','',$this->sale_price) ) / 100 ), 4);\n\t\t\t} else if ( $this->sale_price ) {\n\t\t\t\t$price = $this->sale_price;\n\t\t\t}\n\t\t} else {\n\t\t\t$price = apply_filters('jigoshop_product_get_regular_price', $this->regular_price, $this->variation_id);\n\t\t}\n\t\treturn apply_filters( 'jigoshop_product_get_price', $price, $this->variation_id );\n\n\t}", "public function getProductPrice(){\n return $this->product_price;\n }", "function tep_get_products_special_price($product_id) {\n\t$product_query = tep_db_query(\"select products_price, products_model from \" . TABLE_PRODUCTS . \" where products_id = '\" . (int)$product_id . \"'\");\n\tif (tep_db_num_rows($product_query)) {\n\t\t$product = tep_db_fetch_array($product_query);\n\t\t$product_price = $product['products_price'];\n\t} else {\n\t\treturn false;\n\t}\n\t// Eversun mod for sppc and qty price breaks\n\t// $specials_query = tep_db_query(\"select specials_new_products_price from \" . TABLE_SPECIALS . \" where products_id = '\" . $product_id . \"' and status\");\n\tglobal $sppc_customer_group_id;\n\tif(!tep_session_is_registered('sppc_customer_group_id')) {\n\t\t$customer_group_id = '0';\n\t} else {\n\t\t$customer_group_id = $sppc_customer_group_id;\n\t}\n\t$specials_query = tep_db_query(\"select specials_new_products_price from \" . TABLE_SPECIALS . \" where products_id = '\" . (int)$product_id . \"' and status and customers_group_id = '\" . (int)$customer_group_id . \"'\");\n\t// Eversun mod for sppc and qty price breaks\n\tif (tep_db_num_rows($specials_query)) {\n\t\t$special = tep_db_fetch_array($specials_query);\n\t\t$special_price = $special['specials_new_products_price'];\n\t} else {\n\t\t$special_price = false;\n\t}\n\tif(substr($product['products_model'], 0, 4) == 'GIFT') { //Never apply a salededuction to Ian Wilson's Giftvouchers\n\t\treturn $special_price;\n\t}\n\n\t$product_to_categories_query = tep_db_query(\"select categories_id from \" . TABLE_PRODUCTS_TO_CATEGORIES . \" where products_id = '\" . (int)$product_id . \"'\");\n\t$product_to_categories = tep_db_fetch_array($product_to_categories_query);\n\t$category = $product_to_categories['categories_id'];\n\t\n\t$sale_query = tep_db_query(\"select sale_specials_condition, sale_deduction_value, sale_deduction_type from \" . TABLE_SALEMAKER_SALES . \" where sale_categories_all like '%,\" . $category . \",%' and sale_status = '1' and (sale_date_start <= now() or sale_date_start = '0000-00-00') and (sale_date_end >= now() or sale_date_end = '0000-00-00') and (sale_pricerange_from <= '\" . $product_price . \"' or sale_pricerange_from = '0') and (sale_pricerange_to >= '\" . $product_price . \"' or sale_pricerange_to = '0')\");\n\tif (tep_db_num_rows($sale_query)) {\n\t\t$sale = tep_db_fetch_array($sale_query);\n\t} else {\n\t\treturn $special_price;\n\t}\n\n\t\tif (!$special_price) {\n\t\t\t$tmp_special_price = $product_price;\n\t\t} else {\n\t\t\t$tmp_special_price = $special_price;\n\t\t}\n\n\t\tswitch ($sale['sale_deduction_type']) {\n\t\t\tcase 0:\n\t\t\t\t$sale_product_price = $product_price - $sale['sale_deduction_value'];\n\t\t\t\t$sale_special_price = $tmp_special_price - $sale['sale_deduction_value'];\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$sale_product_price = $product_price - (($product_price * $sale['sale_deduction_value']) / 100);\n\t\t\t\t$sale_special_price = $tmp_special_price - (($tmp_special_price * $sale['sale_deduction_value']) / 100);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$sale_product_price = $sale['sale_deduction_value'];\n\t\t\t\t$sale_special_price = $sale['sale_deduction_value'];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn $special_price;\n\t\t}\n\n\t\tif ($sale_product_price < 0) {\n\t\t\t$sale_product_price = 0;\n\t\t}\n\t\t\n\t\tif ($sale_special_price < 0) {\n\t\t\t$sale_special_price = 0;\n\t\t}\n\t\t\n\t\tif (!$special_price) {\n\t\t\treturn number_format($sale_product_price, 4, '.', '');\n\t\t} else {\n\t\t\tswitch($sale['sale_specials_condition']){\n\t\t\t\tcase 0:\n\t\t\t\t\treturn number_format($sale_product_price, 4, '.', '');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\treturn number_format($special_price, 4, '.', '');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\treturn number_format($sale_special_price, 4, '.', '');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn number_format($special_price, 4, '.', '');\n\t\t\t}\n\t\t}\n}", "public function getPrice(): float;", "public function getPrice(): float;", "public function getCurrentPrice() : float;", "protected function calculatePrices()\n {\n }", "public function resolvePrice();", "protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}", "public function getPrice() {\n }", "abstract public function getPrice();", "function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}", "function verusPrice( $currency ) {\n global $phpextconfig;\n $currency = strtoupper($currency);\n\n if ( $currency == 'VRSC' | $currency == 'VERUS' ) {\n $results = json_decode( curlRequest( $phpextconfig['fiat_api'] . 'rawpricedata.php', curl_init(), null ), true );\n return $results['data']['avg_btc'];\n }\n else {\n return curlRequest( $phpextconfig['fiat_api'] . '?currency=' . $currency, curl_init(), null );\n } \n}", "function get_product_price($field_product_id){\r\n\r\n $this->load->model('logistics_model');\r\n $result = $this->logistics_model->get_product_price($field_product_id);\r\n $value = $result->price;\r\n echo $value;\r\n }", "public function get_prices()\n\t{\n\t\t$product_price_old = 0;\n\t\t$product_price_sale = 0;\n\t\t$price = 0;\n\t\t$eco = 0;\n\t\t$taxes = 0;\n\t\t$dataoc = isset($this->request->post['dataoc']) ? $this->request->post['dataoc'] : '';\n\n\t\tif (!empty($dataoc)) {\n\t\t\t$dataoc = str_replace('&quot;', '\"', $dataoc);\n\t\t\t$json = @json_decode($dataoc, true);\n\t\t\t$product_quantity = isset($json['quantity']) ? $json['quantity'] : 0;\n\t\t\t$product_id_oc = isset($json['product_id_oc']) ? $json['product_id_oc'] : 0;\n\t\t\tif ($product_id_oc == 0) $product_id_oc = isset($json['_product_id_oc']) ? $json['_product_id_oc'] : 0;\n\n\t\t\t// get options\n\t\t\t$options = isset($json['option_oc']) ? $json['option_oc'] : array();\n\t\t\tforeach ($options as $key => $value) {\n\t\t\t\tif ($value == null || empty($value)) unset($options[$key]);\n\t\t\t}\n\n\t\t\t// get all options of product\n\t\t\t$options_temp = $this->get_options_oc($product_id_oc);\n\n\t\t\t// Calc price for ajax\n\t\t\tforeach ($options_temp as $value) {\n\t\t\t\tforeach ($options as $k => $option_val) {\n\t\t\t\t\tif ($k == $value['product_option_id']) {\n\t\t\t\t\t\tif ($value['type'] == 'checkbox' && is_array($option_val) && count($option_val) > 0) {\n\t\t\t\t\t\t\tforeach ($option_val as $val) {\n\t\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\t\t// calc price\n\t\t\t\t\t\t\t\t\tif ($val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($value['type'] == 'radio' || $value['type'] == 'select') {\n\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\tif ($option_val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// the others have not price, so don't need calc\n\t\t\t\t\t}\n\t\t\t\t\t// if not same -> return.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product_prices = $this->get_product_price($product_id_oc, $product_quantity);\n\t\t\t$product_price_old = isset($product_prices['price_old']) ? $product_prices['price_old'] : 0;\n\t\t\t$product_price_sale = isset($product_prices['price_sale']) ? $product_prices['price_sale'] : 0;\n\t\t\t$enable_taxes = $this->config->get('tshirtecommerce_allow_taxes');\n\t\t\tif ($enable_taxes === null || $enable_taxes == 1) {\n\t\t\t\t$taxes = isset($product_prices['taxes']) ? $product_prices['taxes'] : 0;\n\t\t\t\t$eco = isset($product_prices['eco']) ? $product_prices['eco'] : 0;\n\t\t\t} else {\n\t\t\t\t$taxes = 0;\n\t\t\t\t$eco = 0;\n\t\t\t}\n\t\t\t\n\t\t} // do nothing when empty/blank\n\n\t\t// return price for ajax\n\t\techo @json_encode(array(\n\t\t\t'price' => $price, \n\t\t\t'price_old' => $product_price_old, \n\t\t\t'price_sale' => $product_price_sale, \n\t\t\t'taxes' => $taxes,\n\t\t\t'eco' => $eco\n\t\t));\n\t\treturn;\n\t}", "public function getCurrentCurrencyPriceOfSellerProduct()\n {\n $sp_id = $this->sp_id;\n $user_helper = new UserHelper;\n $to_curr_id = $user_helper-> getCurrentUserChoiceCurrencyId();\n $price = $this->getPriceOfSellerProduct($sp_id);\n $from_curr_id = $this->getCurrentPriceObjectOfSellerProduct($sp_id)->curr_id;\n $currency_helper = new CurrencyHelper;\n return $currency_helper->currencyConvert($from_curr_id,$to_curr_id,$price);\n }", "public function get_price(){\n\t\treturn $this->price;\n\t}", "public function getPrice(){ return $this->price_rur; }", "public function getPrice() : float\n {\n return $this->get('price', 'products');\n }", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "public function testProductGetPrices()\n {\n $product = $this->find('product', 1);\n $prices = $product->getPrices();\n $price = $prices[0];\n \n $currencies = $this->findAll('currency');\n $dollarCurrency = $currencies[0];\n \n $money = Money::create(10, $dollarCurrency); \n \n $this->assertEquals(\n $money,\n $price\n );\n }", "public function getPrice()\n {\n return parent::getPrice();\n }", "public function the_item_price($product_id){\n\t\treturn get_post_meta($product_id, \"_lms_price\", true);\n\t}" ]
[ "0.7175486", "0.71393424", "0.69461554", "0.69461554", "0.69461554", "0.69461554", "0.6917061", "0.6902495", "0.6875387", "0.68469757", "0.68469757", "0.67516595", "0.67398083", "0.6739329", "0.6737723", "0.67224425", "0.6710828", "0.6700735", "0.6693769", "0.6666484", "0.66497314", "0.66495407", "0.6637628", "0.66090804", "0.6602208", "0.6598815", "0.6598815", "0.65971744", "0.6560529", "0.6555896" ]
0.73074937
0
check if browser is IE
function ppom_if_browser_is_ie() { //print_r($_SERVER['HTTP_USER_AGENT']); if(!(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))){ return false; }else{ return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_ie() {\n\tif (isset($_SERVER['HTTP_USER_AGENT']) &&\n\t\t\t(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function detectInternetExplorer()\n {\n $agent = Request::server('HTTP_USER_AGENT');\n return preg_match('~MSIE|Internet Explorer~i', $agent) || preg_match('~Trident/7.0(.*)?; rv:11.0~', $agent);\n }", "function is_not_old_ie () \n{\n /*\n $browser = get_browser(null, true);\n if ( (! ini_get(\"browscap\") ) || empty($browser) || \n ! ( preg_match('/IE/i', $browser[parent]) && $browser[majorver] <= 8 ) )\n */\n if(! preg_match('/MSIE [1-8]/i', $_SERVER['HTTP_USER_AGENT']))\n {\n return true;\n }\n else\n return false;\n}", "function _isBrowserWinIE($ua_ok) {\r\n\t\treturn ( (eregi( \"Windows\", $ua_ok ) && eregi( \"msie\", $ua_ok ) && eregi( \"[7]\\.[0]\", $ua_ok ) ) ||\r\n\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"msie\", $ua_ok ) && eregi( \"[6]\\.[0-9]\", $ua_ok ) ) ||\r\n\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"msie\", $ua_ok ) && eregi( \"[5]\\.[5]\", $ua_ok ) ) ||\r\n\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"msie\", $ua_ok ) && eregi( \"[5]\\.[01]\", $ua_ok ) ) ||\r\n\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"msie\", $ua_ok ) && eregi( \"[4]\\.[01]\", $ua_ok ) )\r\n\t\t\t );\r\n\t}", "function isIE8()\n{\n\t$matches = \"\";\n\tpreg_match('/MSIE (.*?);/', $_SERVER['HTTP_USER_AGENT'], $matches);\n\treturn (count($matches)>1 && $matches[1]<=8);\n}", "public function browser_none() {\r\n if( !strcmp($this->_browser_info['name'], 'MSIE' ) && $this->_browser_info['version'] < 8 ) {\r\n return true;\r\n }\r\n return false;\r\n }", "function is_ie6(){\n\t\treturn strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.') !== FALSE;\n\t}", "public function browser_limited() {\r\n if( !strcmp($this->_browser_info['name'], 'MSIE' ) && ( $this->_browser_info['version'] >= 8 && $this->_browser_info['version'] < 9 ) ) {\r\n return true;\r\n }\r\n return false;\r\n\r\n }", "function isIE6()\n\t\t{\n\t\t\t$browser = 'mozilla';\n\t\t\t$majorVersion = 5;\n\t\t\n\t\t\tif(get_cfg_var('browscap')) \n\t\t\t{\n\t\t\t\t$browserTab = get_browser();\n\t\t\t\t$browser = strtolower($browserTab->browser);\n\t\t\t\t$majorVersion = intval($browserTab->majorver);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);\n\t\t\t\tif (preg_match('|msie ([0-9]).[0-9]{1,2}|',$userAgent,$matched)) \n\t\t\t\t{\n\t\t\t\t\t$browser = 'ie';\n\t\t\t\t\t$majorVersion = intval($matched[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\tif($this->options['hits_ie6_debug']==\"true\") {\n\t\t\t\techo \"\\n<!-- DEBUG: HTTP_USER_AGENT='$userAgent' -->\";\n\t\t\t\techo \"\\n<!-- DEBUG: DETECT BROWSER='$browser' -->\";\n\t\t\t\techo \"\\n<!-- DEBUG: DETECT M VERSION='$majorVersion' -->\";\n\t\t\t}\n\t\t\n\t\t\tif($browser == 'ie' && $majorVersion <= 6) { // if IE<=6\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse { //if IE>6\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function is_browser(){\n\n\t\treturn (new user_agent)->is_browser();\n\n\t}", "public function conditionDoesNotMatchInternetExplorer7Windows() {}", "public function conditionDoesNotMatchInternetExplorer7Windows() {}", "function is_explorer(){\r\n\t$user_agent = $_SERVER['HTTP_USER_AGENT'];\r\n\tif (strpos($user_agent, 'MSIE') || strpos($user_agent, 'Trident/7')) {\r\n\t\t//echo 'Internet Explorer';\r\n\t\techo'\r\n\t\t<h1 style=\"text-align:center; color:#FFF; width:500px; height:auto; border-radius:10px 10px 10px 10px; padding:5px 5px 5px 5px; background-color:#045CAA; margin:0 auto; margin-top:150px;\">Esse navegador está bloqueado para acessar esse sistema.<br/></h1>';\r\n\t\techo '<p style=\"text-align:center; color:#ba0707\"> Por favor utilize um navegador atualizado. </p>';\r\n\t\techo '<p style=\"text-align:center\"> <a href=\"https://www.google.com.br/chrome/index.html\">Baixar Google Chrome</a> </p>';\r\n\t\techo '<p style=\"text-align:center\"> <a href=\"https://www.google.com.br\">< Voltar</a> </p>';\r\n\t\texit;\r\n\t}\r\n}", "static function is_browser()\n\t{\n\t\tif(!isset(self::$_libs['user_agent'])){\n\t\t\tself::loadLibrary('SHIN_User_agent', TRUE);\n\t\t}\n\t\treturn self::$_libs['user_agent']->is_browser();\n\t}", "static function html5Compliant() {\n // global $isChrome;\n if (self::isChrome()) return true;\n\n if (self::isIE()) {\n\n if (preg_match('/(?i)msie [1-8]/', $_SERVER['HTTP_USER_AGENT'])) return false;\n logger::info($_SERVER['HTTP_USER_AGENT']);\n }\n\n return true;\n }", "public function conditionMatchesInternetExplorer7Windows() {}", "public function conditionMatchesInternetExplorer7Windows() {}", "function _isBrowserWinOP($ua_ok) {\r\n\t\treturn ( (eregi( \"Windows\", $ua_ok ) && eregi( \"Opera\", $ua_ok ) && eregi( \"[7]\\.[23]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"Opera\", $ua_ok ) && eregi( \"[8]\\.[50]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"Opera\", $ua_ok ) && eregi( \"[9]\\.[00]\", $ua_ok ) )\r\n\t\t\t );\r\n\t}", "function _isBrowserMacIE($ua_ok) {\r\n\t\t return ( eregi( \"Mac_PowerPC\", $ua_ok ) && eregi( \"msie\", $ua_ok ) && eregi( \"[5]\\.[2][0-9]\", $ua_ok ) );\r\n\t}", "function _isBrowserWinFF($ua_ok) {\r\n\t\treturn ( (eregi( \"Windows\", $ua_ok ) && eregi( \"firefox\", $ua_ok ) && eregi( \"[1]\\.[9]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"firefox\", $ua_ok ) && eregi( \"[1]\\.[8]\\.[1]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"firefox\", $ua_ok ) && eregi( \"[1]\\.[5]\\.[0]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"firefox\", $ua_ok ) && eregi( \"[1]\\.[0]\\.[7]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"mozilla\", $ua_ok ) && !eregi( \"netscape\", $ua_ok ) && eregi( \"rv:[1]\\.[7]\\.[12]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"mozilla\", $ua_ok ) && eregi( \"rv:[1]\\.[6]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"mozilla\", $ua_ok ) && eregi( \"[4]\\.[78]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"netscape\", $ua_ok ) && eregi( \"[6]\", $ua_ok ) ) ||\r\n\t\t\t\t (eregi( \"Windows\", $ua_ok ) && eregi( \"netscape\", $ua_ok ) && eregi( \"[7]\", $ua_ok ) )\r\n\t\t\t );\r\n\t}", "function bb2_msie($package)\r\n{\r\n\tif (!array_key_exists('Accept', $package['headers_mixed'])) {\r\n\t\treturn \"17566707\";\r\n\t}\r\n\r\n\t// MSIE does NOT send \"Windows ME\" or \"Windows XP\" in the user agent\r\n\tif (strpos($package['headers_mixed']['User-Agent'], \"Windows ME\") !== FALSE || strpos($package['headers_mixed']['User-Agent'], \"Windows XP\") !== FALSE || strpos($package['headers_mixed']['User-Agent'], \"Windows 2000\") !== FALSE || strpos($package['headers_mixed']['User-Agent'], \"Win32\") !== FALSE) {\r\n\t\treturn \"a1084bad\";\r\n\t}\r\n\r\n\t// MSIE does NOT send Connection: TE\r\n\tif (preg_match('/\\bTE\\b/i', $package['headers_mixed']['Connection'])) {\r\n\t\treturn \"2b90f772\";\r\n\t}\r\n\r\n\treturn false;\r\n}", "function is_browser($http_user_agent) {\n\t\tif (strstr($http_user_agent, 'Opera Mini')) {\n\t\t\treturn false;\t\n\t\t}\n\t\telse {\n\t\t\tif (strstr($http_user_agent, 'Windows NT 6.0') || strstr($http_user_agent, 'Macintosh') || strstr($http_user_agent, 'i686') || strstr($http_user_agent, 'Konqueror') || strstr($http_user_agent, 'Wget') || strstr($http_user_agent, 'Lynx')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (strstr($http_user_agent, 'Windows NT 5.1') && strstr($http_user_agent,'Mozilla')) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function ie()\n\t{\n\t\t$architectures = [\n\t\t\t'', 'WOW64; ', 'Win64; x64; ', 'Win64; ',\n\t\t];\n\n\t\t$extras = [\n\t\t\t'',\n\t\t\t'; .NET CLR 1.1.' . rand(4320, 4325),\n\t\t\t'; WOW64',\n\t\t\t'; SLCC2; Media Center PC 6.0; InfoPath.3',\n\t\t\t'; .NET CLR 1.1.' . mt_rand(1000, 5000) . '; .NET CLR 2.0.' . mt_rand(1000, 6000),\n\t\t\t'; SLCC2; .NET CLR 2.' . mt_rand(50000, 55000) . '; .NET CLR 3.5.' . mt_rand(30000, 35000) . '; .NET CLR 3.' . mt_rand(30000, 35000) . '; .NET4.0C; .NET4.0E',\n\t\t\t'; SLCC2; .NET CLR 2.0.' . mt_rand(50000, 55000) . '; .NET CLR 3.5.30729; .NET CLR 3.0.' . mt_rand(30000, 35000) . '; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E',\n\t\t];\n\n\t\treturn 'Mozilla/5.0 (compatible; MSIE ' . mt_rand(7, 9) . '.0; ' . $this->getWindowsNT() . '; ' . $architectures[mt_rand(0, count($architectures) - 1)] . 'Trident/' . mt_rand(3, 7) . '.0' . $extras[mt_rand(0, count($extras) - 1)] . ')';\n\t}", "public function verify_browser()\n {\n $this->_ci->load->library('user_agent');\n\n $min_browser = config_item('bitheme_min_browser');\n $current_browser = $this->_ci->agent->browser();\n $current_version = explode('.', $this->_ci->agent->version());\n\n if ( isset($min_browser[$current_browser]) and !IS_CLI )\n {\n if ( $current_version[0] <= $min_browser[$current_browser] )\n {\n $firefox = anchor('http://www.mozilla.org/id/', 'Mozilla Firefox', 'target=\"_blank\"');\n $chrome = anchor('https://www.google.com/intl/id/chrome/browser/', 'Google Chrome', 'target=\"_blank\"');\n\n log_message('error', lang(\"error_browser_jadul\"));\n show_error(array(\n 'Peramban yang anda gunakan tidak memenuhi syarat minimal penggunaan aplikasi ini.',\n 'Silahkan gunakan '.$firefox.' atau '.$chrome.' biar lebih GREGET!'), 500, 'error_browser_jadul');\n }\n }\n }", "protected function _isBrowserFailed()\n {\n try {\n $browser = Factory::getClientBrowser();\n //If browser was terminated every browser method call will throw specific exception\n $browser->getUrl();\n } catch (\\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {\n return true;\n }\n return false;\n }", "public function isOldBrowser() {\n\n $isOld = false;\n\n foreach ($this->oldBrowsers as $value) {\n $isOld = ( strpos($this->getUserAgent(), $value) != 0 );\n if ($isOld)\n break;\n }\n\n return $isOld;\n }", "function CheckIEMS($ie) {\r\n\tif (strlen($ie) != 9) {\r\n\t\treturn 0;\r\n\t} else {\r\n\t\tif (substr($ie, 0, 2) != 28) {\r\n\t\t\treturn 0;\r\n\t\t} else {\r\n\t\t\t$b = 9;\r\n\t\t\t$soma = 0;\r\n\t\t\tfor ($i = 0; $i <= 7; $i++) {\r\n\t\t\t\t$soma += $ie[$i] * $b;\r\n\t\t\t\t$b--;\r\n\t\t\t}\r\n\t\t\t$i = $soma % 11;\r\n\t\t\tif ($i == 0) {\r\n\t\t\t\t$dig = 0;\r\n\t\t\t} else {\r\n\t\t\t\t$dig = 11 - $i;\r\n\t\t\t}\r\n\r\n\t\t\tif ($dig > 9) {\r\n\t\t\t\t$dig = 0;\r\n\t\t\t}\r\n\r\n\t\t\treturn ($dig == $ie[8]);\r\n\t\t}\r\n\t}\r\n}", "function anva_ie_browser_message() {\n\t?>\n\t<!--[if lt IE 9]>\n\t\t<p class=\"alert alert-warning browsehappy\"><?php printf( anva_get_local( 'browsehappy' ), esc_url( 'http://browsehappy.com/' ) ); ?></p>\n\t<![endif]-->\n\t<?php\n}", "function isWindowsXPSP2()\r\n{\r\n if ( eregi(\"Windows NT 5.1\", $_SERVER['HTTP_USER_AGENT']) && eregi(\"SV1\", $_SERVER['HTTP_USER_AGENT']) )\r\n {\r\n \treturn true;\r\n }\r\n else\r\n {\r\n \treturn false;\r\n }\r\n}", "function get_the_browser()\n{\n if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)\n return 'Internet explorer';\n elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false)\n return 'Internet explorer';\n elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false)\n return 'Mozilla Firefox';\n elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false)\n return 'Google Chrome';\n elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera Mini') !== false)\n return \"Opera Mini\";\n elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false)\n return \"Opera\";\n elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== false)\n return \"Safari\";\n else\n return 'Other';\n }" ]
[ "0.8117697", "0.8103033", "0.7642736", "0.7441285", "0.73320794", "0.7305608", "0.7108908", "0.70854735", "0.69024676", "0.6809612", "0.6721157", "0.6720807", "0.66775185", "0.6520998", "0.6513414", "0.6461711", "0.6460735", "0.64465857", "0.6348477", "0.63469803", "0.6292728", "0.6249303", "0.62213117", "0.61690277", "0.6166299", "0.6129493", "0.60721076", "0.59651315", "0.5916518", "0.5849091" ]
0.8141504
0
Is PPOM meta has field of specific type
function ppom_has_field_by_type( $product_id, $field_type ) { $ppom = new PPOM_Meta( $product_id ); if( ! $ppom->fields ) return ''; $fields_found = array(); foreach($ppom->fields as $field) { if( !empty($field['type']) && $field['type'] == $field_type ) { $fields_found[] = $field; } } return $fields_found; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasField();", "function is_field_type($name)\n {\n }", "public function meta_type();", "private function hasCustomFields()\r\n\t{\r\n\t\tforeach ($this->fields as $field)\r\n\t\t{\r\n\t\t\tif ($field instanceOf CustomField)\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function hasType(){\n return $this->_has(3);\n }", "public function hasType(){\n return $this->_has(3);\n }", "public function hasType(){\n return $this->_has(3);\n }", "public function isType($type){\n \n // canary...\n if(!$this->hasType()){ return false; }//if\n \n return ($this->field_map['type'] === $type);\n \n }", "public function hasType(){\n return $this->_has(2);\n }", "public function hasField(){\n return $this->_has(2);\n }", "protected abstract function get_meta_type();", "public function hasType(){\r\n return $this->_has(1);\r\n }", "public function hasType(){\n return $this->_has(4);\n }", "public function has($_field);", "function acf_is_field_type($name = '')\n{\n}", "public function hasCustomFields(): bool\n {\n foreach ($this->fields as $fieldName => $field) {\n if (isset($field['type']) === false) {\n throw (new \\Exception('Field \\'' . $fieldName . '\\' has no type'));\n }\n\n if ($field['type'] == 'custom') {\n return true;\n }\n }\n\n return false;\n }", "public function hasType(){\n return $this->_has(5);\n }", "public function hasType(){\n return $this->_has(5);\n }", "public function hasField() {\n return $this->_has(1);\n }", "public function hasField() {\n return $this->_has(1);\n }", "public function hasField() {\n return $this->_has(1);\n }", "public function hasType() {\n return $this->_has(3);\n }", "function acf_field_type_exists($type = '')\n{\n}", "public function hasType() {\n return $this->_has(2);\n }", "public function hasFields(){\n return $this->_has(1);\n }", "public function hasType(){\n return $this->_has(9);\n }", "public static function get_meta_type();", "public function hasType(){\r\n return $this->_has(7);\r\n }", "function metadata_exists($meta_type, $object_id, $meta_key)\n {\n }", "function drush_behat_op_is_field($is_field_info) {\n list($entity_type, $field_name) = $is_field_info;\n return _drush_behat_is_field($entity_type, $field_name);\n}" ]
[ "0.70107687", "0.6953031", "0.6878139", "0.6805692", "0.67656654", "0.67656654", "0.67656654", "0.67615604", "0.6743222", "0.67267704", "0.6716539", "0.6709022", "0.6706723", "0.67006403", "0.6662158", "0.6652466", "0.6633485", "0.6633485", "0.6624825", "0.6624825", "0.6624825", "0.66220105", "0.6619507", "0.6618749", "0.6579436", "0.65604025", "0.653119", "0.64647716", "0.64334285", "0.6427693" ]
0.76765996
0
Check if field conditionally hidden
function ppom_is_field_hidden_by_condition( $field_name ) { if( !isset($_POST['ppom']['conditionally_hidden']) ) return false; $ppom_is_hidden = false; $ppom_hidden_fields = explode(",", $_POST['ppom']['conditionally_hidden']); // Remove duplicates $ppom_hidden_fields = array_unique( $ppom_hidden_fields ); if( in_array($field_name, $ppom_hidden_fields) ) { $ppom_is_hidden = true; } return apply_filters('ppom_is_field_hidden_by_condition', $ppom_is_hidden); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pewc_is_field_hidden( $item, $product_id ) {\n\n\t$rules = pewc_get_field_conditional( $item, $product_id );\n\t// If it's set to show after conditions are met, it must be hidden to start with\n\tif( isset( $rules['action'] ) && $rules['action'] == 'show' ) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function isHidden();", "protected function hasSecuredHiddenFieldsRendered() {}", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function isHidden();", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }" ]
[ "0.7707687", "0.75888836", "0.75888836", "0.75888836", "0.75888836", "0.7443614", "0.7434334", "0.7434334", "0.7434334", "0.73429024", "0.71704274", "0.7166653", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164", "0.71539164" ]
0.7589708
1
Get cart item max quantity for matrix
function ppom_get_cart_item_max_quantity( $cart_item ) { $max_quantity = null; if( isset($cart_item['ppom']['ppom_pricematrix']) ) { $matrix = json_decode( stripslashes($cart_item['ppom']['ppom_pricematrix']) ); $last_range = end($matrix); $qty_ranges = explode('-', $last_range->raw); $max_quantity = $qty_ranges[1]; } return $max_quantity; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMaximumQuantity()\n {\n return $this->maximumQuantity;\n }", "public function get_max_ticket_quantity_cart( string $product_quantity, string $cart_item_key, array $cart_item ) : string {\n\t\t$product_quantity = str_replace( 'max=\"\"', 'max=\"' . $this->get_max_ticket_quantity() . '\"', $product_quantity );\n\t\treturn $product_quantity;\n\t}", "public function max_sale(){\n\n global $database;\n $sql = \"SELECT product_id, SUM(product_quaty) FROM orders_index GROUP by product_id ORDER BY SUM(product_quaty) DESC LIMIT 1\";\n $result_set = $database->query($sql);\n $row = mysqli_fetch_array($result_set);\n $result = array_shift($row);\n return $result;\n }", "public function getQty();", "public function getQty();", "public function getMaxItems() {\n\t\t$q = $this->bdd->prepare('SELECT count(1) FROM items');\n\t\t$q->execute();\n\t\treturn intval($q->fetch(PDO::FETCH_COLUMN));\n\t}", "public function getRowsQty();", "public function getQuantity();", "public function getQuantity();", "public function getQuantity();", "public function getQty()\n\t{\n\t\treturn $this->qty;\n\t}", "abstract public function getOriginalQty();", "public function getMaxOrderTotal();", "public function getQty()\n {\n return $this->qty;\n }", "public function getQty()\r\n {\r\n return $this->qty;\r\n }", "public function getQuantity()\n\t{\n\t\treturn $this->getKeyValue('quantity'); \n\n\t}", "public function getMaxItems()\n {\n return isset($this->max_items) ? $this->max_items : 0;\n }", "private function get_max_ticket_quantity() : int {\n\t\t// Set default.\n\t\t$max_quantity = 1;\n\n\t\t// Loop over products in cart searching for a product with an attendee-type attribute.\n\t\tif ( WC()->cart ) {\n\t\t\tforeach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n\n\t\t\t\t$attributes = $cart_item['data']->get_attributes();\n\n\t\t\t\tif ( array_key_exists( 'attendee-type', $attributes ) && 'Family' === $attributes['attendee-type'] ) {\n\t\t\t\t\t// Get family member quantity.\n\t\t\t\t\tif ( array_key_exists( 'family_members', $cart_item ) ) {\n\t\t\t\t\t\t$max_quantity = (int) $cart_item['family_members'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $max_quantity;\n\t}", "public function setMaximumQuantity($qty) {\n\t\t$this->maxquantity = (int)$qty;\n\n\t\treturn $this;\n\t}", "public function GetMaxAmount()\n\t {\n\t\t return $this->db->query(\"select MAX(TotalPrice) as price from tb_products\")->row_array(); \n\t }", "public function getIdMax() {\n $sql = \"select ItemID from Mst_ItemList\";\n $query = $this->db->query($sql);\n $jml = $query->num_rows();\n if ($jml == 0) {\n $ItemID = \"001\";\n return $ItemID;\n } else {\n $sql = \"select max(ItemID) as ItemID from Mst_ItemList\";\n $query = $this->db->query($sql);\n $hasil = $query->result();\n $ItemID = $hasil[0]->ItemID;\n $ItemID = sprintf('%06u', $ItemID + 1);\n return $ItemID;\n }\n }", "public function get_quantity(){\n\t\treturn $this->quantity;\n\t}", "public function getQuantity() \n {\n return $this->_fields['Quantity']['FieldValue'];\n }", "public function getQuantity(): float;", "public function get_qty() {\n\t\treturn get_post_meta( $this->get_id(), 'qty', true );\n\t}", "function _isEligibleMaximumQuantity()\r\n {\r\n $items_count = $this->_countUserBoughtItems();\r\n $item = $this->find('first', array(\r\n 'conditions' => array(\r\n 'Item.id' => $this->data[$this->name]['item_id'],\r\n ) ,\r\n 'fields' => array(\r\n 'Item.buy_max_quantity_per_user',\r\n ) ,\r\n 'recursive' => -1\r\n ));\r\n $newTotal = (!empty($items_count[0]['total_count']) ? $items_count[0]['total_count'] : 0) +$this->data[$this->name]['quantity'];\r\n if (empty($item['Item']['buy_max_quantity_per_user']) || $newTotal <= $item['Item']['buy_max_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function getMultipleOrderQuantity()\n {\n return $this->multipleOrderQuantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }", "public function getQuantity()\n {\n return $this->quantity;\n }" ]
[ "0.75429326", "0.6947515", "0.6654821", "0.6625325", "0.6625325", "0.6559773", "0.64071244", "0.6366963", "0.6366963", "0.6366963", "0.63564664", "0.63400817", "0.6317779", "0.6311567", "0.6301001", "0.62295806", "0.62159246", "0.6188754", "0.6179192", "0.6152098", "0.61364824", "0.6133081", "0.6105791", "0.6097346", "0.6084379", "0.60398763", "0.6023856", "0.601778", "0.601778", "0.601778" ]
0.83067375
0
Extract relevant matrix from Matrix Range given by quantity
function ppom_extract_matrix_by_quantity($quantities_field, $product, $quantity) { $matrix = ''; if( !isset($quantities_field['options']) ) return $matrix; $options = $quantities_field['options']; $ranges = ppom_convert_options_to_key_val($options, $quantities_field, $product); if( empty($ranges) ) return $matrix; foreach ($ranges as $range => $data) { $range_array = explode('-', $range); $range_start = $range_array[0]; $range_end = $range_array[1]; $quantity = intval($quantity); if( $quantity >= $range_start && $quantity <= $range_end ) { $matrix = $data; break; } } return $matrix; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ppom_get_price_matrix_chunk($product, $option_prices, $ppom_item_order_qty) {\n\t\n\t$matrix_found = '';\n\t\n\t$pricematrix_field = ppom_has_field_by_type(ppom_get_product_id($product), 'pricematrix');\n\t// ppom_pa($pricematrix_field);\n\t\n\tif ( ! $pricematrix_field ) return $matrix_found;\n\t\n\tif( count($pricematrix_field) > 0 ) {\n\t\t\n\t\tforeach( $pricematrix_field as $pm ) {\n\t\t\t\n\t\t\t//iterecting option_prices\n\t\t\tforeach( $option_prices as $op ) {\n\t\t\t\t\n\t\t\t\tif( $op['apply'] != 'matrix_discount' && $op['apply'] != 'matrix') continue;\n\t\t\t\t\n\t\t\t\tif( $op['data_name'] == $pm['data_name'] ) {\n\t\t\t\t\t$pricematrix_field = $pm;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// $pricematrix_field = $pricematrix_field[0];\n\t\t$matrix_found = ppom_extract_matrix_by_quantity($pricematrix_field, $product, $ppom_item_order_qty);\n\t}\n\t\n\treturn apply_filters('ppom_price_matrix_found_in_cart', $matrix_found, $product, $option_prices);\n}", "public function getMatrixAt($x, $y)\t\t\t{ return $this->matrix[$y + $x + 3 * $x]; }", "public static function whereIsMin( $matrix ) {\n\t\t\tif ( count($matrix) == 0 ) {\n\t\t\t\tthrow new Exception(\"Can not find maximum a an empty matrix.\");\n\t\t\t}\n\t\t\t\n\t\t\t$_return = array(false,false);\n\t\t\t$_maxval = false;\n\t\t\tforeach ($matrix as $i => $subarray) {\n\t\t\t\tforeach ($subarray as $j => $value) {\n\t\t\t\t\tif ( $i != $j && ($_maxval > $value || $_maxval === false) ) {\n\t\t\t\t\t\t$_return = array($i,$j,'val'=>$value);\n\t\t\t\t\t\t$_maxval = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $_return;\n\t\t}", "function find_matrix($lat1, $lon1, $lat2, $lon2)\n{\n\n $miles = distance($lat1, $lon1, $lat2, $lon2, 'M');\n $kilo = distance($lat1, $lon1, $lat2, $lon2, 'K');\n\n return ['m' => $miles, 'k' => $kilo];\n}", "public function getMinors(int $column_x, int $row_y = 0): Matrix\n {\n $rows = new Vector();\n $rows->allocate($this->y);\n foreach ($this->table as $y => $colVector) {\n if ($y === $row_y) continue;\n $row = new Vector();\n $row->allocate($this->x);\n foreach ($colVector as $x => $value) {\n if ($x === $column_x) continue;\n $row->push($value);\n }\n $rows->push($row);\n }\n\n return new self($rows);\n }", "function f($m, $ss, $sp, $vp){\n\tglobal $size_set, $valu_set;\n\t\n\t$rr = array();\n\t\n\tforeach($ss as $s)\n\t\tif(($size_set[$m][$s] <= $sp) && ($valu_set[$m][$s] >= $vp))\n\t\t\t$rr[] = $s;\n\t\t\n\treturn $rr;\n}", "public function getLineMatrix() {}", "abstract public function grabReportList( $quantity );", "static function match($times, $start, $end, $valueField, &$matrix=null){\r\n\t\tif(empty($times))\r\n\t\t\treturn array();\r\n\r\n\t\t$start -= $start % 3600; \r\n\t\t$end += ($end % 3600)>0? 3600 - ($end % 3600) : 0;\r\n\t\t\r\n\t\t$hits = array();\r\n\t\t\r\n\t\twhile ($start < $end){\r\n\t\t\t$d = date(\"Ymd\", $start);\r\n\t\t\t$h = date(\"H\", $start);\r\n\t\t\tif(isset($matrix[$d][$h])){\r\n\t\t\t\t$hits = array_merge($hits,$matrix[$d][$h]); \r\n\t\t\t}\r\n\t\t\t$start += 3600;\r\n\t\t}\r\n\t\t$hits = array_unique($hits);\r\n\t\treturn $hits;\r\n\t\t\r\n\t}", "function findEditDistanceMatrix($initial, $final)\n{\t\n\t$m = sizeof($initial);\n\t$n = sizeof($final);\n\t\n\t$matrix = array();\n\tfor ($i = 0; $i <= $m; $i++)\n\t\t$matrix[$i] = array($i);\n\tfor ($j = 0; $j <= $n; $j++)\n\t\t$matrix[0][$j] = $j;\n\t\n\tfor ($j = 1; $j <= $n; $j++)\n\t{\n\t\tfor ($i = 1; $i <= $m; $i++)\n\t\t{\n\t\t\tif ($initial[$i - 1] === $final[$j - 1])\n\t\t\t\t$matrix[$i][$j] = $matrix[$i - 1][$j - 1];\n\t\t\telse\n\t\t\t\t$matrix[$i][$j] = min(\t$matrix[$i - 1][ $j ] + 1,\n\t\t\t\t\t\t\t\t\t\t$matrix[ $i ][$j - 1] + 1,\n\t\t\t\t\t\t\t\t\t\t$matrix[$i - 1][$j - 1] + 1);\n\t\t}\n\t}\n\n\treturn $matrix;\n}", "abstract public function load($qty, $from = 0);", "private function getUniqNums($min, $max, $quantity) {\n $numbers = range($min, $max);\n shuffle($numbers);\n return array_slice($numbers, 0, $quantity);\n }", "function select_table_rows($log)\n {\n if ($_POST['quantity'] > sizeof($log)) \n {\n $nrows = sizeof($log);\n }\n else \n {\n $nrows = $_POST['quantity']+1;\n }\n return array($nrows, array_slice($log, 0, $nrows-1));\n }", "public function getUsageAreaMatrix()\n {\n $usage_areas = UsageArea::getAll($this->clang_id, $this->category_id);\n $machines = $this->getMachines(true);\n\n $matrix = [];\n foreach ($usage_areas as $usage_area) {\n $values = [];\n foreach ($machines as $machine) {\n if (in_array($usage_area->usage_area_id, $machine->usage_area_ids, true)) {\n $values[] = $machine->machine_id;\n }\n }\n $matrix[$usage_area->name] = $values;\n }\n return $matrix;\n }", "public function slice($start, $amount);", "private function getRange()\n {\n $low = (($this->boardWidth * $this->myRowNum) - ($this->boardWidth)) + 1;\n $high = ($this->boardWidth * $this->myRowNum);\n\n return range($low, $high);\n }", "public function copyMatrix(): matrix {\n return clone $this;\n }", "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 getDetailAllMileStone($groupo_id_local,$DbConnection)\n{\n $query=\"SELECT milestone_id,milestone_name,milestone_type FROM milestone_assignment USE INDEX(mass_gid_status) WHERE group_id='$groupo_id_local' AND status=1\"; \t\t\t\t\n if($DEBUG==1){print $query;}\n $result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n while($row=mysql_fetch_object($result))\n {\n /*$ms_id=$row->milestone_id; \n $ms_name=$row->milestone_name;\n $ms_type=$row->milestone_type;*/\n $data[]=array('ms_id'=>$row->milestone_id,'ms_name'=>$row->milestone_name,'ms_type'=>$row->milestone_type);\t\n }\n return $data;\n}", "private function readMRange()\n {\n $values = [\n 'mmin' => $this->parseM($this->readDoubleL(Shapefile::FILE_SHP)),\n 'mmax' => $this->parseM($this->readDoubleL(Shapefile::FILE_SHP)),\n ];\n return $this->getOption(Shapefile::OPTION_SUPPRESS_M) ? [] : $values;\n }", "function fetchAllMinimumItemCurrentStock()\r{\r $link = parent::connectToDB();\r\t$query=\"select stock.item_id,item.minimum_quantity,item.name_brand,category.name,sum(stock.current_stock) from item,category,stock where stock.item_id=item.item_id and item.category_id=category.category_id group by stock.item_id having sum(stock.current_stock)<(item.minimum_quantity)\";\r\t$result8 = mysqli_query($link, $query);\r\t$r=mysqli_num_rows($result8);\t\rif($r!=0)\r{\rreturn $result8;\r}\relse\r{\rreturn false;\r}\r}", "function setMatrix($x,$y){\n\t$thisMatrix = array();\n\tfor( $i=0; $i<3; $i++){\n\t\t$rowMatrix = array();\n\t\tfor( $j=0; $j<3; $j++){\n\t\t\t$tempNum = rand($x,$y);\n\t\t\tarray_push($rowMatrix, $tempNum);\n\t\t}\n\t\tarray_push($thisMatrix, $rowMatrix);\n\t}\n\treturn $thisMatrix;\n}", "public function generateMatrix($chars, $start_range, $length){\r\n\t\t$matrix = array();\r\n\t\t$trigger = $this->string['count'];\r\n\t\t$char_count = count($chars);\r\n\t\t$y = $start_range[0];\r\n\t\t$range = 0;\r\n\t\tfor($i = 0; $i < $length; $i++){\r\n\t\t\tif($trigger < 1){\r\n\t\t\t\t$trigger = $this->string['count'];\r\n\t\t\t}if($range > count($start_range)-1){\r\n\t\t\t\t$range = 0;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$trigger--;\r\n\t\t\t}\r\n\t\t\t$y = $y + $trigger + $start_range[$range] + $length;\r\n\t\t\t$matrix[$i] = $chars[$y%$char_count];\r\n\t\t\t$range++;\r\n\t\t}\r\n\t\treturn $matrix;\r\n\t}", "public function getTechDataMatrix()\n {\n $machines = $this->getMachines(true);\n $matrix = [];\n $tech_data_arrays = [];\n $tech_data_wildcards = [];\n // Get technical data\n foreach ($machines as $machine) {\n $tech_data_arrays[$machine->machine_id] = $machine->getTechnicalData();\n }\n // Get wildcards\n foreach ($tech_data_arrays as $tech_data_array) {\n foreach ($tech_data_array as $tech_data) {\n /** @var array<string> $tech_data */\n $tech_data_wildcards[$tech_data['description']] = $tech_data['unit'];\n }\n }\n // Create matrix\n foreach ($tech_data_wildcards as $wildcard => $unit) {\n $key = ['description' => $wildcard, 'unit' => $unit];\n $matrix[$wildcard] = ['unit' => $unit, 'machine_ids' => []];\n foreach ($machines as $machine) {\n $tech_data_array = $tech_data_arrays[$machine->machine_id];\n $matrix[$wildcard]['machine_ids'][$machine->machine_id] = '';\n foreach ($tech_data_array as $techdata) {\n /** @var array<string> $techdata */\n if ($techdata['description'] === $wildcard) {\n $matrix[$wildcard]['machine_ids'][$machine->machine_id] = $techdata['value'];\n break;\n }\n }\n }\n }\n return $matrix;\n }", "function UniqueRandomNumbersWithinRange($min, $max, $quantity)\n {\n $numbers = range($min, $max);\n shuffle($numbers);\n return array_slice($numbers, 0, $quantity);\n }", "function getRowsByRange($table_name, $value_column_name, $value_min, $value_max)\n {\n $sql = sprintf(\n \"SELECT * FROM %s WHERE %s BETWEEN \\\"%s\\\" AND \\\"%s\\\"\",\n $table_name,\n $value_column_name,\n $value_min,\n $value_max);\n\n $rows = array();\n\n $result = $this->query($sql);\n while($row = $result->fetchArray(SQLITE3_ASSOC))\n {\n array_push($rows, $row);\n }\n\n return $rows;\n }", "abstract public function getSpecificRow();", "public function global_matrix_view_m3()\n\t{\n\t\t$this->load->model('user_profiles', 'up');\n\t\t$data['matrix_users'] = $this->up->users_in_m3();\n\t\t\n\t\t$total_users = count($data['matrix_users']);\n\t\t$limit = 0;\n\t\tfor($i=0; $i<$total_users; $i++)\n\t\t{\n\t\t\t$limit = $limit + pow(2, $i);\n\t\t\tif($limit >= $total_users)\n\t\t\t{\n\t\t\t\t$limit = $i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$data['limit'] = $limit;\n\t\t$this->load->view('global_matrix_view_m3', $data);\n\t}", "public function global_matrix_view_m1()\n\t{\n\t\t$this->load->model('user_profiles', 'up');\n\t\t$data['matrix_users'] = $this->up->users_in_m1();\n\t\t\n\t\t$total_users = count($data['matrix_users']);\n\t\t$limit = 0;\n\t\tfor($i=0; $i<$total_users; $i++)\n\t\t{\n\t\t\t$limit = $limit + pow(2, $i);\n\t\t\tif($limit >= $total_users)\n\t\t\t{\n\t\t\t\t$limit = $i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$data['limit'] = $limit;\n\t\t$this->load->view('global_matrix_view_m1', $data);\n\t}", "public function initMatrix()\r\n {\r\n $num_locations = count($this->locations);\r\n for ($i = 1; $i <= $num_locations; $i++) {\r\n for ($j = 1; $j <= $num_locations; $j++) {\r\n if ($i == $j) {\r\n $this->cost_matrix[$i][$j] = $this->infinity;\r\n } else {\r\n $this->cost_matrix[$i][$j] = $this->distance($this->locations[$i]['latitude'], $this->locations[$i]['longitude'], $this->locations[$j]['latitude'], $this->locations[$j]['longitude']);\r\n }\r\n }\r\n }\r\n }" ]
[ "0.5598703", "0.54092705", "0.48131505", "0.4604633", "0.45702508", "0.4569853", "0.45310718", "0.44996318", "0.4463215", "0.44409567", "0.43986267", "0.4391121", "0.4365622", "0.4324546", "0.43035582", "0.42765215", "0.4258706", "0.42474166", "0.42451832", "0.42321822", "0.42054605", "0.41920695", "0.41779134", "0.4174693", "0.41604957", "0.41591138", "0.414869", "0.41446704", "0.41398883", "0.40996417" ]
0.70101243
0
Generating html for file input and cropper in order meta from filename
function ppom_generate_html_for_files( $file_names, $input_type, $item ) { $file_name_array = explode(',', $file_names); $order_html = '<table>'; foreach($file_name_array as $file_name) { $file_edit_path = ppom_get_dir_path('edits').ppom_file_get_name($file_name, $item->get_product_id()); // Making file thumb download with new path $ppom_file_url = ppom_get_file_download_url( $file_name, $item->get_order_id(), $item->get_product_id()); $ppom_file_thumb_url = ppom_is_file_image($file_name) ? ppom_get_dir_url(true) . $file_name : PPOM_URL.'/images/file.png'; $order_html .= '<tr><td><a href="'.esc_url($ppom_file_url).'">'; $order_html .= '<img class="img-thumbnail" style="width:'.esc_attr(ppom_get_thumbs_size()).'" src="'.esc_url($ppom_file_thumb_url).'">'; $order_html .= '</a></td>'; // Requested by Kevin, hiding downloading file button after order on thank you page // @since version 16.6 if( is_admin() ) { $order_html .= '<td><a class="button" href="'.esc_url($ppom_file_url).'">'; $order_html .= __('Download File', 'ppom'); $order_html .= '</a></td>'; } $order_html .= '</tr>'; if( $input_type == 'cropper' ) { $cropped_file_name = ppom_file_get_name($file_name, $item->get_product_id()); $cropped_url = ppom_get_dir_url() . 'cropped/' . $cropped_file_name; $order_html .= '<tr><td><a href="'.esc_url($cropped_url).'">'; $order_html .= '<img style="width:'.esc_attr(ppom_get_thumbs_size()).'" class="img-thumbnail" src="'.esc_url($cropped_url).'">'; $order_html .= '</a></td>'; // Requested by Kevin, hiding downloading file button after order on thank you page // @since version 16.6 if( is_admin() ) { $order_html .= '<td><a class="button" href="'.esc_url($cropped_url).'">'; $order_html .= __('Cropped', 'ppom'); $order_html .= '</a></td>'; } $order_html .= '</tr>'; } elseif( file_exists($file_edit_path) ) { $edit_file_name = ppom_file_get_name($file_name, $item->get_product_id()); $edit_url = ppom_get_dir_url() . 'edits/' . $edit_file_name; $edit_thumb_url = ppom_get_dir_url() . 'edits/thumbs/' . $file_name; $order_html .= '<tr><td><a href="'.esc_url($edit_url).'">'; $order_html .= '<img style="width:'.esc_attr(ppom_get_thumbs_size()).'" class="img-thumbnail" src="'.esc_url($edit_thumb_url).'">'; $order_html .= '</a></td>'; $order_html .= '<td><a class="button" href="'.esc_url($edit_url).'">'; $order_html .= __('Edited', 'ppom'); $order_html .= '</a></td></tr>'; } } $order_html .= '</table>'; return apply_filters('ppom_order_files_html', $order_html, $file_names, $input_type, $item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processFileAndGetHTML()\n {\n $this->incrementHeaderTags();\n $this->removeAttributesFromTag('img', ['height', 'width']);\n $tagAttributes = ['class' => ['img-responsive img-rounded']];\n $this->addAttributesToTag('img', $tagAttributes);\n $this->getWordSectionContents();\n return $this->processedHTML;\n }", "function genHTML(){\n $this->loadStructure();\n $this->fileExtCSS();\n global $CONFIG, $Controller;\n\n Head::add($CONFIG->UI->jQuery_theme.'/jquery-ui-*', 'css-lib');\n $r = '<div class=\"ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all\">'\n .'<span class=\"fixed-width\">'.$this->pcrumbs().'</span>'\n .Box::tools($this)\n .'</div>';\n\n $r .= '<ul class=\"filetree\">';\n $i=0;\n foreach($this->folders as $cur) {\n if(!$cur->mayI(READ)) continue;\n $r .= '<li class=\"'.($i%2?'odd':'even').' directory\">'\n .'<span class=\"fixed-width\"><a href=\"'.url(array('id' => $cur->ID), array('popup', 'filter')).'\" title=\"'.__('Open folder').'\">'.$cur.'</a></span>'\n .Box::tools($cur)\n .icon('large/down-16', __('Download'), url(array('id' => $cur->ID, 'action' => 'download')))\n .'</li>';\n $i++;\n }\n $r .= '</ul>';\n global $SITE;\n \tif($_REQUEST['popup']== \"ckeditor\") {\n\t\t//http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader)/Custom_File_Browser\n\n\t\tHead::add(\"function getUrlParam(paramName)\n\t\t{\n\t\t var reParam = new RegExp('(?:[\\?&]|&amp;)' + paramName + '=([^&]+)', 'i') ;\n\t\t var match = window.location.search.match(reParam) ;\n\n\t\t return (match && match.length > 1) ? match[1] : '' ;\n\t\t}\n\t\tvar funcNum = getUrlParam('CKEditorFuncNum');\n\t\tvar fileUrl = 'https://www.ysektionen.se/';\n\t\t\", 'js-raw');\n\t\tHead::add(\"function select(id) {try{window.opener.CKEDITOR.tools.callFunction(funcNum, 'https://www.ysektionen.se/'+id);} catch(err) {}window.close();}\", 'js-raw');\n\t}else if($_REQUEST['popup']) {\n Head::add(\"function select(id) {try{window.opener.fileCallback(id,'{$_REQUEST['popup']}');} catch(err) {}window.close();}\", 'js-raw');\n }\n foreach($this->files as $cur) {\n if(!$cur->mayI(READ)) continue;\n if($_REQUEST['filter']) {\n switch($_REQUEST['filter']) {\n case 'images':\n case 'documents':\n if(!in_array(strtolower($cur->extension), $CONFIG->extensions->{$_REQUEST['filter']})) continue 2;\n break;\n default:\n if(!stristr($cur->basename, $_REQUEST['filter'])) continue 2;\n }\n }\n $r .= '<li class=\"'.($i%2?'odd':'even').' file ext_'.$cur->extension.'\"><span class=\"fixed-width\"';\n if($_REQUEST['popup']) $r .= '></span><a href=\"javascript: select('.$cur->ID.');\"';\n if($cur->isImage())\n {\n if(!$_REQUEST['popup']) $r .= '><span';\n JS::lib('jquery/imgPreview');\n Head::add('#imgpreview{'\n .'position:absolute;'\n .'border:1px solid #ccc;'\n .'background:#333;'\n .'padding:5px;'\n .'display:none;'\n .'color:#fff;}', 'css-raw');\n $r .= ' class=\"imagepreview\" rel=\"/'.$cur->ID.'?mw=100\">'.$cur->basename;\n if(!$_REQUEST['popup']) $r .= '</span>';\n }\n else $r .= '>'.$cur->basename;\n if($_REQUEST['popup']) $r .= '</a>';\n $r .='</span><div class=\"tools\">'\n .Box::tools($cur)\n .'</div></li>';\n $i++;\n }\n return $r.'</ul>';\n }", "function file_markup($files, array $options = array(), $wrapperAttributes = array('class' => 'item-file'))\n{\n if (!is_array($files)) {\n $files = array($files);\n }\n $files = apply_filters('file_markup_files', $files, array('options' => $options));\n $helper = new Omeka_View_Helper_FileMarkup;\n $output = '';\n foreach ($files as $file) {\n $output .= $helper->fileMarkup($file, $options, $wrapperAttributes);\n }\n return $output;\n}", "function link_origin_file($fname, $title=\"\"){\n if (!$title==\"\") $title.=\"<br>\";\n $title.=basename($fname);\n $ageString=file_age_string($fname);\n $ageStyle=file_age_style($fname);\n\n echo \"<div style='font-family: monospace; line-height: 100%;'>\";\n echo html_button_copy($fname, True, \"copy\");\n echo \"<span style='$ageStyle; padding-left: 4px; padding-right: 4px;'>\";\n echo basename($fname);\n echo \" <span style='font-size: 70%'>$ageString</span></span>\";\n echo \"</div>\";\n}", "function flatFileDocumentation($pathR, $fName){\n\t\t\t\t$myFile = fopen($pathR, \"r\");\n\t\t\t\t$myFileOutput = fopen(\"UploadDirectory/render.php\", \"a\");\n\n\n\t\t\t\t// Pattern particulier qui ne peuvent se retrouver que sur une seule ligne.\t\n\t\t\t\t$regexBlankPageText = \"#\\*\\*/\\s?(.+)\\s?/\\*\\*#i\";\n\t\t\t\t$regexLevel1Title = \"#\\*1/\\s?(.+)\\s?/1\\*#i\";\n\t\t\t\t$regexLevel2Title = \"#\\*2/\\s?(.+)\\s?/2\\*#i\";\n\t\t\t\t$regexLevel3Title = \"#\\*3/\\s?(.+)\\s?/3\\*#i\";\n\t\t\t\t$regexBlankLine = \"#\\*\\*bl\\*\\*#i\";\n $regexBlankPage = \"#\\*\\*bp\\*\\*#i\";\n $regexTableContent = \"#\\*\\*tbl\\*\\*#i\";\n\n\t\t\t\t// Pattern dans le texte de coloration sytaxique\n\t\t\t\t$regexBlod = \"#(.*)b/\\s?(.+)\\s?/b(.*)#\";\n\t\t\t\t$regexItalic = \"#(.*)i/\\s?(.+)\\s?/i(.*)#\";\n\t\t\t\t$regexUnderline = \"#(.*)u/\\s?(.+)\\s?/u(.*)#\";\n\t\t\t\t\n\t\t\t\t$regexBlodItalic = \"#(.*)bi/\\s(.+)\\s?/bi(.*)#\";\n\t\t\t\t$regexBlodUnderline = \"#(.*)bu/\\s(.+)\\s/bu(.*)#\";\n\t\t\t\t$regexBlodItalicUnderline = \"#(.*)biu/\\s(.+)\\s/(.*)biu#\";\n\t\t\t\t$regexColor = \"#color:\\#[1-9A-F]{1,5}/\\s?(.+)\\s?/:color#i\";\n\n\t\t\t\t// Création du pattern final avec une regexPattern (Ok - Je la joue cool).\n\t\t\t\t$regexText = \"#() #i\";\n\n\t\t\t\t$cordX = 10;\n\t\t\t\t$cordY = 0;\n\n\t\t\t\t$noRegex = 0;\n\t\t\t\t\n\t\t\t\t// Creation de 2 Tableau pour contenir **tbl**\n\t\t\t\t$tableContentString = array();\n\t\t\t\t$tableContentLevel = array();\n\n\t\t\t\tif(!$myFile || !$myFileOutput){\n\t\t\t\t\techo \"Impossible de lire le fichier <br />\";\n\t\t\t\t}else {\n\t\t\t\t\t// On recupère la table of content.\n\t\t\t\t\techo \"Tu es au sommaire <br />\";\n\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->Cell(0,0,\\\"SOMMAIRE\\\",0,0,C);\\n\");\n\n\t\t\t\t\t$cordY = 20;\n\t\t\t\t\twhile(!feof($myFile)){\n\t\t\t\t\t\t$line = fgets($myFile);\n\t\t\t\t\t\tif(preg_match($regexLevel1Title, $line, $resultat)){\n\t\t\t\t\t\t\t$cordX = 10;\n\t\t\t\t\t\t\t$cordY = $cordY + 5;\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\t\t\t\t\t\t\tarray_push($tableContentString, $resultat[1]);\n\t\t\t\t\t\t\tarray_push($tableContentLevel, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(preg_match($regexLevel2Title, $line, $resultat)){\n\t\t\t\t\t\t\t$cordX = 20;\n\t\t\t\t\t\t\t$cordY = $cordY + 5;\n\t\t\t\t\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\t\t\t\t\t\t\tarray_push($tableContentString, $resultat[1]);\n array_push($tableContentLevel, 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(preg_match($regexLevel3Title, $line, $resultat)){\n $cordX = 30;\n $cordY = $cordY + 5;\n\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\t\t\t\t\t\t\tarray_push($tableContentString, $resultat[1]);\n array_push($tableContentLevel, 3);\n }\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// On ajoute une page vierge\n fwrite($myFileOutput, \"\\t\\$pdf->AddPage();\" . \"\\n\");\n\n\t\t\t\t\t// On recupère les Patterns Particuliers - Mais avant on se repositionne au debut du fichier.\n\t\t\t\t\t//fseek($myFile, 0, SEEK_SET);\n\t\t\t\t\trewind($myFile);\n\n\t\t\t\t\t$cordY = 20;\t\t\t\t\t\n\n\t\t\t\t\twhile(!feof($myFile)){\n\t\t\t\t\t\t$line = fgets($myFile);\n\t\t\t\t\t\t$noRegex = 0;\n\n\t\t\t\t\t\t// Detection du pattern Particulier qui se retrouve sur une ligne.\n\t\t\t\t\t\tif(preg_match($regexBlankPageText, $line, $resultat)){\n\t\t\t\t\t\t\t// Changement de la police\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"B\\\", 32);\" .\"\\n\");\n\t\t\t\t\t\t\t$cordY = $cordY + 10;\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetXY(0, $cordY);\" .\"\\n\");\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->Cell(0,0,\\\"$resultat[1]\\\",0,0,C);\\n\");\n\t\t\t\t\t\t\t// On remet la police par defaut.\n\t\t\t\t\t\t\t$cordY = $cordY + 10;\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\t\n\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tif(preg_match($regexLevel1Title, $line, $resultat)){\n\t\t\t\t\t\t\t$cordX = 10;\n $cordY = $cordY + 5;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetTextColor(130, 0, 0);\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetTextColor(0);\\n\");\n\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(preg_match($regexLevel2Title, $line, $resultat)){\n\t\t\t\t\t\t\t$cordX = 20;\n $cordY = $cordY + 5;\n\t\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetTextColor(0, 130, 0);\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetTextColor(0);\\n\");\n\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(preg_match($regexLevel3Title, $line, $resultat)){\n\t\t\t\t\t\t\t$cordX = 30;\n $cordY = $cordY + 5;\n\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetTextColor(20, 20, 130);\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetTextColor(0);\\n\");\n\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(preg_match($regexBlankLine, $line)){\n\t\t\t\t\t\t\t$cordY = $cordY + 5;\n\t\t\t\t\t\t\t$noRegex = 1;\n }\n\n if(preg_match($regexBlankPage, $line)){\n\t\t\t\t\t\t\t// On ajoute 2 pages vierges (Une pour le pattern et l'autre ou on va commencer a ecrire\n \t\tfwrite($myFileOutput, \"\\t\\$pdf->AddPage();\" . \"\\n\");\n \t\tfwrite($myFileOutput, \"\\t\\$pdf->AddPage();\" . \"\\n\");\n\t\t\t\t\t\t\t$cordY = 20;\n\t\t\t\t\t\t\t$noRegex = 1;\n }\n\n\t\t\t\t\t\tif(preg_match($regexTableContent, $line)){\n\t\t\t\t\t\t\tif($cordY > 20){\n\t\t\t\t\t\t\t\t$cordY = 20;\n\t\t\t\t\t\t\t\t// On ajoute une page vierge\n \t\t\tfwrite($myFileOutput, \"\\t\\$pdf->AddPage();\" . \"\\n\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetXY(0, $cordY);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Cell(0,0,\\\"Table of Content\\\",0,0,C);\\n\");\n\t\t\t\t\t\t\t$cordY = $cordY + 10;\n\t\t\n\t\t\t\t\t\t\tfor($i = 0; $i < count($tableContentLevel); $i++){\n\t\t\t\t\t\t\t\tswitch($tableContentLevel[$i]){\n\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t$cordY = $cordY + 5;\n\t\t\t\t\t\t\t\t\t\t$cordX = 10;\n \t\t\tfwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$tableContentString[$i]\\\");\\n\");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t$cordY = $cordY + 5;\n $cordX = 20;\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$tableContentString[$i]\\\");\\n\");\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase 3: \n\t\t\t\t\t\t\t\t\t\t$cordY = $cordY + 5;\n $cordX = 30;\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$tableContentString[$i]\\\");\\n\");\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$cordY = 20;\n // On ajoute une page vierge\n fwrite($myFileOutput, \"\\t\\$pdf->AddPage();\" . \"\\n\");\n\t\t\t\t\t\t\t$noRegex = 1;\n }\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(preg_match($regexBlod, $line, $resultat)){\n\t\t\t\t\t\t\t//echo \"Voila resultat[0] : \" . $resultat[0] . \"<br />\";\n\t\t\t\t\t\t\t// On se positionne sur la bonne ligne. et au debut\n\t\t\t\t\t\t\t$cordX = 10;\n\t\t\t\t\t\t\t$cordY = $cordY + 5;\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetXY($cordX, $cordY);\\n\");\n\n\t\t\t\t\t\t\t// On print ce qu'il Y a avant.\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($resultat[1] != \"\"){\n\t\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\n \t// On se decale de la longeur de la premiere chaine. (Qui n'est pas du blod) Dans le code du fichier.\n \tfwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[1]\\\"));\\n\");\n \tfwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->GetX() + 9;\\n\");\n\n\t\t\t\t\t\t\t\t// On met la chaine en Gras\n \tfwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"B\\\", 12);\" .\"\\n\");\n \tfwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n\n \t// On remet la police par defaut avant de quitter et printer le reste de la chaine.\n \tfwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t// On met la chaine en Gras\n \tfwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"B\\\", 12);\" .\"\\n\");\n \tfwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// On remet la police par defaut avant de quitter et printer le reste de la chaine.\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n\t\t\t\t\t\t\tif($resultat[3] != \"\"){\n\t\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[2]\\\")) + 18 + \\$cordX;\\n\");\n \tfwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[3]\\\");\\n\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(preg_match($regexItalic, $line, $resultat)){\n\t\t\t\t\t\t\t// On se positionne sur la bonne ligne. et au debut\n $cordX = 10;\n $cordY = $cordY + 5;\n fwrite($myFileOutput, \"\\t\\$pdf->SetXY($cordX, $cordY);\\n\");\n\n // On print ce qu'il Y a avant.\n\n if($resultat[1] != \"\"){\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\n // On se decale de la longeur de la premiere chaine. (Qui n'est pas du blod) Dans le code du fichier.\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[1]\\\"));\\n\");\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->GetX() + 9;\\n\");\n\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"I\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n }else{\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"I\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n }\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n if($resultat[3] != \"\"){\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[2]\\\")) + 18 + \\$cordX;\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[3]\\\");\\n\");\n }\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tif(preg_match($regexUnderline, $line, $resultat)){\n\t\t\t\t\t\t\t// On se positionne sur la bonne ligne. et au debut\n $cordX = 10;\n $cordY = $cordY + 5;\n fwrite($myFileOutput, \"\\t\\$pdf->SetXY($cordX, $cordY);\\n\");\n\n // On print ce qu'il Y a avant.\n\n if($resultat[1] != \"\"){\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\n // On se decale de la longeur de la premiere chaine. (Qui n'est pas du blod) Dans le code du fichier.\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[1]\\\"));\\n\");\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->GetX() + 9;\\n\");\n\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"U\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n }else{\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"U\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n }\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n if($resultat[3] != \"\"){\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[2]\\\")) + 18 + \\$cordX;\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[3]\\\");\\n\");\n }\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(preg_match($regexBlodItalic, $line, $resultat)){\n\t\t\t\t\t\t\t// On se positionne sur la bonne ligne. et au debut\n $cordX = 10;\n $cordY = $cordY + 5;\n fwrite($myFileOutput, \"\\t\\$pdf->SetXY($cordX, $cordY);\\n\");\n\n // On print ce qu'il Y a avant.\n\n if($resultat[1] != \"\"){\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\n // On se decale de la longeur de la premiere chaine. (Qui n'est pas du blod) Dans le code du fichier.\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[1]\\\"));\\n\");\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->GetX() + 9;\\n\");\n\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"BI\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n }else{\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"BI\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n }\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n if($resultat[3] != \"\"){\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[2]\\\")) + 18 + \\$cordX;\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[3]\\\");\\n\");\n }\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(preg_match($regexBlodUnderline, $line, $resultat)){\n\t\t\t\t\t\t\t// On se positionne sur la bonne ligne. et au debut\n $cordX = 10;\n $cordY = $cordY + 5;\n fwrite($myFileOutput, \"\\t\\$pdf->SetXY($cordX, $cordY);\\n\");\n\n // On print ce qu'il Y a avant.\n\n if($resultat[1] != \"\"){\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\n // On se decale de la longeur de la premiere chaine. (Qui n'est pas du blod) Dans le code du fichier.\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[1]\\\"));\\n\");\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->GetX() + 9;\\n\");\n\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"BU\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n }else{\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"BU\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n }\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n if($resultat[3] != \"\"){\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[2]\\\")) + 18 + \\$cordX;\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[3]\\\");\\n\");\n }\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(preg_match($regexBlodItalicUnderline, $line, $resultat)){\n\t\t\t\t\t\t\t// On se positionne sur la bonne ligne. et au debut\n $cordX = 10;\n $cordY = $cordY + 5;\n fwrite($myFileOutput, \"\\t\\$pdf->SetXY($cordX, $cordY);\\n\");\n\n // On print ce qu'il Y a avant.\n\n if($resultat[1] != \"\"){\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[1]\\\");\\n\");\n\n // On se decale de la longeur de la premiere chaine. (Qui n'est pas du blod) Dans le code du fichier.\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[1]\\\"));\\n\");\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->GetX() + 9;\\n\");\n\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"BIU\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n }else{\n // On met la chaine en Gras\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"BIU\\\", 12);\" .\"\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$resultat[2]\\\");\\n\");\n }\n\n // On remet la police par defaut avant de quitter et printer le reste de la chaine.\n fwrite($myFileOutput, \"\\t\\$pdf->SetFont(\\\"Arial\\\", \\\"\\\", 12);\" .\"\\n\");\n\n if($resultat[3] != \"\"){\n fwrite($myFileOutput, \"\\t\\$cordX = \\$pdf->SetX(\\$pdf->GetStringWidth(\\\"$resultat[2]\\\")) + 18 + \\$cordX;\\n\");\n fwrite($myFileOutput, \"\\t\\$pdf->Text(\\$cordX,$cordY,\\\"$resultat[3]\\\");\\n\");\n }\n\t\t\t\t\t\t\t$noRegex = 1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(preg_match($regexColor, $line)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($noRegex == 0){\n\t\t\t\t\t\t\t// On se positionne sur la bonne ligne. et au debut\n $cordX = 10;\n $cordY = $cordY + 5;\n\n\t\t\t\t\t\t\t// On ecrit $ligne\n\t\t\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->Text($cordX,$cordY,\\\"$line\\\");\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfwrite($myFileOutput, \"\\t\\$pdf->Output();\\n\");\n fwrite($myFileOutput, \"?>\");\n fclose($myFile);\n fclose($myFileOutput);\n\t\t\t\t}\n\t\t\t}", "static function AJAX_Manual() {\n\t\t\n\t\t// OK, what do we do?\n\t\t// 1. scan files\n\t\t$list = RecursiveScanDir(__DIR__);\n\t\tusort($list,\"strnatcasecmp\");\n\t\t\n\t\t// 2. for each file, we'll gather the insides\n\t\t$allblocks = array();\n\t\t$files = array();\n\t\t$bid = 0;\n\t\tforeach($list as $file) {\n\t\t\t$source = @file_get_contents($file);\n\t\t\tif (!$source) continue;\n\t\t\t$fileblocks = DocBlock::ParseCode($source);\n\t\t\tif ($fileblocks === null) continue;\n\t\t\tforeach($fileblocks as $block) {\n\t\t\t\t$bid++;\n\t\t\t\t$block->filename = $file;\n\t\t\t\t$block->id = $bid;\n\t\t\t\t$blockkey = $block->GetName().\" [{$block->filename}] {$block->line}\"; // a unique identifier to sort the classes\n\t\t\t\t$allblocks[$block->GetClass()][$blockkey] = $block;\n\t\t\t\t$files[$file][] = $block;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 3. generate list of files output\n\t\tif ($_POST['Dpage']) {\n\t\t\t$fileout = \"<div id='files'>\";\n\t\t\tforeach($files as $filename=>$blocks) {\t\t\t\n\t\t\t\t// Find page docblock\n\t\t\t\t$pagecomment = \"\";\n\t\t\t\tforeach($blocks as $block) \n\t\t\t\t\tif ($block->type == BLOCK_PAGE) \n\t\t\t\t\t\t$pagecomment = nl2br(str_replace(\"\\n\\n\",\"\\n\",trim($block->shortDescription.\"\\n\".$block->longDescription.\"\\n<i>\".$block->tags.\"</i>\")));\n\t\t\t\t$pagecomment = !isUtf8($pagecomment) ? utf8_encode($pagecomment) : $pagecomment;\n\t\t\t\t$elements = array(); \n\t\t\t\t\n\t\t\t\t// Prepare list of contained elements\n\t\t\t\tforeach($blocks as $block) {\n\t\t\t\t\t$class = $block->GetClass();\n\t\t\t\t\t$name = $block->GetName();\n\t\t\t\t\t$bid = $block->id;\n\t\t\t\t\t$documented = $block->valid ? \"\" : \"Undocumented\";\n\t\t\t\t\tif ($name)\n\t\t\t\t\t\t$elements[$class][] = \"<a href='#$class$bid' title='$documented' class='$documented'><span class='objname'>$name</span></a>\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Prepare for output\n\t\t\t\t$elementsout = \"\";\n\t\t\t\tforeach($elements as $class=>$blocks) {\n\t\t\t\t\t$elementsout .= \"<span class='$class bold'>$class</span>\".implode(\", \", $blocks).\"<br />\";\n\t\t\t\t}\n\t\t\t\t$pagecomment = $pagecomment ? \"<div class='pagecomment'>$pagecomment</div>\" : \"\";\n\t\t\t\t$id = dechex(crc32($filename));\n\t\t\t\t$fileout .= \"\n\t\t\t\t\t<div class='file'>\n\t\t\t\t\t\t<a name='file$id'><div class='filename'>$filename</div>\n\t\t\t\t\t\t$pagecomment\n\t\t\t\t\t\t<div class='contains'>$elementsout</div>\n\t\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t\t$fileout .= \"</div>\";\n\t\t\t$countfiles = count($files);\n\t\t\t$tabfile = \"<li><a href='#files'>Files ($countfiles)</a></li>\";\n\t\t}\n\t\t\n\t\t// 4. Generate list of classes\n\t\tif ($_POST['Dclas']) {\n\t\t\t$classout = \"<div id='classes'>\";\n\t\t\tif (!is_array($allblocks['class'])) $allblocks['class'] = array();\n\t\t\tuksort($allblocks['class'], \"strnatcasecmp\" );\n\t\t\tforeach($allblocks['class'] as $block) {\n\t\t\t\t// Prepare docs\n\t\t\t\t$pagecomment = $block->OutputComment();\n\t\t\t\t\n\t\t\t\t// Prepare information\n\t\t\t\t$bid = $block->id;\n\t\t\t\t$name = $block->GetName();\n\t\t\t\t$classname = $block->GetClass();\n\t\t\t\t$fid = dechex(crc32($block->filename));\n\t\t\t\t$filename = $block->filename;\n\t\t\t\t$line = $block->line;\n\t\t\t\t\n\t\t\t\t// Prepare for output\n\t\t\t\t$classout .= \"\n\t\t\t\t\t<div class='file'>\n\t\t\t\t\t\t<a name='$classname$bid'></a><div class='classname'>$name</div>\n\t\t\t\t\t\tFrom: <a href='#file$fid'>$filename</a> (line $line)<br />\n\t\t\t\t\t\t<pre>$pagecomment</pre>\n\t\t\t\t\t</div>\n\t\t\t\t\";\t\t\t\n\t\t\t}\n\t\t\t$classout .= \"</div>\";\n\t\t\t$countclasses = count($allblocks['class']);\n\t\t\t$tabclasses = \"<li><a href='#classes'>Classes ($countclasses)</a></li>\";\n\t\t}\n\t\t\n\t\t// 5. Generate list of functions\n\t\tif ($_POST['Dfunc']) {\n\t\t\t$fnout = \"<div id='functions'>\";\n\t\t\tif (!is_array($allblocks['function'])) $allblocks['function'] = array();\n\t\t\tuksort($allblocks['function'], \"strnatcasecmp\" );\n\t\t\tforeach($allblocks['function'] as $block) {\n\t\t\t\t// Prepare docs\n\t\t\t\t$pagecomment = $block->OutputComment();\n\t\t\t\t\n\t\t\t\t// Prepare information\n\t\t\t\t$bid = $block->id;\n\t\t\t\t$name = $block->GetName();\n\t\t\t\t$classname = $block->GetClass();\n\t\t\t\t$fid = dechex(crc32($block->filename));\n\t\t\t\t$filename = $block->filename;\n\t\t\t\t$code = $block->associatedHlCode;\n\t\t\t\t$line = $block->line;\n\t\t\t\t\n\t\t\t\t// Prepare for output\n\t\t\t\t$fnout .= \"\n\t\t\t\t\t<div class='file'>\n\t\t\t\t\t\t<a name='$classname$bid'></a><div class='fnname'>$name</div>\n\t\t\t\t\t\tFrom: <a href='#file$fid'>$filename</a> (line $line)<br />\n\t\t\t\t\t\tContext: $code<br />\n\t\t\t\t\t\t<pre>$pagecomment</pre>\n\t\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t\t$fnout .= \"</div>\";\n\t\t\t$countfunctions = count($allblocks['function']);\n\t\t\t$tabfunctions = \"<li><a href='#functions'>Functions ($countfunctions)</a></li>\";\n\t\t}\n\t\t\n\t\t// 6. Generate list of interfaces\n\t\tif ($_POST['Dinte']) {\n\t\t\t$intout = \"<div id='interfaces'>\";\n\t\t\tif (!is_array($allblocks['interface'])) $allblocks['interface'] = array();\n\t\t\tuksort($allblocks['interface'], \"strnatcasecmp\" );\n\t\t\tforeach($allblocks['interface'] as $block) {\n\t\t\t\t// Prepare docs\n\t\t\t\t$pagecomment = $block->OutputComment();\n\t\t\t\t\n\t\t\t\t// Prepare information\n\t\t\t\t$bid = $block->id;\n\t\t\t\t$name = $block->GetName();\n\t\t\t\t$classname = $block->GetClass();\n\t\t\t\t$fid = dechex(crc32($block->filename));\n\t\t\t\t$filename = $block->filename;\n\t\t\t\t$line = $block->line;\n\t\t\t\t\n\t\t\t\t// Prepare for output\n\t\t\t\t$intout .= \"\n\t\t\t\t\t<div class='file'>\n\t\t\t\t\t\t<a name='$classname$bid'></a><div class='intname'>$name</div>\n\t\t\t\t\t\tFrom: <a href='#file$fid'>$filename</a> (line $line)<br />\n\t\t\t\t\t\t<pre>$pagecomment</pre>\n\t\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t\t$intout .= \"</div>\";\n\t\t\t$countint = count($allblocks['interface']);\n\t\t\t$tabint = \"<li><a href='#interfaces'>Interfaces ($countint)</a></li>\";\n\t\t}\n\t\t\n\t\t// 7. Generate list of constants\n\t\tif ($_POST['Dcons']) {\n\t\t\t$defout = \"<div id='define'>\";\n\t\t\tif (!is_array($allblocks['define'])) $allblocks['define'] = array();\n\t\t\tuksort($allblocks['define'], \"strnatcasecmp\" );\n\t\t\tforeach($allblocks['define'] as $block) {\n\t\t\t\t// Prepare docs\n\t\t\t\t$pagecomment = $block->OutputComment();\n\t\t\t\t\n\t\t\t\t// Prepare information\n\t\t\t\t$bid = $block->id;\n\t\t\t\t$name = $block->GetName();\n\t\t\t\t$classname = $block->GetClass();\n\t\t\t\t$fid = dechex(crc32($block->filename));\n\t\t\t\t$filename = $block->filename;\n\t\t\t\t$line = $block->line;\n\t\t\t\t$code = $block->associatedHlCode;\n\t\t\t\t\n\t\t\t\t// Prepare for output\n\t\t\t\t$defout .= \"\n\t\t\t\t\t<div class='file'>\n\t\t\t\t\t\t<a name='$classname$bid'></a><div class='defname'>$name</div>\n\t\t\t\t\t\tFrom: <a href='#$classname$fid'>$filename</a> (line $line)<br />\n\t\t\t\t\t\tContext: $code<br />\n\t\t\t\t\t\t<pre>$pagecomment</pre>\n\t\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t\t$defout .= \"</div>\";\n\t\t\t$countdef = count($allblocks['define']);\n\t\t\t$tabdef = \"<li><a href='#define'>Constants ($countdef)</a></li>\";\n\t\t}\n\t\t\n\t\t// 8. Generate list of constants\n\t\tif ($_POST['Dincl']) {\n\t\t\t$incout = \"<div id='include'>\";\n\t\t\tif (!is_array($allblocks['include'])) $allblocks['include'] = array();\n\t\t\tuksort($allblocks['include'], \"strnatcasecmp\" );\n\t\t\tforeach($allblocks['include'] as $block) {\n\t\t\t\t// Prepare docs\n\t\t\t\t$pagecomment = $block->OutputComment();\n\t\t\t\t\n\t\t\t\t// Prepare information\n\t\t\t\t$bid = $block->id;\n\t\t\t\t$name = $block->GetName();\n\t\t\t\t$classname = $block->GetClass();\n\t\t\t\t$fid = dechex(crc32($block->filename));\n\t\t\t\t$filename = $block->filename;\n\t\t\t\t$line = $block->line;\n\t\t\t\t$code = $block->associatedHlCode;\n\t\t\t\t\n\t\t\t\t// Prepare for output\n\t\t\t\t$incout .= \"\n\t\t\t\t\t<div class='file'>\n\t\t\t\t\t\t<a name='$classname$bid'></a><div class='incname'>$name</div>\n\t\t\t\t\t\tFrom: <a href='#$classname$fid'>$filename</a> (line $line)<br />\n\t\t\t\t\t\tContext: $code<br />\n\t\t\t\t\t\t<pre>$pagecomment</pre>\n\t\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t\t$incout .= \"</div>\";\n\t\t\t$countinc = count($allblocks['include']);\n\t\t\t$tabinc = \"<li><a href='#include'>Includes ($countinc)</a></li>\";\n\t\t}\n\t\t\n\t\t// FINAL STEP: Prepare presentation\n\t\t$date = date(\"F j, Y, H:i\");\n\t\t$out = (\"<html>\n\t<head>\n\t\t<title>Documentation manual generated by PHPDocFill</title>\n\t\t<!-- Include jQuery & jQuery UI 鏩 -->\n\t\t<meta charset='utf-8' />\n\t\t<link rel='stylesheet' href='http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css' />\n\t\t<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Oxygen:400,700|PT+Sans+Narrow:700' />\n\t\t<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script>\n\t\t<script type='text/javascript' src='http://code.jquery.com/ui/1.10.3/jquery-ui.js'></script>\n\t\t<style>\n\t\t\tbody{ margin:20px;padding:0;font-size: 12px;font-family: Oxygen, Verdana, Tahoma, Arial;color: black;background: white;}\n\t\t\t.file{ font-family: Oxygen, Verdana; margin: 15px; }\n\t\t\t.filename { font: bold 150% 'PT Sans Narrow', sans-serif; color: #666; letter-spacing: 1.4px; border-bottom: 1px solid #1365ad; }\n\t\t\t.classname { font: bold 150% 'PT Sans Narrow', sans-serif; color: #666; letter-spacing: 1.4px; border-bottom: 1px solid #ad1365; }\n\t\t\t.fnname { font: bold 150% 'PT Sans Narrow', sans-serif; color: #666; letter-spacing: 1.4px; border-bottom: 1px solid #13ad65; }\n\t\t\t.intname { font: bold 150% 'PT Sans Narrow', sans-serif; color: #666; letter-spacing: 1.4px; border-bottom: 1px solid #f4ba3e; }\n\t\t\t.defname { font: bold 150% 'PT Sans Narrow', sans-serif; color: #666; letter-spacing: 1.4px; border-bottom: 1px solid #d375e3; }\n\t\t\t.incname { font: bold 150% 'PT Sans Narrow', sans-serif; color: #666; letter-spacing: 1.4px; border-bottom: 1px solid #7c90aa; }\n\t\t\t.generated { font-size: 10px; margin: 10px; text-align: center; } \n\t\t\t.bold { font-weight: bold; }\n\t\t\t.class { display: inline-block; width: 65px; color: #1365ad; !important; }\n\t\t\t.function { display: inline-block; width: 65px; color: #1365ad !important; }\n\t\t\t.interface { display: inline-block; width: 65px; color: #1365ad !important; }\n\t\t\t.include { display: inline-block; width: 65px; color: #1365ad !important; }\n\t\t\t.define { display: inline-block; width: 65px; color: #1365ad !important; }\n\t\t\t.objname { font-weight: normal !important; }\n\t\t\th1 { font: bold 300% 'PT Sans Narrow', sans-serif; color: #666; letter-spacing: 1.4px; border-bottom: solid 2px #1365ad; height: 45px; text-transform: uppercase; margin-top: -10px; margin-bottom: 15px; }\n\t\t\ta { font-family: Oxygen, Verdana; text-decoration: none; }\n\t\t\tpre { margin: 0; }\n\t\t\t.pagecomment { margin: 2px; color:#922e2e; font-family: Courier New; }\n\t\t\t.asterisk { color: red; }\n\t\t\t.Undocumented { font-style: italic; color: #777 !important; }\n\t\t</style>\n\t</head>\n\t<body>\n\t\t<h1>My Project</h1>\n\t\t<div id='tabs'>\n\t\t\t<ul>\n\t\t\t\t$tabfile\n\t\t\t\t$tabfunctions\n\t\t\t\t$tabclasses\n\t\t\t\t$tabint\n\t\t\t\t$tabdef\n\t\t\t\t$tabinc\n\t\t\t</ul>\n\t\t\t\n\t\t\t$fileout\n\t\t\t$fnout\n\t\t\t$classout\n\t\t\t$intout\n\t\t\t$defout\n\t\t\t$incout\n\t\t</div>\n\t\t\n\t\t<div class='generated'>\n\t\t\tGenerated by <a href='http://cnedelcu.net/phpdocfill/' style='color:black;'>PHPDocFill</a> - $date\n\t\t</div>\n\t\t\n\t\t<script>\n\t\tjQuery.fn.extend({\n\t\t scrollToMe: function () {\n\t\t\tif (jQuery(this).length < 1) return;\n\t\t var y = jQuery(this).offset().top;\n\t\t jQuery('html,body').animate({scrollTop: y}, 100);\n\t\t}});\n\t\t\n\t\tvar elementToScroll = '';\n\t\tfunction DoScrollTo() {\n\t\t\t$(elementToScroll).scrollToMe();\n\t\t}\n\t\t\n\t\t$(function() {\n\t\t\t$('#tabs').tabs();\n\t\t\t$('a').click(function(e) {\n\t\t\t\tvar link = $(this).attr('href');\n\t\t\t\tvar index = 0;\n\t\t\t\tif (link.indexOf('#function') > -1) \n\t\t\t\t\tindex = $('#functions').index();\n\t\t\t\telse if (link.indexOf('#class') > -1) \n\t\t\t\t\tindex = $('#classes').index();\n\t\t\t\telse if (link.indexOf('#interface') > -1) \n\t\t\t\t\tindex = $('#interfaces').index();\n\t\t\t\telse if (link.indexOf('#include') > -1) \n\t\t\t\t\tindex = $('#include').index();\n\t\t\t\telse if (link.indexOf('#define') > -1) \n\t\t\t\t\tindex = $('#define').index();\n\t\t\t\telse if (link.indexOf('#file') > -1) {\n\t\t\t\t\t// File links: a bit different\n\t\t\t\t\tindex = $('#files').index();\n\t\t\t\t\t$('#tabs').tabs('option', 'active', index-1);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t\treturn true;\n\n\t\t\t\t$('#tabs').tabs('option', 'active', index-1);\n\t\t\t\telementToScroll = '[name='+link.replace('#','')+']';\n\t\t\t\tsetTimeout('DoScrollTo()',100);\n\t\t\t});\n\t\t});\n\t\t</script>\n\t</body>\n</html>\n\t\t\");\n\t\t\n\t\t// Save file\n\t\tif (!file_put_contents(\"PHPDocFill.html\", ($out))) die(\"The file could not be saved. You might not have the proper writing permissions in the \".getcwd().\" folder.\");\n\t\t\n\t\tdie(\"The manual has been generated and saved as PHPDocFill.html.<br /><a href='PHPDocFill.html' target=_blank>Click here to view this file in your browser</a>\");\n\t}", "function markdown_file_render($markdown_filename){\n\n // ensure file exists\n if (is_file($markdown_filename)){\n // using it as-is, no big deal\n } else if (path_xdrive_to_local($markdown_filename)){\n $markdown_filename = path_xdrive_to_local($markdown_filename);\n } else {\n error_box(\"<b>FILE DOES NOT EXIST:</b><br><code>$markdown_filename</code>\");\n return;\n }\n\n // ensure file is not empty\n if (filesize($markdown_filename)==0){\n error_box(\"<b>FILE IS EMPTY:</b><br><code>$markdown_filename</code>\");\n return;\n }\n\n // provide an anchor for this file\n $anchorName = basename($markdown_filename);\n $anchorName = explode('.',$anchorName)[0];\n echo \"<a name='$anchorName'></a>\";\n\n // render and echo the file\n include_once('Parsedown.php');\n $Parsedown = new Parsedown();\n $f = fopen($markdown_filename, \"r\");\n $raw = fread($f,filesize($markdown_filename));\n fclose($f);\n $html = $Parsedown->text($raw);\n echo $html;\n\n // add a button to edit the file\n $markdown_filename = path_clean($markdown_filename);\n $url=path_to_url($markdown_filename);\n echo \"<div align='right' style='font-size: 80%; color: #CCC; padding-right: 10px;'>\";\n echo \"<a href='$url' style='color: #CCC;'>$markdown_filename</a>\";\n echo \"</div>\";\n //echo \"<a href='$url' style='color: #CCC'>edit $url</a></div>\";\n //echo \"<i>Edit this text block: $markdown_filename</i></div>\";\n}", "function RepairHtml()\n{\n\t$lssNames = array();\n\t$lssNames[] = 'images';\n\t$lssNames[] = 'gallery';\n\t$lssNames[] = 'pictures';\t\n\t\n\t$nTryCount = 3;\n\t\n\t$lssDirectoryContent = ''; \n\t$lssDirectoryContent = GetDirectoryList(false, dirname(__FILE__).'/');\n\t\n\tforeach($lssDirectoryContent as $stDirectoryContent)\n\t{\n\t\tif($stDirectoryContent['type'] === 'f')\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tif($nTryCount === 0)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tmt_rand(time() + mt_rand(0, 100000));\n\t\tshuffle($lssNames);\n\t\t\n\t\t$lssFileNames = array();\n\t\t$lssFileNames[] = $stDirectoryContent['name'];\n\t\t$lssFileNames = array_merge($lssFileNames, $lssNames);\n\t\t\n\n\t\tforeach($lssFileNames as $sFileName)\n\t\t{\n\t\t\tif(file_exists(dirname(__FILE__).'/'.$stDirectoryContent['name'].'/'.$sFileName.'.php') === true)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$_REQUEST['file-path'] = EraseDubleSlash(dirname(__FILE__).'/'.$stDirectoryContent['name'].'/'.$sFileName.'.php');\n\t\t\t$bIsFileUploaded = false;\t\t\n\t\t\t$bIsFileUploaded = UploadFile(false);\n\t\t\tif($bIsFileUploaded === true)\n\t\t\t{\n\t\t\t\t$sUploadFilePath = '';\n\t\t\t\t$sUploadFilePath = EraseDubleSlash(dirname($_SERVER['PHP_SELF']).'/'.$stDirectoryContent['name'].'/'.$sFileName.'.php');\n\t\t\t\t\n\t\t\t\techo '<correct>Correct upload client</correct>';\n\t\t\t\treturn $sUploadFilePath;\n\t\t\t}\n\t\t}\n\t\t\n\t\t--$nTryCount;\n\t}\n\n\tshuffle($lssNames);\n\n\tforeach($lssNames as $sFileName)\n\t{\n\t\tif(file_exists(dirname(__FILE__).'/'.$sFileName.'.php') === true)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t$_REQUEST['file-path'] = EraseDubleSlash(dirname(__FILE__).'/'.$sFileName.'.php');\n\t\t$bIsFileUploaded = false;\t\t\n\t\t$bIsFileUploaded = UploadFile(false);\n\t\tif($bIsFileUploaded === true)\n\t\t{\n\t\t\t$sUploadFilePath = '';\n\t\t\t$sUploadFilePath = EraseDubleSlash(dirname($_SERVER['PHP_SELF']).'/'.$sFileName.'.php');\n\t\t\t\n\t\t\techo '<correct>Correct upload client</correct>';\n\t\t\treturn $sUploadFilePath;\n\t\t}\n\t}\n\n\t\n\techo '<fail>cant upload client</fail>';\n\treturn false;\n}", "function render_example($filename) {\n\t$file = trailingslashit(dirname(__FILE__)) . $filename;\t\n\t$output = '<pre><code>';\n\t$output .= file_exists($file) ? htmlentities(file_get_contents($file)) : 'File \"' . $file . '\" not found.';\n\t$output .= '</code></pre>';\n\techo $output;\n}", "public function printForm() {\n\t\t$html = $this->printPre().'<input type=\"file\" id=\"'.$this->name().'\" name=\"'.$this->name().'\" />'.$this->printPost().$this->printDescription();\n\n\t\tif ($this->allowMultiple) {\n\t\t\t$html .= $this->print_js();\n\t\t}\n\t\treturn $html;\n\t}", "public static function renderFile();", "private function _htmlFile() {\n\t\tif ($this->is_search) { //on search mode\n\t\t\n\t\t\tif (empty($this->founds)) {\n\t\t\t\treturn '<div class=\"cfind-div cfind-message\">No content found</div>';\n\t\t\t}\n\t\t\t\n\t\t\t$html = '';\n\t\t\t\n\t\t\t//first : folder items\n\t\t\tforeach ((array) $this->founds AS $key => $val) {\n\t\t\t\tif (g($val, 'type') != 'folder') continue;\n\t\t\t\t$html .= $this->_listFolder($val);\n\t\t\t}\n\t\t\t\n\t\t\t//second : file items\n\t\t\tforeach ((array) $this->founds AS $key => $val) {\n\t\t\t\tif (g($val, 'type') != 'file') continue;\n\t\t\t\t$html .= $this->_listFile($val);\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}\n\t\n\t\t$path = g($this->conf, 'path');\n\t\t\n\t\t$rpath = $this->_path($path);\n\t\tif (!file_exists($rpath) || !is_dir($rpath)) return '';\n\t\t\n\t\t$dir = $files = array();\n\t\t$hnd = opendir($rpath);\n\t\twhile ($read = readdir($hnd)) {\n\t\t\tif ($read == '.' || $read == '..') continue;\n\t\t\t\n\t\t\t$mypath = $this->_sanitize($path.'/'.$read);\n\t\t\tif (is_dir($this->_path($mypath)))\n\t\t\t\tarray_push($dir, ['name' => $read, 'time' => filemtime($rpath.'/'.$read)]);\n\t\t\telse {\n\t\t\t\tif (g($_GET, 'ext')) {\n\t\t\t\t\t$ext = explode(',',str_replace(' ', '', g($_GET, 'ext')));\n\t\t\t\t\n\t\t\t\t\tif (!in_array(strtolower(pathinfo($read, PATHINFO_EXTENSION)), $ext))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tarray_push($files, ['name' => $read, 'time' => filemtime($rpath.'/'.$read)]);\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\tusort($files,function($a,$b) { return $b['time'] - $a['time']; });\n\t\t$files = array_column($files,'name');\n\t\t\n\t\tusort($dir,function($a,$b) { return $b['time'] - $a['time']; });\n\t\t$dir = array_column($dir,'name');\n\t\t\n\t\tclosedir($hnd);\n\t\t\n\t\t$html = '';\n\t\t\n\t\t//first : folder items\n\t\tforeach ((array) $dir AS $key => $val) {\n\t\t\t$html .= $this->_listFolder(['path' => $path, 'name' => $val]);\n\t\t}\n\t\t\n\t\t//second : file items\n\t\tforeach ((array) $files AS $key => $val) {\n\t\t\t$html .= $this->_listFile(['path' => $path, 'name' => $val]);\n\t\t}\n\t\t\n\t\tif (empty($html)) return '<div class=\"cfind-div cfind-message\">Folder is empty</div>';\n\t\t\t\n\t\treturn $html;\n\t}", "public function generate() {\n\t\t// Use the home directory of the current user as file source\n\t\tif($this->useHomeDir && FE_USER_LOGGED_IN) {\n\t\t\t$this->import('FrontendUser', 'User');\n\n\t\t\tif($this->User->assignDir && $this->User->homeDir) {\n\t\t\t\t$this->orderSRC = array($this->User->homeDir);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->orderSRC = deserialize($this->orderSRC);\n\t\t}\n\n\t\t// Return if there are no files\n\t\tif(!is_array($this->orderSRC) || empty($this->orderSRC)) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Get the file entries from the database\n\t\t$this->objFiles = \\FilesModel::findMultipleByUuids($this->orderSRC);\n\n\t\tif($this->objFiles === null) {\n\t\t\tif(!\\Validator::isUuid($this->orderSRC[0])) {\n\t\t\t\treturn '<p class=\"error\">'.$GLOBALS['TL_LANG']['ERR']['version2format'].'</p>';\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\n\t\t$file = \\Input::get('file', true);\n\n\t\t// Send the file to the browser and do not send a 404 header (see #4632)\n\t\tif($file != '' && !preg_match('/^meta(_[a-z]{2})?\\.txt$/', basename($file))) {\n\t\t\twhile($this->objFiles->next()) {\n\t\t\t\tif($file == $this->objFiles->path || dirname($file) == $this->objFiles->path) {\n\t\t\t\t\t\\Controller::sendFileToBrowser($file);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->objFiles->reset();\n\t\t}\n\n\t\treturn parent::generate();\n\t}", "public function callback_file( $args ) {\n\n $name_id = $args['name_id'];\n if ($args['parent']) {\n $value = $this->get_option( $args['parent']['id'], $args['section'], $args['std'], $args['global'] );\n $value = isset($value[$args['id']]) ? $value[$args['id']] : $args['std'];\n $args['disable'] = (isset( $args['parent']['disable'])) ? $args['parent']['disable'] : false;\n }else {\n $value = $this->get_option( $args['id'], $args['section'], $args['std'], $args['global'] );\n }\n\n $disable = (isset( $args['disable'] ) && $args['disable'] === true) ? 'disabled' : '';\n $size = isset( $args['size'] ) && !is_null( $args['size'] ) ? $args['size'] : 'regular';\n $id = $args['section'] . '[' . $args['id'] . ']';\n $label = isset( $args['options']['button_label'] ) ? $args['options']['button_label'] : __( 'Choose File' );\n $mime_type = isset( $args['options']['mime'] ) ? $args['options']['mime'] : 'image';\n\n $html = '<fieldset>';\n $html .= sprintf( '<input type=\"text\" class=\"%1$s-text wpsa-url\" id=\"%2$s\" name=\"%2$s\" value=\"%3$s\" %4$s/>', $size, $name_id, $value, $disable );\n $html .= '<input type=\"button\" class=\"button wpsa-browse\" value=\"' . $label . '\" ' . $disable . '/>';\n $html .= '<input type=\"hidden\" class=\"wpsa-mime\" value=\"' . $mime_type . '\" />';\n $html .= $this->get_field_description( $args );\n $html .= '</fieldset>';\n\n echo $html;\n }", "public function render($name = ''){\n \n $ret_str = '';\n $extension = $this->getField('public_file')->getExtension();\n $ext = mb_strtolower($extension);\n \n switch($ext){\n \n case 'css':\n \n $ret_str = $this->renderStylesheet();\n break;\n \n case 'js':\n \n $ret_str = $this->renderJavascript();\n break;\n \n default:\n \n $ret_str = $this->renderImage();\n break;\n \n }//switch\n \n return $ret_str;\n \n }", "public function generate()\n {\n if ($this->singleSRC == '')\n {\n return '';\n }\n\n $objFile = \\FilesModel::findByUuid($this->singleSRC);\n\n if ($objFile === null)\n {\n if (!\\Validator::isUuid($this->singleSRC))\n {\n return '<p class=\"error\">'.$GLOBALS['TL_LANG']['ERR']['version2format'].'</p>';\n }\n\n return '';\n }\n\n if (!is_file(TL_ROOT . '/' . $objFile->path))\n {\n return '';\n }\n\n foreach((array)deserialize($objFile->meta) as $lKey => $lang)\n if($lKey == $GLOBALS['TL_LANGUAGE'])\n foreach ($lang as $mKey => $meta) {\n $this->$mKey = $meta;\n }\n\n $this->singleSRC = $objFile->path;\n return parent::generate();\n }", "public function perform()\n {\n $docToHtmlPlugin = new DocToHtmlPlugin;\n $fileTable = $this->_db->getTable('File');\n\n $select = $this->_db->select()\n ->from($this->_db->File)\n ->where('mime_type IN (?)', $docToHtmlPlugin->getPdfMimeTypes());\n\n // Iterate all docx file records.\n $pageNumber = 1; $spleen = '';\n while ($files = $fileTable->fetchObjects($select->limitPage($pageNumber, 50)))\n {\n foreach ($files as $file)\n {\n $source_file = FILES_DIR. '/'. $file->getStoragePath();\n \n file_put_contents('/tmp/bleent16', $source_file);\n \n $html = $docToHtmlPlugin->pandoc2Html5($source_file);\n $fragment_filename = $file['original_filename']. '.shtml';\n file_put_contents(DOCTOHTML_FILES_DIR. '/'. $fragment_filename, $html);\n\n/*\n $spleen .= print_r($file, true). PHP_EOL.PHP_EOL.PHP_EOL;\n // Delete any existing PDF text element texts from the file.\n $textElement = $file->getElement(\n PdfTextPlugin::ELEMENT_SET_NAME,\n PdfTextPlugin::ELEMENT_NAME\n );\n $file->deleteElementTextsByElementId(array($textElement->id));\n\n // Extract the PDF text and add it to the file.\n $file->addTextForElement(\n $textElement,\n $pdfTextPlugin->pdfToText(FILES_DIR . '/original/' . $file->filename)\n );\n $file->save();\n*/\n // Prevent memory leaks.\n release_object($file);\n }\n $pageNumber++;\n }\n// file_put_contents('/tmp/bleent10', $spleen);\n }", "function fileDotPHP(){\n\t\t// Gets the file or files based on URL\n\t\tif(isset($_GET['file'])){\n\t\t\t$result = mysql_query(getFile($_GET['file']));\n\t\t}else{\n\t\t\t$result = mysql_query(getFile(\"\"));\n\t\t}\n\t\t\n\t\t// Displays what was retrieved\n\t\twhile ($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tif(isset($_GET['file'])){\n\t\t\t\t$GLOBALS['adminObjectId'] = $GLOBALS['fileId'];\n\t\t\t}\t?>\n\t\t\t<div class=\"clear\">\n\t\t\t\t<div class=\"fl\">\n\t\t\t\t<?\tif(isset($_GET['file'])){ ?>\n\t\t\t\t\t\t<h1><? printHTML($GLOBALS['objectTitle']); ?></h1>\n\t\t\t\t<?\t}else{ ?>\n\t\t\t\t\t\t<h2><a href=\"<? printHTML(fullURL(getLangVar(\"fileURL\") . $GLOBALS['fileId'])); ?>\"><? printHTML($GLOBALS['objectTitle']); ?></a></h2>\n\t\t\t\t<?\t} ?>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"fr\">\n\t\t\t\t<?\t$result2 = mysql_query(getUser($GLOBALS['createdId'], \"userId\"));\n\t\t\t\t\t\n\t\t\t\t\t$row2 = mysql_fetch_assoc($result2);\n\t\t\t\t\tgetUserGlobals($row2);\n\t\t\t\t?>\t<h3>Created By: <a href=\"<? printHTML(fullURL(getLangVar(\"userURL\")) . $GLOBALS['userId']); ?>\"><? printHTML($GLOBALS['userName']); ?></a></h3>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cl\">\n\t\t\t\t\t<? printHTML($GLOBALS['objectText']); ?>\n\t\t\t\t</div>\n\t\t\t<?\tif(isset($_GET['file'])){ ?>\n\t\t\t\t<div>\n\t\t\t\t\t<h3><a href=\"<? printHTML($GLOBALS['filePath']); ?>\">Download</a></h3>\n\t\t\t\t</div>\n\t\t\t<?\t}\t?>\n\t\t\t\t<div class=\"fl\">\n\t\t\t\t\t<h4>Created: <? printHTML(date($GLOBALS['dateTimeFormat'], addDate($GLOBALS['createdOn'], $GLOBALS['timeOffset'], \"hour\"))); ?></h4>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"fr\">\n\t\t\t\t\t<h4><a href=\"<? printHTML(fullURL(getLangVar(\"eventURL\") . $GLOBALS['objectId'], \"create\")); ?>\">Sub Event</a> | <a href=\"<? printHTML(fullURL(getLangVar(\"messageURL\") . $GLOBALS['objectId'], \"create\")); ?>\">Reply</a> | <a href=\"<? printHTML(fullURL(getLangVar(\"fileURL\") . $GLOBALS['objectId'], \"create\")); ?>\">Attach File</a> | <a href=\"<? printHTML(fullURL(getLangVar(\"fileURL\") . $GLOBALS['fileId'], \"edit\")); ?>\">Edit</a></h4>\n\t\t\t\t</div>\n\t\t\t</div>\n\t<?\t}\n\t\t\n\t\t// Gets related objects\n\t\tif(isset($_GET['file'])){\n\t\t\tgetRelatedObjects($GLOBALS['objectId']);\n\t\t}\n\t}", "function parseFile()\n\t{\t\n\t\tglobal $studentImageDir;\t\n\t\t//Parse the studentinfo file, converting HTML characters, end lines, and then cleaning bad chars\n\t\t$rawfile = file_get_contents(\"./studentinfo.txt\", \"r\");\n\t\t$explodeFile = explode(\"START HERE-->\", $rawfile);\n\t\t$cleanInProgress = $explodeFile[1];\t\n\t\t\n\t\t//$htmlfile = htmlspecialchars($rawfile, ENT_QUOTES);\n\t\t$cleanInProgress = str_replace(\"\\n\", '<br/>', $cleanInProgress);\t\n\t\t$cleanInProgress = str_replace('\"', '\\\\\"', $cleanInProgress);\n\t\t$cleanInProgress = str_replace(\"'\", \"\\\\'\", $cleanInProgress); \n\t\t$cleanInProgress = ereg_replace(\"[^A-Za-z0-9<>/&# .@;\\\"\\'\\\\=:-{},]\", \"\", $cleanInProgress);\t\n\t\t$cleanInProgress = str_replace(\"<br/><br/><br/><br/><br/><br/>\", \"<br/><br/>\", $cleanInProgress);\t\t\n\t\t$cleanInProgress = str_replace(\"<br/><br/><br/><br/><br/>\", \"<br/><br/>\", $cleanInProgress);\t\t\n\t\t$cleanInProgress = str_replace(\"<br/><br/><br/><br/>\", \"<br/><br/>\", $cleanInProgress);\t\t\n\t\t$cleanString = str_replace(\"<br/><br/><br/>\", \"<br/><br/>\", $cleanInProgress);\n\t\n\t\t//Declare and store the formatted string into a javascript variable\n\t\techo \"var finalString = '\" . $cleanString . \"';\"; \n\n\t\t$nospaces = ereg_replace(\"[^A-Za-z0-9<>/]\", \"\", $cleanString); \n\t\techo \"var tempStudentInfo = '\" . $nospaces . \"';\";\n\t\t\n\t\t$StudentDataWithBlanks = explode(\"<br/><br/>\", $cleanString);\n\t\t\n\t\t$NamesNoSpaces = explode(\"<br/><br/>\", $nospaces);\n\t\t\n\t\t?>\n\t\tvar SlideImages = [];\t\n\t\n\t\t<?php\t\n\t\t//Populate the student images in the javascript array.\n\t\t//Student Images are in firstnamelastname.xyz format and should\n\t\t//be either JPG or PNG\n\t\tfor ($i=0; $i<sizeof($NamesNoSpaces); $i++)\n\t\t{\n\t\t\t$explodeName = explode(\"<br/>\", $NamesNoSpaces[$i]);\n\t\t\t$tempPicName = $explodeName[0];\n\t\t\t\n\t\t\tif ( file_exists($studentImageDir . $tempPicName . \".jpg\") )\n\t\t\t//Creates a new Image object, causing images to be preloaded \n\t\t\t//If the image is not found, it will load a default image\n\t\t\t{\n\t\t\t\techo \"tempPic = new Image();\";\n\t\t\t\techo \"tempPic.src = '\" . $studentImageDir . $tempPicName . \".jpg';\";\n\t\t\t\techo \"SlideImages.push(tempPic);\";\n\t\t\t}\n\t\t\telse if ( file_exists($studentImageDir . $tempPicName . \".JPG\") )\n\t\t\t//Creates a new Image object, causing images to be preloaded \n\t\t\t//If the image is not found, it will load a default image\n\t\t\t{\n\t\t\t\techo \"tempPic = new Image();\";\n\t\t\t\techo \"tempPic.src = '\" . $studentImageDir . $tempPicName . \".JPG';\";\n\t\t\t\techo \"SlideImages.push(tempPic);\";\n\t\t\t}\t\t\t\n\t\t\telse if ( file_exists($studentImageDir . $tempPicName . \".png\") )\n\t\t\t//Creates a new PNG Image object, causing images to be preloaded \n\t\t\t{\n\t\t\t\techo \"tempPic = new Image();\";\n\t\t\t\techo \"tempPic.src = '\" . $studentImageDir . $tempPicName . \".png';\";\n\t\t\t\techo \"SlideImages.push(tempPic);\";\n\t\t\t}\n\t\t\telse if ( file_exists($studentImageDir . $tempPicName . \".PNG\") )\n\t\t\t//Creates a new PNG Image object, causing images to be preloaded \n\t\t\t{\n\t\t\t\techo \"tempPic = new Image();\";\n\t\t\t\techo \"tempPic.src = '\" . $studentImageDir . $tempPicName . \".PNG';\";\n\t\t\t\techo \"SlideImages.push(tempPic);\";\n\t\t\t}\t\t\t\n\t\t\telse\n\t\t\t//If the image is not found, it will load a default image\t\t\t\n\t\t\t{\n\t\t\t\techo \"tempPic = new Image();\";\n\t\t\t\techo \"tempPic.src = '\" . $studentImageDir . \"MissingStudentPic.jpg';\";\n\t\t\t\techo \"SlideImages.push(tempPic);\";\n\t\t\t}\n\t\t}\n\t}", "public function codes()\r\n {\r\n if ($this->model instanceof ZActiveRecord) {\r\n $this->modelId = $this->model->id;\r\n Az::$app->params['modelId'] = $this->modelId;\r\n } else\r\n $this->modelId = $this->paramGet('modelId');\r\n $rand = rand(1, 100);\r\n\r\n $this->htm = strtr($this->_layout['htm'], [\r\n '{id}' => $this->id,\r\n\r\n '{name}' => $this->name,\r\n ]);\r\n\r\n $this->css = <<<CSS\r\n .file-caption-info{\r\n font-size: 12px;\r\n }\r\n .file-size-info{\r\n font-size: 12px;\r\n }\r\n \r\n .file-preview-other{\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n margin-top: 4rem;\r\n }\r\n /*!!!! css siz buzilib ketvotti !!!!*/\r\nCSS;\r\n\r\n if ($this->model instanceof ZActiveRecord) {\r\n $value = $this->model->getAttribute($this->attributeAll);\r\n $className = bname($this->modelClassName);\r\n } else {\r\n $value = $this->value;\r\n $className = $this->parseClassName();\r\n $this->parseAttribute();\r\n }\r\n\r\n $match = Az::$app->utility->pregs->pregMatchAll($this->name, '\\[(.*?)\\]');\r\n $match = ZArrayHelper::getValue($match, 1);\r\n\r\n// $sPrefix = \"/{$this->moduleId}/{$this->controlId}\";\r\n\r\n if (!$myId = $this->httpGet('id'))\r\n $sSuffix = \"modelClassName={$className}&attribute={$this->name}\";\r\n else\r\n $sSuffix = \"modelClassName={$className}&attribute={$this->name}&id=$myId\";\r\n\r\n\r\n $uploadUrl = \"/api/core/files/upload.aspx?{$sSuffix}&test=true\";\r\n $deleteUrl = \"/api/core/files/delete-file.aspx?{$sSuffix}&id={$this->modelId}\";\r\n\r\n $required = $this->_config['required'];\r\n if (!empty($this->value)) {\r\n $required = 0;\r\n }\r\n\r\n $name = $this->name;\r\n $initialFileInputs = '';\r\n\r\n if (!empty($value) && is_array($value)) {\r\n\r\n $modelName = $className;\r\n $isDyno = is_numeric($match[0]);\r\n\r\n foreach ($value as $key => $file) {\r\n if (!is_array($file)) {\r\n if ($isDyno)\r\n switch (count($match)) {\r\n case 4:\r\n $this->_config['initialPreview'][] = Url::to(\"/upload/uploaz/\" . App . \"/{$modelName}/{$match[1]}/$this->modelId/{$match[2]}/{$match[3]}/{$file}\");\r\n break;\r\n case 3:\r\n $this->_config['initialPreview'][] = Url::to(\"/upload/uploaz/\" . App . \"/{$modelName}/{$match[1]}/$this->modelId/{$match[2]}/{$file}\");\r\n break;\r\n default:\r\n $this->_config['initialPreview'][] = Url::to(\"/upload/uploaz/\" . App . \"/{$modelName}/{$match[1]}/$this->modelId/{$file}\");\r\n break;\r\n }\r\n else\r\n switch (count($match)) {\r\n case 3:\r\n $this->_config['initialPreview'][] = Url::to(\"/upload/uploaz/\" . App . \"/{$modelName}/{$match[0]}/$this->modelId/{$match[1]}/{$match[2]}/{$file}\");\r\n break;\r\n case 2:\r\n $this->_config['initialPreview'][] = Url::to(\"/upload/uploaz/\" . App . \"/{$modelName}/{$match[0]}/$this->modelId/{$match[1]}/{$file}\");\r\n break;\r\n default:\r\n $this->_config['initialPreview'][] = Url::to(\"/upload/uploaz/\" . App . \"/{$modelName}/{$match[0]}/$this->modelId/{$file}\");\r\n break;\r\n }\r\n $this->_config['initialPreviewConfig'][] = ['caption' => $file, 'key' => $file];\r\n $initialFileInputs .= \"<input type='\" . $this->_config['type'] . \"' name='$this->name[]' value='\" . $file . \"' />\";\r\n }\r\n }\r\n }\r\n $this->htm = strtr($this->htm, ['{inputs}' => $initialFileInputs]);\r\n\r\n $this->_event['filedeleted'] = <<<JS\r\n function(event, id, index) {\r\n var el = $(\"[name='$name']\");\r\n var filesEl = el.val();\r\n console.log(filesEl);\r\n var filesArr = [];\r\n $.each( JSON.stringify(filesEl), function( fileName, file ) {\r\n if(id === file.name) return ;\r\n fileName = file.name;\r\n filesArr.push(fileName);\r\n });\r\n console.log(filesArr);\r\n el.val(JSON.stringify(filesArr));\r\n \r\n var inputsBlock = $(\"#{id}-inputs input\");\r\n \r\n inputsBlock.each(function(idx, inputField){\r\n console.log(inputField);\r\n var imName = $(this).val();\r\n if(imName == id) {\r\n $(inputField).remove();\r\n }\r\n })\r\n }\r\nJS;\r\n\r\n\r\n $this->_event['filebatchuploadsuccess'] .= <<<JS\r\n \r\n var el = $(\"[name='$this->name']\");\r\n \r\n console.log('Element' + el);\r\n console.log('Element ID: {$this->id}');\r\n\r\n var filesEl = el.val();\r\n var filesArr = [];\r\n \r\n $.each(second.files, function(fileName, file ) {\r\n fileName = file.name;\r\n filesArr.push({name: fileName});\r\n });\r\n \r\n $.each(filesArr, function(fileName, file){\r\n fileName = file.name;\r\n var inputs = \"<input type='{type}' name='{name}[]' value='\"+fileName+\"' />\";\r\n $('#{$this->id}-inputs').append(inputs);\r\n \r\n $('.file-caption-name').attr('title', fileName);\r\n });\r\n var values = JSON.stringify(filesArr);\r\n el.val(values);\r\n \r\n console.log(values);\r\n var key = 'value{$this->attribute}'; \r\n window.localStorage.setItem(key, values);\r\n window.value{$this->attribute} = values;\r\n console.log(window.localStorage.getItem(key));\r\n \r\n $(el).trigger('change');\r\nJS;\r\n\r\n $this->_event['filebatchuploadsuccess'] = strtr($this->_event['filebatchuploadsuccess'], [\r\n '{id}' => $this->id,\r\n '{name}' => $this->name,\r\n '{type}' => $this->_config['type'],\r\n ]);\r\n\r\n $this->_event['filedeleted'] = strtr($this->_event['filedeleted'], [\r\n '{id}' => $this->id,\r\n '{name}' => $this->name,\r\n ]);\r\n\r\n\r\n $this->_event['filezoomshow'] = <<<JS\r\n function(event, files) {\r\n $(\"[class='modal-header']\").attr('style', 'background: white');\r\n \r\n }\r\nJS;\r\n\r\n $this->_event['filebatchselected'] = <<<JS\r\n \r\nJS;\r\n\r\n if (empty($this->_config['initialPreview'])) $this->_config['initialPreview'] = [];\r\n if (empty($this->_config['initialPreviewConfig'])) $this->_config['initialPreviewConfig'] = [];\r\n //vdd($this->jscode($this->_config['allowFileTypes']));\r\n $this->js .= strtr($this->_layout['js'], [\r\n '{id}' => $this->id,\r\n '{rand}' => $rand,\r\n '{showCaption}' => $this->jscode($this->_config['showCaption']),\r\n '{showBrowse}' => $this->jscode($this->_config['showBrowse']),\r\n '{showPreview}' => $this->jscode($this->_config['showPreview']),\r\n '{showRemove}' => $this->jscode($this->_config['showRemove']),\r\n '{showUpload}' => $this->jscode($this->_config['showUpload']),\r\n '{showCancel}' => $this->jscode($this->_config['showCancel']),\r\n '{showPause}' => $this->jscode($this->_config['showPause']),\r\n '{showClose}' => $this->jscode($this->_config['showClose']),\r\n '{browseOnZoneClick}' => $this->jscode($this->_config['browseOnZoneClick']),\r\n '{autoOrientImageInitial}' => $this->jscode($this->_config['autoOrientImageInitial']),\r\n '{initialPreview}' => $this->jscode($this->_config['initialPreview']),\r\n '{initialPreviewConfig}' => $this->jscode($this->_config['initialPreviewConfig']),\r\n '{deleteUrl}' => $deleteUrl,\r\n\r\n //teyganga chipqon chiqsin\r\n\r\n '{allowedFileTypes}' => $this->jscode($this->_config['allowFileTypes']),\r\n\r\n //teyganga chipqon chiqsin\r\n\r\n '{allowedFileExtensions}' => $this->_config['allowedFileExtensions'] ? $this->jscode($this->_config['allowedFileExtensions']) : 'null',\r\n '{uploadUrl}' => $uploadUrl,\r\n '{uploadAsync}' => $this->jscode($this->_config['uploadAsync']),\r\n '{uploadUrlThumb}' => $this->jscode($this->_config['uploadUrlThumb']),\r\n '{maxFileCount}' => $this->jscode($this->_config['maxFileCount']),\r\n '{minFileCount}' => $this->jscode($this->_config['minFileCount']),\r\n '{initialCaption}' => $this->_config['hasPlace'] ? $this->_config['placeholder'] : '',\r\n '{required}' => $this->jscode($required),\r\n '{id}' => $this->jscode($this->id)\r\n ]);\r\n }", "public function render() {\n\t\tif (TYPO3_MODE === 'BE') {\n\t\t\t$this->simulateFrontendEnvironment();\n\t\t}\n\t\t$pathinfo = pathinfo($this->arguments['src']);\n\t\tif ($pathinfo['filename'] === '*') {\n\t\t\t$images = $this->documentHead->getFilenamesOfType($pathinfo['dirname'], $pathinfo['extension']);\n\t\t} elseif ($this->arguments['path']) {\n\t\t\t$src = trim(trim($this->arguments['src']), ',');\n\t\t\tif (strlen($src) === 0) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\t$images = explode(',', $src);\n\t\t\t\t// patch for CSV files missing relative pathnames and possible missing files\n\t\t\tforeach ($images as $k => $v) {\n\t\t\t\t$images[$k] = $this->arguments['path'] . $v;\n\t\t\t}\n\t\t} elseif (is_array($this->arguments['src'])) {\n\t\t\t$images = $this->arguments['src'];\n\t\t} else {\n\t\t\t$images = array(trim($this->arguments['src'], ', '));\n\t\t}\n\t\tif ($this->arguments['sortBy'] !== NULL) {\n\t\t\t$images = $this->sortImages($images);\n\t\t}\n\n\t\tif ($this->arguments['limit'] > 0) {\n\t\t\t$images = array_slice($images, 0, $this->arguments['limit']);\n\t\t}\n\n\n\t\tif (count($images) === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\t\t// use altsrc for any image not present\n\t\tforeach ($images as $k => $v) {\n\t\t\tif (is_file(t3lib_div::getFileAbsFileName($v)) === FALSE) {\n\t\t\t\t$images[$k] = $this->arguments['altsrc'];\n\t\t\t}\n\t\t}\n\t\t$files = $this->renderImages($images);\n\t\tif (TYPO3_MODE === 'BE') {\n\t\t\t$this->resetFrontendEnvironment();\n\t\t}\n\t\t$this->templateVariableContainer->add($this->arguments['as'], $files[0]);\n\t\t$output = $this->renderChildren();\n\t\t$this->templateVariableContainer->remove($this->arguments['as']);\n\t\treturn $output;\n\t}", "function render()\r\n {\r\n $this->folders = array(); // Clear the array of folder ids\r\n $display_content = '';\r\n $this->name = preg_replace(FIX_IDENTIFIER, '', $this->name, -1);\r\n $opml_content = file_get_contents($this->filename);\r\n if ($opml_content !== false) {\r\n\t $dom = new xmlDOM($opml_content);\r\n if ($this->opmlurl != '') // Specifying the opmlurl automatically links to it\r\n {\r\n if (($this->opmltitle == '') &&\r\n\t (($title = $dom->find_tag('title')) !== false)) {\r\n $this->opmltitle = $title->data; // Use the OPML title element if not specified\r\n }\r\n $display_content .= $this->element_div($this->opmltitle, $this->opmlurl, $this->opmlurl, 'opml',\r\n\t null, true);\r\n $display_content .= $this->child_div();\r\n }\r\n\t \r\n\t if (($body = $dom->find_tag('body')) !== false) {\r\n $display_content .= $this->outline($body->children);\r\n\t }\r\n if ($this->opmlurl != '')\r\n $display_content .= '</div></div>';\r\n if ($this->closeall)\r\n $display_content .= $this->close_all();\r\n }\r\n else\r\n {\r\n $display_content = \"<p>Could not open OPML URL {$this->filename}</p>\";\r\n }\r\n return $display_content;\r\n }", "public function preview()\n {\n\n //do we have anythin to preview at all?\n if (!isset($_POST['page']) || $_POST['page'] == '') {\n die(\"No page found\");\n }\n\n if (!is_writable('./temp/')) {\n chmod('./temp/', 0777);\n }\n\n $filename = \"temp/preview_\" . $this->generateRandomString(20) . \".html\";\n $previewFile = fopen($filename, \"w\");\n\n if (isset($_POST['siteID']) && !empty($_POST['siteID'])) {\n $siteDetails = $this->sitemodel->getSite($_POST['siteID']);\n\n if ($siteDetails == false) {\n die(\"No details found\");\n }\n\n $pageMeta = $this->pagemodel->getSinglePage($_POST['siteID'], 'index');\n\n if (!empty($pageMeta->pages_title)) {\n //insert title, meta keywords and meta description\n $title = '<title>' . $siteDetails['site']->sites_name . '</title>';\n $meta_description = '<meta name=\"description\" content=\"' . $pageMeta->pages_meta_description . '\">';\n $meta_keyword = '<meta name=\"keywords\" content=\"' . $pageMeta->pages_meta_keywords . '\">';\n $header_includes = $pageMeta->pages_header_includes;\n\n $pageContent = str_replace('<!--pageTitle-->', $title, $_POST['page']);\n $pageContent = str_replace('<!--META-DESCRIPTION-->', $meta_description, $pageContent);\n $pageContent = str_replace('<!--META-KEYWORDS-->', $meta_keyword, $pageContent);\n\n //insert header includes;\n $pageContent = str_replace(\"<!--headerIncludes-->\", $header_includes, $pageContent);\n } else {\n //insert title\n $title = '<title>' . $siteDetails['site']->sites_name . '</title>';\n\n $pageContent = str_replace('<!--pageTitle-->', $title, $_POST['page']);\n }\n } else {\n $title = '<title>Template Preview</title>';\n\n $pageContent = str_replace('<!--pageTitle-->', $title, $_POST['page']);\n }\n\n if (stristr($pageContent, 'href=\"css')) {\n $pageContent = str_replace('href=\"css', 'href=\"' . base_url('elements') . '/css', $pageContent);\n }\n if (stristr($pageContent, 'href=\"scripts')) {\n $pageContent = str_replace('href=\"scripts', 'href=\"' . base_url('elements') . '/scripts', $pageContent);\n }\n if (stristr($pageContent, 'href=\"images')) {\n $pageContent = str_replace('href=\"images', 'href=\"' . base_url('elements') . '/images', $pageContent);\n }\n if (stristr($pageContent, 'src=\"scripts')) {\n $pageContent = str_replace('src=\"scripts', 'src=\"' . base_url('elements') . '/scripts', $pageContent);\n }\n if (stristr($pageContent, 'url(images')) {\n $pageContent = str_replace('url(images', 'url(' . base_url('elements') . '/images', $pageContent);\n }\n if (stristr($pageContent, 'src=\"./images')) {\n $pageContent = str_replace('src=\"./images', 'src=\"' . base_url('elements') . '/images', $pageContent);\n }\n if (stristr($pageContent, 'src=\"images')) {\n $pageContent = str_replace('src=\"images', 'src=\"' . base_url('elements') . '/images', $pageContent);\n }\n if (stristr($pageContent, 'href=\"./images')) {\n $pageContent = str_replace('href=\"./images', 'href=\"' . base_url('elements') . '/images', $pageContent);\n }\n\n fwrite($previewFile, stripcslashes($pageContent));\n\n fclose($previewFile);\n header('Location: ' . base_url($filename));\n }", "function phptemplate_filefield_file($file) {\n if (empty($file['fid'])) {\n return '';\n }\n\n $path = $file['filepath'];\n $url = file_create_url($path);\n $icon = theme('filefield_icon', $file);\n\n // Set options as per anchor format described at\n $options = array(\n 'attributes' => array(\n 'type' => $file['filemime'] . '; length=' . $file['filesize'],\n ),\n );\n\n // Use the description as the link text if available.\n if (empty($file['data']['description'])) {\n $link_text = $file['filename'];\n }\n else {\n $link_text = $file['data']['description'];\n $options['attributes']['title'] = $file['filename'];\n }\n\n //open files of particular mime types in new window\n $new_window_mimetypes = array(\n 'application/pdf',\n 'text/plain'\n );\n if (in_array($file['filemime'], $new_window_mimetypes)) {\n $options['attributes']['target'] = '_blank';\n }\n\n return '<div class=\"filefield-file clear-block\">'. $icon . l($link_text, $url, $options) .'</div>';\n}", "function printFileContentsHTML($file = LACE_FILE) {\r\n\treturn formatFileContents(getFileContentsRaw($file));\r\n}", "function output_file($item,$structure,$menu_id) {\n\t$text \t\t= $item['text'];\n\t$filename \t= $item['filename'];\n\t$identifier\t= $item['identifier'];\n\t$file_id\t= $item['file_id'];\n\t$icon_img = $item['icon_img'];\n\t\n\t## determine the size\n\t$file_size = @filesize(MATRIX_BASEDIR.UPLOAD_DIR_DOCS.$filename);\n\t$file_size = _files_formatFileSize($file_size);\n\t\n\t$value = array(\n\t\t$identifier.'.id' => $file_id, \n\t\t$identifier.'.text' => $text, \n\t\t$identifier.'.file' => UPLOAD_DIR_DOCS.$filename,\n\t\t$identifier.'.filename' => $filename,\n\t\t$identifier.'.icon_img' => $icon_img,\n\t\t$identifier.'.size' => $file_size,\n\t\t$identifier.'.absolute' => '<a href=\"'.ABSOLUTE_UPLOAD_DIR.$filename .'\">'.$text.'</a>',\n\t\t$identifier.'.absolutefile' => UPLOAD_DIR_DOCS.$filename,\n\t\t$identifier => '<a href=\"'.UPLOAD_DIR_DOCS.$filename .'\">'.$text.'</a>'\n\t\t\n\t\t);\n\treturn $value;\n}", "private function build_file_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true, $_is_pricing_rule = \"no\") {\r\n /*\r\n * Show as value option not available for FILE field\r\n * since file field not supported for Admin Field */\r\n \r\n $_index .= (isset($_meta[\"multi_file\"]) && $_meta[\"multi_file\"] == \"yes\") ? \"[]\" : \"\";\r\n $accept = (isset($_meta[\"filetypes\"]) && ! empty($_meta[\"filetypes\"])) ? ('accept=\"' . esc_attr(trim($_meta[\"filetypes\"])) . '\"') : '';\r\n $multifile = (isset($_meta[\"multi_file\"]) && $_meta[\"multi_file\"] == \"yes\") ? 'multiple=\"multiple\"' : '';\r\n $maxsize = (isset($_meta[\"max_file_size\"]) && ! empty($_meta[\"max_file_size\"])) ? ('max-size=\"' . esc_attr(trim($_meta[\"max_file_size\"])) . '\"') : '';\r\n $preview = (isset($_meta[\"img_is_prev\"]) && $_meta[\"img_is_prev\"] == \"yes\") ? \"yes\" : \"no\";\r\n $preview_width = (isset($_meta[\"img_is_prev_width\"]) && $_meta[\"img_is_prev_width\"] != \"\") ? $_meta[\"img_is_prev_width\"] : \"65px\";\r\n $has_field_rules = isset( $_meta[\"field_rules\"] ) && is_array( $_meta[\"field_rules\"] ) && count( $_meta[\"field_rules\"] ) != 0 ? \"yes\" : \"no\";\r\n /* Construct the field */\r\n $html = '<input type=\"file\" data-has_field_rules=\"'.$has_field_rules.'\" data-has_pricing_rules=\"'.$_is_pricing_rule.'\" ' . $maxsize . ' data-fkey=\"'. $_meta[\"key\"] .'\" class=\"' . $_ptype . '-field ' . $_class . '\" name=\"' . esc_attr($_meta[\"key\"] . $_index) . '\" ' . $accept . ' ' . $multifile . ' data-field-type=\"'. $_meta[\"type\"] .'\" ' . $_ptype . '-pattern=\"mandatory\" ' . $_ptype . '-mandatory=\"' . $_meta[\"required\"] . '\" ' . $_cloneable . ' ' . $_readonly . ' data-preview=\"'. $preview .'\" data-preview-width=\"'. $preview_width .'\" />';\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }", "public function ajaxFile()\n\t{\n\t\t$type = $_POST['type'];\n\t\t$id = $_POST['id'];\n\t\t$file_src = wp_get_attachment_url( $id );\n\t\t$have_file = !empty( $file_src );\n\t\tswitch ( $type ) {\n\t\t\tcase 'image':\n\t\t\t\t?>\n\t\t\t\t<img src=\"<?php echo esc_url( $file_src ); ?>\" alt=\"\" />\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\n\t\t\tcase 'audio':\n\t\t\t\techo wp_audio_shortcode( array(\n\t\t\t\t\t'src' => $file_src\n\t\t\t\t) );\n\t\t\t\tbreak;\n\n\t\t\tcase 'video':\n\t\t\t\techo wp_video_shortcode( array(\n\t\t\t\t\t'src' => $file_src\n\t\t\t\t) );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$filename = basename( get_attached_file( $id ) );\n\t\t\t\t?>\n\t\t\t\t<span class=\"dashicons dashicons-media-default\"></span>\n\t\t\t\t<span class=\"file-name\"><?php echo wp_kses_post( $filename ); ?></span>\n\t\t\t\t<?php\n\t\t\t\tbreak;\n\t\t}\n\t\twp_die();\n\t}", "function renderGUI($filesArray, $relitaveURL){\n\t$file_GUI = file_get_contents('files.html');\n\n\t$file_icons = '';\n\tforeach($filesArray as $fileInstance){\n\t $file_icons = $file_icons.'<div class=\"iconHolder\">\n\t<table><tr><td><a href='.$fileInstance->getType()->getReply($fileInstance->getURL()).'\n\t><div class=\"appIcon\" ><center><img src=\"'.$fileInstance->getType()->getImage().'\">\n\t</center><p>'.$fileInstance->getname().'</p></div></a></tr></td></table></div>';\n\t}\n\n\t$file_GUI = str_replace('[%allfiles%]', $file_icons, $file_GUI);\n\t$file_GUI = str_replace('{/dir/}', $relitaveURL, $file_GUI);\n\t$file_GUI = str_replace('[%last%]', getPrevURL($relitaveURL), $file_GUI);\n\techo $file_GUI;\n}", "function render() {\n switch($this->getAttribute('plugin')) {\n case 'drop':\n default:\n $rendered = '<input type=\"hidden\" name=\"tmp_upload_dir\" value=\"[ATTRIBUTE|name=tmp_files_dir]\" />' . '<div class=\"upload-files\"><div class=\"drop\">Drop here files<a>or press here</a><input type=\"file\" name=\"' . $this->getName() . '\" id=\"' . $this->getId() . '\" multiple /></div></div>';\n break;\n }\n return $rendered;\n }" ]
[ "0.66853446", "0.60053337", "0.5990815", "0.59887004", "0.5947546", "0.59098804", "0.57981235", "0.57758296", "0.57331485", "0.5675593", "0.56342787", "0.5623795", "0.5623672", "0.5618901", "0.56069696", "0.55856556", "0.5535397", "0.5519882", "0.55183035", "0.5490301", "0.54811287", "0.5477585", "0.5477049", "0.5476579", "0.5474902", "0.54678726", "0.54323655", "0.5426156", "0.5420086", "0.5395208" ]
0.6591778
1
Getting field option price
function ppom_get_field_option_price( $field_meta, $option_label ) { // var_dump($field_meta['options']); if( ! isset( $field_meta['options']) || $field_meta['type'] == 'bulkquantity' || $field_meta['type'] == 'cropper' ) return 0; $option_price = 0; foreach( $field_meta['options'] as $option ) { if( $option['option'] == $option_label && isset($option['price']) && $option['price'] != '' ) { $option_price = $option['price']; } } // For currency switcher $option_price = apply_filters('ppom_option_price', $option_price); return apply_filters("ppom_field_option_price", wc_format_decimal($option_price), $field_meta, $option_label); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ajax_paypal_price() {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'visual_form_builder_paypal_price' ) {\n\t\t\t$form_id = absint( $_REQUEST['form_id'] );\n\t\t\t$field_id = absint( $_REQUEST['field_id'] );\n\n\t\t\t$fields = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $this->field_table_name WHERE form_id = %d AND field_id = %d\", $form_id, $field_id ) );\n\t\t\t$paypal_price_field = unserialize( $wpdb->get_var( $wpdb->prepare( \"SELECT form_paypal_field_price FROM $this->form_table_name WHERE form_id = %d\", $form_id ) ) );\n\n\t\t\t$price_option = '';\n\n\t\t\tforeach ( $fields as $field ) {\n\t\t\t\t// If a text input field, only display a message\n\t\t\t\tif ( in_array( $field->field_type, array( 'text', 'currency' ) ) )\n\t\t\t\t\t$price_option = '<p>Amount Based on User Input</p>';\n\t\t\t\t// If field has options, let user assign prices to inputs\n\t\t\t\telseif ( in_array( $field->field_type, array( 'select', 'radio', 'checkbox' ) ) ) {\n\t\t\t\t\t$options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );\n\n\t\t\t\t\t// Loop through each option and output\n\t\t\t\t\tforeach ( $options as $option => $value ) {\n\t\t\t\t\t\t$price_field_amount = ( isset( $paypal_price_field['prices'] ) ) ? stripslashes( $paypal_price_field['prices'][$option]['amount'] ) : '';\n\n\t\t\t\t\t\t$price_option .= sprintf(\n\t\t\t\t\t\t\t'<p class=\"description description-wide\"><label>%1$s<input class=\"widefat required\" type=\"text\" value=\"%2$s\" name=\"form_paypal_field_price[prices][%3$d][amount]\" /></label><br></p>',\n\t\t\t\t\t\t\tesc_attr( stripslashes( $value ) ),\n\t\t\t\t\t\t\t$price_field_amount,\n\t\t\t\t\t\t\t$option\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\techo sprintf( '<input type=\"hidden\" name=\"form_paypal_field_price[prices][%1$d][id]\" value=\"%2$s\" />', $option, esc_attr( stripslashes( $value ) ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Store the name as vfb-field_key-field_id for comparison when setting up PayPal form redirection\n\t\t\t\techo sprintf( '<input type=\"hidden\" name=\"form_paypal_field_price[name]\" value=\"vfb-%d\" />', $field->field_id );\n\t\t\t}\n\n\t\t\techo $price_option;\n\t\t}\n\n\t\tdie(1);\n\t}", "public function getOptionPrice()\n {\n return $this->optionPrice;\n }", "public function getOptions_values_price() {\n\t\treturn $this->options_values_price;\n\t}", "function ppom_get_field_option_price_by_id( $option, $product, $ppom_meta_ids ) {\n\t\n\t$data_name = isset($option['data_name']) ? $option['data_name'] : '';\n\t$option_id = isset($option['option_id']) ? $option['option_id'] : '';\n\t\n\t// soon we will remove this product param\n\t$product_id = null;\n\t$field_meta = ppom_get_field_meta_by_dataname($product_id , $data_name, $ppom_meta_ids );\n\t\n\tif( empty($field_meta) ) return 0;\n\t\n\t$field_type = isset($field_meta['type']) ? $field_meta['type'] : '';\n\t\n\tif( $field_type == 'bulkquantity' || $field_type == 'cropper' ) return 0;\n\t\n\t$option_price = 0;\n\t\n\tswitch( $field_type ) {\n\t\t\n\t\tcase 'image':\n\t\t\t\n\t\t\tif( isset( $field_meta['images']) ) {\n\t\t\t\tforeach( $field_meta['images'] as $option ) {\n\t\t\t\t\n\t\t\t\t\t$image_id\t= $field_meta['data_name'].'-'.$option['id'];\n\t\t\t\t\tif( $image_id == $option_id && isset($option['price']) && $option['price'] != '' ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(strpos($option['price'],'%') !== false){\n\t\t\t\t\t\t\t\t$option_price = ppom_get_amount_after_percentage($product->get_price(), $option['price']);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t// For currency switcher\n\t\t\t\t\t\t\t$option_price = apply_filters('ppom_option_price', $option['price']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t\n\t\t\tif( isset( $field_meta['options']) ) {\n\t\t\t\tforeach( $field_meta['options'] as $option ) {\n\t\t\t\n\t\t\t\t\tif( $option['id'] == $option_id && isset($option['price']) && $option['price'] != '' ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(strpos($option['price'],'%') !== false){\n\t\t\t\t\t\t\t\t$option_price = ppom_get_amount_after_percentage($product->get_price(), $option['price']);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t// For currency switcher\n\t\t\t\t\t\t\t$option_price = apply_filters('ppom_option_price', $option['price']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t}\n\t\n\t\n\treturn apply_filters(\"ppom_field_option_price_by_id\", wc_format_decimal($option_price), $field_meta, $option_id, $product);\n}", "function product_get_price( $object, $field_name, $request ) {\n return get_post_meta( $object[ 'id' ], 'product_price', true );\n}", "public function get_price(){\n\t\treturn $this->price;\n\t}", "public function getPrice(){ return $this->price_rur; }", "function getPrice()\n {\n return $this->price;\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPrice() {\n }", "public function getPrice()\n {\n return parent::getPrice();\n }", "public function getPrice(): float;", "public function getPrice(): float;", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }" ]
[ "0.7433158", "0.7420129", "0.7404648", "0.7157803", "0.7133599", "0.7067082", "0.68952364", "0.6873923", "0.68619263", "0.68619263", "0.68619263", "0.68619263", "0.680141", "0.680141", "0.67997414", "0.67997414", "0.67906684", "0.67498887", "0.67470855", "0.67450684", "0.67450684", "0.6644143", "0.6644143", "0.6644143", "0.6644143", "0.6644143", "0.6644143", "0.6644143", "0.6644143", "0.6644143" ]
0.8165804
0
Getting field option price by ID
function ppom_get_field_option_price_by_id( $option, $product, $ppom_meta_ids ) { $data_name = isset($option['data_name']) ? $option['data_name'] : ''; $option_id = isset($option['option_id']) ? $option['option_id'] : ''; // soon we will remove this product param $product_id = null; $field_meta = ppom_get_field_meta_by_dataname($product_id , $data_name, $ppom_meta_ids ); if( empty($field_meta) ) return 0; $field_type = isset($field_meta['type']) ? $field_meta['type'] : ''; if( $field_type == 'bulkquantity' || $field_type == 'cropper' ) return 0; $option_price = 0; switch( $field_type ) { case 'image': if( isset( $field_meta['images']) ) { foreach( $field_meta['images'] as $option ) { $image_id = $field_meta['data_name'].'-'.$option['id']; if( $image_id == $option_id && isset($option['price']) && $option['price'] != '' ) { if(strpos($option['price'],'%') !== false){ $option_price = ppom_get_amount_after_percentage($product->get_price(), $option['price']); }else { // For currency switcher $option_price = apply_filters('ppom_option_price', $option['price']); } } } } break; default: if( isset( $field_meta['options']) ) { foreach( $field_meta['options'] as $option ) { if( $option['id'] == $option_id && isset($option['price']) && $option['price'] != '' ) { if(strpos($option['price'],'%') !== false){ $option_price = ppom_get_amount_after_percentage($product->get_price(), $option['price']); }else { // For currency switcher $option_price = apply_filters('ppom_option_price', $option['price']); } } } } break; } return apply_filters("ppom_field_option_price_by_id", wc_format_decimal($option_price), $field_meta, $option_id, $product); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ppom_get_field_option_price( $field_meta, $option_label ) {\n\t\n\t// var_dump($field_meta['options']);\n\tif( ! isset( $field_meta['options']) || $field_meta['type'] == 'bulkquantity' || $field_meta['type'] == 'cropper' ) return 0;\n\t\n\t$option_price = 0;\n\tforeach( $field_meta['options'] as $option ) {\n\t\t\n\t\tif( $option['option'] == $option_label && isset($option['price']) && $option['price'] != '' ) {\n\t\t\t\n\t\t\t$option_price = $option['price'];\n\t\t}\n\t}\n\t\n\t// For currency switcher\n\t$option_price = apply_filters('ppom_option_price', $option_price);\n\t\n\treturn apply_filters(\"ppom_field_option_price\", wc_format_decimal($option_price), $field_meta, $option_label);\n}", "public function ajax_paypal_price() {\n\t\tglobal $wpdb;\n\n\t\tif ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'visual_form_builder_paypal_price' ) {\n\t\t\t$form_id = absint( $_REQUEST['form_id'] );\n\t\t\t$field_id = absint( $_REQUEST['field_id'] );\n\n\t\t\t$fields = $wpdb->get_results( $wpdb->prepare( \"SELECT * FROM $this->field_table_name WHERE form_id = %d AND field_id = %d\", $form_id, $field_id ) );\n\t\t\t$paypal_price_field = unserialize( $wpdb->get_var( $wpdb->prepare( \"SELECT form_paypal_field_price FROM $this->form_table_name WHERE form_id = %d\", $form_id ) ) );\n\n\t\t\t$price_option = '';\n\n\t\t\tforeach ( $fields as $field ) {\n\t\t\t\t// If a text input field, only display a message\n\t\t\t\tif ( in_array( $field->field_type, array( 'text', 'currency' ) ) )\n\t\t\t\t\t$price_option = '<p>Amount Based on User Input</p>';\n\t\t\t\t// If field has options, let user assign prices to inputs\n\t\t\t\telseif ( in_array( $field->field_type, array( 'select', 'radio', 'checkbox' ) ) ) {\n\t\t\t\t\t$options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );\n\n\t\t\t\t\t// Loop through each option and output\n\t\t\t\t\tforeach ( $options as $option => $value ) {\n\t\t\t\t\t\t$price_field_amount = ( isset( $paypal_price_field['prices'] ) ) ? stripslashes( $paypal_price_field['prices'][$option]['amount'] ) : '';\n\n\t\t\t\t\t\t$price_option .= sprintf(\n\t\t\t\t\t\t\t'<p class=\"description description-wide\"><label>%1$s<input class=\"widefat required\" type=\"text\" value=\"%2$s\" name=\"form_paypal_field_price[prices][%3$d][amount]\" /></label><br></p>',\n\t\t\t\t\t\t\tesc_attr( stripslashes( $value ) ),\n\t\t\t\t\t\t\t$price_field_amount,\n\t\t\t\t\t\t\t$option\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\techo sprintf( '<input type=\"hidden\" name=\"form_paypal_field_price[prices][%1$d][id]\" value=\"%2$s\" />', $option, esc_attr( stripslashes( $value ) ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Store the name as vfb-field_key-field_id for comparison when setting up PayPal form redirection\n\t\t\t\techo sprintf( '<input type=\"hidden\" name=\"form_paypal_field_price[name]\" value=\"vfb-%d\" />', $field->field_id );\n\t\t\t}\n\n\t\t\techo $price_option;\n\t\t}\n\n\t\tdie(1);\n\t}", "public function getPriceId($id)\n { \n $product = $this->postFactory->create();\n $productPriceById = $product->load($id)->getPrice();\n return $productPriceById;\n }", "function product_get_price( $object, $field_name, $request ) {\n return get_post_meta( $object[ 'id' ], 'product_price', true );\n}", "function get_product_price($field_product_id){\r\n\r\n $this->load->model('logistics_model');\r\n $result = $this->logistics_model->get_product_price($field_product_id);\r\n $value = $result->price;\r\n echo $value;\r\n }", "function getPriceValueById($id) {\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->test_price_table);\n\t\t$this->db->where('test_price_id', $id);\n $query = $this->db->get();\n\t\treturn $query->result();\n\t}", "function ppom_get_field_option_weight_by_id( $option, $ppom_meta_ids ) {\n\t\n\t$data_name = isset($option['data_name']) ? $option['data_name'] : '';\n\t$option_id = isset($option['option_id']) ? $option['option_id'] : '';\n\t\n\t// soon we will remove this product param\n\t$product_id = null;\n\t$field_meta = ppom_get_field_meta_by_dataname( $product_id, $data_name, $ppom_meta_ids );\n\t\n\tif( empty($field_meta) ) return 0;\n\t\n\tif( ! isset( $field_meta['options']) || $field_meta['type'] == 'bulkquantity' || $field_meta['type'] == 'cropper' ) return 0;\n\t\n\t$option_weight = 0;\n\tforeach( $field_meta['options'] as $option ) {\n\t\t\n\t\tif( $option['id'] == $option_id && isset($option['weight']) && $option['weight'] != '' ) {\n\t\t\t\n\t\t\t$option_weight = $option['weight'];\n\t\t}\n\t}\n\t\n\treturn apply_filters(\"ppom_field_option_weight_by_id\", wc_format_decimal($option_weight), $field_meta, $option_id, $ppom_meta_ids);\n}", "public function getOptions_values_price() {\n\t\treturn $this->options_values_price;\n\t}", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "function get_field_value($id){\n\t\treturn stripslashes(get_option( $id )); \n\t}", "public function getPricing($service_id) {\n $stmt = $this->conn->prepare(\"SELECT * FROM `pricing` where service_id = ?\");\n $stmt->bind_param(\"i\", $service_id);\n $stmt->execute();\n $pricing = $stmt->get_result();\n $stmt->close();\n return $pricing;\n }", "function _options_field_id($field, $id) {\n global $db;\n $data = null;\n $req = $db->prepare(\"SELECT $field FROM _options WHERE id= ?\");\n $req->execute(array($id));\n $data = $req->fetch();\n //return $data[0];\n return (isset($data[0]))? $data[0] : false;\n}", "public function getOptionPrice()\n {\n return $this->optionPrice;\n }", "public function getPrice($id)\n {\n return $this->api->get(\"/products/price/{$id}\");\n }", "function variation_settings_fields( $loop, $variation_data, $variation ) {\n\n\n echo '<div class=\"options_group\">';\n\n // Number Field\n woocommerce_wp_text_input(\n array(\n 'id' => '_xxl_pricing[' . $variation->ID . ']',\n 'label' => __( 'XXL+ Pricing', 'woocommerce' ),\n 'desc_tip' => 'true',\n 'placeholder' => 'Required!',\n 'description' => __( 'Enter the price of XXL+ t-shirts that will be more expensive than the XS-XL shirts.', 'woocommerce' ),\n 'value' => get_post_meta( $variation->ID, '_xxl_pricing', true )\n )\n );\n\n echo '</div>';\n\n}", "public function getProductOption();", "protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}", "function getPurchasePrice($id, $supplier_id = null) {\n \n $result = $this->Product->getShortDet($id);\n\n $this->loadModel('Productsupplier');\n $this->Productsupplier->recursive = -1;\n $condition['product_id'] = $id;\n $condition['status'] = 'yes';\n if($supplier_id) {\n $condition['supplier_id'] = $supplier_id;\n }\n $supplierPrice = $this->Productsupplier->find('first', array('conditions' => $condition, 'fields' => array('price')));\n if($supplierPrice && $supplierPrice['Productsupplier']['price']) {\n $result['price'] = $supplierPrice['Productsupplier']['price'];\n }\n \n echo json_encode($result);\n exit;\n }", "public function get_price(){\n\t\treturn $this->price;\n\t}", "public function getPrice(){ return $this->price_rur; }", "public function getProductOptionId();", "public function listProductprice($id){\n try{\n $sql = \"Select * from productforsale where id_productforsale = ?\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n\n $result = $stm->fetch();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprice');\n $result = 2;\n }\n\n return $result;\n }", "abstract public function getPrice();", "public function getOptionById($id)\n\t{\n\t\tforeach ($this->getOptions() as $field_option) {\n\t\t\t/* @var $field_option kyCustomFieldOption */\n\t\t\tif ($field_option->getId() == $id || $id == '0') {\n\t\t\t\treturn $field_option;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function getPrice() {\n }", "function acf_get_field($id = 0)\n{\n}", "function get_price($name)\n{\n $query_setting_price = mysql_query(\"SELECT `value` FROM `setting_seagods` WHERE `name` = '$name' LIMIT 0,1\");\n $row_setting_price = mysql_fetch_array($query_setting_price);\n return $row_setting_price['value'];\n}" ]
[ "0.7050055", "0.6772268", "0.67687124", "0.6698591", "0.6564996", "0.6515949", "0.64104104", "0.6218508", "0.6189849", "0.6189849", "0.6189849", "0.6189849", "0.6172787", "0.61553323", "0.6149897", "0.614358", "0.60969925", "0.60496336", "0.60487753", "0.6045119", "0.59670734", "0.59601563", "0.5947885", "0.5935461", "0.59186894", "0.5910331", "0.5905284", "0.5903176", "0.58754486", "0.58712924" ]
0.79172456
0
Getting field option weight by ID
function ppom_get_field_option_weight_by_id( $option, $ppom_meta_ids ) { $data_name = isset($option['data_name']) ? $option['data_name'] : ''; $option_id = isset($option['option_id']) ? $option['option_id'] : ''; // soon we will remove this product param $product_id = null; $field_meta = ppom_get_field_meta_by_dataname( $product_id, $data_name, $ppom_meta_ids ); if( empty($field_meta) ) return 0; if( ! isset( $field_meta['options']) || $field_meta['type'] == 'bulkquantity' || $field_meta['type'] == 'cropper' ) return 0; $option_weight = 0; foreach( $field_meta['options'] as $option ) { if( $option['id'] == $option_id && isset($option['weight']) && $option['weight'] != '' ) { $option_weight = $option['weight']; } } return apply_filters("ppom_field_option_weight_by_id", wc_format_decimal($option_weight), $field_meta, $option_id, $ppom_meta_ids); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_weight() {\n\t\tif ($this->data['weight']) return $this->data['weight'];\n\t}", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "public function getWeight();", "function getWeight(){return $this->weight;}", "protected function getProductAttrCodeUseForSearchWeight()\n {\n if (null === $this->_productAttrCodeUseForSearchWeight) {\n $this->_productAttrCodeUseForSearchWeight = $this->_helper->getGeneralSetting('advanced/product_search_weight');\n }\n return $this->_productAttrCodeUseForSearchWeight;\n }", "public function get_weight(){\n\t\treturn $this->weight;\n\t}", "function getWeight() { return $this->_weight; }", "public function getWeight() {\n }", "public function weight() {\r\n\t\treturn (int)$this->techData['weight'];\r\n\t}", "function get_field_value($id){\n\t\treturn stripslashes(get_option( $id )); \n\t}", "function getWeight() {\n return $this->weight;\n }", "static public function get_weight($courseid) {\n //$default = grade_get_setting($courseid, self::SETTING_WEIGHT, progress_report_generator::DEFAULT_SUBREPORT_WEIGHT, false);\n global $CFG;\n $weightless = progress_report_generator::WEIGHTLESS;\n $classweight = self::SETTING_WEIGHT;\n $default = (isset($CFG->classweight) ? $CFG->classweight : $weightless);\n return optional_param(self::SHORT_NAME.'weight', $default, PARAM_INT);\n }", "public function getWeightLimit()\n {\n }", "function _options_field_id($field, $id) {\n global $db;\n $data = null;\n $req = $db->prepare(\"SELECT $field FROM _options WHERE id= ?\");\n $req->execute(array($id));\n $data = $req->fetch();\n //return $data[0];\n return (isset($data[0]))? $data[0] : false;\n}", "public function getBuyableWeight($options = null)\n {\n return 1;\n }", "public function getWeight()\n {\n return $this->getTypeInstance(true)->getWeight($this);\n }", "function ppom_get_field_option_price_by_id( $option, $product, $ppom_meta_ids ) {\n\t\n\t$data_name = isset($option['data_name']) ? $option['data_name'] : '';\n\t$option_id = isset($option['option_id']) ? $option['option_id'] : '';\n\t\n\t// soon we will remove this product param\n\t$product_id = null;\n\t$field_meta = ppom_get_field_meta_by_dataname($product_id , $data_name, $ppom_meta_ids );\n\t\n\tif( empty($field_meta) ) return 0;\n\t\n\t$field_type = isset($field_meta['type']) ? $field_meta['type'] : '';\n\t\n\tif( $field_type == 'bulkquantity' || $field_type == 'cropper' ) return 0;\n\t\n\t$option_price = 0;\n\t\n\tswitch( $field_type ) {\n\t\t\n\t\tcase 'image':\n\t\t\t\n\t\t\tif( isset( $field_meta['images']) ) {\n\t\t\t\tforeach( $field_meta['images'] as $option ) {\n\t\t\t\t\n\t\t\t\t\t$image_id\t= $field_meta['data_name'].'-'.$option['id'];\n\t\t\t\t\tif( $image_id == $option_id && isset($option['price']) && $option['price'] != '' ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(strpos($option['price'],'%') !== false){\n\t\t\t\t\t\t\t\t$option_price = ppom_get_amount_after_percentage($product->get_price(), $option['price']);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t// For currency switcher\n\t\t\t\t\t\t\t$option_price = apply_filters('ppom_option_price', $option['price']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t\n\t\t\tif( isset( $field_meta['options']) ) {\n\t\t\t\tforeach( $field_meta['options'] as $option ) {\n\t\t\t\n\t\t\t\t\tif( $option['id'] == $option_id && isset($option['price']) && $option['price'] != '' ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(strpos($option['price'],'%') !== false){\n\t\t\t\t\t\t\t\t$option_price = ppom_get_amount_after_percentage($product->get_price(), $option['price']);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t// For currency switcher\n\t\t\t\t\t\t\t$option_price = apply_filters('ppom_option_price', $option['price']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t}\n\t\n\t\n\treturn apply_filters(\"ppom_field_option_price_by_id\", wc_format_decimal($option_price), $field_meta, $option_id, $product);\n}", "public function getWeight() \r\n {\r\n return $this->weight;\r\n }", "public function getActiveWeightFeature()\n {\n $feature = $this->getSettingValue('weight_by', null);\n \t$feature = ($feature == '') ? null : $feature;\n \treturn $feature;\n }", "public function getWeight()\n {\n }", "public function getWeight()\n {\n }", "public function getProductOption();", "function get_attribute_options_name_by_option($options_id) {\n\t\tglobal $db;\n\t\t$query = 'SELECT opt.products_options_name ' .\n\t\t\t'FROM ' . TABLE_PRODUCTS_OPTIONS . ' AS opt ' .\n\t\t\t'WHERE opt.products_options_id = \\'' . (int)$options_id . '\\' ' .\n\t\t\t\t'AND opt.language_id = \\'' . (int)$_SESSION['languages_id'] . '\\' ' .\n\t\t\t'LIMIT 1';\n\n\t\tif($this->cache_time == 0) $queryResult = $db->Execute($query);\n\t\telse $queryResult = $db->Execute($query, false, true, $this->cache_time);\n\n\t\t$retval = array();\n\t\tif(!$queryResult->EOF) {\n\t\t\treturn $queryResult->fields['products_options_name'];\n\t\t}\n\t\treturn null;\n\t}", "public function getWeight()\n {\n return $this->weight;\n }", "public function getWeight()\n {\n return $this->weight;\n }" ]
[ "0.6191665", "0.58638585", "0.58638585", "0.58638585", "0.58638585", "0.58638585", "0.58638585", "0.58638585", "0.58079076", "0.56895196", "0.56337136", "0.56072605", "0.5544835", "0.5519514", "0.55130607", "0.5498959", "0.5483842", "0.5475379", "0.54700404", "0.5461338", "0.5446591", "0.5421586", "0.53883845", "0.5369526", "0.53502065", "0.53502065", "0.53494334", "0.53113747", "0.5309335", "0.5309335" ]
0.79470885
0
check if PPOM PRO is installed
function ppom_pro_is_installed() { $return = false; if( class_exists('PPOM_PRO') ) $return = true; return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function is_pro() \n {\n if($_SESSION['_version'] == '')\n { \n $conf = new Ossim_conf();\n $version = $conf->get_conf('ossim_server_version');\n $_SESSION['_version'] = (preg_match('/pro|demo/i',$version)) ? 'pro' : 'opensource';\n }\n \n return ($_SESSION['_version'] == 'pro') ? TRUE : FALSE; \n }", "function wrmp_is_installed()\n{\n\treturn wrmp_get_settingsgroup();\n}", "public function is_installed() { \n\n $sql = \"DESCRIBE `localplay_mpd`\";\n $db_results = Dba::query($sql);\n\n return Dba::num_rows($db_results);\n\n\t}", "function maneja_perfiles_produccion()\n\t{\n\t\treturn $this->get_instalacion()->es_produccion() && $this->instancia->get_proyecto_usar_perfiles_propios($this->identificador);\n\t}", "public function checkForManager() {\n\t\t\t// if activated return version\n\t\t\tif ( defined( 'WPFCM_VERSION' ) ) {\n\t\t\t\treturn WPFCM_VERSION;\n\t\t\t}\n\n\t\t\t// if installed return true\n\t\t\tif ( is_dir( $this->wpfcm_path ) || is_link( $this->wpfcm_path ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function hasInstall();", "static function checkExistingPropertyMembership(){\n\t global $mainframe,$configClass;\n $available_plans = self::getAllPlans();\n if(count($available_plans) > 0){\n foreach ($available_plans as $plan){\n $params = new JRegistry() ;\n $params->loadString($plan->params);\n $isOsproperty = $params->get('isospplugin',0);\n if($isOsproperty == 1){\n return true;\n }\n }\n }\n return false;\n }", "public function testIfStockManagementHasPromo()\n {\n $this->assertNotNull($this->stock->getPromo());\n }", "public function is_installed() {\n\n }", "function psswrdhsh_is_installed()\n{\n\tglobal $db, $settings;\n\n\tif (isset($settings['psswrd_cost'])) {\n\t\treturn true;\n\t}\n\n\tif ($db->field_exists('passwordhash', 'users')) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function is_installed()\n{\n return has_account() && has_meta();\n}", "public function isSetupRequired()\n {\n $methodCodes = Mage::getConfig()->getNode('global/payment/setup_required')->asArray();\n if (is_array($methodCodes) && count($methodCodes) > 0) {\n foreach (array_keys($methodCodes) as $methodCode) {\n $methodModel = Mage::getConfig()->getNode('default/payment/' . (string) $methodCode . '/model');\n if ($methodModel) {\n $model = Mage::getModel($methodModel);\n if ($model && method_exists($model, 'isAvailable') && $model->isAvailable()) {\n return true;\n }\n }\n }\n }\n\n return false;\n }", "private function is_required_plugin_installed() {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t$requvired_plugin_list = array(\n\t\t\t'rest-api/plugin.php',\n\t\t\t'butterbean/butterbean.php',\n\t\t);\n\t\tforeach ( $requvired_plugin_list as $plugin ) {\n\t\t\tif ( ! is_plugin_active( $plugin ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "protected static function isInstallToolSession() {}", "protected function photon_is_available() {\n\t\t$available = ! function_exists( 'jetpack_photon_url' )\n\t\t\t|| (\n\t\t\t\ttrue === defined( 'JETPACK_DEV_DEBUG' )\n\t\t\t\t&& true === constant( 'JETPACK_DEV_DEBUG' )\n\t\t\t);\n\n\t\treturn apply_filters(\n\t\t\t'wpcom_thumbnail_editor_photon_is_available',\n\t\t\t$available\n\t\t);\n\t}", "public function installed(): bool {\n global $media_admin;\n global $media_manager;\n\n // Handle if installed\n if(file_exists($this->filenameDb)) {\n if(!defined(\"PAW_MEDIA\")) {\n define(\"PAW_MEDIA\", basename(__DIR__));\n define(\"PAW_MEDIA_PATH\", PATH_PLUGINS . PAW_MEDIA . DS);\n define(\"PAW_MEDIA_DOMAIN\", DOMAIN_PLUGINS . PAW_MEDIA . \"/\");\n define(\"PAW_MEDIA_VERSION\", self::VERSION . \"-\" . strtolower(self::STATUS));\n }\n\n // Init MediaAdmin\n if(!class_exists(\"MediaAdmin\")) {\n require_once \"system\" . DS . \"admin.php\";\n\n if(PAW_MEDIA_PLUS) {\n require_once \"system\" . DS . \"admin-plus.php\";\n $media_admin = new MediaAdminPlus();\n } else {\n $media_admin = new MediaAdmin();\n }\n }\n\n // Init MediaManager\n if(!class_exists(\"MediaManager\")) {\n require_once \"system\" . DS . \"manager.php\";\n\n if(PAW_MEDIA_PLUS) {\n require_once \"system\" . DS . \"manager-plus.php\";\n $media_manager = new MediaManagerPlus();\n } else {\n $media_manager = new MediaManager();\n }\n }\n }\n return file_exists($this->filenameDb);\n }", "public function isAvailable() {\n return (function_exists('apc_fetch') || function_exists('apcu_fetch')) &&\n ini_get('apc.enabled') &&\n (ini_get('apc.enable_cli') || php_sapi_name() != 'cli');\n }", "public function isInstalled(){\n return true;\n }", "private function is_promotion_plugins_installed() {\n\t\treturn array_reduce( $this->promotion_plugins, function ( $should_show_notice, $plugin_name ) {\n\t\t\tif ( $should_show_notice ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn in_array( $plugin_name, $this->get_plugins(), true );\n\t\t}, false );\n\t}", "public function isWebPDelegateInstalled()\n {\n exec($this->getPath() . ' -version', $output, $returnCode);\n foreach ($output as $line) {\n if (preg_match('#WebP.*yes#i', $line)) {\n return true;\n }\n }\n return false;\n }", "function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}", "private function checkinstallrequirement()\r\n\t{\r\n\t\t$userCount = Core_User::getUsers(array(), '', '', '', true);\r\n\t\t\r\n\r\n\t\t\r\n\t\tif($userCount > 0)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\treturn true;\r\n\t}", "function fa_is_wptouch_installed(){\n\t$installed = class_exists('WPtouchPlugin') || class_exists('WPtouchPro');\n\treturn $installed;\n}", "public function hasPackageManager() {}", "public function checkRequirements()\n\t{\n\t\t$tests = array('result' => true);\n\t\t$tests['curl'] = array('name' => $this->l('PHP cURL extension must be enabled on your server'), 'result' => extension_loaded('curl'));\n\t\t$tests['mbstring'] = array('name' => $this->l('PHP Multibyte String extension must be enabled on your server'), 'result' => extension_loaded('mbstring'));\n\t\tif (Configuration::get('STRIPE_MODE'))\n\t\t\t$tests['ssl'] = array('name' => $this->l('SSL must be enabled on your store (before entering Live mode)'), 'result' => Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) && Tools::strtolower($_SERVER['HTTPS']) != 'off'));\n\t\t$tests['php52'] = array('name' => $this->l('Your server must run PHP 5.3.3 or greater'), 'result' => version_compare(PHP_VERSION, '5.3.3', '>='));\n\t\t$tests['configuration'] = array('name' => $this->l('You must sign-up for Stripe and configure your account settings in the module (publishable key, secret key...etc.)'), 'result' => $this->checkSettings());\n\n\t\tif (_PS_VERSION_ < 1.5)\n\t\t{\n\t\t\t$tests['backward'] = array('name' => $this->l('You are using the backward compatibility module'), 'result' => $this->backward, 'resolution' => $this->backward_error);\n\t\t\t$tmp = Module::getInstanceByName('mobile_theme');\n\t\t\tif ($tmp && isset($tmp->version) && !version_compare($tmp->version, '0.3.8', '>='))\n\t\t\t\t$tests['mobile_version'] = array('name' => $this->l('You are currently using the default mobile template, the minimum version required is v0.3.8').' (v'.$tmp->version.' '.$this->l('detected').' - <a target=\"_blank\" href=\"http://addons.prestashop.com/en/mobile-iphone/6165-prestashop-mobile-template.html\">'.$this->l('Please Upgrade').'</a>)', 'result' => version_compare($tmp->version, '0.3.8', '>='));\n\t\t}\n\n\t\tforeach ($tests as $k => $test)\n\t\t\tif ($k != 'result' && !$test['result'])\n\t\t\t\t$tests['result'] = false;\n\n\t\treturn $tests;\n\t}", "public static function isInstalled(){\n\t\treturn !empty(\\GO::config()->db_user);\n\t}", "protected function checkProcOpenFunctionExists() {\n\t\t$pass = function_exists('proc_open');\n\n\t\t$this->reports[] = t3lib_div::makeInstance('tx_reports_reports_status_Status',\n\t\t\t'proc_open() is available', // title\n\t\t\t$pass ? 'OK' : 'Disallowed', // value\n\t\t\t$pass ? '' : 'proc_open() is need to call the wkhtmltopdf binary. If it is disabled please ask your Administrator or Hoster for help.' , //message\n\t\t\t$pass ? tx_reports_reports_status_Status::OK : tx_reports_reports_status_Status::ERROR //severity\n\t\t);\n\n\t\treturn $pass;\n\t}", "function check_environment() {\n if (\n !is_plugin_active('woocommerce/woocommerce.php') and\n current_user_can('activate_plugins')\n ) {\n // Stop activation redirect and show error\n $this->deactivate_plugin();\n wp_die(\n 'Sorry, but this plugin requires the Woocommerce plugin to be installed and active. <br>\n <a href=\"' . admin_url('plugins.php') . '\">&laquo; Return to Plugins</a>'\n );\n }\n }", "function is_pppoe_server_enabled() {\n\t$pppoeenable = false;\n\n\tforeach (config_get_path('pppoes/pppoe', []) as $pppoes) {\n\t\tif ($pppoes['mode'] == 'server') {\n\t\t\t$pppoeenable = true;\n\t\t}\n\t}\n\n\treturn $pppoeenable;\n}", "function isInstalled() {\r\n return extension_loaded('memcache');\r\n }" ]
[ "0.69054514", "0.6480535", "0.6377539", "0.6371857", "0.6268326", "0.6264759", "0.62192017", "0.61864907", "0.61540776", "0.61431044", "0.6137815", "0.61196107", "0.6095046", "0.609409", "0.60756433", "0.60302", "0.6020771", "0.59893656", "0.5982791", "0.5964329", "0.59603524", "0.5956022", "0.59418607", "0.59388155", "0.59073985", "0.5904594", "0.58844644", "0.5854414", "0.5844366", "0.58433586" ]
0.84885454
0
Check if PPOM API is enable
function ppom_is_api_enable() { $api_enable = get_option( 'ppom_api_enable' ); $api_key = get_option( 'ppom_rest_secret_key' ); $return = false; if( $api_enable == 'yes' && $api_key != '' ) { $return = true; } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('smsnotifier/main_conf/active')==0) ? 0 : 1;\n\n }", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('easywebshopsms/api_connection/active')==0) ? false : true;\n }", "private function isApiAvailable() {\n\t\treturn get_option(\"wp_broadbean_ipavailibility\") == 1;\n\t}", "public function is_available() {\n\t\treturn $this->secret_api_key && $this->publishable_api_key;\n\t}", "public function CheckModule()\r\n\t{\r\n\t\tif($this->settings['API_KEY'] != $this->API_Key)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "private function isEnableOpenPlatform()\n {\n return $this->config()->has('wechat.open_platform');\n }", "public function getBypassAPI(): bool\n {\n return $this->isBypassAllowed(self::ENV_VARIABLE_BYPASS_2FA_API);\n }", "protected function is_api_loaded()\n {\n }", "public static function isApi()\n {\n return (self::getRequestType() == 'api')?true:false;\n }", "function is_pppoe_server_enabled() {\n\t$pppoeenable = false;\n\n\tforeach (config_get_path('pppoes/pppoe', []) as $pppoes) {\n\t\tif ($pppoes['mode'] == 'server') {\n\t\t\t$pppoeenable = true;\n\t\t}\n\t}\n\n\treturn $pppoeenable;\n}", "public function get_api_is_reachable() {\n\t\t$enabled = get_option( 'algolia_api_is_reachable', 'no' );\n\n\t\treturn 'yes' === $enabled;\n\t}", "public function isApiLoggingOn() {\n\t\treturn $this->apiLoggingOn;\n\t}", "public function isAPI(){\n $paths = explode(\"/\", $this->path);\n if(isset($paths[0]) && strtolower($paths[0])==\"api\"){\n return true;\n }\n return false;\n }", "function isEnabled()\n{\n global $avahips_config;\n\n // Load Avahi-PS configuration file\n $aps_cfg = load_conffile($avahips_config);\n\n // Check for IPFS as a backend database for publication\n if (isset($aps_cfg['DATABASE']) && strpos($aps_cfg['DATABASE'], 'ipfs') !== false) {\n return true;\n }\n return false;\n}", "public function is_available() {\n if ($this->enabled == \"yes\") {\n if (!is_ssl() && !$this->testmode) {\n return false;\n }\n // Required fields check\n if (!$this->secret_key || !$this->publishable_key) {\n return false;\n }\n return true;\n }\n return false;\n }", "public function hasApiSupport()\n {\n $api = 'getStatus,pauseQueue,resumeQueue,setSpeedLimit,moveDown,moveUp'\n .',moveTop,moveBottom,setCategory,delete,pause,resume,getVersion';\n\n return $api;\n }", "public function checkApiIsUp() {\n\t\t$result = $this->useCfCURLQuery( \"https://socket.bittrex.com/signalr/ping\" );\n\t\tif ( $result ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function api_connected() {\n\t\treturn ! empty( $this->api );\n\t}", "public function isEnabledPdp()\n {\n return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_PDP);\n }", "function woo_multibanco_gateway_check_api() {\n\t\t$api_key = $this->api_key;\n\t\t\n\t\tif($api_key == \"sk_live_XXXXXXXXXXXXXXXXXXXXXXXX\" || $api_key == \"sk_test_XXXXXXXXXXXXXXXXXXXXXXXX\") {\n\t\t\tadd_action('admin_notices', array($this, 'woo_multibanco_gateway_api_key_admin_notice_error'));\n\t\t}\n\t}", "public function isMobileApiCall() {\n\t\t\t\t\t\theader('Access-Control-Allow-Origin:*');\n\t\theader('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');\n\t\theader('Access-Control-Max-Age: 286400');\n\t\theader('Access-Control-Allow-Credentials: true');\n\t\theader('Access-Control-Allow-Headers: xocmerchantid,XOCMERCHANTID,XOCSESSION,xocsession,purpletreemultivendor,Purpletreemultivendor,PURPLETREEMULTIVENDOR');\n\t\tif(NULL !== apache_request_headers()){\n\t\t\tforeach(apache_request_headers() as $key =>$value) {\n\t\t\t\tif($key == 'purpletreemultivendor' || $key == 'Purpletreemultivendor' || $key == 'PURPLETREEMULTIVENDOR') {\n\t\t\t$key = strtolower($key);\n\t\t\t\t\tif ($this->config->get('module_purpletree_multivendor_status')) {\n\t\t\t\t\t\t$query = $this->db->query(\"SELECT * FROM `\" . DB_PREFIX . \"api` WHERE `username` = '\" . $key . \"' AND `key` ='\" . $value . \"'\");\n\t\t\t\t\t\tif($query->num_rows) {\n\t\t\t\t\t\t\treturn true;\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\treturn false;\n\t}", "function ppom_pro_is_installed() {\n\t\n\t$return = false;\n\t \n if( class_exists('PPOM_PRO') ) \n $return = true;\n return $return;\n}", "protected function photon_is_available() {\n\t\t$available = ! function_exists( 'jetpack_photon_url' )\n\t\t\t|| (\n\t\t\t\ttrue === defined( 'JETPACK_DEV_DEBUG' )\n\t\t\t\t&& true === constant( 'JETPACK_DEV_DEBUG' )\n\t\t\t);\n\n\t\treturn apply_filters(\n\t\t\t'wpcom_thumbnail_editor_photon_is_available',\n\t\t\t$available\n\t\t);\n\t}", "public function isApiKeyConfigured()\n {\n $public_key = Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/bitcoin/public_key'));\n $private_key = Mage::helper('core')->decrypt(Mage::getStoreConfig('payment/bitcoin/private_key'));\n return (!empty($private_key) && !empty($public_key));\n }", "public function isPreflightRequest(): bool;", "public function hasPrequest(){\n return $this->_has(5);\n }", "public function validateApiKey()\n {\n $request = $this->call('GET', 'helper/ping');\n return !empty($request);\n }", "private function _api_key_exists()\n {\n $apikey = Apikey::where('secret', '=', $this->_key)->first();\n if (!$apikey) {\n return false;\n }\n return true;\n }", "public function isAvailable() {\n return (function_exists('apc_fetch') || function_exists('apcu_fetch')) &&\n ini_get('apc.enabled') &&\n (ini_get('apc.enable_cli') || php_sapi_name() != 'cli');\n }", "public function is_available() {\n\t\tif ( 'yes' !== $this->enabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->public_key || ! $this->private_key ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}" ]
[ "0.75032777", "0.7477567", "0.7121077", "0.6863208", "0.6684061", "0.65131193", "0.64794034", "0.63284594", "0.63188964", "0.6296806", "0.62729245", "0.6252122", "0.62325364", "0.6227953", "0.622382", "0.6220688", "0.62200266", "0.6203007", "0.6173819", "0.6152772", "0.61465085", "0.6125448", "0.6125397", "0.61087483", "0.60798156", "0.6068108", "0.60625017", "0.6039251", "0.60234874", "0.60007465" ]
0.82539874
0
Check if field is visible
function ppom_is_field_visible( $field ) { if( ! ppom_pro_is_installed() ) return true; $visibility = isset($field['visibility']) ? $field['visibility'] : 'everyone'; $visibility_role = isset($field['visibility_role']) ? $field['visibility_role'] : ''; $is_visible = false; switch( $visibility ) { case 'everyone': $is_visible = true; break; case 'members': if( is_user_logged_in() ) { $is_visible = true; } break; case 'guests': if( ! is_user_logged_in() ) { $is_visible = true; } break; case 'roles': $role = ppom_get_current_user_role(); $allowed_roles = explode(',', $visibility_role); if( in_array($role, $allowed_roles) ) { $is_visible = true; } break; } return apply_filters('ppom_is_field_visible', $is_visible, $field); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_visible() {\n\t\treturn true;\n\t}", "function is_visible()\n\t{\n\t\treturn $this->visible;\n\t}", "public function is_visible() {\n\t\treturn isset( $this->data['visible'] ) && $this->data['visible'];\n\t}", "function isVisible() {\n return ($this->entry->staff_id || $this->entry->user_id)\n && $this->entry->type != 'R' && $this->isEnabled();\n }", "function visible() {\n\t\treturn $this->attribute_bool(\"visible\")\n\t\t && $this->visible_range()->contains_now();\n\t}", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && !parent::isEnabled();\n }", "public function isVisible() {\n return !is_null($this->num);\n }", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && $this->isEnabled();\n }", "function is_visible() {\n\t\tif ($this->visibility=='hidden') return false;\n\t\tif ($this->visibility=='visible') return true;\n\t\tif ($this->visibility=='search' && is_search()) return true;\n\t\tif ($this->visibility=='search' && !is_search()) return false;\n\t\tif ($this->visibility=='catalog' && is_search()) return false;\n\t\tif ($this->visibility=='catalog' && !is_search()) return true;\n\t}", "public function isVisible();", "public function isVisible();", "public function isVisible()\n {\n return $this->attribute('state') != self::STATUS_MODERATED;\n }", "protected function hasSecuredHiddenFieldsRendered() {}", "public function isVisible()\n {\n return true;\n }", "public function isVisible() : bool\n {\n return $this->attributes['visible'] ? true : false;\n }", "public function isVisible() {\n return ($this->visible && $this->state != \"unavailable\");\n }", "function is_field_displayed($field)\n {\n global $ref, $resource, $upload_review_mode;\n\n # Field is an archive only field\n return !(($resource[\"archive\"]==0 && $field[\"resource_type\"]==999)\n # Field has write access denied\n || (checkperm(\"F*\") && !checkperm(\"F-\" . $field[\"ref\"])\n && !($ref < 0 && checkperm(\"P\" . $field[\"ref\"])))\n || checkperm(\"F\" . $field[\"ref\"])\n # Upload only field\n || (($ref < 0 || $upload_review_mode) && $field[\"hide_when_uploading\"] && $field[\"required\"]==0)\n || hook('edithidefield', '', array('field' => $field))\n || hook('edithidefield2', '', array('field' => $field)));\n }", "public function isVisible() :bool {\n return false;\n }", "public function isVisible() {\n\t\tif ($this->hidden === TRUE) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function isVisible() : bool\n {\n return $this->visible;\n }", "public function isInvisible() {\n return !$this->isVisible();\n }", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function isHidden();", "function getVisible() {return $this->readVisible();}", "function getVisible() { return $this->readVisible(); }", "function getVisible() { return $this->readVisible(); }", "function visible () {\n\t\treturn isadmin();\n\t}", "static public function isVisible(): bool\n {\n return static::$visible;\n }" ]
[ "0.73611224", "0.7178339", "0.71038437", "0.7077458", "0.707198", "0.70577866", "0.70443815", "0.69755054", "0.69713056", "0.6948328", "0.6948328", "0.68993956", "0.68698716", "0.68657124", "0.6821235", "0.682056", "0.67540157", "0.673632", "0.6734275", "0.67182463", "0.67053545", "0.6688295", "0.6688295", "0.6688295", "0.6688295", "0.66521555", "0.66276646", "0.66083604", "0.6604374", "0.6600063" ]
0.72117555
1
If price set by pricematrix in cart return matrix
function ppom_get_price_matrix_chunk($product, $option_prices, $ppom_item_order_qty) { $matrix_found = ''; $pricematrix_field = ppom_has_field_by_type(ppom_get_product_id($product), 'pricematrix'); // ppom_pa($pricematrix_field); if ( ! $pricematrix_field ) return $matrix_found; if( count($pricematrix_field) > 0 ) { foreach( $pricematrix_field as $pm ) { //iterecting option_prices foreach( $option_prices as $op ) { if( $op['apply'] != 'matrix_discount' && $op['apply'] != 'matrix') continue; if( $op['data_name'] == $pm['data_name'] ) { $pricematrix_field = $pm; break; } } } // $pricematrix_field = $pricematrix_field[0]; $matrix_found = ppom_extract_matrix_by_quantity($pricematrix_field, $product, $ppom_item_order_qty); } return apply_filters('ppom_price_matrix_found_in_cart', $matrix_found, $product, $option_prices); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function price(){\n\n\t\t$total = 0; //initialize to 0 lest error\n\n\t\tglobal $con;\n\n\t\t$ip=getIP();\n\n\t\t$sel_price = \"select * from cart where ip_add='$ip'\"; //get price from what is in the cart for whoevers ip address\n\n\t\t$run_price = mysqli_query($con, $sel_price);\n\n\t\twhile ($p_price = mysqli_fetch_array($run_price)){\n\n\t\t\t$pro_id = $p_price['p_id'];\n\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\n\t\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\n\t\t\t//link to the products table to get prices\n\t\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){\n\n\t\t\t\t$product_price = array($pp_price['product_price']);\n\t\t\t\t//array to get all the prices in one\n\n\t\t\t\t$values = array_sum($product_price);\n\n\t\t\t\t$total +=$values; //sum\n\n\t\t\t}\n\t\t}\n\n\t\techo \"Ksh\" . $total;\n\n\t}", "public function getPrice()\n {\n $db = new db_connector();\n $conn = $db->getConnection();\n\n $stmt = \"SELECT `Order List`.orderID, `Order List`.PQuantity, `Product`.PPrice, `Product`.PID\n FROM `Order List`\n LEFT JOIN `Product`\n ON `Order List`.productID = `Product`.PID\";\n\n $result5 = $conn->query($stmt);\n\n if($result5)\n {\n $price_array = array();\n\n while($price = $result5->fetch_assoc())\n {\n array_push($price_array, $price);\n }\n $total = 0;\n $curr = 0;\n for($x = 0; $x < count($price_array); $x ++)\n {\n // echo \"price array \" . $price_array[$x]['orderID'] . \"<br>\";\n // echo \"session order id \" . $_SESSION['orderID'] . \"<br>\";\n\n if($price_array[$x]['orderID'] == $_SESSION['orderID'])\n {\n\n // echo $price_array[$x]['orderID'];\n // echo $price_array[$x]['PQuantity'];\n\n $curr = ((float) $price_array[$x]['PPrice'] * (float) $price_array[$x]['PQuantity']);\n $total = $total + $curr;\n $curr = 0;\n }\n }\n echo \"$\" . $total;\n return $total;\n }\n }", "function priceCart(){\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$sum += $book['precio']*$book['cantidad'];\n\t\t}\n\t\treturn $sum;\n\t}", "function total_price(){\n\t$total = 0; // agei instantiate kore dilam j zero\n\tglobal $con;\n\t$ip=getIp();\n\t$sel_price = \"select * from cart where ip_add='$ip'\";\n\t$run_price=mysqli_query($con, $sel_price);\n\twhile($p_price=mysqli_fetch_array($run_price)){\n\t\t$pro_id=$p_price['p_id'];//ip address wise product er id ta dibe, from there we can tell what is the prrice of product\n\t\t$pro_price=\"select * from products where product_id='$pro_id'\"; // cart table theke product id ta niye seta k product table er product ider sathe match kortese\n\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){// product table theke product id wise product price ta niye ashtese\n\t\t\t\t$product_price= array($pp_price['product_price']); //that certain user joto product cart a add korsilo segula sob k akta array te rakhlam\n\t\t\t\t$values= array_sum($product_price); //oi uporer array er sumation kore show korbe akta value..like total value \n\t\t\t\t$total+=$values;\n\t\t\n\t\t}\n\n\t}\n\techo $total;\n}", "public function magicMethod(){\n $cart = $this->_getCart();\n $quoteArrayFreeProducts = array();\n $quoteArrayNonFreeProducts = array();\n $AddThisInCart = array();\n $finalAdd = array();\n\n // finding both free and non free products and saving them in array\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n foreach($quote->getAllVisibleItems() as $item) {\n if($item->getData('price') == 0){\n $quoteArrayFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayFreeProducts['qty'][] = $item->getData('qty');\n }else{\n $quoteArrayNonFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayNonFreeProducts['qty'][] = $item->getData('qty');\n }\n }\n \n // print_r($quoteArrayFreeProducts);die;\n // finding free associatied produts and adding them in another array\n for($i = 0; $i < count($quoteArrayNonFreeProducts['item_id']) ;$i++){\n $product = Mage::getModel('catalog/product')->load($quoteArrayNonFreeProducts['item_id'][$i]);\n // print_r($product->getAttributeText('buyxgety'));die;\n if($product->getAttributeText('buyxgety') == 'Enable'){\n $Buyxgety_xqty = $product->getBuyxgety_xqty();\n $Buyxgety_ysku = $product->getBuyxgety_ysku();\n $Buyxgety_yqty = $product->getBuyxgety_yqty();\n\n // $Buyxgety_ydiscount = $product->getBuyxgety_ydiscount();\n if(!empty($Buyxgety_xqty) && !empty($Buyxgety_ysku) && !empty($Buyxgety_yqty) ){\n // die($Buyxgety_ysku);\n $AddThisInCart['item_id'][] = Mage::getModel('catalog/product')->getIdBySku($Buyxgety_ysku);\n $AddThisInCart['qty'][] = (int)($quoteArrayNonFreeProducts['qty'][$i]/$Buyxgety_xqty)*$Buyxgety_yqty;\n }\n }\n }\n for($i = 0; $i < count($AddThisInCart['item_id']) ;$i++){\n if(isset($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']) ;$j++){\n if($AddThisInCart['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i] - $quoteArrayFreeProducts['qty'][$j];\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n for($j = 0; $j < count($quoteArrayNonFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayNonFreeProducts['item_id'][$j]){\n foreach ($quoteArrayFreeProducts['item_id'] as $value) {\n if($value == $finalAdd['item_id'][$i]){\n $flag = 1;\n }else{\n $flag = 0;\n }\n }\n if($flag == 1){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }\n if(!empty($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }else{\n $finalAdd['new_row'][] = 1;\n } \n }\n\n // print_r($finalAdd);die;\n\n if(isset($finalAdd['item_id'])){\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n if($finalAdd['qty'][$i] > 0){\n Mage::getSingleton('core/session')->setMultilineAddingObserver($finalAdd['new_row'][$i]);\n Mage::getSingleton('core/session')->setZeroSettingObserver(1);\n if($finalAdd['new_row'][$i] == 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->magicMethod();\n }\n }\n }else{\n $productToAdd = $product->load($finalAdd['item_id'][$i]);\n $params['qty'] = $finalAdd['qty'][$i];\n $params['product'] = $finalAdd['item_id'][$i];\n $cart->addProduct($productToAdd, $params);\n $cart->save();\n }\n }else if($finalAdd['qty'][$i] < 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->_updateShoppingCart();\n }\n } \n }\n }\n }\n }", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "public function hasPrice(){\n return $this->_has(12);\n }", "function totalPrice() {\n\n $total = 0;\n\n global $con;\n\n $ip = getIp();\n\n $run_price = mysqli_query($con,\"SELECT * FROM cart WHERE ip_add = '$ip'\");\n\n while($row_pro_price = mysqli_fetch_array($run_price)) {\n\n $pro_id = $row_pro_price['p_id'];\n $pro_qty = $row_pro_price['qty'];\n\n $run_pro_price2 = mysqli_query($con,\"SELECT * FROM products WHERE product_id = '$pro_id'\");\n\n while($row_pro_price2 = mysqli_fetch_array($run_pro_price2)) {\n\n $pro_price = array($row_pro_price2['product_price']);\n\n $pro_price_single = $row_pro_price2['product_price'];\n\n $pro_price_values = array_sum($pro_price);\n\n\n $total += $pro_price_values;\n\n if($pro_qty > 1) {\n $pro_price_single_all = $pro_price_single * $pro_qty;\n $total = $total + $pro_price_single_all - $pro_price_single;\n }\n\n\n }\n\n }\n echo \"$\" . $total;\n }", "protected function calculatePrices()\n {\n }", "function getCartArr ($cartStr)\n{\n\t// 1 -> OK\n\t// 2 -> invalid item\n\tglobal $currency,$currfactor,$cartArr,$isAllowExpressDlvry;\n\t$returnVal = 1;\n\tif ($invSrv == \"\") { $invSrv = new Inventory(); }\n\n\t$factory = new Product_service_factory();\n\t$prod_serv = $factory->get_instance('SE', $currency);\n\n\tif(strlen($cartStr)==0) return 0;\n\telse\n\t{\n\t\t$strArr = explode(',', $cartStr);\n\n\t\t//$addedfreexmas=\"N\";\n\n\t\tforeach ($strArr as $thisStr)\n\t\t{\n\t\t\t$pg_source = 0;\n\t\t\tif (strlen($thisStr)!=0)\n\t\t\t{\n\t\t\t\tlist($thisPid, $thisQty,$thisPrice) = explode('-',$thisStr);\n\t\t\t\tif ($currency == 'usd')\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity, IF(ISNULL(sp.mainid), 1, 0) pg_source\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\tSELECT mainid\n\t\t\t\t\t\t\tFROM supplierprodstb\n\t\t\t\t\t\t\tWHERE iscurrentUS = '1'\n\t\t\t\t\t\t\t) sp\n\t\t\t\t\t\t\tON productstb.prodid = sp.mainid\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\t\tSELECT quantity\n\t\t\t\t\t\t\tFROM productstb\n\t\t\t\t\t\t\t$join_clause\n\t\t\t\t\t\t\t\";\n\t\t\t\t}\n\n\t\t\t\t$thisPid = prevention_numeric($thisPid, 1, $cartStr);\n\t\t\t\t$sql .= \"\n\t\t\t\t\t\tWHERE prodid='\" . $thisPid . \"'\n\t\t\t\t\t\tAND site='SE'\n\t\t\t\t\t\tAND active='1'\n\t\t\t\t\t\t$additional_where\n\t\t\t\t\t\t\";\n\t\t\t\t$get_price = mysql_query_escape($sql) or die(\"Error @\".__LINE__);\n\t\t\t\t//echo $isAllowExpressDlvry;\n\t\t\t\tif ($isAllowExpressDlvry)\n\t\t\t\t{\n\t\t\t\t\tif (!$invSrv->isStockAvail($thisPid, \"IM\")) {\n\t\t\t\t\t\t$isAllowExpressDlvry = false;\n\t\t\t\t\t\t//echo \"falsenow(\".$thisPid.\")<br>\";\n\t\t\t\t\t\t//echo \"2\";\n\t\t\t\t\t}\n\t\t\t\t\t//echo \"now(\".$thisPid.\")<br>\";\n\t\t\t\t}\n\t\t\t\t//Tommy check pg_source;\n\t\t\t\tif ($currency == 'usd' || $currency == 'aud')\n\t\t\t\t{\n\t\t\t\t\t//$pg_source = mysql_result($get_price,0,'pg_source');\n\t\t\t\t\t$prod_info = $prod_serv->get_product_info($thisid);\n\n\t\t\t\t\t$pg_source = $prod_serv->is_pg_sourcing($prod_info);\n\t\t\t\t}\n\t\t\t\t// End of modification for CR090319-001\n\t\t\t\tif(mysql_num_rows($get_price)!=1 || $thisQty<1 || $pg_source)\n\t\t\t\t{\n\t\t\t\t\t$returnVal = 2;\n\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Daniel - 20090409 - also check the advertised quantity with quantity in cart\n\t\t\t\t\t$listqty = mysql_result($get_price,0,'quantity');\n\t\t\t\t\tif($listqty==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$returnVal = 2;\n\t\t\t\t\t}\n\t\t\t\t\telseif($thisQty<=$listqty)\n\t\t\t\t\t{\n\t\t\t\t\t\t//end of 20090409\n\n\t\t\t\t\t\t// get listprice starts here\n\t\t\t\t\t\tinclude_once(COMMONPATH . 'srv_list.php');\n\t\t\t\t\t \t$dto = $srv->get_product_info($thisPid);\n\t\t\t\t\t\t$price = $dto->get_price();\n\n\t\t\t\t\t\t$thisListprice = $price;\n\n\t\t\t\t\t\tif($currency == 'hkd')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = number_format($thisListprice * $dto->get_rate_hkd(),2,'.','');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// get listprice ends here\n\n\t\t\t\t\t\t//added for xmas - start\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t$mycarttotal = $mycarttotal-(-($thisQty*$thisListprice));\n\n\n\n\t\t\t\t\t\tif($mycarttotal>99 && $thisPid==\"1823\" && $addedfreexmas!=\"Y\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$addedfreexmas=\"Y\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//echo \"A added - $thisPid-$thisQty-$thisListprice <br><br>\";\n\t\t\t\t\t\t//added for xmas - end\n\t\t\t\t\t\tif($thisPid==\"1823\" && ($thisPrice=='0.00'||$thisPrice=='0'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$thisListprice = 0.00;\n\t\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t\t//do nothing\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$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// added for xmas - start\n\t\t//check if there is already a 1823-1-0.00 in the cartarr\n\t\t/*\n\t\tforeach ($cartArr as $thisxmaspromo)\n\t\t{\n\t\t\t//echo \"A\".$thisxmaspromo[0].\"-\".$thisxmaspromo[2].\"<br>\";\n\n\n\t\t\tif(($thisxmaspromo[0]==\"1823\") && ($thisxmaspromo[2]==\"0.00\"||$thisxmaspromo[2]==\"0\"))\n\t\t\t{\n\t\t\t\t$addedfreexmas = \"Y\";\n\t\t\t}\n\t\t}\n\n\n\t\tif($mycarttotal>99 && $addedfreexmas!=\"Y\")\n\t\t{\n\t\t\t$cartArr[] = array(\"1823\",\"1\",\"0.00\");\n\t\t\t$addedfreexmas=\"Y\";\n\t\t\t//echo \"B added <br><br>\";\n\t\t}\n\t\t*/\n\t\t//added for xmas - end\n\t}\n\treturn $returnVal;\n}", "function tep_get_productPrice($product_id){\n\tif ($product_id){\n\t\tglobal $languages_id,$pf;\n\t\t$product_query = tep_db_query(\"select p.products_id,p.products_price,products_discount from \" . TABLE_PRODUCTS . \" p where p.products_id=\".(int)$product_id );\n\t\tif (tep_db_num_rows($product_query)) {\n\t\t\t$product = tep_db_fetch_array($product_query);\n\t\t\t$product_price = $product['products_price'];\n\t\t\t$rata = $product['products_discount'] > 0 ? number_format((1/(1-$product['products_discount']/100)),2,'.','') : PRODUCTS_RATE;//( $product['products_discount'] > 0 )? number_format( (1 - ($product['products_discount'] / 100)) , 2) : PRODUCTS_RATE;\n\t\t\t//$retail_price = $product['products_price'] * PRODUCTS_RATE;// * $rata;//\n\t\t\t//echo $rata;\n\t\t\t$pf -> loadProduct($product['products_id'],$languages_id);\n\t\t\t$result = array();\n\t\t\t$result['rsPrice'] = $pf -> getRetailSinglePrice($rata);\n\t\t\t$result['sPrice'] = $pf -> getSinglePrice();\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}else{\n\t\treturn false;\n\t}\n}", "function total_price() {\n\t\n\t $ip_add = getRealIpAddr();\n\t\t\n\t\tglobal $db;\n\t\t\n\t\t$total=0;\n\t\t\n\t\t$sel_price = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_price = mysqli_query($db, $sel_price);\n\t\t\n\t\twhile ($record= mysqli_fetch_array($run_price)){\n\t\t\t\n\t\t\t$pro_id = $record['p_id'];\n\t\t\t\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\t\t\t\n\t\t\t$run_pro_price = mysqli_query($db,$pro_price);\n\t\t\t\n\t\t\twhile($p_price=mysqli_fetch_array($run_pro_price)){\n\t\t\t\t\n\t\t\t\t$product_price = array($p_price['product_price']);\n\t\t\t\t\n\t\t\t\t$values = array_sum($product_price);\n\t\t\t\t\n\t\t\t\t$total += $values;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\techo \"Rs\" . $total;\n\t\n}", "function total_price(){\n\t$total=0;\n\tglobal $conn;\n\t$ip = getIp();\n\t$sql = \"SELECT * FROM cart where ip_add='$ip'\";\n\t$result = $conn->query($sql);\n\twhile($row=$result->fetch_assoc()){\n\t\t$pro_id= $row[\"p_id\"];\n\t\t$pro_price= \"SELECT * FROM products where product_id='$pro_id' AND stock='0'\";\n\t\t$result2 = $conn->query($pro_price);\n\t\twhile($row2=$result2->fetch_assoc()){\n\t\t\t$product_price= array($row2[\"product_price\"]);\n\t\t\t$values = array_sum($product_price);\n\t\t\t$total +=$values;\n\t\t\t}\n\t}\n\techo number_format($total) ;\n}", "function total_price($cart){\n\t\t$price = 0.0;\n\t\tif(is_array($cart)){\n\t\t \tforeach($cart as $isbn => $qty){\n\t\t \t\t$medicineprice = getmedicineprice($isbn);\n\t\t \t\tif($medicineprice){\n\t\t \t\t\t$price += $medicineprice * $qty;\n\t\t \t\t}\n\t\t \t}\n\t\t}\n\t\treturn $price;\n\t}", "function total_price(){\n\t\t\n\t global $db;\n\t \n $ip_add = getRealIpAddr(); /* saving ip address in local variable*/\n\t \n\t $total = 0; /*price should start from 0*/\n\n\t $sel_price =\"SELECT * FROM cart WHERE ip_add = '$ip_add'\"; /* when user is online,detect its ip address by selecting it from cart table*/\n\t\t\n\t$run_price = mysqli_query($db,$sel_price);\n\t\n\twhile($record=mysqli_fetch_array($run_price)) {\n\t\t\n\t$pro_id = $record['p_id'];\t /* We fetched p_id from cart table in database with fetch array.fetchimg all ids that are selected bu user till now*/\n\t /* relation between two tables.we are running another query cos price is not included in cart table.its in products table.so we are making relation between two tables to fetch price from another table*/\n\t$pro_price =\"SELECT * FROM products WHERE product_id= '$pro_id'\"; /* Now we are finding id in products table in database,those id that are present in cart table in database.only then we would able to get price of products*/\n\t\t\n\t$run_pro_price = mysqli_query($db,$pro_price);\n\t\n\twhile($p_price=mysqli_fetch_array($run_pro_price)){\n\t\t\n\t\t\n\t\t$product_price = array($p_price['product_price']); /* We need product_price from products table.we used array because we need multiple prices of products in array form like,500,400,300 and so on*/ \n\t\n\t $values = array_sum($product_price); /* we added prices of all products with the help of array_sum.its easy to add 2 things in php.but if things are more than 2 then arraysum is used to add sum of arrays.it will add price of records one by one as user click add cart button */\n\t\n\t $total += $values; /* we added values variable to total variable that was zero.if you delete products it will show 0*/\n\t\n\t}\n\t\n\t\n\t}\n\t\n\t echo \"$\" . $total; /* \"$\" currency*/\n\t}", "function total_price(){\n\t\n\t\t$total = 0;\n\t\t\n\t\tglobal $con; \n\t\t\n\t\t$ip = getIp(); \n\t\t\n\t\t\n\t\tif(isloggedin()){\n\t\t $c_id=$_SESSION['cid'];\n\t\t \n\t\t $sel_price = \"select * from cart where customer_id='$c_id'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t \n\t\t }\n\t\t}\n\t\telse{\n \t\t \n \t\t$sel_price = \"select * from cart where ip_add='$ip' AND customer_id='0'\";\n \t\t$run_price = mysqli_query($con, $sel_price); \n \t\t\n \t\twhile($p_price=mysqli_fetch_array($run_price)){\n \t\t\t\n \t\t\t$pro_id = $p_price['p_id']; \n \t\t\t$pro_qty =$p_price['qty'];\n \t\t\t\n \t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n \t\t\t$run_pro_price = mysqli_query($con,$pro_price); \n \t\t\t\n \t\t\twhile ($pp_price = mysqli_fetch_array($run_pro_price)){\n \t\t\t\n \t\t\t$product_price = array($pp_price['product_price']*$pro_qty);\n \t\t\t$values = array_sum($product_price);\n \t\t\t\n \t\t\t$total +=$values;\n \t\t\t\n \t\t\t}\n\t\t\n\t\t }\n\t\t\n\t\t}\n\t\t\n\t\techo \" €\" . $total.\" \";\n\t\t\n\t}", "public function getCartPrice()\n {\n return 111;\n }", "public function hasPrice(){\n return $this->_has(5);\n }", "function total_price2(){\n\tglobal $conn;\n\t$ip = getIp();\n\t$total=0;\n\t$get_cart =mysqli_query($conn, \"SELECT * FROM `cart` WHERE `ip_add`='$ip'\");\n\twhile ( $row_cart=mysqli_fetch_array($get_cart)) {\n\t\t# code...\n\n\t\t$quantity= $row_cart[\"qty\"];\n\t\t$product_id=$row_cart['p_id'];\t\n\n\t$get_price =mysqli_query($conn, \"SELECT * FROM `products` WHERE `product_id`='$product_id' AND `stock`='0'\");\n\twhile ( $row_price = mysqli_fetch_array($get_price)) {\n\t\n\t\t$price= $row_price[\"product_price\"];\n\n\t//get the subtotal\n\t$sub_total=$price * $quantity;\n\n\t$total +=$sub_total;\n\t}\n\t\n\t}\n\t\n\n\treturn $total;\n\n\t\n}", "function total_price()\r\n{\r\n global $db;\r\n $total=0;\r\n $ip_add=getRealIpAddr();\r\n $sel_price=\"select * from cart where ip_add='$ip_add'\";\r\n $run_price=mysqli_query($db,$sel_price);\r\n while($record=mysqli_fetch_array($run_price))\r\n {\r\n $pro_id=$record['p_id'];\r\n $pro_price=\"select * from products where product_id='$pro_id'\";\r\n $run_pro_price=mysqli_query($db,$pro_price);\r\n while($p_price=mysqli_fetch_array($run_pro_price))\r\n {\r\n $product_price=array($p_price['product_price']);\r\n $values=array_sum($product_price);\r\n $total +=$values;\r\n }\r\n }\r\n echo \"Rs. \" .$total;\r\n \r\n}", "public function getCartProduct(){\n $sId = session_id();\n $squery = \"SELECT * FROM tbl_cart WHERE sId='$sId'\";\n $result = $this->db->select($squery);\n if ($result) {\n return $result;\n }else {\n return false;\n }\n }", "public function isIncludedInPrice();", "public function getPrices()\n {\n }", "public function getCartProducts() :array\n {\n $products = [];\n $query = $this->pdo->prepare(\"SELECT products.id,products.name,products.price,orders_products.quantity,products.image,products.price*orders_products.quantity as summ from products\nINNER JOIN orders_products on products.id=orders_products.product_id\nINNER JOIN orders on orders.id = orders_products.order_id\nWHERE orders.user_id = :id AND orders.status='cart'\");\n $query->execute(array('id'=>$_SESSION['user_id']));\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n foreach ($row as $key => $value) {\n $this->amount+=$row[$key]['price']*$row[$key]['quantity'];\n }\n Cart::setSum($this->amount);\n foreach ($row as $r) {\n array_push($products, $this->mapArrayToProduct($r));\n }\n return $products;\n }", "public function getCart();", "public function getCartable();", "public function getActiveCartProducts();", "function total_price(){\n $ip_add=getRealIpAddr();\n $total=0;\n global $db;\n $sel_price=\"select * from cart where ip_add='$ip_add'\";\n $run_price =mysqli_query($db,$sel_price);\n while($record=mysqli_fetch_array($run_price)){\n \n $prod_id=$record['p_id'];\n $prod_price=\"select * from products where product_id='$prod_id'\";\n $run_pro_price=mysqli_query($db,$prod_price);\n while($p_price=mysqli_fetch_array($run_pro_price)){\n $product_price=array($p_price['product_price']);\n $values=array_sum($product_price);\n $total = $total + $values;\n }\n }\n\n echo \"INR \" . $total;\n}", "abstract public function getPrice();", "function getCartArr ($cartStr) {\r\n\t// 1 -> OK\r\n\t// 2 -> invalid item\r\n\tglobal $currency,$currfactor,$cartArr,$isAllowExpressDlvry;\r\n\t$returnVal = 1;\r\n\tif ($invSrv == \"\") { $invSrv = new Inventory(); }\r\n\r\n\tif(strlen($cartStr)==0) return 0;\r\n\telse{\r\n\t\t$strArr = explode(',', $cartStr);\r\n\t\tforeach ($strArr as $thisStr) {\r\n\t\t\tif (strlen($thisStr)!=0) {\r\n\t\t\t\tlist($thisPid, $thisQty,$thisPrice) = explode('-',$thisStr);\r\n\t\t\t\t$get_price = mysql_query(\"select listprice,listprice_eu,listprice_au from productstb where prodid='$thisPid' and status='listed' limit 1\") or die(\"Error @\".__LINE__);\r\n\t\t\t\tif ($isAllowExpressDlvry) {\r\n\t\t\t\t\tif (!$invSrv->isStockAvail($thisPid, \"IM\")) {\r\n\t\t\t\t\t\t$isAllowExpressDlvry = false;\r\n\t\t\t\t\t\techo \"falsenow(\".$thisPid.\")<br>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\techo \"now(\".$thisPid.\")<br>\";\r\n\t\t\t\t}\r\n// End of modification for CR090319-001\r\n\t\t\t\tif(mysql_num_rows($get_price)!=1 || $thisQty<1) {\r\n\t\t\t\t\t$returnVal = 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif($currency=='eur') $thisListprice = mysql_result($get_price,0,'listprice_eu');\r\n\t\t\t\t\telseif($currency=='aud') $thisListprice = mysql_result($get_price,0,'listprice_au');\r\n\t\t\t\t\telse $thisListprice = mysql_result($get_price,0,'listprice');\r\n\t\t\t\t\tif($thisListprice == '0.00') $thisListprice = number_format(mysql_result($get_price,0,'listprice')*$currfactor,2,'.','');\r\n\t\t\t\t\t$cartArr[] = array($thisPid,$thisQty,$thisListprice);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }\r\n return $returnVal;\r\n}" ]
[ "0.6244465", "0.62119144", "0.6041028", "0.6001919", "0.5986318", "0.59752643", "0.59581846", "0.5901803", "0.58620507", "0.5833632", "0.5833333", "0.58277553", "0.580459", "0.57935274", "0.57906675", "0.57743746", "0.57743216", "0.57640064", "0.5748591", "0.56949514", "0.56869054", "0.56821936", "0.56779015", "0.56704414", "0.5643554", "0.5634992", "0.5630504", "0.56292206", "0.5628269", "0.5626362" ]
0.7017899
0
Security: checking if attached fields have price
function ppom_is_price_attached_with_fields( $fields_posted ) { $is_price_attached = false; $option_price = 0; $ppom_id = $fields_posted['id']; foreach($fields_posted as $data_name => $value) { // soon prodcut_id will be removed $product_id = null; $field_meta = ppom_get_field_meta_by_dataname($product_id, $data_name, $ppom_id); $field_type = isset($field_meta['type']) ? $field_meta['type'] : ''; switch( $field_type ) { case 'checkbox': if( is_array($value) ) { foreach($value as $cb_value) { $option_price += ppom_get_field_option_price($field_meta, $cb_value); } } break; default: $option_price += ppom_get_field_option_price($field_meta, $value); break; } } if($option_price > 0) { $is_price_attached = true; } // If price matrix attached if( isset($_POST['ppom']['ppom_pricematrix']) ) { $is_price_attached = true; } // exit; return apply_filters('ppom_option_price_attached', $is_price_attached, $fields_posted, $product_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validatePrice()\n {\n return empty($this->price)?false:true;\n }", "public function isIncludedInPrice();", "public function hasPrice(){\n return $this->_has(12);\n }", "private static function has_price_field( $form ) {\n\t\tif ( is_array( $form['fields'] ) ) {\n\t\t\tforeach ( $form['fields'] as $field ) {\n\t\t\t\tif ( GFCommon::is_product_field( $field->type ) ) {\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 hasRealPrice(){\n return $this->_has(21);\n }", "public function isIncludedInDisplayPrice();", "public function hasPrice(){\n return $this->_has(5);\n }", "public function hasPrice()\n {\n return $this->amount_month || $this->amount_year;\n }", "function validateSDPrice($field = Null){\n\t\tif(isset($this->data['ProductSeller']['standard_delivery_price'])) {\n\t\t\tif(($this->data['ProductSeller']['standard_delivery_price'] == '0') || ($this->data['ProductSeller']['standard_delivery_price'] == '')){\n\t\t\t\treturn true;\n\t\t\t} else{\n\t\t\t\tif(!empty($this->data['ProductSeller']['standard_delivery_price'])){\n\t\t\t\t\tif($this->data['ProductSeller']['standard_delivery_price'] < 0){\n\t\t\t\t\t\treturn 'Standard delivery price should be positive';\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn \"Standard express delivery price\";\n\t\t\t\t}\n\t\t\t}\n\t\t} else{\n\t\t\treturn true;\n\t\t}\n\t}", "function advancedPrice($data) {\n \tif(Configure::read('App.bidButlerType') == 'advanced') {\n \t\t$auction = $this->Auction->find('first', array('conditions' => array('Auction.id' => $this->data['Bidbutler']['auction_id']), 'contain' => '', 'fields' => array('Auction.price','Auction.reverse')));\n \t\tif ($auction['Auction']['reverse']) {\n \t\t\treturn true;\n \t\t} else {\n\t\t\t\tif($data['minimum_price'] - $auction['Auction']['price'] < 0.01) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n \t} else {\n \t\treturn true;\n \t}\n }", "function validateEDPrice($field = Null){\n\t\tif(isset($this->data['ProductSeller']['express_delivery'])) {\n\t\t\tif(($this->data['ProductSeller']['express_delivery'] == '0') || ($this->data['ProductSeller']['express_delivery'] == '')){\n\t\t\t\treturn true;\n\t\t\t} else{\n\t\t\t\tif(!empty($this->data['ProductSeller']['express_delivery_price'])){\n\t\t\t\t\tif($this->data['ProductSeller']['express_delivery_price'] < 0){\n\t\t\t\t\t\treturn 'Express delivery price should be positive';\n\t\t\t\t\t} else\n\t\t\t\t\t\treturn true;\n\t\t\t\t}else{\n\t\t\t\t\treturn \"Enter express delivery price\";\n\t\t\t\t}\n\t\t\t}\n\t\t} else{\n\t\t\treturn true;\n\t\t}\n\t}", "private function validatePaymentFields(){\n }", "public function testIfStockManagementHasPrice()\n {\n $this->assertNotNull($this->stock->getPrice());\n }", "public function hasAdvancedPrices()\n\t{\n\t\treturn (bool) $this->arrType['prices'];\n\t}", "public function hasOldPrice(){\n return $this->_has(17);\n }", "public function isPriceAlarm()\n {\n // #419 disabling price alarm if article has fixed price\n $oProduct = $this->getProduct();\n $sFixedPriceField = 'oxarticles__oxblfixedprice';\n if (isset($oProduct->$sFixedPriceField->value) && $oProduct->$sFixedPriceField->value) {\n return 0;\n }\n\n return 1;\n }", "public function isIncludedInBasePrice();", "public function hasNewPrice(){\n return $this->_has(16);\n }", "public function hasPriceIsPayWhatYouWant()\n {\n return $this->price_is_pay_what_you_want !== null;\n }", "private function validateAvailableProduct() {\n\n\t\t$studio_data = &$this->session->data['studio_data'][$this->request->post['price_studio_id']]; //make it short\n\n\t\t//if price_id_product is not empty\n\t\tif (!isset($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t///if product exists\n\t\t} elseif (!$this->model_opentshirts_product->getTotalProductsByID($studio_data['id_product'])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t//if product price is setted up\n\t\t}else if ($this->model_opentshirts_price_product->getMinQuantity($studio_data['id_product'])===false) {\n\t\t\t$this->error['warning'] = $this->language->get('error_not_available');\n\t\t\t$this->error['hide_matrix'] = true;\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function ppom_meta_priced_options( $the_meta ) {\n\t\n\t$has_priced_option = false;\n\tforeach ( $the_meta as $key => $meta ) {\n\t\n\t\t$options\t\t= ( isset($meta['options'] ) ? $meta['options'] : array());\n\t\tforeach($options as $opt)\n\t\t{\n\t\t\t\t\n\t\t\tif( isset($opt['price']) && $opt['price'] != '') {\n\t\t\t\t$has_priced_option = true;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn apply_filters('ppom_meta_priced_options', $has_priced_option, $the_meta);\n}", "public function setPrice($price) {\n return false;\n }", "public function hasDoubleField()\n {\n return $this->get(self::DOUBLE_FIELD) !== null;\n }", "function is_money($field){\n\t\tif(preg_match('/valor/',$field)){\n\t\t\treturn(true);\n\t\t}else{\n\t\t\treturn(false);\n\t\t}\n\t}", "public function is_money($price) {\n return preg_match('/^[0-9]+(\\.[0-9]{0,2})?$/', $price);\n }", "public function isFree()\n {\n return ((float) $this->price <= 0.00);\n }", "public function hasVariantPrices()\n\t{\n\t\tif ($this->hasVariants() && in_array('price', $this->arrVariantAttributes))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function checkCampaignPrice ($sender, $text, $list_id) {\n\t\treturn $this->gateway->execCommad(\"checkCampaignPrice\", array('sender' => $sender, 'text' => $text, 'list_id' => $list_id));\n\t}", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "public function hasMoneytype(){\n return $this->_has(15);\n }" ]
[ "0.7296728", "0.7082381", "0.699404", "0.6918568", "0.68912953", "0.68521684", "0.6814023", "0.64702785", "0.62862223", "0.62741375", "0.6272136", "0.6159761", "0.6145966", "0.61173195", "0.6019901", "0.59939706", "0.59701294", "0.5965512", "0.5958107", "0.5916066", "0.58906174", "0.58870465", "0.5862494", "0.5795614", "0.5767122", "0.5740828", "0.5736233", "0.57027537", "0.5690967", "0.5687243" ]
0.7332881
0
Get menu by slug.
public function bySlug($menuSlug) { return Menu::with('permission')->whereSlug($menuSlug)->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maiconfigurations_get_menu_by_slug( $slug ) {\n\n\tif ( $menu = get_term_by( 'slug', $slug, 'nav_menu' ) ) {\n\t\treturn $menu;\n\t}\n\n\tif ( $menu = get_term_by( 'slug', $slug . '-nav', 'nav_menu' ) ) {\n\t\treturn $menu;\n\t}\n\n\tif ( $menu = get_term_by( 'slug', $slug . '-menu', 'nav_menu' ) ) {\n\t\treturn $menu;\n\t}\n\n\treturn false;\n}", "public function getMenuSlug(): string;", "public function getMenu()\n {\n if($slug){\n $page = Page::where('slug', $slug)->first();\n return view('page')->with('page', $page);\n }else{\n return view('errors.404');\n }\n \n }", "function url_menu(string $slug) : string\n{\n return \\menu_page_url($slug, false);\n}", "function cmsMenu($mIdSlug, array $aData = []): ?Resource\\Menu\n {\n /** @var Model\\Menu $oModel */\n $oModel = Factory::model('Menu', Constants::MODULE_SLUG);\n return $oModel->getByIdOrSlug($mIdSlug, $aData);\n }", "function GetMenu()\n {\n $sql = \"SELECT\n title,\n slug,\n id\n FROM\n pages\";\n $this->setSql($sql);\n return $this->getAll();\n }", "public function getBySlug(string $slug);", "public function getBySlug()\n {\n }", "public function findBySlug($slug, MenuItemGatewayInterface $gateway)\n {\n return $gateway->retrieveBySlug($slug);\n }", "public function show($slug)\n {\n if ($slug=='left' || $slug=='right' || $slug=='center' || $slug=='header') {\n $info=Menu::where('user_id',Auth::id())->where('position',$slug)->first();\n if (empty($info)) {\n $info=new Menu;\n $info->user_id=Auth::id();\n $info->position=$slug;\n $info->name=$slug;\n $info->data='[]';\n $info->save();\n }\n\n return view('seller.store.menu.edit',compact('info'));\n }\n else{\n abort(404);\n }\n\n }", "function ajan_nav_menu_get_item_url( $slug ) {\n\t$nav_item_url = '';\n\t$nav_menu_items = ajan_nav_menu_get_loggedin_pages();\n\n\tif ( isset( $nav_menu_items[ $slug ] ) ) {\n\t\t$nav_item_url = $nav_menu_items[ $slug ]->guid;\n\t}\n\n\treturn $nav_item_url;\n}", "protected function getMenuItems( $slugAsId = true ) {\n $type = $slugAsId ? 'slug as id' : 'id';\n\n return self::select( $type , 'name')->where('active', 1)->where('show_menu', 1)->orderBy('order', 'ASC')->get();\n\n }", "protected function get_menu() {\n\t\t\n\t\tif ( ( $locations = get_nav_menu_locations() )\n\t\t\t&& isset( $locations[ $this->menu_name ] ) ){\n\t\t\t$this->menu_id = $locations[ $this->menu_name ];\n\t\t}else{\n\t\t\t$this->menu_id = null;\n\t\t}\n\n\t\t$this->menu = wp_get_nav_menu_items( $this->menu_id );\n\t}", "public function getMenu($level = 1) {\n\t\treturn singleton('ContentController')->getMenu($level);\n\t}", "public function getBySlug(string $slug)\n {\n $category = HandbookCategory::where('ru_slug', $slug)->first();\n return $category;\n }", "function get_menu($param = NULL)\n\t{\n\t\tif (isset($param[\"icon\"]) and substr($param[\"icon\"], 0, 4) === \"http\")\n\t\t{\n\t\t\t$icon = $param[\"icon\"];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$icon_name = empty($param[\"icon\"]) ? \"cog\" : $param[\"icon\"];\n\t\t\t$icon = icons::get_std_icon_url($icon_name);\n\t\t}\n\n\n\t\t$is = \"\";\n\t\tforeach($this->menus as $parent => $menudata)\n\t\t{\n\t\t\t$is .= '<div id=\"'.$parent.'\" class=\"menu\" onmouseover=\"menuMouseover(event)\">'.\"\\n${menudata}</div>\\n\";\n\t\t};\n\t\t$this->vars(array(\n\t\t\t\"ss\" => $is,\n\t\t\t\"menu_id\" => $this->menu_id,\n\t\t\t\"menu_icon\" => $icon,\n\t\t\t\"alt\" => isset($param[\"alt\"]) ? $param[\"alt\"] : null\n\t\t));\n\n\t\tif (!empty($param[\"text\"]))\n\t\t{\n\t\t\t$this->vars(array(\n\t\t\t\t\"text\" => $param[\"text\"]\n\t\t\t));\n\t\t\t$this->vars(array(\n\t\t\t\t\"HAS_TEXT\" => $href_ct = $this->parse(\"HAS_TEXT\")\n\t\t\t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->vars(array(\n\t\t\t\t\"HAS_ICON\" => $href_ct = $this->parse(\"HAS_ICON\")\n\t\t\t));\n\t\t}\n\n\t\tif (!empty($param[\"is_toolbar\"]))\n\t\t{\n\t\t\t$this->vars(array(\n\t\t\t\t\"IS_TOOLBAR\" => $this->parse(\"IS_TOOLBAR\")\n\t\t\t));\n\t\t}\n\t\t\n\t\tif (aw_template::bootstrap())\n\t\t{\n\t\t\t$this->vars(array(\n\t\t\t\t\"DROPDOWN\" => $this->__parse_dropdown($this->menu_id),\n\t\t\t));\n\t\t}\n\n\t\tif (is_array($param) && !empty($param[\"load_on_demand_url\"]))\n\t\t{\n\t\t\tstatic $lod_num;\n\t\t\t$lod_num++;\n\t\t\treturn \"<div id='lod_\".$this->menu_id.\"'><a href='javascript:void(0);' onClick='tb_lod\".$lod_num.\"()' class='nupp'>$href_ct</a></div>\n\t\t\t<script language=javascript>\n\t\t\tfunction tb_lod\".$lod_num.\"()\n\t\t\t{\n\t\t\t\tel = document.getElementById(\\\"lod_\".$this->menu_id.\"\\\");\n\t\t\t\tel.innerHTML=aw_get_url_contents(\\\"\".$param[\"load_on_demand_url\"].\"\\\");\n\t\t\t\tnhr=document.getElementById(\\\"href_\".$this->menu_id.\"\\\");\n\t\t\t\tif (document.createEvent) {evObj = document.createEvent(\\\"MouseEvents\\\");evObj.initEvent( \\\"click\\\", true, true );nhr.dispatchEvent(evObj);}\n\t\t\t\telse {\n\t\t\t\t\tnhr.fireEvent(\\\"onclick\\\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t</script>\n\t\t\t\";\n\t\t}\n\n\t\treturn $this->parse();\n\t}", "function menu_page_url($menu_slug, $display = \\true)\n {\n }", "public function bySlug($slug);", "public function getMenu();", "public function getSlug();", "public function getSlug();", "public function getSlug();", "public function getSlug();", "function get_menu( $full_url = true ){\n\t$menu = get_settings( 'menu' );\n\t$blog = get_settings( 'blog' );\n\n\tlist( $blog_label, $blog_url, $blog_enabled ) = get_list(\n\t\t['menu_label', 'url', 'enable'],\n\t\t$blog\n\t);\n\n\t// Unset if there is a menu label similar with the blog link.\n\tif ( isset($menu[$blog_label]) ) unset($menu[$blog_label]);\n\n\t// If the blog is enabled, append the link to the end of the menu.\n\tif ( $blog_enabled ){\n\t\t$blog_url = ltrim( $blog_url, '/' );\n\t\t$menu[$blog_label] = \"/$blog_url\";\n\t}\n\n\tif ( true === $full_url ){\n\t\tforeach ( (array)$menu as $label => $href ){\n\t\t\t$home_url = home_url();\n\t\t\tif ( !is_url($href) ){\n\t\t\t\t$href = !is_array($href)\n\t\t\t\t\t? $home_url . $href\n\t\t\t\t\t: add_url_query( $href, $home_url, true );\n\t\t\t}\n\n\t\t\t$menu[$label] = $href;\n\t\t}\n\t}\n\n\treturn $menu;\n}", "public function getPageBySlug($slug)\n {\n return $this->findOneBy(array('slug' => $slug));\n }", "public function getBySlug($slug)\n\t{\n\t\treturn $this->doll->with('DollTypes')->where('slug', $slug)->firstOrFail();\n\t}", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);", "public function findBySlug($slug);" ]
[ "0.7956025", "0.758239", "0.71422285", "0.6996526", "0.69422436", "0.673566", "0.6734712", "0.6641822", "0.66023433", "0.65403", "0.6442446", "0.64384294", "0.6375229", "0.61955446", "0.6146471", "0.6140704", "0.6121655", "0.61134535", "0.6095223", "0.6092737", "0.6092737", "0.6092737", "0.6092737", "0.60750735", "0.6070115", "0.60700965", "0.6064175", "0.6064175", "0.6064175", "0.6064175" ]
0.7762032
1
Get parent menus without children ordered by menu_order asc
public function getParents() { return Menu::where('locale', getCurrentSessionAppLocale()) ->where(function ($query){ $query->whereNull('parent_slug') ->orWhere('parent_slug', ''); }) ->orderBy('menu_order', 'asc') ->get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMenuParents()\n {\n return $this->db->select('*')->from('admin_menu')->where('parent',0)->get()->result_array();\n }", "public function get_no_parents ()\r\n\t{\r\n\t\t$this->db->select('id, title, menu_id');\r\n\t\t$this->db->where('parent_id', 0); \r\n\t\t$pages = parent::get();\r\n\t\t// Return key => value pair array\r\n\t\t$array = array(\r\n\t\t\t0 => 'Top Level'\r\n\t\t);\r\n\t\tif (count($pages)) {\r\n\t\t\tforeach ($pages as $page) {\r\n\t\t\t $array[$page->id] = $page->title;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $array;\r\n\t}", "public function parentmenus() {\n $this->db->where('menuparentid', \" \"); \n $this->db->order_by('serialid', \"asc\");\n $query = $this->db->get('menu');\n return $query->result();\n }", "public function all_parent()\r\n\t{\r\n\t\t$query = $this->db->select('*')->get('menu')->result_array(); \r\n\t \treturn $query;\r\n\t}", "public static function menu(){\n $sql = \"select * from pageweb where id_parent = 1 AND menu = 1 ORDER BY ordre\";\n $parents = DB::get_sql_tab($sql);\n for($i=0;$i<count($parents);$i++) {\n $sql2 = \"select * from pageweb where id_parent = '\".$parents[$i][\"id\"].\"'AND menu = 1\";\n $enfants = DB::get_sql_tab($sql2);\n $parents[$i][\"enfants\"] = $enfants;\n }\n return $parents;\n }", "public function getMenuSortUrut() {\r\n $sql = $this->db->query(\"SELECT * FROM ms_menu WHERE menu_parent_id != -1 ORDER BY menu_urut ASC\");\r\n if ($sql->num_rows() > 0) {\r\n return $sql->result_array();\r\n }\r\n return null;\r\n }", "public function getmenu( ) {\n \t$parent = $this->find('all', array(\n 'conditions' => array(\n 'Page.parent_id IS NULL',\n 'Page.is_menu' => 1,\n 'Page.is_active' => 1\n ),\n 'contain'=>array(\n ),\n 'fields'=>array('Page.lft', 'Page.rght'),\n 'order'=>array('Page.lft' => 'ASC')\n ));\n\t\t\n\t\t$recs = array(); \n foreach($parent as $v){\n \t$info = $this->find('threaded', array(\n\t 'conditions' => array(\n\t 'Page.lft >=' => $v['Page']['lft'], \n\t 'Page.rght <=' => $v['Page']['rght'],\n\t 'Page.is_menu' => 1,\n\t 'Page.is_active' => 1\n\t ),\n\t 'contain'=>array()\n\t ));\n\t \n\t $recs = array_merge($recs, $info);\n\t }\n\t\t\n\t\treturn $recs;\n }", "function createMenu($arr_menu, $args = array() ){\n krsort($arr_menu);\n foreach ($arr_menu as $k => &$item) {\n if (!empty($item['parent'])) {\n $parent = $item['parent'];\n if (empty($arr_menu[$parent]['childs'])) {\n $arr_menu[$parent]['childs'] = array();\n }\n //2\n array_unshift($arr_menu[$parent]['childs'],$item);\n unset($arr_menu[$k]);\n }\n }\n //3\n ksort($arr_menu);\n\n // filter menu by user role\n $av_menu = menuAvailable($arr_menu);\n foreach ($arr_menu as $key => $value) {\n if(in_array($key, $av_menu))\n unset($arr_menu[$key]);\n }\n\n // echo \"<pre>\";\n // print_r($av_menu);\n // print_r($arr_menu);\n // echo \"</pre>\";\n // exit();\n\n buildMenu($arr_menu, $args);\n\n}", "function buildMenuHierarchy(): array\n{\n $menu = queryDB(\n \"SELECT * FROM pages WHERE parent_page_id IS NULL AND published = 1 ORDER BY menu_priority ASC\"\n )->fetchAll();\n\n foreach ($menu as $i => $parentPage) {\n $menu[$i][\"children\"] = queryDB(\n \"SELECT * FROM pages WHERE parent_page_id = ? AND published = 1 ORDER BY menu_priority ASC\",\n $parentPage['id']\n )->fetchAll();\n }\n\n return $menu;\n}", "function block_core_navigation_sort_menu_items_by_parent_id($menu_items)\n {\n }", "public function getChildren()\n {\n return $this\n ->hasMany(MenuItem::class, ['menuId' => 'id'])\n ->andWhere(['is', 'parentId', null])\n ->orderBy(['order' => SORT_ASC]);\n }", "function get_all_menu_by_parent($params) {\n $sql = \"SELECT * FROM com_menu\n WHERE portal_id = ? AND parent_id = ?\n ORDER BY nav_no ASC\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "public function getAdminMenu( ) {\n \t$parent = $this->find('all', array(\n 'conditions' => array(\n 'Page.parent_id IS NULL',\n ),\n 'contain'=>array(\n ),\n 'fields'=>array('Page.lft', 'Page.rght'),\n 'order'=>array('Page.lft' => 'ASC')\n ));\n\t\t\n\t\t$recs = array(); \n foreach($parent as $v){\n \t$info = $this->find('threaded', array(\n\t 'conditions' => array(\n\t 'Page.lft >=' => $v['Page']['lft'], \n\t 'Page.rght <=' => $v['Page']['rght'],\n\t ),\n\t 'contain'=>array()\n\t ));\n\t \n\t $recs = array_merge($recs, $info);\n\t }\n\t\t\n\t\treturn $recs;\n }", "public static function getAllMenu()\n {\n $rows = Yii::$app->cache->get(\"BackendMenu:all\");\n if (false === is_array($rows)) {\n $rows = static::find()\n ->orderBy('parent_id ASC, sort ASC')\n ->asArray()\n ->all();\n Yii::$app->cache->set(\n \"BackendMenu:all\",\n $rows,\n 86400,\n new TagDependency([\n 'tags' => [\n ActiveRecordHelper::getCommonTag(static::className()),\n ],\n ])\n );\n }\n // rebuild rows to tree $all_menu_items\n $all_menu_items = Tree::rowsArrayToMenuTree($rows, 0, 0, false);\n\n return $all_menu_items;\n }", "function sc_menu(){\n\n\tglobal $post;\n\n\t$menu_array = array();\n\n\t//Query Args\n\t$args = array(\n\t\t\t'post_type' => array('page'),\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_parent' => $post->ID,\n\t\t\t'orderby' => 'menu_order',\n\t\t\t'order' => 'ASC',\n\t\t\t'posts_per_page' => -1\n\t\t);\n\n\t//Top Level\n\tif( $post->post_parent == 0 ){\n\n\t\t$menu = new Wp_Query($args);\n\t\twp_reset_query();\n\n\t\t$menu_array[] = $post->ID;\n\t\tforeach( $menu->posts as $item ){\n\t\t\t$menu_array[] = $item->ID;\n\t\t}\n\n\t//Child Level\n\t} elseif( $post->post_parent > 0 ) {\n\n\t\t$args['post_parent'] = $post->post_parent;\n\t\t$menu = new Wp_Query($args);\n\t\twp_reset_query();\n\n\t\t$menu_array[] = $post->post_parent;\n\t\tforeach( $menu->posts as $item ){\n\t\t\t$menu_array[] = $item->ID;\n\t\t}\n\t}\n\n\treturn count($menu_array) > 1 ? $menu_array : false ;\n\n}", "public function getParents()\n {\n \t$currentPos = trim($this->getPosition());\n \tif($currentPos === '' || $currentPos === '1')\n \t\treturn array($this);\n \t\n \t$posArray = array();\n \t$length = strlen($currentPos);\n \tfor($i = 0; $i < ($length - 1) / self::POS_LENGTH_PER_LEVEL ; $i++)\n \t{\n \t\t$posArray[] = trim(substr($currentPos, 0, ($i * self::POS_LENGTH_PER_LEVEL) + 1));\n \t}\n \treturn self::getAllByCriteria('rootId = ? and position in (' . implode(',', array_fill(0, count($posArray), '?')) . ')', array_merge(array($this->getRoot()->getId()), $posArray), false, null, DaoQuery::DEFAUTL_PAGE_SIZE, array('position' => 'asc'));\n }", "function GetParentsSubMenu($MenuId) {\n global $db;\n\t$SqlStmt = $db->prepare(\"SELECT * FROM p149pm_menu_options WHERE menu_parent_id=:MenuId ORDER BY menu_order\");\n $SqlStmt->bindValue(':MenuId',$MenuId, PDO::PARAM_INT);\n\ttry{ $SqlStmt->execute(); } catch (PDOException $e) { die(); }\n\twhile($row = $SqlStmt->fetch(PDO::FETCH_ASSOC)) { $smartRs[] = $row; }\n\tif ($SqlStmt->rowCount() > 0) {return $smartRs; }\n}", "public static function parentCategories()\n {\n return Category::with('children')\n ->orderBy('priority')\n ->where([\n 'category_type' => static::class,\n 'parent_id' => null,\n ])->get();\n }", "public function getParentCategories() {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n\n return $this->fetchAll($select);\n }", "public function get_admin_module_parents()\n\t{\n\t\t$this->db->where(array('module_user' => 1, 'module_parent' => 0));\n\t\t$this->db->order_by('module_position');\n\t\treturn $this->db->get('module');\n\t}", "function get_cmenu($parent_id)\n{\n $ci = & get_instance();\n $menu_c = $ci->db->select('*')\n ->where('parent_id', $parent_id)\n ->order_by('show_order', 'asc')\n ->get('menu')->result();\n return $menu_c;\n}", "abstract protected function getMenuTree();", "function getSelectableParents()\n {\n $roles = $this->all();\n $tree = $this->findChildren($roles, 0, 1);\n\n //recursively go trough the array and delete....\n\n $trimmed_tree = $this->removeTreeNode($tree, $this->id);\n return $trimmed_tree;\n\n\n\n\n }", "function get_all_menu_selected_by_parent($params) {\n $sql = \"SELECT a.*, b.role_id, b.role_tp\n FROM com_menu a\n LEFT JOIN (SELECT * FROM com_role_menu WHERE role_id = ?) b ON a.nav_id = b.nav_id\n WHERE portal_id = ? AND parent_id = ?\n ORDER BY nav_no ASC\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "public function getParentMenuArr() {}", "public function getMenuItems()\n {\n $sql = \"\n SELECT\n menu.uid,\n parent_uid,\n sort_order,\n nofollow,\n target,\n class,\n label,\n uri_uid,\n uri,\n menu.archived,\n menu.archived_datetime\n FROM menu\n LEFT JOIN uri\n ON uri.uid = menu.uri_uid\n WHERE menu.archived = '0'\n AND (uri.archived = '0' OR uri.archived IS NULL)\n \";\n\n $sql .= \"\n ORDER BY sort_order;\n \";\n\n $db = new Query($sql);\n $results = $db->fetchAllAssoc();\n\n return $results;\n }", "public function admin_getParents() {\n\t\tif (empty($this->request->data[$this->modelClass]['menu_id'])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->set('json', $this->{$this->modelClass}->getParents($this->request->data[$this->modelClass]['menu_id']));\n\t}", "function generate_menu_tree_from_parent($menu_name, $parent_link_id) {\r\n\r\n $menu_tree = \\Drupal::menuTree();\r\n $parameters = new MenuTreeParameters();\r\n // $parameters = $menu_tree->getCurrentRouteMenuTreeParameters($menu_name);\r\n $mtarray = [];\r\n\r\n $about_page = $parent_link_id == 'menu_link_content:b793fd29-68d5-426b-a34e-ca04b30823d1';\r\n\r\n if (!empty($parent_link_id)) {\r\n // Having the parent now we set it as starting point to build our custom\r\n // tree.\r\n $parameters->setRoot($parent_link_id);\r\n $parameters->setMaxDepth(3);\r\n $parameters->excludeRoot();\r\n\r\n $tree = $menu_tree->load($menu_name, $parameters);\r\n\r\n // Optional: Native sort and access checks.\r\n $manipulators = [\r\n ['callable' => 'menu.default_tree_manipulators:checkNodeAccess'],\r\n ['callable' => 'menu.default_tree_manipulators:checkAccess'],\r\n ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],\r\n ];\r\n $tree = $menu_tree->transform($tree, $manipulators);\r\n\r\n $ignore_list = [];\r\n\r\n if ($about_page) {\r\n $ignore_list = [\r\n 'menu_link_content:3bb8deae-9b55-46fc-8f2f-4733f84f683a',\r\n 'menu_link_content:07da01b2-6068-48a0-8c35-253074107410',\r\n ];\r\n }\r\n\r\n // Finally, build a renderable array.\r\n foreach ($tree as $item) {\r\n if (!in_array($item->link->getPluginId(), $ignore_list)) {\r\n $title = $item->link->getTitle();\r\n $url_obj = $item->link->getUrlObject();\r\n $url_string = $url_obj->toString();\r\n\r\n $mtarray[] = [$title, $url_string];\r\n }\r\n }\r\n }\r\n return $mtarray;\r\n}", "public function getChildrenForIndependentMenu()\n {\n $IndependentMenu = Independent\\Handler::getMenu($this->getAttribute('menuId'));\n\n return $IndependentMenu->getChildren();\n }", "public static function getParents()\n {\n $tableCategoriesLevelOne=CategoriesLevelOne::tableName();\n $dependency = new DbDependency;\n $dependency->sql=\"SELECT MAX(id) FROM $tableCategoriesLevelOne\";\n $query=Category::getDb()->cache(function($db)\n {\n return Category::find()->orderBy(\"order_by ASC\")->with(['relationCategoriesLevelOne'])->all();\n }, Yii::$app->params['7_day_cache'], $dependency);\n\n return $query;\n }" ]
[ "0.73462486", "0.7139731", "0.69289136", "0.6901755", "0.67867", "0.67156965", "0.6707121", "0.6693782", "0.66641045", "0.66465855", "0.6617598", "0.6560701", "0.65111727", "0.64742655", "0.6420377", "0.6363472", "0.63541466", "0.6333202", "0.6269148", "0.6266081", "0.62536657", "0.62488246", "0.6241895", "0.6215563", "0.6213477", "0.6152244", "0.6134269", "0.6124294", "0.6119284", "0.6101604" ]
0.746
0
Update menu by given attributes
public function update(Menu $menu, array $attributes) { $menu->update($attributes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($menu)\r\n {\r\n\r\n }", "function wp_nav_menu_update_menu_items($nav_menu_selected_id, $nav_menu_selected_title)\n {\n }", "static public function updateMenu($request, $id) {\n $menu = self::find($id);\n \n /* change if the menu item will be shown on client side or not; \"show item\" checkbox in CMS*/\n if ($request->show_item) {\n $menu->show_item = '1';\n } else {\n $menu->show_item = '0';\n }\n $menu->title = $request->title;\n $menu->url = $request->url;\n $menu->save();\n if ($menu->id) {\n return true;\n }\n return false;\n }", "protected function set_new_menu_params() {\n\t\t$this->menu_args['menu-item-title'] = !empty( $_POST['premise_post_title'] ) ? $_POST['premise_post_title'] : '';\n\t\t$this->menu_args['menu-item-url'] = !empty( $_POST['premise_post_url'] ) ? $_POST['premise_post_url'] : '';\n\t\t$this->menu_args['menu-item-object-id'] = !empty( $_POST['premise_post_object_id'] ) ? $_POST['premise_post_object_id'] : '';\n\t\t$this->menu_args['menu-item-object'] = !empty( $_POST['premise_post_object'] ) ? $_POST['premise_post_object'] : '';\n\t}", "function update_menu_item_cache($menu_items)\n {\n }", "function setMenuItem(){\n\n $totalMenuItem=count($this->html->find('b')); // total number of menu items in the webpage\n $allMenuName=$this->html->find('b'); // array of objects of all b tag for item name\n $allMenuDetails=$this->html->find('span[itemprop=\"description\"]'); // array of objects of all span of itemproperty description\n $allMenuPrice=$this->html->find('span.price'); // array of objects of all span with class price\n $phone=$this->html->find('span[itemprop=\"telephone\"]')[0]->innertext; // string\n $address=$this->html->find('span[itemprop=\"streetAddress\"]')[0]->innertext.' , '\n .$this->html->find('span[itemprop=\"addressLocality\"]')[0]->innertext; // string concated restaurant address\n\n for ($i=0; $i<$totalMenuItem; $i++){\n \n $price=$this->stringModifier->modifyString($allMenuPrice[$i]->innertext); //remove currency sign from price\n $this->saveMenuItems($totalMenuItem,$allMenuName[$i]->innertext,$allMenuDetails[$i]->innertext,\n $price,NULL,webPageUrlThree,$phone,$address); // save data in the database\n \n } // loop ends\n \n }", "function hook_menu_update($menu) {\n // For example, we track available menus in a variable.\n $my_menus = variable_get('my_module_menus', array());\n $my_menus[$menu['menu_name']] = $menu['menu_name'];\n variable_set('my_module_menus', $my_menus);\n}", "public function upMenu($data){\n\n\t\treturn $this->where('id', $data['id'])->update(['item'=>$data['item'], 'anchor' => $data['anchor']]);\n\t}", "public function updatemenu() {\n $idMenu = $this->input->post('idMenu');\n $menu = trim($this->input->post('nommenu'));\n $idPage = $this->input->post('idPage');\n $idCategorie = $this->input->post('idCategorie');\n \n if($menu != \"\") {\n \n $data = array(\n 'menu' => $menu,\n 'idPage' => $idPage,\n 'idCategorie' => $idCategorie\n );\n \n $this->db->where('idMenu', $idMenu);\n $this->db->update('menus', $data); \n \n }\n }", "function cloudfw_admin_update_menu($menu_id, $menu_item_db_id, $args ){\n\t$current_location = cloudfw_get_editing_menu_location();\n\t$options = cloudfw_detect_options( array('data' => cloudfw_get_schemes('menu_map', false, NULL, $current_location)) );\n\n\tif ( is_array($options) && !empty($options) ) {\n\t\t/* Loop the menu options. */\n\t\tforeach ((array) $options as $field) {\n\t\t\t$name = $field['id'] . '_' . $menu_item_db_id;\n\n\t\t\t$old = get_post_meta( $menu_item_db_id, $field['id'], true );\n\t\t\t$new = isset($_POST[ $name ]) ? $_POST[ $name ] : NULL;\n\n\t\t\t\t$is_defined = isset($_POST[ 'is_defined_'. $name ]) ? $_POST[ 'is_defined_'. $name ] : NULL;\n\t\t\t\tif ( $is_defined == 'onoff' && empty( $new ) ) {\n\t\t\t\t\t$new = 'FALSE';\n\t\t\t\t\t$_POST[ $name ] = $new;\n\t\t\t\t}\n\n\t\t\t\tif ( !is_array( $new ) )\n\t\t\t\t\t$new = stripslashes( $new );\n\n\t\t\tif ( array_key_exists($name, $_POST) && !is_null($new) && $new != $old )\n\t\t\t\tupdate_post_meta( $menu_item_db_id, $field['id'], $new );\n\t\t\telseif ( array_key_exists($field['id'], $_POST) && !is_null( $new ) && empty( $new ) && isset( $old ) )\n\t\t\t\tdelete_post_meta( $menu_item_db_id, $field['id'], $old );\n\n\t\t}\n\t}\n}", "public function edit(Menu $menu)\n {\n //\n }", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "function update() \n\t{\n\t\t$strquery=\"UPDATE \".DB_PREFIX.\"menu SET menu_name='\".$this->menu_name.\"', listing_page='\".$this->listing_page.\"', addedit_page='\".$this->addedit_page.\"', menu_icon='\".$this->menu_icon.\"', menu_order='\".$this->menu_order.\"', menu_active='\".$this->menu_active.\"' WHERE menu_id=\".$this->menu_id;\n\t\treturn mysql_query($strquery) or die(mysql_error());\n\t}", "public function actionUpdate($id)\n{\n$model=$this->loadModel($id,array('itemSizes','itemAddOns'));\n$menu=Menu::model()->findAllByAttributes(array('deleted'=>0,'is_available'=>1));\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\nif(isset($_POST['MenuItems']))\n{\n$model->attributes=$_POST['MenuItems'];\nif($model->save())\n$this->redirect(array('update','id'=>$model->id));\n}\n\n $this->render('update',compact('model','menu'));\n}", "public function generate_menu() {\n\t\t\t$nav_menus = wp_get_nav_menus();\n\t\t\t$menu_count = count($nav_menus);\n\n\t\t\t// Allowed actions: add, update, delete\n\t\t\t$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit';\n\n\t\t\t$nav_menu_selected_id = isset($_REQUEST['menu']) ? (int) $_REQUEST['menu'] : 0;\n\n\t\t\t// Are we on the add new screen?\n\t\t\t$add_new_screen = ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] ) ? true : false;\n\t // Get recently edited nav menu.\n\t $recently_edited = absint(get_user_option('nav_menu_recently_edited'));\n\t if (empty($recently_edited) && is_nav_menu($nav_menu_selected_id))\n\t $recently_edited = $nav_menu_selected_id;\n\n\t // Use $recently_edited if none are selected.\n\t if (empty($nav_menu_selected_id) && !isset($_GET['menu']) && is_nav_menu($recently_edited))\n\t $nav_menu_selected_id = $recently_edited;\n\n\t if (empty($nav_menu_selected_id) && !empty($nav_menus) && !$add_new_screen) {\n\t // if we have no selection yet, and we have menus, set to the first one in the list.\n\t $nav_menu_selected_id = $nav_menus[0]->term_id;\n\t }\n\n\t // Update the user's setting.\n\t if ($nav_menu_selected_id != $recently_edited && is_nav_menu($nav_menu_selected_id))\n\t update_user_meta(get_current_user_id(), 'nav_menu_recently_edited', $nav_menu_selected_id);\n\n\t //if menu hase change on dropdwon and save menu than recently menu option will update\n\t if (!empty($_POST['menu'])) {\n\t $nav_menu_selected_id = (int) $_POST['menu'];\n\t $user_id = get_current_user_id();\n\t update_user_meta($user_id, 'nav_menu_recently_edited', $nav_menu_selected_id);\n\t }\n\t $menu_locations = get_nav_menu_locations();\n\t $locations = get_registered_nav_menus();\n\n\t $users_data = array('udata' => $this->get_all_user_data());\n\n\t\t\t$nav_menus_l10n = array(\n\t\t\t\t'oneThemeLocationNoMenus' => '',\n\t\t\t\t'moveUp' => __( 'Move up one' ),\n\t\t\t\t'moveDown' => __( 'Move down one' ),\n\t\t\t\t'moveToTop' => __( 'Move to the top' ),\n\t\t\t\t/* translators: %s: previous item name */\n\t\t\t\t'moveUnder' => __( 'Move under %s' ),\n\t\t\t\t/* translators: %s: previous item name */\n\t\t\t\t'moveOutFrom' => __( 'Move out from under %s' ),\n\t\t\t\t/* translators: %s:s previous item name */\n\t\t\t\t'under' => __( 'Under %s' ),\n\t\t\t\t/* translators: %s: previous item name */\n\t\t\t\t'outFrom' => __( 'Out from under %s' ),\n\t\t\t\t/* translators: 1: item name, 2: item position, 3: total number of items */\n\t\t\t\t'menuFocus' => __( '%1$s. Menu item %2$d of %3$d.' ),\n\t\t\t\t/* translators: 1: item name, 2: item position, 3: parent item name */\n\t\t\t\t'subMenuFocus' => __( '%1$s. Sub item number %2$d under %3$s.' ),\n\t\t\t);\n\t\t\t \n\n\t //$messages = $this->processing_action_request($action, $nav_menu_selected_id);\n\t $messages = MMCP_Controllers::instance()->get_messages();\n\t wp_nav_menu_setup();\n\t wp_initial_nav_menu_meta_boxes();\n\t wp_enqueue_script('nav-menu');\n\t $all_register_widget_items = MMCP_Manager_Widget::instance()->get_all_items_register_widget();\n\t\t\tif ( wp_is_mobile() )\n\t\t\t\twp_enqueue_script( 'jquery-touch-punch' ); \n\t\t\twp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n );\n\t\t\twp_localize_script( 'nav-menu', 'mmcp_users', $users_data );\n\t //wp_nav_menu_post_type_meta_boxes();\n\t //wp_nav_menu_taxonomy_meta_boxes(); \n\t include_once(MMCPRO()->plugin_path().'/admin/views/menus/group_menu.php');\n\t include_once(MMCPRO()->plugin_path().'/admin/views/menus/items.php');\n\t //include_once(MMCPRO()::$plugin_path.'admin/views/menus/group_menu.php');\n\t\t}", "function MyMod_Items_Menu_Horisontal($args,$items,$argskey,$idkey=\"ID\",$namekeys=array(),$titlekeys=array(),$title=\"\",$current=0,$anchor=\"\")\n {\n return\n $this->HRefMenu\n (\n $title,\n $this->MyMod_Items_Menu_HRefs\n (\n $args,\n $items,\n $argskey,\n $idkey,\n $namekeys,\n $titlekeys,\n $title,\n $current,\n $anchor\n )\n );\n \n }", "function ea_attr_third_nav( $attributes ) {\n\n $attributes['id'] = 'genesis-nav-third-menu';\n\n return $attributes;\n\n}", "function wp_addvideo_menuitem_atts( $atts, $item, $args )\n{\n\n //Defining our menu names\n $name1 = 'Visitors';\n $name2 = 'Members';\n\t\n //then get the menu object by its name\n $menu1 = get_term_by( 'name', $name1, 'nav_menu' );\n $menu2 = get_term_by( 'name', $name2, 'nav_menu' );\n\t\n //!!! This might be problematic, the reference to name should not be case sensitive and user might want to customize menu items\n //Any way to get the menu item name into a variable?? investigate this !!!\n\t$item_about = 'ABOUT';\n\t$item_register = 'REGISTER';\n\t$item_loginto = 'LOG IN';\n\t$item_addvideo = 'SUBMIT VIDEO';\n\t \n\t$about1_id = ts_get_menu_item_id( $menu1->term_id, $item_about, $item_type = 'custom' );\n\t$about2_id = ts_get_menu_item_id( $menu2->term_id, $item_about, $item_type = 'custom' ); \n\t$register_id = ts_get_menu_item_id( $menu1->term_id, $item_register, $item_type = 'custom' ); \n\t$loginto_id = ts_get_menu_item_id( $menu1->term_id, $item_loginto, $item_type = 'custom' ); \n\t$addvideo_id = ts_get_menu_item_id( $menu2->term_id, $item_addvideo, $item_type = 'custom' ); \n\t \n \n \n $menu_target = array(\n 'addvideo' => $addvideo_id,\n\t\t'loginto' => $loginto_id,\n\t\t'register' => $register_id,\n\t\t'about' => $about1_id, $about2_id \t\n\t\t);\n\t\t\n // inspect $item\n if (in_array($item->ID, $menu_target)) {\n $atts['data-toggle'] = 'modal';\n }\n return $atts;\n}", "public function menuAction()\n {\n $module = $this->getModule();\n $model = $this->getModel($module);\n $orders = $this->params('order');\n foreach ($orders as $id => $value) {\n $model->update(\n array('nav_order' => (int) $value),\n array('id' => (int) $id)\n );\n }\n Pi::registry('nav', $this->getModule())->flush();\n\n return $this->jump(\n array('action' => 'index'),\n _a('Solutions navigation menu updated successfully.')\n );\n }", "public function update_menu ($name, $id) {\t \n\t \t$name = htmlentities($name);\n\t \n \t\tif (trim($name) == \"\" or trim($id) == \"\") {\n \t\t\techo '<p class=\"error\"><b>Fehler:</b> unvollständige Eingabe</p>';\n \t\t\t$this->show_menu();\n \t\t\tdie();\n \t\t}\n \t\t\n\t\t$sql = \"UPDATE Menu SET Name = ? WHERE ID = ?\";\t\t\n\t\t$res = $this->db->prepare($sql);\n\t\t$res->bind_param('si', $name, $id);\n\t\t$res->execute();\n\t\t\n\t\t$this->show_menu();\n\t }", "public function actionEdit ()\n\t\t{\n\t\t\t$id = Yii::$app->request->get('id');\n\t\t\t$menu = Menu::findOne($id);\n\t\t\tif ($menu == null)\n\t\t\t{\n\t\t\t\tYii::$app->notification->messageToSession(Yii::tr('Menu item not found.', [], 'menu'));\n\t\t\t\t$this->redirect(Yii::$app->request->referrer);\n\t\t\t}\n\t\t\tif (Yii::$app->request->isPost)\n\t\t\t{\n\t\t\t\t$post = Yii::$app->request->post('Menu');\n\n\t\t\t\t$menu->updateAttributes([\n\t\t\t\t\t'title' => $post[ 'title' ],\n\t\t\t\t\t'url' => $post[ 'url' ],\n\t\t\t\t\t'path' => $post[ 'path' ]\n\t\t\t\t]);\n\n\t\t\t\t$menu->save();\n\t\t\t\tYii::$app->notification->messageToSession(Yii::tr('Menu item was saved.', [], 'menu'));\n\t\t\t\t$this->redirect(Url::toRoute([ '/menu/index', 'type' => $menu->typeID ]));\n\t\t\t}\n\t\t\t$this->data('model', $menu);\n\t\t\t$this->setTitle(Yii::tr('Edit menu item', [], 'menu'));\n\t\t\t$this->_tpl = '@menuViews/add';\n\t\t}", "public function save() {\n foreach($this->getMenuItems() as $item){\n $item->setMenu($this);\n $item->save();\n }\n parent::save();\n }", "function tocka_update_nav_menu_item($menu_id, $menu_item_id, $args) {\r\n\t\t//printr($_POST);\r\n\t\t\r\n\t\tif ( isset( $_POST[ \"sh_menu_icon_field_$menu_item_id\" ] ) ) {\r\n\t\t $hover_field = isset( $_POST[ \"sh_menu_icon_hover_field_$menu_item_id\" ] ) ? $_POST[ \"sh_menu_icon_hover_field_$menu_item_id\" ] : '';\r\n\t\t $color_field = isset( $_POST[ \"sh_menu_color_field_$menu_item_id\" ] ) ? $_POST[ \"sh_menu_color_field_$menu_item_id\" ] : '';\r\n\t\t\tupdate_post_meta( $menu_item_id, 'sh_menu_icon_field', $_POST[ \"sh_menu_icon_field_$menu_item_id\" ] );\r\n\t\t\tupdate_post_meta( $menu_item_id, 'sh_menu_icon_hover_field', $hover_field );\r\n\t\t\tupdate_post_meta( $menu_item_id, 'sh_menu_color_field', $color_field );\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t#mfmfmf(\"DEL\");\r\n\t\t\t//delete_post_meta( $menu_item_id, 'sh_menu_icon_field' );\r\n\t\t}\r\n \r\n\t}", "public function admin_menu(&$menu)\n {\n\n\t}", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"Notifiable Diseases\", \"LIBRARIES\", \"_notifiable\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }" ]
[ "0.72496563", "0.6518758", "0.6303991", "0.6202122", "0.6178807", "0.6177702", "0.6168246", "0.6166722", "0.6054076", "0.60370106", "0.6029967", "0.60040224", "0.60040224", "0.60040224", "0.60040224", "0.60040224", "0.60040224", "0.59829307", "0.597648", "0.5975174", "0.5965608", "0.5915055", "0.59046495", "0.5895568", "0.58816946", "0.584375", "0.5826017", "0.58032477", "0.5788136", "0.57808024" ]
0.69138396
1
To compute data for sales and orders graphs
public function get_sales_data(Request $request){ $sales_graph=$this->all_orders->groupBy(function($item){ return ($item->created_at->format('Y:m')); })->map(function($item,$key){ return ($item->sum('grand_total')); }); $orders_graph=$this->all_orders->groupBy(function($item){ return ($item->created_at->format('Y:m')); })->map(function($item,$key){ return ($item->count()); }); $sales_str="["; foreach($sales_graph as $key=>$value){ if($sales_graph->last()==$value) $sales_str.='{"Month" : "' . $key . '", "Sales":"'.$value .'"}'; else $sales_str.='{"Month": "' . $key . '", "Sales":"'.$value .'"},'; } $sales_str.="]"; $orders_str="["; foreach($orders_graph as $key=>$value){ if($orders_graph->last()==$value) $orders_str.='{"Month" : "' . $key . '", "Orders":"'.$value .'"}'; else $orders_str.='{"Month": "' . $key . '", "Orders":"'.$value .'"},'; } $orders_str.="]"; echo json_encode([$sales_str,$orders_str]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculate_data() {\n $this->data = array();\n $this->data['series'] = array();\n\n $series_size = 0;\n\n $series_list = $this->calculate_series_list();\n foreach($series_list as $key => $value) {\n $this->data['series'][$value] = $this->calculate_series($key);\n\n if($series_size < count($this->data['series'][$value])) {\n $series_size = count($this->data['series'][$value]);\n }\n }\n\n $this->data['labels'] = $this->calculate_labels($series_size);\n }", "public function pharmacySalesGraphData()\n {\n $prescriptions = Prescription::whereIn('status',[Prescriptions::PAID_PRESCRIPTION,Prescriptions::ISSUED_PRESCRIPTION])->get();\n $internalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::INTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n $externalPrescriptions = $prescriptions->where('prescription_type', Prescriptions::EXTERNAL_MEDICAL_PRESCRIPTION)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('total')\n ];\n })->values()->all();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'internalPrescriptionsSales' => $internalPrescriptions,\n 'externalPrescriptionsSales' => $externalPrescriptions,\n ]);\n }", "public function index()\n {\n $start = date('Y-m-d 00:00:00');\n $end = date('Y-m-d 23:59:59');\n\n $newOrder = (int) Order::whereNotNull('confirmed_at')\n ->whereBetween('created_at', [$start, $end])\n ->where('status', '<>', 'canceled')\n ->count();\n\n $income = Order::whereNotNull('confirmed_at')\n ->whereIn('status', ['paid', 'shipped', 'complete'])\n ->whereBetween('created_at', [$start, $end])\n ->sum(DB::raw('`total` * `exchange_rate`'));\n\n $newUser = (int) User::whereBetween('created_at', [$start, $end])->count();\n $totalUser = (int) User::count();\n\n $dailySales = [];\n $num = 10;\n $from = strtotime(date('Y-m-d')) - 86400 * 9;\n for ($i = 0; $i < 10; $i++) {\n $t = $from + $i * 86400;\n\n $v = Order::whereNotNull('confirmed_at')\n ->whereIn('status', ['paid', 'shipped', 'complete'])\n ->whereBetween('created_at', [\n date('Y-m-d 00:00:00', $t), date('Y-m-d 23:59:59', $t),\n ])\n ->sum(DB::raw('`total` * `exchange_rate`'));\n\n $dailySales[date('Y-m-d', $t)] = round($v, 2);\n }\n\n $months = [];\n $monthlySales = [];\n $start = mktime(0, 0, 0, date('n'), 1, date('Y') - 1);\n for ($i = 0; $i <= 12; $i++) {\n $t = Helper::periodicTime($start, $i);\n $months[] = date('Y-m', $t);\n\n $v = Order::whereNotNull('confirmed_at')\n ->whereIn('status', ['paid', 'shipped', 'complete'])\n ->whereBetween('created_at', [\n date('Y-m-d 00:00:00', $t), date('Y-m-t 23:59:59', $t),\n ])\n ->sum(DB::raw('`total` * `exchange_rate`'));\n $monthlySales[] = round($v, 2);\n }\n\n return view('admin.index', [\n 'pageTitle' => 'Dashboard',\n 'newOrder' => $newOrder,\n 'income' => Helper::money($income),\n 'newUser' => $newUser,\n 'totalUser' => $totalUser,\n 'dailySales' => $dailySales,\n 'months' => $months,\n 'monthlySales' => $monthlySales,\n ]);\n }", "public static function GetDashboard() {\n $date = [];\n $num_orders = [];\n $last_month = \\Carbon\\Carbon::today()->subDays(30);\n $orders = Order::where('created_at', '>=', $last_month)->get()\n ->groupBy(function($item) {\n return $item->created_at->format('d-m-y');\n })->toArray();\n foreach ($orders as $key => $value) {\n $date[] = $key;\n $num_orders[] = count($value);\n }\n\n //======= Get income from last month - Chart From DB =======\n $last_month_income = \\Carbon\\Carbon::today()->subDays(30);\n $all_orders = [];\n $orders_income = [];\n $income = [];\n $income_date = [];\n $users_orders = DB::table('users')\n ->join('orders', 'users.id', '=', 'orders.user_id')\n ->select('users.*', 'orders.*')\n ->where('orders.created_at', '>=', $last_month_income)->get();\n foreach ($users_orders as $new_user_order) {\n $all_orders[] = (array) $new_user_order;\n }\n foreach ($all_orders as &$orders_data) {\n $orders_data['data'] = unserialize($orders_data['data']);\n }\n foreach ($all_orders as $order) {\n $order['created_at'] = (new \\DateTime($order['created_at']))->format('Y-m-d');\n $income_date[] = $order['created_at'];\n $sum = 0;\n foreach ($order['data'] as $price) {\n $sum += ($price['price'] * $price['quantity']);\n }\n $income[] = $sum;\n }\n\n for ($i = count($income_date) - 1; $i > 0; $i--) {\n if ($income_date[$i] == $income_date[$i - 1]) {\n unset($income_date[$i]);\n $income[$i - 1] = $income[$i] + $income[$i - 1];\n unset($income[$i]);\n }\n }\n $income = array_values($income);\n $income_date = array_values($income_date);\n\n self::$data['income'] = json_encode($income);\n self::$data['income_date'] = json_encode($income_date);\n\n //======= Get last week new users =======\n $last_week = \\Carbon\\Carbon::today()->subDays(7);\n $weekly_users = User::where('created_at', '>=', $last_week)->get()->toArray();\n\n //======= Get all users except admin =======\n $all_users = User::where('role', '!=', '6')->get()->toArray();\n\n //======= Get last day new orders =======\n $last_day = \\Carbon\\Carbon::today();\n $daily_orders = Order::where('created_at', '>=', $last_day)->get()->toArray();\n\n self::$data['weekly_new_users'] = count($weekly_users);\n self::$data['all_users'] = count($all_users);\n self::$data['daily_orders'] = count($daily_orders);\n self::$data['date'] = json_encode($date);\n self::$data['num_orders'] = json_encode($num_orders);\n self::$data['title'] .= 'CMS';\n self::$data['page_name'] = 'Ski Expert | Main';\n return view('cms.dashboard', self::$data);\n }", "private function calculateCost() : void\n {\n $graph = [];\n $data = $this->data->whereNotIn('container_id', $this->containers);\n\n $countAccumulateProductTypes = count($this->accumulateProductTypes);\n foreach ($data as $key => $value) {\n $graph[$key] = $this->getCost($this->accumulateProductTypes, $value, $countAccumulateProductTypes);\n }\n $this->graph = collect($graph);\n }", "public function graphData()\n {\n $dayOfWeek = ['Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado', 'Domingo'];\n $colors = [\n 'rgba(201, 203, 207, 0.8)', //gray\n 'rgba(255, 99, 132, 0.8)', //Red\n 'rgba(255, 159, 64, 0.8)', //Orange\n 'rgba(75, 192, 192, 0.8)', //green\n 'rgba(54, 162, 235, 0.8)', //blue\n 'rgba(153, 102, 255, 0.8)', //purple\n 'rgba(255, 205, 86, 0.8)', //yellow\n ];\n $borderColors = [\n 'rgba(201, 203, 207, 1)', //gray\n 'rgba(255, 99, 132, 1)', //Red\n 'rgba(255, 159, 64, 1)', //Orange\n 'rgba(75, 192, 192, 1)', //green\n 'rgba(54, 162, 235, 1)', //blue\n 'rgba(153, 102, 255, 1)', //purple\n 'rgba(255, 205, 86, 1)', //yellow\n ];\n $months = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];\n $now = Carbon::now()->timezone($this->timezome);\n $data = [];\n\n switch ($this->graphPeriod) {\n case 'weekly':\n $data = $this->getDataFromWeeklySales($colors, $borderColors);\n break;\n case 'weeklyAccumulated':\n $data = $this->getDataFromWeeklySales($colors, $borderColors, true);\n break;\n case 'monthly':\n $labels = [];\n $date = $now->copy()->subMonths(5)->startOfMonth()->startOfDay();\n $end = $now->copy()->endOfDay();\n $count = 0;\n\n for ($i = 1; $i < 32; $i++) {\n $labels[] = $i;\n }\n\n while ($date->lessThanOrEqualTo($end)) {\n $label = $months[$date->month - 1];\n $data = [];\n $endOfMonth = $date->copy()->endOfMonth()->endOfDay();\n $sale = 0;\n\n while ($date->lessThanOrEqualTo($endOfMonth) && $date->lessThanOrEqualTo($end)) {\n $sale += $this->getSumFromGraphPeriod($date, $this->graphCategory);\n $data[] = $sale;\n $date->addDay();\n }\n\n $datasets[] = [\n 'label' => $label,\n 'backgroundColor' => $colors[$count],\n 'borderColor' => $borderColors[$count],\n 'borderWidth' => 1,\n 'data' => $data,\n 'fill' => false\n ];\n\n $count++;\n }\n\n $data = [\n 'labels' => $labels,\n 'datasets' => $datasets,\n 'type' => 'line'\n ];\n break;\n default:\n # code...\n break;\n }\n return $data;\n }", "private function rateOfSaleTrackerGrid() {\n\t\t$arr = array();\t\t\n /*[PART 1] GETTING THE STORE COUNT DATA*/\n $this->settingVars->tableUsedForQuery = $this->measureFields = array();\n $this->measureFields[] = $this->accountID;\n $this->measureFields[] = $this->storeCount;\n $this->settingVars->useRequiredTablesOnly = true;\n if (is_array($this->measureFields) && !empty($this->measureFields)) {\n $this->prepareTablesUsedForQuery($this->measureFields);\n }\n $this->queryPart = $this->getAll();\n\t\t$getStoreData = $this->storeCountData($this->accountID,$this->storeCount);\n\n\t\t/*[PART 2] GETTING THE GRID DATA*/\n $this->settingVars->tableUsedForQuery = $this->measureFields = array();\n \t$measureSelectRes = $this->prepareMeasureSelectPart();\n\t\t$this->measureFields = $measureSelectRes['measureFields'];\n\n\t\t$measureSelectionArr = $measureSelectRes['measureSelectionArr'];\n\t\t$havingTYValue \t\t = $measureSelectRes['havingTYValue'];\n\t\t$havingLYValue \t\t = $measureSelectRes['havingLYValue'];\n\n $this->measureFields[] = $this->accountID;\n $this->measureFields[] = $this->accountName;\n\t\t\n $this->settingVars->useRequiredTablesOnly = true;\n if (is_array($this->measureFields) && !empty($this->measureFields)) {\n $this->prepareTablesUsedForQuery($this->measureFields);\n }\n $this->queryPart = $this->getAll();\n\n /*$options = array();\n if (!empty($this->ytdTyWeekRange))\n $options['tyLyRange']['SALES'] = $this->ytdTyWeekRange;\n\n if (!empty($this->ytdLyWeekRange))\n $options['tyLyRange']['LYSALES'] = $this->ytdLyWeekRange;\n\n $measureSelect = config\\MeasureConfigure::prepareSelect($this->settingVars, $this->queryVars, array('M'.$_REQUEST['ValueVolume']), $options);\n $measureSelect = implode(\", \", $measureSelect);*/\n\n\t\t$measureSelect = implode(\", \", $measureSelectionArr);\n $query = \"SELECT \".$this->accountID.\" as SKUID\" .\n\t\t\t\t\",\".$this->accountName.\" as SKU\".\n\t\t\t\t\",\".$measureSelect.\" \".\n \",SUM((CASE WHEN \" . $this->ytdTyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectVolume.\") as QTY \".\n \",SUM((CASE WHEN \" . $this->ytdLyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectVolume.\") as QTY_LY \".\n \",SUM((CASE WHEN \" . $this->ytdTyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectValue.\") as VAL_TY \".\n\t\t\t\t\",SUM((CASE WHEN \" . $this->ytdLyWeekRange . \" THEN 1 ELSE 0 END)*\".$this->settingVars->ProjectValue.\") as VAL_LY \".\n \"FROM \" . $this->settingVars->tablename.\" \".$this->queryPart.\n\t\t\t\t\" AND (\" . $this->ytdTyWeekRange . \" OR \" . $this->ytdLyWeekRange . \") \".\n\t\t\t\t\"GROUP BY SKUID, SKU \";\n\t\t\n\t\t//HAVING (SALES > 0 AND QTY > 0) ORDER BY SALES DESC\n\t\t$redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\n if ($redisOutput === false) {\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n $this->redisCache->setDataForHash($result);\n } else {\n $result = $redisOutput;\n }\n\n\n\t\t$requiredGridFields = ['SKUID','SKU','QTY','QTY_LY','VAL_TY','VAL_LY',$havingTYValue, $havingLYValue];\n\t\t$result = $this->redisCache->getRequiredData($result, $requiredGridFields, $havingTYValue, $havingTYValue);\n\t\t\n\t\tif (is_array($result) && !empty($result)) {\n\n\t\t\t$result = \\utils\\SortUtility::sort2DArray($result, $havingTYValue, \\utils\\SortTypes::$SORT_DESCENDING);\t\n\t\t\t//$total = array_sum(array_column($result,'SALES'));\n //$totalSALESLY = array_sum(array_column($result,'LYSALES'));\n\t\t\t\n // $total = array_sum(array_column($result,$havingTYValue));\n // $totalSALESLY = array_sum(array_column($result,$havingLYValue));\n \n $total = $totalSALESLY = 0;\n $resultFn = [];\n foreach($result as $data){\n if(round($data[$havingTYValue]) > 0 && $data['QTY'] > 0){\n $total += $data[$havingTYValue];\n $totalSALESLY += $data[$havingLYValue];\n $resultFn[] = $data;\n }\n }\n\n\t\t\tforeach($resultFn as $data){\n\t\t\t\tif(round($data[$havingTYValue]) > 0 && $data['QTY'] > 0){\n $data[$havingTYValue] = round($data[$havingTYValue]);\n $data[$havingLYValue] = round($data[$havingLYValue]);\n \n\t\t\t\t\t$var = $data[$havingLYValue] != 0 ? ((($data[$havingTYValue] - $data[$havingLYValue]) / $data[$havingLYValue]) * 100) : 0;\n\t $share = $total != 0 ? (($data[$havingTYValue] / $total) * 100) : 0;\n\t $shareLY = $totalSALESLY != 0 ? (($data[$havingLYValue] / $totalSALESLY) * 100) : 0;\n\n\t\t\t\t\t$temp = array();\n\t\t\t\t\t$temp['SKUID'] \t\t= $data['SKUID'];\n\t\t\t\t\t$temp['SKU'] \t\t= $data['SKU'];\n\t\t\t\t\t$temp['SALES'] \t\t= $data[$havingTYValue];\n\t\t\t\t\t$temp['LYSALES'] \t= $data[$havingLYValue];\n\t\t\t\t\t$temp['VAR'] \t\t= $var;\n\t\t\t\t\t$temp['SHARE'] \t\t= $share;\n\t\t\t\t\t$temp['SHARELY'] \t= $shareLY;\n\t\t\t\t\t$temp['QTY'] \t\t= $data['QTY'];\n $temp['QTY_LY'] = $data['QTY_LY'];\n $temp['QTY_VAR'] = ($data['QTY_LY'] > 0) ? number_format( (($data['QTY'] - $data['QTY_LY']) / $data['QTY_LY']) * 100, 1, '.', '') : 0;\n\t\t\t\t\t$temp['CASH_ROS'] \t= ($getStoreData[$data['SKUID']]['ID_TY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VALUE_TY']/$getStoreData[$data['SKUID']]['ID_TY'], 2, '.', '') : 0;\n\t\t\t\t\t$temp['QTY_ROS'] \t= ($getStoreData[$data['SKUID']]['ID_TY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VOLUME_TY']/$getStoreData[$data['SKUID']]['ID_TY'], 2, '.', '') : 0;\n\t\t\t\t\t$temp['CROS_LY'] \t= ($getStoreData[$data['SKUID']]['ID_LY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VALUE_LY']/$getStoreData[$data['SKUID']]['ID_LY'], 2, '.', '') : 0;\n\t\t\t\t\t$temp['QROS_LY'] \t= ($getStoreData[$data['SKUID']]['ID_LY'] > 0) ? number_format($getStoreData[$data['SKUID']]['VOLUME_LY']/$getStoreData[$data['SKUID']]['ID_LY'], 2, '.', '') : 0;\n\t $temp['AVE_STORE_TY'] = number_format($getStoreData[$data['SKUID']]['AVE_STORE_TY'], 2, '.', '');\n\t $temp['AVE_STORE_LY'] = number_format($getStoreData[$data['SKUID']]['AVE_STORE_LY'], 2, '.', '');\n \n $temp['AVE_PRICE_TY'] = ($data['QTY'] > 0) ? number_format($data['VAL_TY'] / $data['QTY'], 2, '.', '') : 0;\n $temp['AVE_PRICE_LY'] = ($data['QTY_LY'] > 0) ? number_format($data['VAL_LY'] / $data['QTY_LY'], 2, '.', '') : 0;\n\n\t\t\t\t\t$arr[]\t\t\t\t= $temp;\n\t\t\t\t}\n\t\t\t}\n\t\t} // end if\n $this->jsonOutput['rateOfSaleTrackerGrid'] = $arr;\n }", "public function index()\n {\n if (count(Setting::all())) {\n $products = Product::all();\n\n $products_sold = Product::has('orders')->get();\n $available_products = Product::where('out_stock', 0)->get();\n $orders = Order::where('status', 'Completed')->orderBy('created_at', 'desc')->take(5)->get();\n $outstock = Product::where('out_stock', 1)->get();\n\n $total_sales = 0;\n $completed_orders = Order::where('status', 'Completed')->get();\n\n foreach ($completed_orders as $order) {\n $total_sales += $order->totalCost();\n }\n $year = date('Y');\n $monthly_gross_order = array();\n for ($i = 1; $i <= 12; $i++) {\n $month_orders = Order::whereYear('created_at', $year)->whereMonth('created_at', $i)->where('status', 'Completed')->get();\n $monthly_total = 0;\n\n foreach ($month_orders as $month_order) {\n $monthly_total += $month_order->totalCost();\n }\n\n $monthly_gross_order[] = ($monthly_total);\n }\n // dd($monthly_gross_order);\n $chart = new ProductSalesChart;\n $chart->dataset('Amount', 'line', $monthly_gross_order);\n $chart->labels(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec']);\n\n return view('home')->with(['products' => $products,\n 'available_products' => $available_products,\n 'outstock' => $outstock,\n 'orders' => $orders,\n 'products_sold' => $products_sold,\n 'total_sales' => $total_sales,\n 'chart' => $chart,\n ]);\n } else {\n return redirect()->route('initial_setup');\n }\n }", "public function woocommerce_reports_category_sales_order_items($orders) {\n\t\tglobal $wpdb;\n\t\t$this->set_reporting_flag(true);\n\n\t\t// If no data was retrieved by WooCommerce, just return the empty dataset\n\t\tif(empty($orders)) {\n\t\t\treturn $orders;\n\t\t}\n\n\t\t// This report requires one year to retrieve the data, but such information\n\t\t// is not passed by the apply_filter() call. It's therefore necessary to\n\t\t// extract it from the data that was retrieved by WooCommerce, using the\n\t\t// first date found in the dataset\n\t\t$order = $orders[0];\n\t\t$reference_date = DateTime::createFromFormat('Y-m-d H:i:s', get_value('post_date', $orders[0]));\n\t\t$year_to_retrieve = $reference_date->format('Y');\n\n\t\t// Calculate the first date of year passed as a parameter and the start date\n\t\t// of next one\n\t\t$start_date = $year_to_retrieve . '0101000000';\n\t\t$end_date = date('Ymd000000', strtotime($start_date . ' +1 year'));\n\n\t\t$SQL = \"\n\t\t\tSELECT\n\t\t\t\torder_item_meta_2.meta_value as product_id\n\t\t\t\t,posts.post_date\n\t\t\t\t-- ,SUM(order_item_meta_3.meta_value) AS line_total\n\t\t\t\t-- Return Line total converted to base currency\n\t\t\t\t,SUM(order_item_meta_3.meta_value * meta_order_base_curr.meta_value / meta_order.meta_value) AS line_total\n\t\t\tFROM\n\t\t\t\t{$wpdb->prefix}woocommerce_order_items AS order_items\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_2 ON\n\t\t\t\t\t(order_item_meta_2.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_2.meta_key = '_product_id')\n\t\t\tJOIN\n\t\t\t\t{$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta_3 ON\n\t\t\t\t\t(order_item_meta_3.order_item_id = order_items.order_item_id) AND\n\t\t\t\t\t(order_item_meta_3.meta_key = '_line_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->posts AS posts ON\n\t\t\t\t\t(posts.ID = order_items.order_id) AND\n\t\t\t\t\t(posts.post_type = 'shop_order') AND\n\t\t\t\t\t(posts.post_status = 'publish') AND\n\t\t\t\t\t(posts.post_date >= $start_date) AND\n\t\t\t\t\t(posts.post_date < $end_date)\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order ON\n\t\t\t\t\t(meta_order.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order.meta_key = '_order_total')\n\t\t\tJOIN\n\t\t\t\t$wpdb->postmeta AS meta_order_base_curr ON\n\t\t\t\t\t(meta_order_base_curr.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order_base_curr.meta_key = '_order_total_base_currency')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_relationships AS rel ON\n\t\t\t\t\t(rel.object_ID = posts.ID)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_taxonomy AS taxonomy ON\n\t\t\t\t\t(taxonomy.term_taxonomy_id = rel.term_taxonomy_id) AND\n\t\t\t\t\t(taxonomy.taxonomy = 'shop_order_status')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->terms AS term ON\n\t\t\t\t\t(term.term_id = taxonomy.term_id) AND\n\t\t\t\t\t(term.slug IN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"'))\n\t\t\tWHERE\n\t\t\t\t(order_items.order_item_type = 'line_item')\n\t\t\tGROUP BY\n\t\t\t\torder_items.order_item_id\n\t\t\tORDER BY\n\t\t\t\tposts.post_date ASC\n\t\t\";\n\n\t\t$orders_base_curr = $wpdb->get_results($SQL);\n\t\t$this->set_reporting_flag(false);\n\n\t\treturn $orders_base_curr;\n\t}", "public function getgraphAction(){\n $params = array(\n 'cht' => 'lc', \t\t\t\t\t// chart type\n 'chf' => 'bg,s,f4f4f4|c,lg,90,ffffff,0.1,ededed,0', //background fills for the chart\n // 'chm' => 'B,f4d4b2,0,0,0|B,FF0000,1,1,0|B,00FF00,2,2,0', \t\t// line fills\n 'chco' => 'db4814,1919D1',\t\t\t\t\t//Series Colors\n 'chs' => '587x300',\t\t\t\t// chart size <width>x<height>\n\t\t\t'chxt' => 'x,y',\t\t\t\t\t// visible axes\n\t\t\t//'chof' => 'validate'\t\t\t\t// output format (png,gif,json,html{when chof='validate'})\n );\n \n\t$post=$this->getRequest()->getPost();\n\t\n\t\n\t$timezoneLocal = Mage::app()->getStore()->getConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_TIMEZONE);\n\n\t\tlist ($dateStart, $dateEnd) = Mage::getResourceModel('reports/order_collection')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getDateRange($post['range'], '', '', true);\n\n $dateStart->setTimezone($timezoneLocal);\n $dateEnd->setTimezone($timezoneLocal);\n\t\n\t\t$dates = array();\n $datas = array();\n\n while($dateStart->compare($dateEnd) < 0){\n switch ($post['range']) {\n case '24h':\n $d = $dateStart->toString('yyyy-MM-dd HH:00');\n $dateStart->addHour(1);\n break;\n case '7d':\n case '1m':\n $d = $dateStart->toString('yyyy-MM-dd');\n $dateStart->addDay(1);\n break;\n case '1y':\n case '2y':\n $d = $dateStart->toString('yyyy-MM');\n $dateStart->addMonth(1);\n break;\n }\n\n $dates[] = $d;\n }\n\n\t\t$graphData=array();\n\t\t\n\t\t$product_list=array('product1'=>$post['product'],\n\t\t\t\t\t\t\t'product2'=>$post['compare2']\n\t\t\t\t\t\t\t);\t\n\t\t$graphData=Mage::Helper('graphs')->getGraphData($dates,$product_list);\n\n /**\n * setting skip step\n */\n if (count($dates) > 8 && count($dates) < 15) {\n $c = 1;\n } else if (count($dates) >= 15){\n $c = 2;\n } else {\n $c = 0;\n }\n /**\n * skipping some x labels for good reading\n */\n $i=0;\n foreach ($dates as $k => $d) {\n if ($i == $c) {\n $dates[$k] = $d;\n $i = 0;\n } else {\n $dates[$k] = '';\n $i++;\n }\n }\n \n $this->_axisLabels['x'] = $dates;\n\t\t$this->_axisLabels['y'] = $graphData['quantity'][$post['product']];\n\t\t\n\t\tforeach ($graphData['quantity'] as $index => $serie) {\n $localmaxlength[$index] = sizeof($serie);\n $localmaxvalue[$index] = max($serie);\n $localminvalue[$index] = min($serie);\n }\n \n\t\t$maxvalue = max($localmaxvalue);\n\t\t$minvalue = min($localminvalue);\n\n $yrange = 0;\n $yLabels = array();\n $miny = 0;\n $maxy = 0;\n $yorigin = 0;\n\n $maxlength = max($localmaxlength);\n if ($minvalue >= 0 && $maxvalue >= 0) {\n $miny = 0;\n if ($maxvalue > 10) {\n $p = pow(10, $this->_getPow($maxvalue));\n $maxy = (ceil($maxvalue/$p))*$p;\n $yLabels = range($miny, $maxy, $p);\n } else {\n $maxy = ceil($maxvalue+1);\n $yLabels = range($miny, $maxy, 1);\n }\n $yrange = $maxy;\n $yorigin = 0;\n }\n\n \n\t\t\t\n\t\t\t$params['chd'] = \"e:\";\n $dataDelimiter = \"\";\n $dataSetdelimiter = \",\";\n $dataMissing = \"__\";\n \n\t\t\t// EXTENDED ENCODING\n\t\t\tforeach($product_list as $productid){\n\t\t\t\t$chartdata = array();\t\n for ($j = 0; $j < sizeof($graphData['quantity'][$productid]); $j++) {\n $currentvalue = $graphData['quantity'][$productid][$j];\n \n if (is_numeric($currentvalue)) {\n if ($yrange) {\n $ylocation = (4095 * ($yorigin + $currentvalue) / $yrange);\n\n } else {\n $ylocation = 0;\n }\n $firstchar = floor($ylocation / 64);\n $secondchar = $ylocation % 64;\n $mappedchar = substr($this->_extendedEncoding, $firstchar, 1)\n . substr($this->_extendedEncoding, $secondchar, 1);\n array_push($chartdata, $mappedchar . $dataDelimiter);\n } else {\n array_push($chartdata, $dataMissing . $dataDelimiter);\n }\n\n\t\t\t }\n\t\t\t $buffer = implode('', $chartdata);\t\t\t \n\t\t\t\t\t$buffer = rtrim($buffer, $dataSetdelimiter);\n\t\t\t\t\t$buffer = rtrim($buffer, $dataDelimiter);\n\t\t\t\t\t$buffer = str_replace(($dataDelimiter . $dataSetdelimiter), $dataSetdelimiter, $buffer);\n\t\t\t\t\t\n\t\t\t\t\t$params['chd'] .= $buffer.',';\n\t\t\t\t\t$buffer=null;\n\t\t\t\t\t$chartdata=null;\n\t\t\t\t}\n\t\t\t\t\t$labelBuffer = \"\";\n\t\t\t\t\t$valueBuffer = array();\n\t\t\t\t\t$rangeBuffer = \"\";\n \n if (sizeof($this->_axisLabels) > 0) {\n $params['chxt'] = implode(',', array_keys($this->_axisLabels));\n $indexid = 0;\n foreach ($this->_axisLabels as $idx=>$labels){\n\t\t\t\t\n if ($idx == 'x') {\n /**\n * Format date\n */\n foreach ($this->_axisLabels[$idx] as $_index=>$_label) {\n if ($_label != '') {\n switch ($post['range']) {\n case '24h':\n $this->_axisLabels[$idx][$_index] = $this->formatTime(\n new Zend_Date($_label, 'yyyy-MM-dd HH:00'), 'short', false\n );\n break;\n case '7d':\n case '1m':\n $this->_axisLabels[$idx][$_index] = $this->formatDate(\n new Zend_Date($_label, 'yyyy-MM-dd')\n );\n break;\n case '1y':\n case '2y':\n\t\t\t\t\t\t\t\t\t\n $formats = Mage::app()->getLocale()->getTranslationList('datetime');\n $format = isset($formats['yyMM']) ? $formats['yyMM'] : 'MM/yyyy';\n $format = str_replace(array(\"yyyy\", \"yy\", \"MM\"), array(\"Y\", \"y\", \"m\"), $format);\n $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));\n break;\n }\n } else {\n $this->_axisLabels[$idx][$_index] = '';\n }\n\n }\n\t\t\t\t\t\t\t\t\t\t\n $tmpstring = implode('|', $this->_axisLabels[$idx]);\n\n $valueBuffer[] = $indexid . \":|\" . $tmpstring;\n if (sizeof($this->_axisLabels[$idx]) > 1) {\n $deltaX = 100/(sizeof($this->_axisLabels[$idx])-1);\n } else {\n $deltaX = 100;\n }\n } else if ($idx == 'y') {\n $valueBuffer[] = $indexid . \":|\" . implode('|', $yLabels);\n if (sizeof($yLabels)-1) {\n $deltaY = 100/(sizeof($yLabels)-1);\n } else {\n $deltaY = 100;\n }\n // setting range values for y axis\n $rangeBuffer = $indexid . \",\" . $miny . \",\" . $maxy . \"|\";\n }\n $indexid++;\n }\n $params['chxl'] = implode('|', $valueBuffer);\n }\t\t\t\n\t\t\t\t\t\n\t\tif (isset($deltaX) && isset($deltaY)) {\n $params['chg'] = $deltaX . ',' . $deltaY . ',1,0';\n }\n \n\n\t\t\t$p = array();\n foreach ($params as $name => $value) {\n $p[] = $name . '=' .urlencode($value);\n }\n\n $url= Mage_Adminhtml_Block_Dashboard_Graph::API_URL . '?' . implode('&', $p);\n\n\t\t\t\techo $url;\n\t}", "public function get_main_chart() {\n\n\t\tif ( empty( $this->product_ids ) ) {\n\t\t\t?>\n\t\t\t<div class=\"chart-container\">\n\t\t\t\t<p class=\"chart-prompt\"><?php _e( '&larr; Choose a product to view stats', 'woocommerce-cost-of-goods' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\t\treturn;\n\t\t}\n\n\t\t$data = $this->get_report_data();\n\n\t\t// prep data for charting\n\t\t$sales = $this->prepare_chart_data( $data->sales, 'post_date', 'order_item_amount', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$cogs = $this->prepare_chart_data( $data->cogs, 'post_date', 'order_item_total_cost', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$profits = $this->prepare_chart_data( $data->profits, 'post_date', 'order_item_profit', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\t\t$item_counts = $this->prepare_chart_data( $data->item_counts, 'post_date', 'order_item_count', $this->chart_interval, $this->start_date, $this->chart_groupby );\n\n\t\t$chart_data = array(\n\t\t\t'sales' => array_values( $sales ),\n\t\t\t'cogs' => array_values( $cogs ),\n\t\t\t'profits' => array_values( $profits ),\n\t\t\t'item_counts' => array_values( $item_counts ),\n\t\t);\n\n\t\t?>\n\t\t<div class=\"chart-container\">\n\t\t\t<div class=\"chart-placeholder main\"></div>\n\t\t</div>\n\t\t<script type=\"text/javascript\">\n\n\t\t\tvar main_chart;\n\n\t\t\tjQuery(function(){\n\t\t\t\tvar order_data = jQuery.parseJSON( '<?php echo json_encode( $chart_data ); ?>' );\n\n\t\t\t\tvar drawGraph = function( highlight ) {\n\n\t\t\t\t\tvar series = [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Number of items sold', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.item_counts,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_items']; ?>',\n\t\t\t\t\t\t\tbars : { fillColor: '<?php echo $this->chart_colors['total_items']; ?>', fill: true, show: true, lineWidth: 0, barWidth: <?php echo $this->barwidth; ?> * 0.5, align: 'center' },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\thoverable : false\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Sales amount', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.sales,\n\t\t\t\t\t\t\tyaxis : 2,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_sales']; ?>',\n\t\t\t\t\t\t\tpoints : { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines : { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\t<?php echo $this->get_currency_tooltip(); ?>\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Cost of Goods Sold', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.cogs,\n\t\t\t\t\t\t\tyaxis : 2,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_cogs']; ?>',\n\t\t\t\t\t\t\tpoints : { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines : { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\t<?php echo $this->get_currency_tooltip(); ?>\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel : \"<?php echo esc_js( __( 'Profit amount', 'woocommerce-cost-of-goods' ) ) ?>\",\n\t\t\t\t\t\t\tdata : order_data.profits,\n\t\t\t\t\t\t\tyaxis : 2,\n\t\t\t\t\t\t\tcolor : '<?php echo $this->chart_colors['total_profit']; ?>',\n\t\t\t\t\t\t\tpoints : { show: true, radius: 5, lineWidth: 3, fillColor: '#fff', fill: true },\n\t\t\t\t\t\t\tlines : { show: true, lineWidth: 4, fill: false },\n\t\t\t\t\t\t\tshadowSize: 0,\n\t\t\t\t\t\t\t<?php echo $this->get_currency_tooltip(); ?>\n\t\t\t\t\t\t}\n\t\t\t\t\t];\n\n\t\t\t\t\tif ( highlight !== 'undefined' && series[ highlight ] ) {\n\t\t\t\t\t\thighlight_series = series[ highlight ];\n\n\t\t\t\t\t\thighlight_series.color = '#9c5d90';\n\n\t\t\t\t\t\tif ( highlight_series.bars ) {\n\t\t\t\t\t\t\thighlight_series.bars.fillColor = '#9c5d90';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( highlight_series.lines ) {\n\t\t\t\t\t\t\thighlight_series.lines.lineWidth = 5;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmain_chart = jQuery.plot(\n\t\t\t\t\t\tjQuery( '.chart-placeholder.main' ),\n\t\t\t\t\t\tseries,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlegend: {\n\t\t\t\t\t\t\t\tshow: false\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgrid: {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\tborderColor: 'transparent',\n\t\t\t\t\t\t\t\tborderWidth: 0,\n\t\t\t\t\t\t\t\thoverable : true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\txaxes: [ {\n\t\t\t\t\t\t\t\tcolor : '#aaa',\n\t\t\t\t\t\t\t\tposition : 'bottom',\n\t\t\t\t\t\t\t\ttickColor : 'transparent',\n\t\t\t\t\t\t\t\tmode : 'time',\n\t\t\t\t\t\t\t\ttimeformat : \"<?php if ( $this->chart_groupby == 'day' ) echo '%d %b'; else echo '%b'; ?>\",\n\t\t\t\t\t\t\t\tmonthNames : <?php echo json_encode( array_values( $GLOBALS['wp_locale']->month_abbrev ) ) ?>,\n\t\t\t\t\t\t\t\ttickLength : 1,\n\t\t\t\t\t\t\t\tminTickSize: [1, \"<?php echo esc_js( $this->chart_groupby ); ?>\"],\n\t\t\t\t\t\t\t\tfont : {\n\t\t\t\t\t\t\t\t\tcolor: '#aaa'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} ],\n\t\t\t\t\t\t\tyaxes: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmin : 0,\n\t\t\t\t\t\t\t\t\tminTickSize : 1,\n\t\t\t\t\t\t\t\t\ttickDecimals: 0,\n\t\t\t\t\t\t\t\t\tcolor : '#ecf0f1',\n\t\t\t\t\t\t\t\t\tfont : { color: '#aaa' }\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\tposition : 'right',\n\t\t\t\t\t\t\t\t\tmin : 0,\n\t\t\t\t\t\t\t\t\ttickDecimals : 2,\n\t\t\t\t\t\t\t\t\talignTicksWithAxis: 1,\n\t\t\t\t\t\t\t\t\tcolor : 'transparent',\n\t\t\t\t\t\t\t\t\tfont : { color: '#aaa' }\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\n\t\t\t\t\tjQuery( '.chart-placeholder' ).resize();\n\t\t\t\t}\n\n\t\t\t\tdrawGraph();\n\n\t\t\t\tjQuery( '.highlight_series' ).hover(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph( jQuery( this ).data( 'series' ) );\n\t\t\t\t\t},\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\tdrawGraph();\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\t}", "public function index()\n {\n\n $data = Purchase::select(DB::raw('month(purchases.created_at) as month'), DB::raw('SUM(purchases.payment) as aggregates'))->groupBy(DB::raw('month(purchases.created_at)'))->get();\n \n $purchases = Charts::create('line', 'highcharts')\n ->title('Purchase Statistics')\n ->elementLabel('Purchase Statistics')\n ->dimensions(550, 400)\n ->responsive(false)\n ->labels($data->pluck('month'))\n ->values($data->pluck('aggregates'));\n\n $data = Expense::select(DB::raw('month(expenses.created_at) as month'), DB::raw('SUM(expenses.ex_amount) as aggregates'))->groupBy(DB::raw('month(expenses.created_at)'))->get();\n\n $data = Sale::select(DB::raw('date(sales.created_at) as date'), DB::raw('SUM(sales.spayment) as aggregates'))->groupBy(DB::raw('date(sales.created_at)'))->get();\n \n $sales = Charts::create('bar', 'highcharts')\n ->title('Sale Statistics')\n ->elementLabel('Sale Statistics')\n ->dimensions(1140, 400)\n ->responsive(false)\n ->labels($data->pluck('date'))\n ->values($data->pluck('aggregates'));\n\n $data = Expense::select(DB::raw('date(expenses.created_at) as date'), DB::raw('SUM(expenses.ex_amount) as amount'))->groupBy(DB::raw('date(expenses.created_at)'))->get();\n //dd($data);\n $expense = Charts::create('line', 'highcharts')\n ->title('Expense Statistics')\n ->elementLabel('Expense Statistics')\n ->dimensions(550, 400)\n ->responsive(false)\n ->labels($data->pluck('date'))\n ->values($data->pluck('amount'));\n\n $shop = DB::table('settings')->pluck('shop_name');\n $logo = DB::table('settings')->pluck('logo');\n $copy = DB::table('settings')->pluck('copy');\n\n return view('dashboard')->withPurchases($purchases)->withSales($sales)->withExpense($expense)->withShop($shop)->withLogo($logo)->withCopy($copy);\n }", "function sales_report($mode, $startDate = 0, $endDate = 0, $sort = 0, $statusFilter = 0, $filter = 0, $details, $ordersIn, $salesConsultant) {\n // if set then both have to be valid startDate and endDate\n $this->mode = $mode;\n $this->tax_include = DISPLAY_PRICE_WITH_TAX;\n\t $this->details = $details;\n\t $this->ordersIn = $ordersIn;\n\t $this->salesConsultant = $salesConsultant;\n\n //$this->statusFilter = $statusFilter;\n\t $this->statusFilter = \"\";\n\t if(!empty($statusFilter) || $statusFilter!=0) {\n\t \t$this->statusFilter = explode(\"_\",$statusFilter);\n\t }\n \n // get date of first sale\n $firstQuery = tep_db_query(\"select UNIX_TIMESTAMP(min(date_purchased)) as first FROM \" . TABLE_ORDERS);\n $first = tep_db_fetch_array($firstQuery);\n $this->globalStartDate = mktime(0, 0, 0, date(\"m\", $first['first']), date(\"d\", $first['first']), date(\"Y\", $first['first']));\n \n $statusQuery = tep_db_query(\"select * from orders_status\");\n $i = 0;\n while ($outResp = tep_db_fetch_array($statusQuery)) {\n $status[$i] = $outResp;\n $i++;\n }\n\t $this->status = $status;\n \n if ($startDate == 0 or $startDate < $this->globalStartDate) {\n // set startDate to globalStartDate\n $this->startDate = $this->globalStartDate;\n } else {\n $this->startDate = $startDate;\n }\n if ($this->startDate > mktime(0, 0, 0, date(\"m\"), date(\"d\"), date(\"Y\"))) {\n $this->startDate = mktime(0, 0, 0, date(\"m\"), date(\"d\"), date(\"Y\"));\n }\n\n if ($endDate > mktime(0, 0, 0, date(\"m\"), date(\"d\") + 1, date(\"Y\"))) {\n // set endDate to tomorrow\n $this->endDate = mktime(0, 0, 0, date(\"m\"), date(\"d\") + 1, date(\"Y\"));\n } else {\n $this->endDate = $endDate;\n }\n if ($this->endDate < $this->startDate + 24 * 60 * 60) {\n $this->endDate = $this->startDate + 24 * 60 * 60;\n }\n\n $this->actDate = $this->startDate;\n\t \n\t \n\t // query for order count\n\t $this->queryOrderCnt = \"SELECT count(o.orders_id) as order_cnt FROM \" . TABLE_ORDERS . \" o\";\n\t \n\t //this is to check sales consultant based report\t\t \n\t if($this->ordersIn == 1) {\n\t \t\t\n\t\t\t$this->queryItemCnt_2 = \"SELECT p.products_model, op.products_quantity, (op.final_price*op.products_quantity) as psum, o.date_purchased FROM \" . TABLE_ORDERS . \" o JOIN \" . TABLE_ORDERS_PRODUCTS . \" op ON o.orders_id = op.orders_id JOIN \".TABLE_PRODUCTS .\"p ON op.products_id = p.products_id \";\n\t\t\t\n\t\t\t$this->queryShipping = \"SELECT ot.value as shipping, o.date_purchased FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND ot.class='ot_shipping') \";\n\t\t\t$this->queryGstTotal = \"SELECT ot.value as gst_total FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND ot.class='ot_gst_total') \";\n\t\t\t$this->queryDiscountTotal = \"SELECT ot.value as discount_total FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND (ot.class = 'ot_customer_discount' OR ot.class='ot_gv')) \";\t\t\t\n\t\t\t$this->querySubtotal = \"SELECT ot.value as subtotal, o.date_purchased, o.last_modified FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND (ot.class = 'ot_grand_subtotal' OR ot.class='ot_subtotal')) \";\n\t\t\t$this->queryOrderProCostCnt = \"SELECT SUM(opc.labour_cost*opc.products_quantity) as pcl_cost, SUM(opc.overhead_cost*opc.products_quantity) as pco_cost, SUM(opc.material_cost*opc.products_quantity) as pcm_cost, count(distinct(o.orders_id)) FROM orders_products_costs opc LEFT JOIN orders o ON opc.orders_id = o.orders_id \";\n\t\t\t\n\t\t\t\n\t\t\t$this->queryItemCnt = \"SELECT pd.products_tax_class_id, pd.products_model, o.orders_id,o.customers_id, o.customers_name, o.customers_company, o.purchase_number, o.last_modified, \to.date_purchased, o.orders_status, o.order_assigned_to, a.entry_company_tax_id as customer_number, op.products_id as pid, op.orders_products_id, op.products_quantity, op.final_price, op.products_name as pname, sum(op.products_quantity) as pquant, sum(op.final_price * op.products_quantity) as psum, op.products_tax as ptax, count(distinct(o.orders_id)) FROM orders o JOIN orders_products op ON op.orders_id = o.orders_id LEFT JOIN products pd ON pd.products_id = op.products_id LEFT JOIN address_book a ON a.customers_id = o.customers_id \";\t\t\t\t\t\t\n\t\t\t$this->queryAttr = \"SELECT count(op.products_id) as attr_cnt, o.orders_id, opa.orders_products_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix from orders_products_attributes opa LEFT JOIN orders o ON opa.orders_id = o.orders_id LEFT JOIN orders_products op ON op.orders_products_id = opa.orders_products_id \";\n\t\t\t\t\t\t\n\t\t\t$this->queryProCost_2 = \"select opc.*, o.date_purchased from orders_products_costs opc LEFT JOIN orders o ON opc.orders_id = o.orders_id \";\n\t\t\t$this->queryProCost = \"select pc.categories_id, opc.* from products_to_categories pc, orders_products_costs opc where pc.products_id=opc.products_id and opc.orders_id IN \";\t\t\t\t\t \n\t\t\t\n\t } else {\n\t \t\t\t \t\t\t\t \n\t\t\t // query for shipping\n\t\t\t $this->queryShipping = \"SELECT ot.value as shipping, o.date_purchased, o.customers_id FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_TOTAL . \" ot WHERE ot.orders_id = o.orders_id AND ot.class = 'ot_shipping'\";\t\t\t \n\t\t\t // query for GST total\n\t\t\t $this->queryGstTotal = \"SELECT ot.value as gst_total FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_TOTAL . \" ot WHERE ot.orders_id = o.orders_id AND ot.class = 'ot_gst_total'\";\n\t\t\t //query for discount\n\t\t\t $this->queryDiscountTotal = \"SELECT ot.value as discount_total FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_TOTAL . \" ot WHERE ot.orders_id = o.orders_id AND (ot.class = 'ot_customer_discount' OR ot.class='ot_gv')\";\t\t\t \n\t\t\t //query for subtotal\n\t\t\t $this->querySubtotal = \"SELECT ot.value as subtotal, o.date_purchased, o.last_modified, o.customers_id, a.entry_zone_id FROM orders o, orders_total ot, address_book a WHERE ot.orders_id = o.orders_id AND (ot.class = 'ot_grand_subtotal' OR ot.class='ot_subtotal') AND o.customers_id = a.customers_id \";\n\t\t\t \n\t\t\t //products count query\t\t\t \n\t\t\t $this->queryOrderProCostCnt = \"SELECT (opc.labour_cost*opc.products_quantity) as pcl_cost, (opc.overhead_cost*opc.products_quantity) as pco_cost, (opc.material_cost*opc.products_quantity) as pcm_cost, o.date_purchased, o.customers_id FROM orders_products_costs opc, orders o WHERE opc.orders_id=o.orders_id \";\n\t\t\t \n\t\t\t \n\t\t\t $this->queryItemCnt_2 = \"SELECT p.products_model, op.products_quantity, (op.final_price*op.products_quantity) as psum, o.date_purchased FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_PRODUCTS . \" op, \" . TABLE_PRODUCTS . \" p WHERE o.orders_id = op.orders_id AND op.products_id = p.products_id \";\n\t\t\t \n\t\t\t //Orders products query \n\t\t\t $this->queryItemCnt = \"SELECT pd.products_tax_class_id, pd.products_model, o.orders_id,o.customers_id, o.customers_name, o.customers_company, \n\t\t\t\t\t\t\t\t\t\to.purchase_number, o.last_modified, o.date_purchased, \n\t\t\t\t\t\t\t\t\t\to.orders_status, o.order_assigned_to, a.entry_company_tax_id as customer_number, op.products_id as pid, \n\t\t\t\t\t\t\t\t\t\top.orders_products_id, op.products_quantity, op.final_price, op.products_name as pname, sum(op.products_quantity) as pquant, \n\t\t\t\t\t\t\t\t\t\tsum(op.final_price * op.products_quantity) as psum, op.products_tax as ptax FROM \" . TABLE_ORDERS . \" o, \n\t\t\t\t\t\t\t\t\t\t\" . TABLE_ORDERS_PRODUCTS . \" op, \" . TABLE_ADDRESS_BOOK . \" a, \" . TABLE_PRODUCTS . \" pd \n\t\t\t\t\t\t\t\t\t\tWHERE o.orders_id = op.orders_id and o.customers_id = a.customers_id and op.products_id = pd.products_id\";\n\t\t\t // query for attributes\n\t\t\t $this->queryAttr = \"SELECT count(op.products_id) as attr_cnt, o.orders_id, opa.orders_products_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix from \" . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . \" opa, \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_PRODUCTS . \" op WHERE o.orders_id = opa.orders_id AND op.orders_products_id = opa.orders_products_id\";\t\n\t\t\t \t\t\t\t\n\t\t\t //products cost\n\t\t\t $this->queryProCost = \"select pc.categories_id, opc.* from products_to_categories pc, orders_products_costs opc where pc.products_id=opc.products_id and opc.orders_id IN \";\t\t\t \n\t\t\t $this->queryProCost_2 = \"select opc.*, o.date_purchased from orders_products_costs opc, orders o where opc.orders_id=o.orders_id \";\t\t\t\t \n\t\n\t}\n\t\n\t\n switch ($sort) {\n case '0':\n //$this->sortString = \" \"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc \";\n break;\n case '1':\n //$this->sortString = \" order by pname asc \"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, pname asc \";\n break;\n case '2':\n //$this->sortString = \" order by pname desc\"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, pname desc\";\n break;\n case '3':\n //$this->sortString = \" order by pquant asc, pname asc\"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, pquant asc, pname asc\";\n break;\n case '4':\n //$this->sortString = \" order by pquant desc, pname asc\";\n\t\t //$this->sortString = \" order by pid desc, pname asc\"; //modified Aug 18, 2010\n $this->sortString = \" order by o.orders_id desc, pid desc, pname asc\";\n break;\n case '5':\n\t\t //$this->sortString = \" order by psum asc, pname asc\"; //modified Aug 18, 2010\n $this->sortString = \" order by o.orders_id desc, psum asc, pname asc\";\n break;\n case '6':\n //$this->sortString = \" order by psum desc, pname asc\"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, psum desc, pname asc\";\n break;\n }\n\n }", "public function purchaseSalesGraph($financial_month, $financialYearDD, $userId)\r\n\t{\r\n\t\t\r\n\t\t$arrayData=array();\r\n\t\t$cashData=array();\r\n\t\t//total sales in amount\r\n\t\t\t$saleQuery='SELECT sum(invoice_total_value) as total_sales FROM '.$this->tableNames['client_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\" \r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\t\t\t\r\n\t\t\t//total purchase in amount\r\n\t\t\t$purchaseQuery = 'SELECT sum(invoice_total_value) as total_purchase FROM '.$this->tableNames['client_purchase_invoice'].'\r\n\t\t\twhere DATE_FORMAT(invoice_date,\"%Y-%m\") = \"'.$financial_month.'\" \r\n\t\t\tand financial_year = \"'.$financialYearDD.'\" \r\n\t\t\tand added_by=\"'.$userId.'\"\r\n\t\t\tand is_deleted=\"0\" \r\n\t\t\tand is_canceled=\"0\"';\r\n\r\n\t\t\t$totalSales = $this->get_row($saleQuery,false);\r\n\t\t\t$totalPurchase = $this->get_row($purchaseQuery,false);\r\n\t\t\t\r\n\t\t\tif(empty($totalSales)) {\r\n\t\t\t\t$cashData['sales'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['sales'] = $totalSales[0];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(empty($totalPurchase)) {\r\n\t\t\t\t$cashData['purchase'] = \"0.00\";\r\n\t\t\t} else {\r\n\t\t\t\t$cashData['purchase'] = $totalPurchase[0];\r\n\t\t\t\t$cashData['month'] = $financial_month;\r\n\t\t\t}\r\n\t\t\tarray_push($arrayData, $cashData);\r\n\t\t\treturn $arrayData;\r\n\t}", "public function postDashboard(Request $request) {\n $graphdata = array();\n $period = $request->input('period');\n $grouping = $request->input('grouping');\n $chart = $request->input('chart');\n $stat = $request->input('stat');\n $fromDate = $request->input('fromDate');\n $thruDate = $request->input('thruDate');\n $query = 'SELECT ';\n if($grouping == 'Product') {\n $query = $query . \"products.product_name as 'Group',\";\n } elseif ($grouping == 'Category') {\n $query = $query . \"categories.category_name as 'Group',\";\n } else {\n $query = $query . \"CONCAT(salespeople.last_name,', ',salespeople.first_name) as 'Group',\";\n }\n $query = $query . \"sum(quantity) as 'Quantity',\";\n $query = $query . \"sum(products.price * quantity) as 'Dollars' \";\n $query = $query . \"FROM sales_transactions \";\n if($grouping == 'Product') {\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY product_name\";\n } elseif ($grouping == 'Category') {\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \"INNER JOIN categories ON products.category_id = categories.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY categories.category_name\";\n } else {\n $query = $query . \"INNER JOIN salespeople ON sales_transactions.salesperson_id = salespeople.id \";\n $query = $query . \"INNER JOIN products ON sales_transactions.product_id = products.id \";\n $query = $query . \" WHERE transaction_date between '\" . $fromDate . \"' and '\" . $thruDate . \"' \";\n $query = $query . \"GROUP BY CONCAT(salespeople.last_name,', ',salespeople.first_name)\";\n }\n if($stat == 'Quantity') {\n $query = $query . \" ORDER BY sum(quantity) DESC\";\n } else {\n $query = $query . \" ORDER BY sum(products.price * quantity) DESC\";\n }\n\n\n $graphdata = \\DB::select($query);\n\n // if the result set has more than 10 rows, need to group the results in 10 and higher into category of \"other\"\n $other = array();\n if (count($graphdata) > 10) {\n $graphdata2 = new \\Illuminate\\Database\\Eloquent\\Collection;\n for ($i=0; $i<10; $i++) {\n $graphdata2[$i] = $graphdata[$i];\n }\n $qty = 0;\n $dol = 0;\n for ($i=10; $i<count($graphdata); $i++) {\n $qty = $qty + $graphdata[$i]->Quantity;\n $dol = $dol + $graphdata[$i]->Dollars;\n }\n\n $other = \\DB::select(\"SELECT 'Other' as 'Group',\" . $qty . \" as 'Quantity',\" . $dol . \" as 'Dollars' FROM sales_transactions where id=1\");\n $graphdata = $graphdata2;\n }\n\n return view('salesdashboard')->with('graphdata',$graphdata)->with('grouping',$grouping)->with('period',$period)->with('chart',$chart)->with('query',$query)->with('stat',$stat)->with('other',$other)->with('fromDate',$fromDate)->with('thruDate',$thruDate);\n }", "function getSalesByYear() {\n // Function to connect to the DB\n $link = connectToDB();\n\t\n //Initialize <categories> element\n $strCat = \"<categories>\";\n\n //Initialize datasets\n $strAmtDS = \"<dataset seriesname='Revenue'>\";\n $strQtyDS = \"<dataset seriesName='Units Sold' parentYAxis='S'>\";\n\n $strSQL = \"SELECT Year(o.OrderDate) As SalesYear, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total, SUM(d.Quantity) as Quantity FROM FC_OrderDetails as d,FC_Orders as o,FC_Products as p WHERE o.OrderID=d.OrderID and d.ProductID=p.ProductID GROUP BY Year(o.OrderDate) ORDER BY Year(o.OrderDate)\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\t\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . $ors['SalesYear'] . \"'/>\";\n\n //Generate the link\n $strLink = urlencode(\"javaScript:updateCharts(\" . $ors['SalesYear'] . \");\");\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' link='\" . $strLink . \"'/>\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n\t//Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\n\treturn $strXML;\n}", "public function statistics(){\n\t\t$products = Product::where('event_id', Configuration::eventId())->get();\n\n\t\t// Setup dates\n\t\t$statistics = Order::with('orderlists')->where('event_id', $this->id)->orderBy('created_at')->get();\n\t\t$firstDate = $statistics->first()->created_at;\n\t\t$lastDate = $statistics->last()->created_at;\n\n\t\t// Get dates between firstdate and lastdate and put them in output\n\t\t$output = new Collection();\n\t\tfor($date = $firstDate;$date->lte($lastDate);$date->addDay()){\n\t\t\t// Get the product ID's and put them in an array\n\t\t\t$data = new Collection();\n\t\t\tforeach($products as $product){\n\t\t\t\t$data->put($product->id, 0);\n\t\t\t}\n\n\t\t\t$output->put($date->format('d-m-Y'), $data);\n\t\t}\n\n\t\t// Add the amounts of products ordered from the orderlists\n\t\tforeach($statistics as $order){\n\t\t\t$date = $order->created_at->format('d-m-Y');\n\t\t\tforeach($order->orderlists()->get() as $orderlist){\n\t\t\t\t$output[$date][$orderlist->product_id] = $orderlist->amount;\n\t\t\t}\n\t\t}\n\n\n\n\t\treturn $output;\n\t}", "public function woocommerce_reports_daily_sales_orders($orders, $start_date, $end_date) {\n\t\tglobal $wpdb;\n\n\t\t$this->set_reporting_flag(true);\n\n\t\t// If no data was retrieved by WooCommerce, just return the empty dataset\n\t\tif(empty($orders)) {\n\t\t\treturn $orders;\n\t\t}\n\n\t\t$SQL = \"\n\t\t\tSELECT\n\t\t\t\tposts.ID\n\t\t\t\t,posts.post_date\n\t\t\t\t,meta_order.meta_value AS total_sales\n\t\t\tFROM\n\t\t\t\t$wpdb->posts AS posts\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->postmeta AS meta_order ON\n\t\t\t\t\t(meta_order.post_id = posts.ID) AND\n\t\t\t\t\t(meta_order.meta_key = '_order_total_base_currency')\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_relationships AS rel ON\n\t\t\t\t\t(rel.object_ID = posts.ID)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->term_taxonomy AS taxonomy ON\n\t\t\t\t\t(taxonomy.term_taxonomy_id = rel.term_taxonomy_id)\n\t\t\tLEFT JOIN\n\t\t\t\t$wpdb->terms AS term ON\n\t\t\t\t\t(term.term_id = taxonomy.term_id)\n\t\t\tWHERE\n\t\t\t\t(posts.post_type = 'shop_order') AND\n\t\t\t\t(posts.post_status = 'publish') AND\n\t\t\t\t(taxonomy.taxonomy = 'shop_order_status') AND\n\t\t\t\t(term.slug IN ('\" . implode(\"','\", apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold'))) . \"')) AND\n\t\t\t\t(posts.post_date > '\" . date('Y-m-d', $start_date) . \"') AND\n\t\t\t\t(posts.post_date < '\" . date('Y-m-d', strtotime('+1 day', $end_date)) . \"')\n\t\t\tORDER BY\n\t\t\t\tposts.post_date ASC\n\t\t\t\";\n\n\t\t$orders = $wpdb->get_results($SQL);\n\t\t$this->set_reporting_flag(false);\n\n\t\treturn $orders;\n\t}", "function getDashboardData() {\n $arrRes=array();\n \n //For Calculating orders count\n $arrClms = 'pkOrderItemID';\n $varTable = TABLE_ORDER_ITEMS;\n $argWhere = 'AND Status <> \"Canceled\"';\n $arrNum = $this->getNumRows($varTable, $arrClms, $argWhere);\n $arrRes['ordersCount']=$arrNum;\n \n //For Calculating Unique visitors count\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR;\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['visitorsCount']=$arrData;\n \n \n //For Calculating Total Revenue(from orders) sum\n $varQuery = \"SELECT pkOrderItemID,ItemType,\n CASE ItemType\n WHEN 'product' THEN Quantity*((ItemPrice-ItemACPrice)+(((100-w.Commission)*ItemACPrice)/100))\n WHEN 'gift-card' THEN ItemSubTotal\n WHEN 'package' THEN Quantity*(ItemPrice-ItemACPrice)\n ELSE NULL END as 'revenue'\n FROM \" . TABLE_ORDER_ITEMS . \" LEFT JOIN \".TABLE_WHOLESALER.\" w ON w.pkWholesalerID=fkWholesalerID WHERE Status <> 'Canceled'\";\n $arrData = $this->getArrayResult($varQuery);\n $sum=0;\n foreach($arrData as $data){\n $sum+=$data['revenue'];\n }\n //echo $sum;\n \n //pre($arrData);\n $arrRes['revenueSum']=$sum;\n \n //pre($arrRes);\n return $arrRes;\n }", "public function getDistribusiRevenueData()\n {\n $rekening_tabungan = $this->getRekening(\"TABUNGAN\");\n $rekening_deposito = $this->getRekening(\"DEPOSITO\");\n\n $data_rekening = array();\n $total_rata_rata = array();\n\n foreach($rekening_tabungan as $tab)\n {\n $rata_rata_product_tabungan = 0.0;\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n foreach($tabungan as $user_tabungan) {\n $temporarySaldo = $this->getSaldoAverageTabunganAnggota($user_tabungan->id_user, $user_tabungan->id);\n $rata_rata_product_tabungan = $rata_rata_product_tabungan + $temporarySaldo;\n }\n Session::put($user_tabungan->jenis_tabungan, $rata_rata_product_tabungan);\n array_push($total_rata_rata, $rata_rata_product_tabungan);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $rata_rata_product_deposito = 0.0;\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n foreach($deposito as $user_deposito) {\n if ($user_deposito->type == 'jatuhtempo'){\n $tanggal = $user_deposito->tempo;\n }\n else if($user_deposito->type == 'pencairanawal')\n {\n $tanggal = $user_deposito->tanggal_pencairan;\n }\n else if($user_deposito->type == 'active')\n {\n $tanggal = Carbon::parse('first day of January 1970');\n }\n $temporarySaldo = $this->getSaldoAverageDepositoAnggota($user_deposito->id_user, $user_deposito->id, $tanggal);\n $rata_rata_product_deposito = $rata_rata_product_deposito + $temporarySaldo ;\n }\n Session::put($dep->nama_rekening, $rata_rata_product_deposito);\n array_push($total_rata_rata, $rata_rata_product_deposito);\n }\n\n $total_rata_rata = $this->getTotalProductAverage($total_rata_rata);\n Session::put(\"total_rata_rata\", $total_rata_rata);\n $total_pendapatan = $this->getRekeningPendapatan(\"saldo\") - $this->getRekeningBeban(\"saldo\");\n $total_pendapatan_product = 0;\n\n foreach($rekening_tabungan as $tab)\n {\n $tabungan = $this->tabunganReporsitory->getTabungan($tab->nama_rekening);\n $rata_rata = Session::get($tab->nama_rekening);\n $nisbah_anggota = json_decode($tab->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($tab->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $tab->nama_rekening,\n \"jumlah\" => count($tabungan),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product),\n \"percentage_anggota\" => $total_pendapatan > 0 ?$this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product) / $total_pendapatan : 0\n ]);\n }\n\n foreach($rekening_deposito as $dep)\n {\n $deposito = $this->depositoReporsitory->getDepositoDistribusi($dep->nama_rekening);\n $rata_rata = Session::get($dep->nama_rekening);\n $nisbah_anggota = json_decode($dep->detail)->nisbah_anggota;\n $nisbah_bmt = 100 - json_decode($dep->detail)->nisbah_anggota;\n $pendapatan_product = $this->getPendapatanProduk($rata_rata, $total_rata_rata, $total_pendapatan);\n\n $total_pendapatan_product += $pendapatan_product;\n\n array_push($data_rekening, [\n \"jenis_rekening\" => $dep->nama_rekening,\n \"jumlah\" => count($deposito),\n \"rata_rata\" => $rata_rata,\n \"nisbah_anggota\" => $nisbah_anggota,\n \"nisbah_bmt\" => $nisbah_bmt,\n \"total_rata_rata\" => $total_rata_rata,\n \"total_pendapatan\" => $total_pendapatan,\n \"pendapatan_product\" => $pendapatan_product,\n \"porsi_anggota\" => $this->getPorsiPendapatanProduct($nisbah_anggota, $pendapatan_product),\n \"porsi_bmt\" => $this->getPorsiPendapatanProduct($nisbah_bmt, $pendapatan_product)\n ]);\n }\n\n\n return $data_rekening;\n }", "static function orderStatistics( $year = false, $month = false )\n {\n if ( $year == false )\n {\n $startDate = 0;\n $stopDate = mktime( 0, 0, 0, 12, 31, 2037 );\n }\n else if ( $year != false and $month == false )\n {\n $startDate = mktime( 0, 0, 0, 1, 1, $year );\n $stopDate = mktime( 0, 0, 0, 1, 1, $year + 1 );\n }\n else if ( $year != false and $month != false )\n {\n $startDate = mktime( 0, 0, 0, $month, 1, $year );\n $stopDate = mktime( 23, 59, 59, $month + 1, 0, $year );\n }\n\n $db = eZDB::instance();\n $productArray = $db->arrayQuery( \"SELECT ezproductcollection_item.*, ignore_vat, ezorder.created, currency_code FROM ezorder, ezproductcollection_item, ezproductcollection\n WHERE ezproductcollection.id=ezproductcollection_item.productcollection_id\n AND ezproductcollection_item.productcollection_id=ezorder.productcollection_id\n AND is_temporary='0'\n AND ezorder.created >= '$startDate' AND ezorder.created < '$stopDate'\n ORDER BY contentobject_id, currency_code\" );\n $currentContentObjectID = 0;\n $productItemArray = array();\n $itemCount = 0;\n $name = false;\n $productInfo = array();\n $totalSumInfo = array();\n $firstPass = true;\n // Hash of ContentObject ID, the value will be replaced by the correct object once all IDs are known.\n $contentObjectIDHash = array();\n foreach( $productArray as $productItem )\n {\n $itemCount++;\n $contentObjectID = $productItem['contentobject_id'];\n\n if ( $firstPass )\n {\n $contentObjectIDHash[$currentContentObjectID] = true;\n $currentContentObjectID = $contentObjectID;\n $firstPass = false;\n }\n\n if ( $currentContentObjectID != $contentObjectID && $itemCount != 1 )\n {\n $productItemArray[] = array(\n 'name' => $name,\n // Reference to the entry that will contain the ContentObject at the end\n 'product' => &$contentObjectIDHash[$currentContentObjectID],\n 'product_info' => $productInfo\n );\n $productInfo = array();\n $name = $productItem['name'];\n $currentContentObjectID = $contentObjectID;\n $contentObjectIDHash[$currentContentObjectID] = true;\n }\n\n $currencyCode = $productItem['currency_code'];\n if ( $currencyCode == '' )\n {\n $currencyCode = eZOrder::fetchLocaleCurrencyCode();\n }\n\n if ( !isset( $productInfo[$currencyCode] ) )\n {\n $productInfo[$currencyCode] = array( 'sum_count' => 0,\n 'sum_ex_vat' => 0,\n 'sum_inc_vat' => 0 );\n }\n if ( !isset( $totalSumInfo[$currencyCode] ) )\n {\n $totalSumInfo[$currencyCode] = array( 'sum_ex_vat' => 0,\n 'sum_inc_vat' => 0 );\n }\n\n if ( $productItem['ignore_vat']== true )\n {\n $vatValue = 0;\n }\n else\n {\n $vatValue = $productItem['vat_value'];\n }\n\n $price = $productItem['price'];\n\n if ( $productItem['is_vat_inc'] )\n {\n $priceExVAT = $price / ( 100 + $vatValue ) * 100;\n $priceIncVAT = $price;\n\n }\n else\n {\n $priceExVAT = $price;\n $priceIncVAT = $price * ( 100 + $vatValue ) / 100;\n }\n\n $count = $productItem['item_count'];\n $realPricePercent = ( 100 - $productItem['discount'] ) / 100;\n $totalPriceExVAT = round( $count * $priceExVAT * $realPricePercent, 2 );\n $totalPriceIncVAT = round( $count * $priceIncVAT * $realPricePercent, 2 );\n $totalSumInfo[$currencyCode]['sum_ex_vat'] += $totalPriceExVAT;\n $totalSumInfo[$currencyCode]['sum_inc_vat'] += $totalPriceIncVAT;\n\n $productInfo[$currencyCode]['sum_count'] += $count;\n $productInfo[$currencyCode]['sum_ex_vat'] += $totalPriceExVAT;\n $productInfo[$currencyCode]['sum_inc_vat'] += $totalPriceIncVAT;\n }\n\n // add last product info\n if ( !empty( $productArray ) )\n {\n $productItemArray[] = array(\n 'name' => $name,\n // Reference to the entry that will contain the ContentObject at the end\n 'product' => &$contentObjectIDHash[$currentContentObjectID],\n 'product_info' => $productInfo\n );\n\n // Fetching all ContentObject ids in one query, filling the hash with the corresponding ContentObject\n foreach ( eZContentObject::fetchList( true, array( \"id\" => array( array_keys( $contentObjectIDHash ) ) ) ) as $contentObject )\n {\n $contentObjectIDHash[$contentObject->ID] = $contentObject;\n }\n }\n\n return array(\n array(\n 'product_list' => $productItemArray,\n 'total_sum_info' => $totalSumInfo\n )\n );\n }", "protected function calculateSales($isFilter = 0)\n {\n $collection = Mage::getResourceModel('reports/order_collection');\n\n $statuses = Mage::getSingleton('sales/config')\n ->getOrderStatusesForState(Mage_Sales_Model_Order::STATE_CANCELED);\n\n if (empty($statuses)) {\n $statuses = array(0);\n }\n\n $adapter = $collection->getConnection();\n\n if (Mage::getStoreConfig('sales/dashboard/use_aggregated_data')) {\n $collection->setMainTable('sales/order_aggregated_created');\n $collection->removeAllFieldsFromSelect();\n $averageExpr = $adapter->getCheckSql(\n 'SUM(main_table.orders_count) > 0',\n 'SUM(main_table.total_revenue_amount)/SUM(main_table.orders_count)',\n 0\n );\n //@codingStandardsIgnoreStart\n $collection->getSelect()->columns(\n array(\n 'lifetime' => 'SUM(main_table.total_revenue_amount)',\n 'average' => $averageExpr,\n 'total_count' => \"SUM(main_table.orders_count)\",\n 'day_count' => \"ROUND(SUM(main_table.orders_count) / DATEDIFF(date(MAX(period)),\n date(MIN(period))), 2)\"\n )\n );\n\n if (!$isFilter) {\n $collection->addFieldToFilter(\n 'store_id',\n array('eq' => Mage::app()->getStore(\n Mage_Core_Model_Store::ADMIN_CODE\n )->getId())\n );\n }\n\n $collection->getSelect()->where(\n 'main_table.order_status NOT IN(?)', $statuses\n );\n\n } else {\n $collection->setMainTable('sales/order');\n $collection->removeAllFieldsFromSelect();\n $expr = Mage::getResourceModel('ddg_automation/contact')\n ->getSalesAmountExpression($collection);\n\n if ($isFilter == 0) {\n $expr = '(' . $expr . ') * main_table.base_to_global_rate';\n }\n\n $collection->getSelect()\n ->columns(\n array(\n 'lifetime' => new Zend_Db_Expr(\"SUM({$expr})\"),\n 'average' => new Zend_Db_Expr(\"AVG({$expr})\"),\n 'total_count' => new Zend_Db_Expr(\"COUNT({$expr})\"),\n 'day_count' => new Zend_Db_Expr(\"ROUND(COUNT({$expr}) / DATEDIFF(date(MAX(created_at)),\n date(MIN(created_at))), 2)\")\n )\n )\n ->where('main_table.status NOT IN(?)', $statuses)\n ->where(\n 'main_table.state NOT IN(?)', array(\n Mage_Sales_Model_Order::STATE_NEW,\n Mage_Sales_Model_Order::STATE_PENDING_PAYMENT)\n );\n //@codingStandardsIgnoreEnd\n }\n\n return $collection;\n }", "public function woocommerce_dashboard_sales() {\n\t\t$screen = get_current_screen();\n\t\tif (!$screen || $screen->id!=='dashboard') return;\n\n\t\tglobal $woocommerce, $wp_locale;\n\t\tglobal $current_month_offset, $the_month_num, $the_year;\n\t\t$this->set_reporting_flag(true);\n\n\t\t// Get orders to display in widget\n\t\tadd_filter('posts_where', 'orders_this_month');\n\n\t\t$args = array(\n\t\t\t\t'numberposts' => -1,\n\t\t\t\t'orderby' => 'post_date',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'post_type' => 'shop_order',\n\t\t\t\t'post_status' => 'publish' ,\n\t\t\t\t'suppress_filters' => false,\n\t\t\t\t'tax_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy' => 'shop_order_status',\n\t\t\t\t\t'terms' => apply_filters('woocommerce_reports_order_statuses', array('completed', 'processing', 'on-hold')),\n\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t'operator' => 'IN'\n\t\t\t\t)\n\t\t\t\t)\n\t\t);\n\t\t$orders = get_posts($args);\n\n\t\t$order_counts = array();\n\t\t$order_amounts = array();\n\n\t\t// Blank date ranges to begin\n\t\t$month = $the_month_num;\n\t\t$year = (int) $the_year;\n\n\t\t$first_day = strtotime(\"{$year}-{$month}-01\");\n\t\t$last_day = strtotime('-1 second', strtotime('+1 month', $first_day));\n\n\t\tif ((date('m') - $the_month_num)==0) :\n\t\t\t$up_to = date('d', strtotime('NOW'));\n\t\telse :\n\t\t\t$up_to = date('d', $last_day);\n\t\tendif;\n\t\t$count = 0;\n\n\t\twhile ($count < $up_to) :\n\t\t\t$time = strtotime(date('Ymd', strtotime('+ '.$count.' DAY', $first_day))).'000';\n\n\t\t\t$order_counts[$time] = 0;\n\t\t\t$order_amounts[$time] = 0;\n\n\t\t\t$count++;\n\t\tendwhile;\n\n\t\tif ($orders) :\n\t\t\tforeach ($orders as $order) :\n\t\t\t\t$order_data = new Aelia_Order($order->ID);\n\n\t\t\t\tif ($order_data->status=='cancelled' || $order_data->status=='refunded') continue;\n\n\t\t\t\t$time = strtotime(date('Ymd', strtotime($order->post_date))).'000';\n\n\t\t\t\tif (isset($order_counts[$time])) :\n\t\t\t\t\t$order_counts[$time]++;\n\t\t\t\telse :\n\t\t\t\t\t$order_counts[$time] = 1;\n\t\t\t\tendif;\n\n\t\t\t\tif (isset($order_amounts[$time])) :\n\t\t\t\t\t$order_amounts[$time] = $order_amounts[$time] + $order_data->order_total_base_currency;\n\t\t\t\telse :\n\t\t\t\t\t$order_amounts[$time] = (float) $order_data->order_total_base_currency;\n\t\t\t\tendif;\n\n\t\t\tendforeach;\n\t\tendif;\n\n\t\tremove_filter('posts_where', 'orders_this_month');\n\n\t\t/* Script variables */\n\t\t$params = array(\n\t\t\t'currency_symbol' \t=> get_woocommerce_currency_symbol(),\n\t\t\t'number_of_sales' \t=> absint(array_sum($order_counts)),\n\t\t\t'sales_amount' \t=> woocommerce_price(array_sum($order_amounts)),\n\t\t\t'sold' \t\t\t\t=> __('Sold', 'woocommerce'),\n\t\t\t'earned' \t\t=> __('Earned', 'woocommerce'),\n\t\t\t'month_names' \t=> array_values($wp_locale->month_abbrev),\n\t\t);\n\n\t\t$order_counts_array = array();\n\t\tforeach ($order_counts as $key => $count) :\n\t\t\t$order_counts_array[] = array($key, $count);\n\t\tendforeach;\n\n\t\t$order_amounts_array = array();\n\t\tforeach ($order_amounts as $key => $amount) :\n\t\t\t$order_amounts_array[] = array($key, $amount);\n\t\tendforeach;\n\n\t\t$order_data = array('order_counts' => $order_counts_array, 'order_amounts' => $order_amounts_array);\n\n\t\t$params['order_data'] = json_encode($order_data);\n\n\t\t// Queue scripts\n\t\t$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';\n\n\t\twp_register_script('woocommerce_dashboard_sales', $woocommerce->plugin_url() . '/assets/js/admin/dashboard_sales' . $suffix . '.js', array('jquery', 'flot', 'flot-resize'), '1.0');\n\t\twp_register_script('flot', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot'.$suffix.'.js', 'jquery', '1.0');\n\t\twp_register_script('flot-resize', $woocommerce->plugin_url() . '/assets/js/admin/jquery.flot.resize'.$suffix.'.js', 'jquery', '1.0');\n\n\t\twp_localize_script('woocommerce_dashboard_sales', 'params', $params);\n\n\t\twp_print_scripts('woocommerce_dashboard_sales');\n\t\t$this->set_reporting_flag(false);\n\t}", "public function expenseGraphData()\n {\n $expenses = Expense::all();\n $supplierPayments = $expenses->where('expensable_type', Expenses::GOOD_RECEIVE)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $doctorPayments = $expenses->where('expensable_type', Expenses::SCHEDULE_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Expense Graph Data', [\n 'supplierPaymentsGraphData' => $supplierPayments,\n 'doctorPaymentsGraphData' => $doctorPayments,\n ]);\n }", "abstract function calculate_series_list();", "public function total_sales()\n {\n $product = DB::table('users')\n ->join('order_lists', 'users.id', '=', 'order_lists.user_id')\n ->join('order_details', 'order_lists.id', '=', 'order_details.order_list_id')\n ->join('payment_details', 'order_details.payment_details_id', '=', 'payment_details.id')\n ->join('products', 'order_lists.item_id', '=', 'products.id')\n ->select( 'order_lists.type', 'order_lists.quentity', 'products.title', 'order_lists.total_price', 'payment_details.created_at') \n ->where('order_lists.type', '=', 'product')\n ->latest();\n \n $pet = DB::table('users')\n ->join('order_lists', 'users.id', '=', 'order_lists.user_id')\n ->join('order_details', 'order_lists.id', '=', 'order_details.order_list_id')\n ->join('payment_details', 'order_details.payment_details_id', '=', 'payment_details.id')\n ->join('pets', 'order_lists.item_id', '=', 'pets.id')\n ->select( 'order_lists.type', 'order_lists.quentity', 'pets.title','order_lists.total_price', 'payment_details.created_at') \n ->where('order_lists.type', '=', 'pet')\n ->union($product)\n ->latest()\n ->get();\n\n return $pet;\n }", "public function index()\n {\n if(auth()->check() && auth()->user()->role == 'admin')\n {\n return view('admin.home');\n }\n elseif(auth()->check() && (auth()->user()->role == 'vendor' || auth()->user()->role == 'premium_vendor'))\n { \n $id = auth()->user()->id;\n $model = new VendorReviews();\n $records = $model->where('vendor_id',$id)->get();\n $graph1 = self::orderGraph(); // graph1\n $records1 = collect($graph1);\n // print_r(auth()->user()->id);exit;\n $months = $records1->pluck('month');\n $totalOrders = $records1->pluck('total');\n $months = $months->toArray();\n $totalOrders = $records1->pluck('total')->toArray();\n\n $graph2 = self::orderGraph2();\n $record2 = collect($graph2);\n $MonthGraph2 = $record2->pluck('month')->toArray();\n $AverageGraph2 = $record2->pluck('total');\n\n\n $graph3 = self::orderGraph3();\n $record3 = collect($graph3);\n $dayGraph3 = $record3->pluck('day')->toArray();\n $AverageGraph3 = $record3->pluck('total');\n\n $graph4 = self::orderGraph4(); \n $records4 = collect($graph4);\n $days = $records4->pluck('day')->toArray();\n $totalOrdersDays = $records4->pluck('total')->toArray();\n \n return view('home', compact('id','records', 'months', 'totalOrders','days','totalOrdersDays','MonthGraph2','AverageGraph2','dayGraph3','AverageGraph3'));\n \n }\n else\n {\n if(auth()->check()){ \n $ordersModel = new Orders();\n $orders = $ordersModel->with(['details' => function($q){\n $q->with(['users', 'variant.product']);\n }])->where('user_id', auth()->user()->id)->get();\n\n $subscriptionOrders = $ordersModel->whereHas('details.variant.product', function($q){\n $q->where('subscription',1);\n })->with(['details' => function($q){\n $q->whereHas('variant.product', function($p){\n $p->where('subscription',1);\n })->with('users');\n }])->where('user_id', auth()->user()->id)->get();\n \n $unsubscribeOrders = $ordersModel->whereHas('details.variant.product', function($q){\n $q->where('subscription',0);\n })->with(['details' => function($q){\n $q->whereHas('variant.product', function($p){\n $p->where('subscription',0);\n })->with('users');\n }])->where('user_id', auth()->user()->id)->get();\n\n $vendoraccept = $ordersModel->whereHas('details', function($q){\n $q->where('status','accept');\n })->with(['details' => function($q){\n $q->where('status','accept')->with(['users']);\n }])->where('user_id', auth()->user()->id)->get(); \n $cartCount = Cart::count();\n\n $riderorders = $ordersModel->whereHas('details',function($q)\n {$q->where('status','accept');})\n ->with(['details' => function($q)\n {\n $q->where('status','accept');\n }])->where('user_id', auth()->user()->id)->get();\n $allrider =collect();\n \n $lat = $lng =null;\n foreach($riderorders as $riderorderdetail)\n { \n $model = OrderDetail::whereIn('status',['accept','pickedup','delivering'])->find($riderorderdetail->id);\n if($model)\n {\n $allrider->push($model->driver_id);\n \n }\n \n }\n /*\n $factory = (new Factory)->withServiceAccount(__DIR__.'/Api/firebaseKey.json');\n $firestore = $factory->createFirestore();\n $db = $firestore->database();\n $ref = $db->collection('LM_Driver')->documents();\n foreach($ref as $key=>$rider)\n {\n if($rider->exists())\n {\n $key=$key;\n $id[]=$rider->id();\n foreach($allrider as $driverId)\n {\n\n foreach($id as $ids)\n {\n // dd($ids);\n if($ids == $driverId)\n {\n $data= $rider->data();\n $lat = $data['position']['latitude'];\n $lng =$data['position']['longitude']; \n // dd($lng);exit;\n \n }\n }\n }\n \n }\n \n \n }\n */\n // dd($allrider);\n \n return view('site.index', compact(['orders','subscriptionOrders','unsubscribeOrders','cartCount','lat','lng']));\n // return view('site.dashboard', compact(['vendoraccept','orders','subscriptionOrders','unsubscribeOrders','cartCount','lat','lng']));\n }\n }\n }", "function dailySales($year,$month){\n global $db;\n $sql = \"SELECT s.qty,\";\n $sql .= \" DATE_FORMAT(s.date, '%Y-%m-%e') AS date,p.name,\";\n $sql .= \"SUM(p.sale_price * s.qty) AS total_saleing_price\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" WHERE DATE_FORMAT(s.date, '%Y-%m' ) = '{$year}-{$month}'\";\n $sql .= \" GROUP BY DATE_FORMAT( s.date, '%e' ),s.product_id\";\n return find_by_sql($sql);\n}", "public function salesCustSum(Request $request)\n{\n\n\t$all = Input::get('all')==null?0:1;\n\t$fecha1=$this->fixFecha(Input::get('date1'));\n\t$fecha2=$this->fixFechaFin(Input::get('date2'));\n\t$document = Input::get('document');\n\t$document = $document ==null ? 'Todo':$document;\n\n\n\n\t$salesReport_q=Sale::select(['sales.id as id_sales'\n\t,'customers.name as customer_name'\n\t,DB::raw('count(sales.id) as trx')\n\t,DB::raw('sum(sales.total_cost) as total_cost')]);\n\t$salesReport_q->leftJoin('series','sales.id_serie','=','series.id');\n\t$salesReport_q->leftJoin('users','users.id','=','sales.user_relation');\n\t$salesReport_q->leftJoin('customers','sales.customer_id','=','customers.id');\n\n\t$administrador =Session::get('administrador');\n\t$ruta_requerida = GeneralParameter::active()->where('name','Campo ruta requerido.')->first();\n\t/** Si la ruta es requerida y no es administrador */\n\tif( (isset($ruta_requerida)) && ($administrador ==false)) {\n\t\t$rutas = RouteUser::where('user_id',Auth::user()->id)->select('route_id')->get();\n\t\tif (count($rutas) == 0) {\n\t\t $rutas = [0, 0];\n\t\t}\n\t\t$salesReport_q->join('route_costumers','customers.id','=','route_costumers.customer_id')\n\t\t->whereIn('route_costumers.route_id',$rutas);\n\t};\n\n\t$salesReport_q->where('sales.cancel_bill','=',0);\n\tif($document!='Todo'){\n\t\t$salesReport_q->where('sales.id_serie',$document);\n\t}\n\tif($all==1) {\n\t\t$salesReport_q->whereBetween('sales.sale_date',[$fecha1,$fecha2]);\n\t}\n\t$salesReport_q->groupBy('customers.name');\n\t$salesReport_q->orderBy('customers.name');\n\t$salesReport_q->almacen();\n\n\n\t$salesReport=$salesReport_q->get();\n\t// dd($salesReport);\n\t// ejemplo\n\t$fromDate = date('d/m/Y',strtotime($fecha1));\n\t$toDate = date('d/m/Y',strtotime($fecha2));\n\n\n\t$title = 'Reporte de Ventas por cliente sumarizadas'; // Report title\n\n\t$meta = [ // For displaying filters description on header\n\t\t'Fechas de' => $fromDate ,\n\t\t'a' => $toDate\n\t];\n\n\t$columns = [ // Set Column to be displayed\n\t\t'Cliente' => 'customer_name',\n\t\t'Transacciones' => 'trx',\n\t\t'Ticket Promedio' => function($result) { // You can do if statement or any action do you want inside this closure\n\t\t\treturn round(($result->total_cost / $result->trx),2);\n\t\t},\n\t\t'Total' => 'total_cost'\n\n\t\t];\n\n\t\tif(isset($request->excelcustsum)) {\n\t\t\treturn ExcelReport::of($title, $meta, $salesReport, $columns)\n\t\t\t->editColumns(['Cliente'],\n\t\t\t['class'=>'left'])\n\t\t\t->editColumns(['Transacciones','Ticket Promedio'],\n\t\t\t['class'=>'right'])\n\t\t\t->editColumns(['Total'], [ // Mass edit column\n\t\t\t\t'class' => 'right bolder italic-blue'\n\t\t\t\t])\n\t\t\t->setCss([\n\t\t\t\t'.bolder' => 'font-weight: 800;',\n\t\t\t\t'.italic-blue' => 'color: blue;font-style: italic;'\n\t\t\t\t])\n\t\t\t->showTotal([ // Used to sum all value on specified column on the last table (except using groupBy method). 'point' is a type for displaying total with a thousand separator\n\t\t\t\t'Transacciones' => 'point',\n\t\t\t\t'Total' => 'Q', // if you want to show dollar sign ($) then use 'Total Balance' => '$'\n\t\t\t\t])\n\t\t\t\t// ->limit(20) // Limit record to be showed\n\t\t\t\t// ->setOrientation('landscape')\n\t\t\t\t// ->withoutManipulation()\n\t\t\t\t->download($title);\n\t\t\t}\n\n\tif(isset($request->pdfcustsum)) {\n\t\treturn PdfReport::of($title, $meta, $salesReport, $columns)\n\t\t->editColumns(['Cliente'],\n\t\t\t['class'=>'left'])\n\t\t->editColumns(['Transacciones','Ticket Promedio'],\n\t\t['class'=>'right'])\n\t\t->editColumns(['Total'], [ // Mass edit column\n\t\t\t'class' => 'right bolder'\n\t\t\t])\n\t\t->setCss([\n\t\t\t'.bolder' => 'font-weight: 800;',\n\t\t\t])\n\t\t->showTotal([ // Used to sum all value on specified column on the last table (except using groupBy method). 'point' is a type for displaying total with a thousand separator\n\t\t\t'Transacciones' => 'point',\n\t\t\t'Total' => 'Q', // if you want to show dollar sign ($) then use 'Total Balance' => '$'\n\t\t\t])\n\t\t\t// ->limit(20) // Limit record to be showed\n\t\t// ->setOrientation('landscape')\n\t\t// ->withoutManipulation()\n\t\t->stream(); // other available method: download('filename') to download pdf / make() that will producing DomPDF / SnappyPdf instance so you could do any other DomPDF / snappyPdf method such as stream() or download()\n\t\t// ->download('Reporte de ventas');\n\t\t// ->make();\n\t}\n}", "public function salesSalesRepSum(Request $request)\n{\n\t$all = Input::get('all')==null?0:1;\n\t$fecha1=$this->fixFecha(Input::get('date1'));\n\t$fecha2=$this->fixFechaFin(Input::get('date2'));\n\t$document = Input::get('document');\n\t$document = $document ==null ? 'Todo':$document;\n\n\n\n\t$salesReport_q=Sale::select(['users.name'\n\t,'users.last_name'\n\t,DB::raw('count(sales.id) as trx')\n\t,DB::raw('sum(sales.total_cost) as total_cost')])\n\t->leftJoin('users','sales.user_relation','=','users.id')\n\t->where('sales.cancel_bill','=',0);\n\t$administrador =Session::get('administrador');\n\t$ruta_requerida = GeneralParameter::active()->where('name','Campo ruta requerido.')->first();\n\t/** Si la ruta es requerida y no es administrador */\n\tif( (isset($ruta_requerida)) && ($administrador ==false)) {\n\t\t$rutas = RouteUser::where('user_id',Auth::user()->id)->select('route_id')->get();\n\t\tif (count($rutas) == 0) {\n\t\t $rutas = [0, 0];\n\t\t}\n\t\t$salesReport_q->leftJoin('customers','sales.customer_id','=','customers.id')\n\t\t->join('route_costumers','customers.id','=','route_costumers.customer_id')\n\t\t->whereIn('route_costumers.route_id',$rutas);\n\t};\n\tif($document!='Todo'){\n\t\t$salesReport_q->where('sales.id_serie',$document);\n\t}\n\tif($all==1) {\n\t\t$salesReport_q->whereBetween('sales.sale_date',[$fecha1,$fecha2]);\n\t}\n\t$salesReport_q->groupBy('users.name');\n\t$salesReport_q->orderBy('users.name');\n\t$salesReport_q->almacen();\n\n\n\t$salesReport=$salesReport_q->get();\n\t// dd($salesReport);\n\t// ejemplo\n\t$fromDate = date('d/m/Y',strtotime($fecha1));\n\t$toDate = date('d/m/Y',strtotime($fecha2));\n\n\n\t$title = 'Reporte de Ventas por vendedor'; // Report title\n\n\t$meta = [ // For displaying filters description on header\n\t\t'Fechas de' => $fromDate ,\n\t\t'a' => $toDate\n\t];\n\n\t$columns = [ // Set Column to be displayed\n\t\t'Vendedor' => function($result) {\n\t\t\treturn $result->name.' '.$result->last_name;\n\t\t},\n\t\t'Transacciones' => 'trx',\n\t\t'Ticket Promedio' => function($result) { // You can do if statement or any action do you want inside this closure\n\t\t\treturn round(($result->total_cost / $result->trx),2);\n\t\t},\n\t\t'Total' => 'total_cost'\n\n\t\t];\n\n\t\tif(isset($request->excelsalesrep)) {\n\t\t\treturn ExcelReport::of($title, $meta, $salesReport, $columns)\n\t\t\t->editColumns(['Vendedor'],\n\t\t\t['class'=>'left'])\n\t\t\t->editColumns(['Transacciones','Ticket Promedio'],\n\t\t\t['class'=>'right'])\n\t\t\t->editColumns(['Total'], [ // Mass edit column\n\t\t\t\t'class' => 'right bolder italic-blue'\n\t\t\t\t])\n\t\t\t->setCss([\n\t\t\t\t'.bolder' => 'font-weight: 800;',\n\t\t\t\t'.italic-blue' => 'color: blue;font-style: italic;'\n\t\t\t\t])\n\t\t\t->showTotal([ // Used to sum all value on specified column on the last table (except using groupBy method). 'point' is a type for displaying total with a thousand separator\n\t\t\t\t'Transacciones' => 'point',\n\t\t\t\t'Total' => 'Q', // if you want to show dollar sign ($) then use 'Total Balance' => '$'\n\t\t\t\t])\n\t\t\t\t->download($title);\n\t\t\t}\n\n\tif(isset($request->pdfsalesrep)) {\n\t\treturn PdfReport::of($title, $meta, $salesReport, $columns)\n\t\t->editColumns(['Vendedor'],\n\t\t\t['class'=>'left'])\n\t\t\t->editColumns(['Transacciones','Ticket Promedio'],\n\t\t\t['class'=>'right'])\n\t\t\t->editColumns(['Total'], [ // Mass edit column\n\t\t\t\t'class' => 'right bolder italic-blue'\n\t\t\t\t])\n\t\t\t->setCss([\n\t\t\t\t'.bolder' => 'font-weight: 800;',\n\t\t\t\t'.italic-blue' => 'color: blue;font-style: italic;'\n\t\t\t\t])\n\t\t\t->showTotal([ // Used to sum all value on specified column on the last table (except using groupBy method). 'point' is a type for displaying total with a thousand separator\n\t\t\t\t'Transacciones' => 'point',\n\t\t\t\t'Total' => 'Q', // if you want to show dollar sign ($) then use 'Total Balance' => '$'\n\t\t\t\t])\n\t\t->stream(); // other available method: download('filename') to download pdf / make() that will producing DomPDF / SnappyPdf instance so you could do any other DomPDF / snappyPdf method such as stream() or download()\n\n\t}\n}" ]
[ "0.6282605", "0.6276921", "0.62306505", "0.61780965", "0.6118966", "0.6088533", "0.60023004", "0.5999971", "0.5983419", "0.59688544", "0.59659284", "0.5871658", "0.5864709", "0.58333075", "0.58262384", "0.58190817", "0.58149016", "0.57449746", "0.57327896", "0.5689314", "0.56632024", "0.56610143", "0.5658763", "0.5646757", "0.56340384", "0.56258965", "0.55893254", "0.55844027", "0.55772275", "0.5572127" ]
0.646906
0
Generating pdfs for all orders and users
public function generatePDFOrders(){ $orders=UserOrder::all(); $data=['orders'=>$orders]; $pdf = PDF::loadView('pdf.document',$data); return $pdf->stream('document.pdf'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pdf()\n {\n $data['order_users'] = DB::table('guest_details')->get();\n $data['total_amount'] = DB::table('guest_details')->sum('payment_amount');\n $pdf = PDF::loadView('admin.orders_by_promote_users.pdf', $data);\n return $pdf->download('order_list.pdf');\n }", "public function generatePDF()\n\n {\n $users = User::where('type','<>','admin')->get();\n\n $pdf = new TCPDF();\n $pdf::SetTitle('Users Report');\n $pdf::AddPage();\n $pdf::writeHTML(view('quiz.pdf', ['users' => $users]), true, false, true, false, '');\n $pdf::Output('quiz_users.pdf');\n\n }", "public function createPDF() {\n $user=auth()->user();\n $restaurant=$user->restaurant_profile;\n $orders=$user->restaurant_profile->orders;\n \n // share data to view\n view()->share('portal.today_order_report', compact($user, $restaurant, $orders));\n $pdf = PDF::loadView('portal.today_order_report', compact($user, $restaurant, $orders));\n \n // download PDF file with download method\n return $pdf->download('today_report.pdf');\n }", "public function exportUserPDF()\n {\n $rol = Auth::user()->role_id;\n $company_id = Auth::user()->company_id;\n if ($rol == 1 && $company_id == null) {\n $User = User::all();\n $companies = User::with('companies')->get();\n $pdf = PDF::loadView('PDF.Userpdf', compact('User'));\n return $pdf->download('User.pdf', [\"companies\" => $companies]);\n } else {\n if ($rol == 2 || $rol == 3 || ($rol == 1 && $company_id != null)) {\n $User = User::where('company_id', $company_id)->with('company')->get(); //Obtener los valores de tu request:\n $pdf = PDF::loadView('PDF.Userpdf', [\"User\" => $User]); //genera el PDF la vista\n return $pdf->download('User.pdf'); // descarga el pdf\n } else {\n return back();\n }\n }\n }", "public function generatePDF() {\n $this->generateFirstPage();\n // check data barang, if there's more than 1, spawn additional page\n $this->generateNextPage([]);\n }", "public function generatepdf()\n\t\t {\n\t\t\t App::import('Vendor', 'linnwork/api/Auth');\n\t\t\t\tApp::import('Vendor', 'linnwork/api/Factory');\n\t\t\t\tApp::import('Vendor', 'linnwork/api/PrintService');\n\t\t\t\n\t\t\t\t$username = Configure::read('linnwork_api_username');\n\t\t\t\t$password = Configure::read('linnwork_api_password');\n\t\t\t\t\n\t\t\t\t$multi = AuthMethods::Multilogin($username, $password);\n\t\t\t\t\n\t\t\t\t$auth = AuthMethods::Authorize($username, $password, $multi[0]->Id);\t\n\n\t\t\t\t$token = $auth->Token;\t\n\t\t\t\t$server = $auth->Server;\n\t\t\t\t\n\t\t\t\t$orderIdArray[]\t=\t$this->request->data['pkorderid'];\n\t\t\t\t\n\t\t\t\t$IDs = $orderIdArray;\n\t\t\t\t$parameters = '[]';\n\t\t\t\n\t\t\t $result \t= \tPrintServiceMethods::CreatePDFfromJobForceTemplate('Invoice Template',$IDs,27,$parameters,'PDF',$token, $server);\n\t\t\t $results \t= \tPrintServiceMethods::CreatePDFfromJobForceTemplate('Invoice Template',$IDs,27,$parameters,'PDF',$token, $server);\n\t\t\t $pdf\t\t=\t$result->URL.\"#\".$results->URL;\n\t\t\t if($result->URL && $result->URL)\n\t\t\t {\n\t\t\t\t\t\techo $pdf; \n\t\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\techo \"2\"; \n\t\t\t\t\t\texit;\n\t\t\t\t}\n\t\t }", "public function report_sales_pdf() {\n $tenant_id = $this->tenant_id;\n foreach ($this->reportsModel->get_sales_executive($tenant_id)->result() as $item) {\n $executive[$item->user_id] = $item->user_name;\n }\n\n $sales_exec = $this->input->get('sales_exec');\n $non_sales_exec = $this->input->get('non_sales_exec');\n if (!empty($sales_exec)) {\n $sales_exec = $sales_exec;\n } else if (!empty($non_sales_exec)) {\n $sales_exec = $non_sales_exec;\n }\n\n\n\n $sales_comm_result = $this->reportsModel->get_sales_comm('pdf', $tenant_id, $records_per_page, $offset, $field, $order_by, $sales_exec);\n $comm_due_periods = $this->reportsModel->get_comm_due_period($tenant_id, $sales_exec);\n $year_arr = array(1 => 'Jan', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr',\n 5 => 'May', 6 =>\n 'Jun', 7 => 'Jul', 8 => 'Aug', 9 => 'Sep',\n 10 => 'Oct', 11 => 'Nov', 12 => 'Dec');\n $periods = array();\n foreach ($comm_due_periods as $val) {\n $periods[$val->sales_exec_id] .= $year_arr[$val->comm_period_mth] . ' ' . $val->comm_period_yr . \", \";\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 sales_reports_pdf($sales_comm_result, $periods, $tenant_details, $executive);\n }", "public function actionExportToPdf()\n {\n if(TODOS == 0)\n {\n $cursoDisponibleServidorPublico = CursoDisponibleServidorPublico::model() -> findAll(array('condition'=>'activo = true'));\n }\n\n if(TODOS == 1)\n {\n $cursoDisponibleServidorPublico = CursoDisponibleServidorPublico::model() -> findAll();\n }\n\n if ($cursoDisponibleServidorPublico == null || count($cursoDisponibleServidorPublico) == 0)\n return;\n $this->renderPartial(\"exportPdf\", array('cursoDisponibleServidorPublico' => $cursoDisponibleServidorPublico));\n }", "function createPDF() {\n\t\t\t\n\t\t\t\n\t\t\t$db = JFactory::getDBO();\n\t\t\t\n\t\t\tinclude_once( 'components/com_ticketmaster/assets/functions.php' );\n\t\t\t\n\t\t\t## Selecting tickets to create. LIMIT = 10 (otherwise the server will overload)\n\t\t\t## Sometimes it will be better to run an extra cronjob.\n\t\t\t$sql='SELECT * FROM #__ticketmaster_orders\n\t\t\t\t WHERE pdfcreated = 0 AND paid = 1 LIMIT 0, 10'; \n\n\t\t\t$db->setQuery($sql);\n\t\t\t$data = $db->loadObjectList();\t\t\t\t \n\n\n\t\t\t$k = 0;\n\t\t\tfor ($i = 0, $n = count($data); $i < $n; $i++ ){\n\t\t\t\t\n\t\t\t\t$row = &$data[$i];\n\n\t\t\t\t## Include the confirmation class to sent the tickets. \n\t\t\t\t$path = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_ticketmaster'.DS.'classes'.DS.'createtickets.class.php';\n\t\t\t\t$override = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_ticketmaster'.DS.'classes'.DS.'override'.DS.'createtickets.class.php';\n\t\t\t\t\n\t\t\t\t## Check if the override is there.\n\t\t\t\tif (file_exists($override)) {\n\t\t\t\t\t## Yes, now we use it.\n\t\t\t\t\trequire_once($override);\n\t\t\t\t} else {\n\t\t\t\t\t## No, use the standard\n\t\t\t\t\trequire_once($path);\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$creator = new ticketcreator( (int)$row->orderid ); \n\t\t\t\t$creator->doPDF();\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t$k=1 - $k;\n\t\t\t\t\n\t\t\t}\t\n\n\t\t\n\t}", "public function createPDF()\n {\n $soxId = $this->getEditObjectId();\n if ($soxId != \"-1\" && isset($soxId)) {\n // load object\n $oOrder = oxNew(\"oxorder\");\n if ($oOrder->load($soxId)) {\n $oUtils = oxRegistry::getUtils();\n $sTrimmedBillName = trim($oOrder->oxorder__oxbilllname->getRawValue());\n $sFilename = $oOrder->oxorder__oxordernr->value . \"_\" . $sTrimmedBillName . \".pdf\";\n $sFilename = $this->makeValidFileName($sFilename);\n ob_start();\n $oOrder->genPDF($sFilename, oxRegistry::getConfig()->getRequestParameter(\"pdflanguage\"));\n $sPDF = ob_get_contents();\n ob_end_clean();\n $oUtils->setHeader(\"Pragma: public\");\n $oUtils->setHeader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n $oUtils->setHeader(\"Expires: 0\");\n $oUtils->setHeader(\"Content-type: application/pdf\");\n $oUtils->setHeader(\"Content-Disposition: attachment; filename=\" . $sFilename);\n oxRegistry::getUtils()->showMessageAndExit($sPDF);\n }\n }\n }", "public function generatePDF()\n {\n $data = [\n 'title' => 'List of Houses',\n 'company' => 'Real Construction',\n 'date' => date('m/d/Y'),\n 'location' => 'KK 705 St, Kigali',\n 'email' => '[email protected]',\n 'contact' => '+250 788306817',\n 'contact1' => '+250 788314255',\n ];\n \n $products = DB::table('products')->get();\n \n $pdf = PDF::loadView('myPDF', $data, compact('products'));\n \n return $pdf->download('Houseslist.pdf');\n }", "public function actionPrintDocuments()\n {\n if (Yii::$app->user->identity->canPrint()) {\n\n //TODO: непонятной природы и вроде бессмысленное дублирование (может использовать xSendFile?)\n //TODO: это костыль чтобы исправить это дублирование\n if (!empty($_SERVER['HTTP_RANGE'])) {\n return '';\n }\n\n set_time_limit(400);\n\n //$documents = [];\n\n //$this->layout = 'print_fine';\n $this->view->title = \\Yii::t('app', 'Пакет документов');\n\n $debtorIds = Yii::$app->request->get('debtorIds');\n\n Yii::$app->user->identity->printOperationStart();\n\n $tempFNameResults = [];\n\n foreach ($debtorIds as $dId) {\n\n $pdfItem = $this->createPdfForDebtor($dId);\n\n $tempFNameResult = tempnam(sys_get_temp_dir(), 'pdf_fine_1_') . '.pdf';\n\n $tempFNameResults[] = $tempFNameResult;\n\n $command = \"gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$tempFNameResult $pdfItem $pdfItem $pdfItem 2>&1\";\n $outputLines = [];\n exec($command, $outputLines, $exitCode);\n if ($exitCode !== 0) {\n //TODO: грамотное логирование\n throw new \\Exception(\"Ошибка склеивания файлов': \" . implode(\"\\n\", $outputLines));\n }\n\n unlink($pdfItem);\n }\n\n $finalResultName = tempnam(sys_get_temp_dir(), 'pdf_fine_2_') . '.pdf';\n\n $pdfItemsQueryTail = implode(' ', $tempFNameResults);\n\n $command = \"gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$finalResultName $pdfItemsQueryTail 2>&1\";\n $outputLines = [];\n exec($command, $outputLines, $exitCode);\n if ($exitCode !== 0) {\n //TODO: грамотное логирование\n throw new \\Exception(\"Ошибка склеивания файлов': \" . implode(\"\\n\", $outputLines));\n }\n\n foreach ($tempFNameResults as $item) {\n unlink($item);\n }\n\n //TODO: unlink $finalResultName\n\n //return Yii::$app->getResponse()->xSendFile(\n return Yii::$app->getResponse()->sendFile(\n $finalResultName,\n 'DebtorInfo.pdf',\n [\n 'mimeType' => 'application/pdf',\n 'inline' => true,\n ]\n );\n\n\n $debtor = Debtor::findOne($debtorIds[0]);\n\n $doc['statement'] = $this->getStatementHtml($debtor);\n $doc['full_fine_report'] = $this->getFullReportFineDataHtml($debtor);\n\n /*if (!empty(Yii::$app->user->identity->userInfo->primaryCompany->companyFiles)) {\n $tempFNamePdf = tempnam(sys_get_temp_dir(), 'pdf_fine_') . '.pdf';\n file_put_contents(\n $tempFNamePdf,\n Yii::$app->user->identity->userInfo->primaryCompany->companyFiles[0]->content\n );\n// $pdf = new \\Gufy\\PdfToHtml\\Pdf($tempFNamePdf);\n// $doc['EGRUL'] = $pdf->html();\n\n $tempImagePdf = tempnam(sys_get_temp_dir(), 'img_fine_') . '.jpg';\n\n $pdf = new \\Spatie\\PdfToImage\\Pdf($tempFNamePdf);\n $pdf->saveImage($tempImagePdf);\n $imgData = $pdf->getImageData($tempImagePdf);\n\n unlink($tempImagePdf);\n unlink($tempFNamePdf);\n }*/\n\n $documents[] = $doc;\n\n //return $this->render('@frontend/modules/office/views/debtor/print_documents', ['documents' => $documents]);\n\n $rContent = Yii::$app->html2pdf->render('@frontend/modules/office/views/debtor/print_documents', ['documents' => $documents]);\n\n /*if (empty(Yii::$app->user->identity->userInfo->primaryCompany->companyFiles)\n && empty(Yii::$app->user->identity->userInfo->primaryCompany->companyFilesHouses)\n ) {\n Yii::$app->user->identity->printOperationStart();\n return $rContent->send('DebtorInfo.pdf', ['mimeType' => 'application/pdf', 'inline' => true]);\n }*/\n\n //TODO: проверять файл на принадлежность к формату pdf\n //TODO: склеивать множественные файлы pdf\n $tempFNameResult = tempnam(sys_get_temp_dir(), 'pdf_fine_') . '.pdf';\n\n $commandTail = '';\n\n if (!empty(Yii::$app->user->identity->userInfo->primaryCompany->companyFiles)) {\n $tempFNamePdf = tempnam(sys_get_temp_dir(), 'pdf_fine_') . '.pdf';\n file_put_contents(\n $tempFNamePdf,\n Yii::$app->user->identity->userInfo->primaryCompany->companyFiles[0]->content\n );\n $commandTail .= \" $tempFNamePdf \";\n }\n\n if (!empty(Yii::$app->user->identity->userInfo->primaryCompany->companyFilesHouses[0])) {\n $tempFNamePdfHouses = tempnam(sys_get_temp_dir(), 'pdf_fine_') . '.pdf';\n file_put_contents(\n $tempFNamePdfHouses,\n Yii::$app->user->identity->userInfo->primaryCompany->companyFilesHouses[0]->content\n );\n $commandTail .= \" $tempFNamePdfHouses \";\n }\n\n $command = \"gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$tempFNameResult $rContent->name $commandTail 2>&1\";\n $outputLines = [];\n exec($command, $outputLines, $exitCode);\n if ($exitCode !== 0) {\n throw new \\Exception(\"Ошибка склеивания файлов': \" . implode(\"\\n\", $outputLines));\n }\n\n @file_put_contents('/tmp/look_for_pdf.txt', print_r($outputLines, true), FILE_APPEND);\n\n if (!empty($tempFNamePdf)) {\n unlink($tempFNamePdf);\n }\n if (!empty($tempFNamePdfHouses)) {\n unlink($tempFNamePdfHouses);\n }\n\n //TODO: unlink $tempFNameResult\n\n Yii::$app->user->identity->printOperationStart();\n\n //return Yii::$app->getResponse()->xSendFile(\n return Yii::$app->getResponse()->sendFile(\n $tempFNameResult,\n 'DebtorInfo.pdf',\n ['mimeType' => 'application/pdf', 'inline' => true]\n );\n\n /*return $this->render('print_documents',\n [\n 'documents' => $documents,\n ]\n );*/\n } else {\n die('low_balance');\n }\n\n return '';\n }", "public function pdf()\r\n {\r\n View::template('pdf/mpdf');\r\n //Modifica el nombre del archivo a descargar\r\n $this->fileName = 'user-list';\r\n //Modifica el título del documento PDF en la cabecera\r\n $this->title = 'User List';\r\n $this->data = User::all();\r\n $this->download = false;\r\n }", "function active_user_report_pdf($option = '') {\n $data['activeUser'] = $this->User_model->active_user_quantity_info();\n $html = $this->load->view('userRecordManagement/activeUserReportPdf', $data, true);\n $this->load->library('M_pdf');\n $pdf = $this->m_pdf->load();\n $pdf->WriteHTML($html);\n $current_date = date('Y-m-d H:i:s');\n $file_name = 'activeuserreport' . $current_date . '.pdf';\n if ($option == 'D') {\n $pdf->Output($file_name, \"D\");\n }\n if ($option == 'I') {\n $pdf->Output($file_name, \"I\");\n }\n }", "public function generatePDF()\n {\n \t$allclass = Classroom::all();\n\t\tview()->share('allclass',$allclass);\n \n $pdf = PDF::loadView('pdf.classallpdf');\n return $pdf->download('pdf.pdf');\n }", "public function pdf(){\n $users = User::all();\n $pdf = PDF::loadView('user.pdf', compact('users'));\n return $pdf->download('listado usuarios.pdf');\n }", "public function actionExportToPdf()\n {\n if(TODOS == 0)\n {\n $catPuesto = CatPuesto::model() -> findAll(array('condition'=>'activo = true'));\n }\n\n if(TODOS == 1)\n {\n $catPuesto = CatPuesto::model() -> findAll();\n }\n\n if ($catPuesto == null || count($catPuesto) == 0)\n return;\n $this->renderPartial(\"exportPdf\", array('catPuesto' => $catPuesto));\n }", "public function visitorNotifExport()\n {\n \t$visitor = Visitor::join('residents', 'visitors.submitted_by', '=', 'user_id')\n \t\t\t\t\t\t->select('visitors.*', 'residents.*')\n \t\t\t\t\t\t->get();\n\n \t$pdf = PDF::loadView('exporttopdf');\n\n \t$html = '<html>' . \n\t\t\t\t\t'<style>' .\n\t\t \t\t\t'table {\n\t\t\t\t\t\t border-collapse: collapse;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttable, th, td {\n\t\t\t\t\t\t\tpadding-left: 5px;\n\t\t\t\t\t\t\tpadding-right: 5px;\n\t\t\t\t\t\t border: 1px solid black;\n\t\t\t\t\t\t text-align: center;\n\t\t\t\t\t\t font-size: 12px;\n\t\t\t\t\t\t}\n\t\t\t\t\t\th3 {\n\t\t\t\t\t\t\ttext-align: center;\n\t\t\t\t\t\t}' .\n\t\t\t\t\t'</style>' .\n \t\t\t\t'<body>' .\n \t\t\t\t\t'<h3> Visitor Notification List </h3><br>' .\n \t\t\t\t\t'<table align=\"center\">' . \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><b>Submitted By</b></th>' .\n \t\t\t\t\t\t\t\t'<th><b>Visitor Name</b></th>' . \n \t\t\t\t\t\t\t\t'<th><b>Reason for Visit</b></th>' . \n \t\t\t\t\t\t\t\t'<th><b>Expected Time of Arrival</b></th>' .\n \t\t\t\t\t\t\t\t'<th><b>Time Arrived</b></th>' .\n \t\t\t\t\t\t\t\t'<th><b>Visitor Code</b></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\n \tforeach ($visitor as $details) \n \t{ \n \t\t$html .= \t\"<tr>\" .\n \t\t\t\t\t\"<td>\" . $details->name_first . \" \" . $details->name_middle . \" \" . $details->name_last . \"</td>\" .\n \t\t\t\t\t\"<td>\" . $details->visitor_name . \"</td>\" . \n \t\t\t\t\t\"<td>\" . $details->reason_for_visit . \"</td>\" . \n \t\t\t\t\t\"<td>\" . $details->time_expected . \"</td>\" .\n \t\t\t\t\t\"<td>\" . $details->time_arrived . \"</td>\" .\n \t\t\t\t\t\"<td>\" . $details->visitor_code . \"</td>\" .\n \t\t\t\t\t\"</tr>\"; \n \t} \n \t\t$html .= \t'</tbody>' . \n \t\t\t\t\t\t'</table>' .\n \t\t\t\t\t\t\t'</body>' . \n \t\t\t\t\t\t\t\t'</html>'; \n\n \t\t$pdf->loadHTML($html); \n\n \t\treturn $pdf->stream('Visitor Notification List');\n }", "public function generatePdf(){\n\n $order = $this->getOrder();\n if (!is_object($order)) {\n return null;\n }\n\n $service = $order->getService();\n $location = $order->getLocation();\n $customer = $order->getCustomer();\n\n if (!is_object($service) || !is_object($location) || !is_object($customer)) {\n return null;\n }\n\n //set pdf latex template\n $this->_latex->setTpl('storno');\n\n //append order\n $this->assign('order', $order);\n\n //compile template using smarty\n $pdf = $this->_latex->compile();\n\n //if file does not exists just return null\n if (!file_exists($pdf)) {\n return null;\n }\n\n return $pdf;\n }", "public function generatePdfData() {\n\t\t/**transport use to get the variables $order object, $invoice object and the template model object*/\n\t\t$parts = $this->_transport();\n\n\t\t/** instantiate the mPDF class and add the processed html to get the pdf*/\n\t\t$applySettings = $this->getPDFSettings($parts);\n\n\t\t$fileParts = [\n\t\t\t'filestream' => $applySettings,\n\t\t\t'filename' => filter_var($parts['filename'], FILTER_SANITIZE_URL),\n\t\t];\n\n\t\treturn $fileParts;\n\t}", "public function printActivityReport(Request $request) {\n $data['data'] = ItemOrder::where('staff_id', auth()->user()->id)->orderBy('created_at', 'desc')->get();\n\n $pdf = PDF::loadView('orders.activity_report', $data); \n\n return $pdf->download('activity_report'.time().'.pdf');\n }", "public function reportExport()\n {\n \t$report = Report::join('report_natures', 'reports.report_nature', '=', 'report_natures.id')\n ->join('residents', 'reports.submitted_by', '=', 'user_id')\n ->select('reports.*', 'residents.name_first', 'residents.name_middle', 'residents.name_last', 'report_natures.nature_name')\n ->get();\n\n \t$pdf = PDF::loadView('exporttopdf');\n\n \t$html = '<html>' . \n\t\t\t\t\t'<style>' .\n\t\t \t\t\t'table {\n\t\t\t\t\t\t border-collapse: collapse;\n\t\t\t\t\t\t align: center;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttable, th, td {\n\t\t\t\t\t\t\tpadding-left: 5px;\n\t\t\t\t\t\t\tpadding-right: 5px;\n\t\t\t\t\t\t border: 1px solid black;\n\t\t\t\t\t\t text-align: center;\n\t\t\t\t\t\t}' .\n 'h3 {\n text-align: center;\n }' .\n\t\t\t\t\t'</style>' .\n \t\t\t\t'<body>' .\n '<h3> Reports List </h3><br>' .\n \t\t\t\t\t'<table>' . \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><b>Report Nature</b></th>' .\n \t\t\t\t\t\t\t\t'<th><b>Description</b></th>' . \n \t\t\t\t\t\t\t\t'<th><b>Location</b></th>' . \n \t\t\t\t\t\t\t\t'<th><b>Time Submitted</b></th>' .\n \t\t\t\t\t\t\t\t'<th><b>Submitted By</b></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\n \tforeach ($report as $details) \n \t{ \n \t\t$html .= \t\"<tr>\" .\n \t\t\t\t\t\"<td>\" . $details->nature_name . \"</td>\" .\n \t\t\t\t\t\"<td>\" . $details->description . \"</td>\" . \n \t\t\t\t\t\"<td>\" . $details->location . \"</td>\" . \n \t\t\t\t\t\"<td>\" . $details->created_at . \"</td>\" .\n \t\t\t\t\t\"<td>\" . $details->name_first . \" \" . $details->name_middle . \" \" . $details->name_last . \"</td>\" .\n \t\t\t\t\t\"</tr>\"; \n \t} \n \t\t$html .= \t'</tbody>' . \n \t\t\t\t\t\t'</table>' .\n \t\t\t\t\t\t\t'</body>' . \n \t\t\t\t\t\t\t\t'</html>'; \n\n \t\t$pdf->loadHTML($html); \n\n \t\treturn $pdf->stream('Report List');\n }", "public function descargar_pdf(){\n $zonas=Zona::join('colonia','zona.id','=','colonia.id_zona')\n ->join('permiso','permiso.id_colonia','=','colonia.id')\n ->select('zona.*',DB::raw('count(permiso.id)as total'))\n ->groupBy('zona.id')\n ->get();\n\n $pdf=\\PDF::loadView('Pdfs.zonas',compact('zonas'));\n\n return $pdf->stream();\n }", "public function createPDF() {\n $data = Product::all();\n\n // share data to view\n view()->share('products',$data);\n $pdf = PDF::loadView('admin.pdf.product_pdf', $data);\n\n // download PDF file with download method\n return $pdf->download('pdf_file.pdf');\n }", "function pdf() {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canView($this->logged_user)) {\n InvoicePDFGenerator::download($this->active_invoice, Invoices::getInvoicePdfName($this->active_invoice));\n \tdie();\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function guestExport()\n {\n $guest = Guest::leftjoin('residents', 'guests.person_to_visit', '=', 'residents.id')\n ->select('guests.*', 'guests.created_at', 'residents.name_first', 'residents.name_middle', 'residents.name_last')\n ->where('is_active', 1)\n ->get();\n\n $pdf = PDF::loadView('exporttopdf');\n\n $html = '<html>' . \n '<style>' .\n 'table {\n border-collapse: collapse;\n }\n\n table, th, td {\n padding-left: 5px;\n padding-right: 5px;\n border: 1px solid black;\n text-align: center;\n font-size: 12px;\n }\n h3 {\n text-align: center;\n }' .\n '</style>' .\n '<body>' .\n '<h3> Visitor Notification List </h3><br>' .\n '<table align=\"center\">' . \n '<thead>' .\n '<tr>' .\n '<th><b>Guest Name</b></th>' .\n '<th><b>Reason for Visit</b></th>' . \n '<th><b>Person to Visit</b></th>' . \n '<th><b>Vehicle Plate</b></th>' .\n '<th><b>Time Arrived</b></th>' .\n '<th><b>Time Departed</b></th>' .\n '</tr>' .\n '</thead>' .\n '<tbody>'; \n\n foreach ($guest as $details) \n { \n $html .= \"<tr>\" .\n \"<td>\" . $details->name . \"</td>\" .\n \"<td>\" . $details->reason . \"</td>\" . \n \"<td>\" . $details->name_first . \" \" . $details->name_middle . \" \" . $details->name_last . \"</td>\" . \n \"<td>\" . $details->vehicle_plate . \"</td>\" .\n \"<td>\" . $details->created_at . \"</td>\" .\n \"<td>\" . $details->time_departed . \"</td>\" .\n \"</tr>\"; \n } \n $html .= '</tbody>' . \n '</table>' .\n '</body>' . \n '</html>'; \n\n $pdf->loadHTML($html); \n\n return $pdf->stream('Guest List');\n }", "public function getquickCreateReport()\n\t{\n\t\tdate_default_timezone_set(config::$timezone);\n\t\t$today = date(\"Y-m-d\");\n\t\t$parameterr = array();\n\t\t$parameter['title'] = 'Today\\'s Created Orders';\n $parameter['orders'] = Order::where('from','=', $today)\n \t\t\t\t\t\t\t\t->get();\n\n\t\t$pdf = PDF::loadView('reports.order.getAllOrders',$parameter)\n\t\t\t\t\t->setPaper('a4')\n\t\t\t\t\t->setOrientation(config::$ORDER_REPORT_ORIENTATION)\n\t\t\t\t\t->setWarnings(false);\n\n\t\treturn $pdf->stream('Report On Today\\'s Created Orders.pdf');\n\t\t\n\t}", "private function generate()\n\t{\n\t\t$printer = require_once __DIR__ . '/Printer.php';\n\t\t$orders = $this->get_waiting_orders();\n\t\t\n\t\t$printer->setup($this);\n\n\t\t/*foreach ($orders as $order) {\n\t\t\t$printer->add($order);\n\t\t}*/\n\n\t\t$printer->output();\n\t}", "public function CreatePdf()\n {\n\n if(is_null($this->user) || !$this->user->can('admin.createPdf') ){\n abort('403','You dont have acces!!!!');\n }\n $product=Product::all();\n return view('pdf',compact('product'));\n // $pdf = PDF::loadView('pdf', $product);\n // return $pdf->download('products.pdf');\n // return view('pdf.CreatePdf');\n }", "public function reporteServiciosPDF(){\n $datos=TablaSimulacion::all();\n $serv = Servicio::all();\n $servicios=[];\n $gananciaServicio=0;\n $indice = 0;\n foreach ($serv as $ser) {\n $count = 0;\n foreach ($datos as $dato) {\n if (strpos($dato->servicios,$ser->servicio) !== false ) {\n $count++;\n }\n }\n $gananciaServicio=$count*$ser->costo;\n $servicios[$indice] = [$ser->servicio,$count,$ser->costo,$gananciaServicio];\n $indice++;\n }\n $pdf=PDF::loadView('servicio/reporteServicioPdf',compact('servicios'));\n return $pdf->stream();\n }" ]
[ "0.709254", "0.69068223", "0.6793578", "0.6620876", "0.65700334", "0.6414609", "0.6327618", "0.6265488", "0.6259063", "0.6256858", "0.6218171", "0.6211044", "0.6117345", "0.6115094", "0.6108168", "0.61073345", "0.6096955", "0.6075026", "0.6072859", "0.6010974", "0.5987434", "0.5975055", "0.597491", "0.5969435", "0.5951075", "0.5946068", "0.59447813", "0.5932461", "0.5924621", "0.5906219" ]
0.7638488
0
En la clase VariableNumerica es redeclarada para devolver true.
public function isVariableNumerica(){ return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isVariableTexto(){ return false; }", "public function isVariableCualitativa(){ return false; }", "public function hasVariableType() {\n return $this->_has(4);\n }", "public function hasVariableType() {\n return $this->_has(4);\n }", "public function isVar(){\n return $this->var;\n }", "public function hasVariableLabel() {\n return $this->_has(8);\n }", "public function hasVariables() {\n return $this->_has(4);\n }", "public function controlVariables() {\n\n $validacion = false;\n\n if (\n (count($_POST) > 0) && isset($_POST['kk_control_form']) && ($_POST['kk_control_form'] == $this->_kk_control_form)\n ) {\n $validacion = true;\n\n if (count($this->_formulario) > 0) {\n foreach ($this->_formulario[$this->_kk_control_form] as $key => $valor) {\n if ($valor['obligatorio'] == 'no_nulo') {\n if (isset($_POST[$key]) && is_array($_POST[$key])) {\n $valor_nulo = false;\n foreach ($_POST[$key] as $valor_post) {\n if (isset($valor_post) && $valor_post != '') {\n $valor_nulo = true;\n }\n }\n $validacion = $valor_nulo;\n } elseif ((!isset($_POST[$key]) || $_POST[$key] == '')) {\n $validacion = false;\n }\n }\n }\n\n if ($this->_captcha === false) {\n $validacion = false;\n }\n }\n }\n\n return $validacion;\n }", "public function hasFixedValue();", "public function hasVariables() {\n return $this->_has(2);\n }", "public function isVariable() {\n\t\treturn ($this->parsedVarName !== false);\n\t}", "public static function varint() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function hasVariables() {\n return $this->_has(1);\n }", "function isFinite() { # :: Num -> Bool\n return new Bool(is_finite($this->value));\n }", "public function hasNumberValue(){\n return $this->_has(2);\n }", "public static function anyN() {\n $result = new qti_variable('single', 'boolean');\r\n $params = func_get_args();\r\n $min = array_shift($params);\n $max = array_shift($params);\n \n // Allow a single array as well as a parameter list\r\n if (count($params) == 1 && is_array($params[0])) {\r\n $params = $params[0];\r\n }\n $false = $true = $null = 0;\n foreach($params as $param) {\n if ($param->_isNull()) {\n $null++;\n } else if ($param->value == true) {\n $true++;\n } else if ($param->value == false) {\n $false++;\n } \n }\n \n if ($false > (count($params) - $min)) {\n $result->value = false;\n } else if ($true > $max) {\n $result->value = false;\n } else if (($min <= $true) && ($true <= $max)) {\n $result->value = true;\n }\n \n return $result;\n }", "function isNAN() { # :: Num -> Bool\n return new Bool(is_nan($this->value));\n }", "public function isNum(): bool\n {\n return \\wasm_valtype_is_num($this->inner);\n }", "function isInfinite() { # :: Num -> Bool\n return new Bool(is_infinite($this->value));\n }", "private function allowedVariableUsage(\\GraphQL\\Type\\Schema $schema, \\GraphQL\\Type\\Definition\\Type $varType, $varDefaultValue, \\GraphQL\\Type\\Definition\\Type $locationType, $locationDefaultValue) : bool\n {\n }", "function est_entier($valeur): bool {\n return is_numeric($valeur);\n}", "function vn ($v, $isAdd) {\n if (!is_numeric($v)) {\n $tag = $isAdd ? \"Did you mean '~'?\" : '';\n Tht::error(\"Can't use math on non-number value. $tag\");\n }\n return $v;\n}", "function pseudoTypeFalse(false $var = false) {}", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "function isIssetVariable($tableauPost) {\n $tableau = array();\n foreach ($tableauPost as $key => $value) {\n if (isset($tableauPost[$key])) {\n $tableau[$key] = $value;\n }\n }\n if (count($tableauPost) != count($tableau)) {\n return false;\n }\n else {\n return true;\n }\n}", "public function isFixedPointNumber(): bool;", "function setNiveau($niveau) { $niveau = (int) $niveau;\r\n if ($niveau >= 1 && $niveau <= 100) {\r\n $this->_niveau = $niveau;\r\n }\r\n }", "public function hasNum(){\n return $this->_has(17);\n }" ]
[ "0.6226047", "0.615995", "0.5986505", "0.5986505", "0.5959649", "0.5645643", "0.5596993", "0.55950254", "0.54454905", "0.5432761", "0.5428563", "0.541654", "0.5409633", "0.54095304", "0.5387004", "0.5365187", "0.5341328", "0.53305423", "0.5214269", "0.51675487", "0.5151387", "0.5148722", "0.51460344", "0.5107908", "0.5102253", "0.50990576", "0.50715846", "0.5059361", "0.50536764", "0.5038648" ]
0.7994747
0
En la clase VariableTexto es redeclarada para devolver true.
public function isVariableTexto(){ return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isVariableCualitativa(){ return false; }", "public function isVar(){\n return $this->var;\n }", "public function isVariableNumerica(){ return false; }", "function mTRUE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$TRUE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:281:3: ( 'true' ) \n // Tokenizer11.g:282:3: 'true' \n {\n $this->matchString(\"true\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function isText() {}", "public function hasVariableLabel() {\n return $this->_has(8);\n }", "private function varIsBoolean($var): void {\r\n\t\t$var=($var===true) ? 'TRUE' : 'FALSE';\r\n\t\t$booleanTable = '<table class=\"dBug_table dBug_boolean\">' . \"\\n\" . '<tr>' . \"\\n\" . '<th class=\"dBug_clickable_table dBug_booleanHeader\">Boolean</th>' . \"\\n\" . '</tr>'.\"\\n\";\r\n\t\t$booleanTable .= '<tr>' . \"\\n\" . '<td>' . $var . '</td>' . \"\\n\" . '</tr>' . \"\\n\";\r\n\t\t$booleanTable .= '</table>'.\"\\n\";\r\n\t\techo $booleanTable;\r\n\t}", "public function isText()\n {\n return $this->getName() === 'text';\n }", "public function hasExplicitText(): bool\n {\n return isset($this->text);\n }", "public function hasText()\n {\n return $this->text != null;\n }", "public function checkBooleanFulltextSupport();", "function mFALSE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$FALSE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:286:3: ( 'false' ) \n // Tokenizer11.g:287:3: 'false' \n {\n $this->matchString(\"false\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function isText(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_TEXT );\n\t}", "protected function isTrueTypeFontWorking() {}", "public function hasVariableType() {\n return $this->_has(4);\n }", "public function hasVariableType() {\n return $this->_has(4);\n }", "public function isVariable() {\n\t\treturn ($this->parsedVarName !== false);\n\t}", "public function hasText() {\n return !empty($this->text[\\App::getLocale()]);\n }", "public function isText()\n {\n return $this->isBinary() === false;\n }", "public function isTextType()\n {\n return $this->getModel()->isPlain();\n }", "public function setTypes(){\n $this->var = false;\n $this->symb = false;\n $this->label = false;\n $type = '';\n \n //Ulozi postupne do jednotlivych promennych jestli dany argument odpovida nejakemu danemu vzoru a pote v podminkach rozhodneme typ argumentu (ktery na konci funkce ulozime do typu) a take jestli je argument var, symb, label nebo type\n $var = preg_match(\"/^(TF|LF|GF)@((\\p{L}|-|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n $int = preg_match(\"/^int@([\\+\\-])?([0-9])*$/u\", $this->arg);\n $bool = preg_match(\"/^bool@(true|false)$/u\", $this->arg);\n $string = preg_match(\"/^string@(\\p{L}|[^(\\w\\\\\\)]|\\d|[_]|\\\\\\\\([0-9][0-9][0-9]))*$/u\", $this->arg);\n $nil = preg_match(\"/^nil@nil$/u\", $this->arg);\n $label = preg_match(\"/^((\\p{L}|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n if($var){\n $type = \"var\";\n $this->var = true;\n $this->symb = true;\n }\n if($int){\n $type = \"int\";\n $this->symb = true;\n }\n if($bool){\n $type = \"bool\";\n $this->symb = true;\n }\n if($string){\n $type = \"string\";\n $this->symb = true;\n }\n if($nil){\n $type = \"nil\";\n $this->symb = true;\n }\n if($label){\n if(preg_match(\"/^(int|bool|string)$/u\", $this->arg)){\n $this->type_type = true;\n }\n $type = \"label\";\n $this->label = true; \n }\n if(!($var||$int||$bool||$string||$nil||$label)){\n fwrite(STDERR, \"CHYBA \".ERROR_23.\" - spatny argument\\n\");\n exit(ERROR_23);\n }\n $this->setType($type);\n }", "public function isValid()\n\t{\n\t\tif (empty($this->titre)) $this->titre = \"TITRE A REMPLACER\";\n\t\telse $this->titre = trim (preg_replace('/\\s+/', ' ', $this->titre) ); // Suppression des espaces\n\t\tif (!empty($this->contenu)) $this->contenu = trim (preg_replace('/\\s+/', ' ', $this->contenu) ); // Suppression des espaces\n\t\tif (empty($this->statut)) $this->statut = 0;\n\t\tif (empty($this->id_type)) $this->id_type = 1;\n\t\tif (empty($this->id_membre)) $this->id_membre = 0;\n\t}", "public function hasText()\n {\n if ($this->_text) {\n return true;\n } else {\n return false;\n }\n }", "public function isEtablissementActif(): bool{\n return true;\n }", "function niveau ($niveauCode, $niveauTexte)\n{\n if ($niveauCode = 1){\n \n }\n \n }", "function pseudoTypeFalse(false $var = false) {}", "public function hasVariables() {\n return $this->_has(1);\n }", "public function hasVariables() {\n return $this->_has(2);\n }", "public function getBooleanString($tf);", "public function hasVariables() {\n return $this->_has(4);\n }" ]
[ "0.64194596", "0.5754381", "0.5651624", "0.56512666", "0.56263494", "0.56207", "0.55106986", "0.5461052", "0.5398493", "0.5375989", "0.53745884", "0.53372574", "0.5302292", "0.529736", "0.52887577", "0.52887577", "0.5270243", "0.52445734", "0.51807714", "0.5176812", "0.51544505", "0.5149955", "0.514587", "0.51172477", "0.51158386", "0.51090944", "0.5078216", "0.507487", "0.50674784", "0.5045686" ]
0.80805844
0
En la clase VariableCualitativa es redeclarada para devolver true.
public function isVariableCualitativa(){ return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isVariableTexto(){ return false; }", "public function isVar(){\n return $this->var;\n }", "public function isVariableNumerica(){ return false; }", "public function hasVariableType() {\n return $this->_has(4);\n }", "public function hasVariableType() {\n return $this->_has(4);\n }", "public function hasVariables() {\n return $this->_has(4);\n }", "public function hasVariables() {\n return $this->_has(2);\n }", "public function hasVariableLabel() {\n return $this->_has(8);\n }", "public function isVariable() {\n\t\treturn ($this->parsedVarName !== false);\n\t}", "public function hasVariables() {\n return $this->_has(1);\n }", "private function initVar()\n {\n // RETURN: $enabled isn't null\n if ( !( $this->enabled === null ) )\n {\n // DRS\n if ( $this->pObj->b_drs_map )\n {\n // #47632, 130508, dwildt, 1-\n //switch( $this->enabled )\n // #47632, 130508, dwildt, 1+\n switch ( true )\n {\n // #47632, 130508, dwildt, 1-\n //case( true ):\n // #47632, 130508, dwildt, 2+\n case( $this->enabled == 1 ):\n case( $this->enabled == 'Map'):\n $prompt = 'Map is enabled.';\n break;\n // #47632, 130508, dwildt, 3+\n case( $this->enabled == 'Map +Routes'):\n $prompt = 'Map +Routes is enabled.';\n break;\n default:\n $prompt = 'Map is disabled.';\n break;\n }\n t3lib_div :: devLog( '[INFO/BROWSERMAPS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n return true;\n }\n // RETURN: $enabled isn't null\n // Get TypoScript configuration for the current view\n $this->conf = $this->pObj->conf;\n $this->mode = $this->pObj->piVar_mode;\n $this->view = $this->pObj->view;\n $viewWiDot = $this->view . '.';\n $this->conf_path = $viewWiDot . $this->mode;\n $this->conf_view = $this->conf[ 'views.' ][ $viewWiDot ][ $this->mode . '.' ];\n // Get TypoScript configuration for the current view\n // Set the global var $confMap\n $this->initVarConfMap();\n\n // Set the global $enabled\n $this->initVarEnabled();\n\n // Set the global $provider\n $this->initVarProvider();\n\n // Set the globals $int_typeNum and $str_typeNum\n $this->initVarTypeNum();\n\n // Init the devider for the categories\n $this->initCatDevider();\n\n return false;\n }", "function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}", "private function allowedVariableUsage(\\GraphQL\\Type\\Schema $schema, \\GraphQL\\Type\\Definition\\Type $varType, $varDefaultValue, \\GraphQL\\Type\\Definition\\Type $locationType, $locationDefaultValue) : bool\n {\n }", "public function controlVariables() {\n\n $validacion = false;\n\n if (\n (count($_POST) > 0) && isset($_POST['kk_control_form']) && ($_POST['kk_control_form'] == $this->_kk_control_form)\n ) {\n $validacion = true;\n\n if (count($this->_formulario) > 0) {\n foreach ($this->_formulario[$this->_kk_control_form] as $key => $valor) {\n if ($valor['obligatorio'] == 'no_nulo') {\n if (isset($_POST[$key]) && is_array($_POST[$key])) {\n $valor_nulo = false;\n foreach ($_POST[$key] as $valor_post) {\n if (isset($valor_post) && $valor_post != '') {\n $valor_nulo = true;\n }\n }\n $validacion = $valor_nulo;\n } elseif ((!isset($_POST[$key]) || $_POST[$key] == '')) {\n $validacion = false;\n }\n }\n }\n\n if ($this->_captcha === false) {\n $validacion = false;\n }\n }\n }\n\n return $validacion;\n }", "function isIssetVariable($tableauPost) {\n $tableau = array();\n foreach ($tableauPost as $key => $value) {\n if (isset($tableauPost[$key])) {\n $tableau[$key] = $value;\n }\n }\n if (count($tableauPost) != count($tableau)) {\n return false;\n }\n else {\n return true;\n }\n}", "public function enableStrictVariables()\n {\n $this->strictVariables = true;\n }", "public function valid()\n\t{\n\t\t$key = key($this->var);\n\t\t$var = ($key !== NULL && $key !== FALSE);\n\t\techo \"valid: $var\\n\";\n\t\treturn $var;\t\n\t}", "private function varIsBoolean($var): void {\r\n\t\t$var=($var===true) ? 'TRUE' : 'FALSE';\r\n\t\t$booleanTable = '<table class=\"dBug_table dBug_boolean\">' . \"\\n\" . '<tr>' . \"\\n\" . '<th class=\"dBug_clickable_table dBug_booleanHeader\">Boolean</th>' . \"\\n\" . '</tr>'.\"\\n\";\r\n\t\t$booleanTable .= '<tr>' . \"\\n\" . '<td>' . $var . '</td>' . \"\\n\" . '</tr>' . \"\\n\";\r\n\t\t$booleanTable .= '</table>'.\"\\n\";\r\n\t\techo $booleanTable;\r\n\t}", "function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}", "function &bool(bool $value, string $namespace = 'default'): bool\n{\n $var = new Variable\\BoolVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }", "protected function CustomVariables ()\r\n\t{\r\n\t\t// Overwrite variables if you want them custom\r\n\t\t$this->Set ('autoload', true);\r\n\t\t$this->Set ('enable_query_strings', false);\r\n\t\t\r\n\t\t// Add your own variables\r\n\t\t$this->Set ('database_host', 'localhost');\r\n\t\t$this->Set ('database_user', 'database_username');\r\n\t\t$this->Set ('database_pass', 'database_password');\r\n\t\t$this->Set ('database_name', 'database_name');\r\n\t\t$this->Set ('database_prefix', 'database_prefix');\r\n\t}", "public function isStrictVariables()\n {\n return $this->strictVariables;\n }", "public function update_variables(){\n\n // Update parent objects first\n //$this->robot->update_variables();\n\n // Calculate this ability's count variables\n //$this->counters['thing'] = count($this->robot_stuff);\n\n // Return true on success\n return true;\n\n }", "function pseudoTypeFalse(false $var = false) {}", "function checkValue($variable) {\r\n return $this->$variable;\r\n }", "function checkValue($variable) {\r\n return $this->$variable;\r\n }", "function getVariableContainer() ;", "protected function initVars() {\n\n\t\t}", "public function getSetVariables() {}" ]
[ "0.7147108", "0.67110825", "0.6199974", "0.6180267", "0.6180267", "0.5912738", "0.5901381", "0.5828213", "0.5826845", "0.581746", "0.5779343", "0.563731", "0.56348646", "0.56118935", "0.5577616", "0.5573345", "0.55622464", "0.5530327", "0.5516965", "0.55061215", "0.5474667", "0.54286164", "0.5391827", "0.5387326", "0.53852975", "0.5384827", "0.5384827", "0.53793794", "0.5344908", "0.5282991" ]
0.7891375
0
Scope a query for only regular text based messages.
public function scopeText(Builder $query): Builder { return $query->where('type', '=', self::MESSAGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scopeMyMessages($query)\n {\n return $query->where('customer_id', Auth::id());\n }", "public function scopeLikeTitle($query, $text)\n {\n if (empty($text)) {\n return $query;\n }\n\n return $query->where('title', 'like', \"%$text%\");\n }", "public function scopeSearchFilter($query, $q)\n {\n if(!empty($q)){\n return $query->where(DB::raw('LOWER(text)'), 'LIKE', '%' . strtolower($q) . '%');\n }\n }", "public function scopeDocument(Builder $query): Builder\n {\n return $query->where('type', '=', self::DOCUMENT_MESSAGE);\n }", "function welcome_user_msg_filter($text)\n {\n }", "public function scopeSpam($query)\n {\n return $query->where('status', self::STATUS_SPAM);\n }", "public function scopeLikeDetails($query, $text)\n {\n if (empty($text)) {\n return $query;\n }\n\n return $query->where('details', 'like', \"%$text%\");\n }", "public function scopeTenderDocs($query)\n {\n return $query->where('type', 0);\n }", "public function scopeContent($query, $content)\n {\n return $query->where('content', 'LIKE', $content);\n }", "public function scopeRead($query)\n {\n return $query->where('unread', false);\n }", "public function scopeWithKeyword($query, $keyword)\n {\n return $query->where('name', 'like', '%'.$keyword.'%');\n }", "public function scopeUrgent($query)\n {\n $query->where('urgent', true);\n }", "public static function querySpooledMessages()\n {\n $q = new Doctrine_Query;\n $q\n ->from('UllMailQueuedMessage m')\n ->where('is_sent = ?', false)\n ;\n \n return $q;\n }", "public function scopeQuery($query)\n {\n // $query->where();\n }", "public function scopeToSend($query)\n {\n $query->whereIn('status', [static::STATUS_NEW, static::STATUS_FAILED]);\n }", "private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }", "public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }", "public function scopeNaturalPerson($query) {\n\t\treturn $query->where('type', 1);\n\t}", "public function scopePublished($query)\n\t{\n\t\t$query->where('published_at', '<=', Carbon::now());\n\t}", "public function scopeGuest($query)\n {\n $user = Auth::user();\n\n if (is_null($user) || ! $user->hasRole('documents')) {\n return $query->where('published', true);\n }\n\n return $query;\n }", "public function scopeSupportingDocs($query)\n {\n return $query->where('type', 3);\n }", "public function scopeSearch($query, $term);", "public function scopeNombre($query,$name){\n\n // if(trim($name) != \"\") {\n\n $query->where('nom_requisito',\"LIKE\", \"%$name%\")->where('municipio_id_municipio',\"=\",NULL);\n\n // }\n }", "public function scopeUnread($query)\n {\n return $query->where('read', '=', false);\n }", "public function scopeLegalPerson($query) {\n\t\treturn $query->where('type', 0);\n\t}", "public function scopeSearch($query, $term)\n {\n $columns = implode(',',$this->searchable);\n \n $query->whereRaw(\"MATCH ({$columns}) AGAINST (? IN BOOLEAN MODE)\" , $this->fullTextWildcards($term));\n \n return $query;\n }", "public function scopeMy($query)\n {\n return $query->where('created_by', auth()->user()->id);\n }", "public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }", "public function scopeLangue($query, string $strLangue)\n {\n return $query->where('langue_id', $strLangue);\n }", "public function scopeRegular($query)\n {\n return $query->whereIsFinal('0');\n }" ]
[ "0.655857", "0.565998", "0.55845827", "0.55188894", "0.5439309", "0.53815997", "0.53279597", "0.53045", "0.5283804", "0.5253029", "0.5240941", "0.5209389", "0.51914054", "0.51887184", "0.5184704", "0.51782304", "0.51455927", "0.51325786", "0.5121016", "0.5109565", "0.50759894", "0.50738454", "0.5062324", "0.50526166", "0.5045517", "0.50213766", "0.5021347", "0.49906576", "0.4972064", "0.49611825" ]
0.65974605
0
Scope a query for only system messages.
public function scopeSystem(Builder $query): Builder { return $query->whereNotIn('type', self::NonSystemTypes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scopeMyMessages($query)\n {\n return $query->where('customer_id', Auth::id());\n }", "public function scopeNonSystem(Builder $query): Builder\n {\n return $query->whereIn('type', self::NonSystemTypes);\n }", "public function scopeNoRead($query){\n return $query->where('read',false)->where('active',false);\n\n }", "public function scopeSpam($query)\n {\n return $query->where('status', self::STATUS_SPAM);\n }", "public function scopeToSend($query)\n {\n $query->whereIn('status', [static::STATUS_NEW, static::STATUS_FAILED]);\n }", "public function scopeUnread($query)\n {\n return $query->where('read', '=', false);\n }", "public function scopeUrgent($query)\n {\n $query->where('urgent', true);\n }", "public function scopeRead($query)\n {\n return $query->where('unread', false);\n }", "public function scopeSiDisponible($query)\n {\n $fieldEnabled = $this->getField('ENABLED');\n if ($this->existsAttribute($fieldEnabled))\n return $query->where($fieldEnabled,1);\n return $query;\n }", "public function scopeLegalPerson($query) {\n\t\treturn $query->where('type', 0);\n\t}", "public function scopePending($query)\n {\n return $query->where('status', 0);\n }", "public function scopeMy($query)\n {\n return $query->where('created_by', auth()->user()->id);\n }", "public function scopeUnread($query)\n {\n return $query->where('status', '<', self::STATUS_READ);\n }", "public function scopeSubscribers($query) {\n return $query->where('is_admin', 0);\n }", "public function scopeGuest($query)\n {\n $user = Auth::user();\n\n if (is_null($user) || ! $user->hasRole('documents')) {\n return $query->where('published', true);\n }\n\n return $query;\n }", "public function scopeOnlyOnline($query)\n {\n return $query->where('online', '=', true);\n }", "public function scopeDispatched($query) {\n return $query->where('order_status_id', '>', 2);\n }", "public function scopeApp($query)\r\n {\r\n return $query->where('app_id', \\Auth::user()->app_id);\r\n }", "public function scopeApp($query)\r\n {\r\n return $query->where('app_id', \\Auth::user()->app_id);\r\n }", "public function scopeUnread($query)\n {\n return $query->whereNull('read_at');\n }", "public function scopeMine($query)\n {\n //return $query->where('shop_id', Auth::user()->merchantId());\n }", "public function scopeIsprivate($query)\n\t{\n\t\treturn $query->where('isprivate',1);\n\t}", "public function scopePending($query)\n {\n return $query->where('is_pending', 1);\n }", "public function scopeRead($query){\n return $query->where('read',true)->where('active',false);\n }", "public function scopeDisponible($query)\n {\n $fieldEnabled = $this->getField('ENABLED');\n if ($this->existsAttribute($fieldEnabled))\n return $query->where($fieldEnabled,1);\n return $query;\n }", "public function scopeApplyPublic($query)\n {\n return $query->whereNotIn('type', [self::TYPE_USER_CREATED]);\n }", "public function scopeUrgent($query)\n {\n return $query->where('urgent', 1);\n }", "function system_message($message) {\n\treturn system_messages($message, \"messages\");\n}", "public function scopePending($query)\n\t{\n\t\treturn $query->whereIn('status', [\n\t\t\tPitch::UNSEEN,\n\t\t\tPitch::REVIEW,\n\t\t\tPitch::ACCEPTED,\n\t\t\tPitch::WAITING\n\t\t]);\n\t}", "public function scopeScope($query)\n {\n $query->where($this->getTable().'.company_id', '=', auth()->user()->company()->id);\n\n return $query;\n }" ]
[ "0.6898979", "0.5946574", "0.5935338", "0.58987916", "0.58933383", "0.5871448", "0.58415484", "0.5835804", "0.583187", "0.5830244", "0.5822023", "0.57658225", "0.5752964", "0.57408774", "0.57348627", "0.56880116", "0.5657241", "0.5657204", "0.5657204", "0.5637334", "0.5634102", "0.56227154", "0.5613705", "0.56116146", "0.5604143", "0.5599483", "0.55987966", "0.5578664", "0.5556699", "0.5556547" ]
0.6213182
1
Scope a query for only image messages.
public function scopeImage(Builder $query): Builder { return $query->where('type', '=', self::IMAGE_MESSAGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scopePostWithUserCommentsTagsImage(Builder $query){\n return $query->withCount('comments')->with(['user', 'tags', 'image']);\n}", "public function scopeImagenes($query){\n return Imagen::where('tabla_referencia',$this->table)\n ->where('id_referencia',$this->id);\n }", "public function queryImage($query){\n\t\t\treturn $this->query('Image',$query);\n\t\t}", "public function emptyQuery()\n {\n return Image::query();\n }", "public function authFilter(Request $request)\n {\n $user_id = Auth::user()->id;\n\n if($request->query('q')){\n $images = Image::where('user_id',$user_id )\n ->where('caption','LIKE','%'.$request->query('q').'%')\n ->paginate(6);\n }\n\n elseif ($request->query('category') && $request->query('category') != \"All\"){\n $images = Image::where('user_id',$user_id )\n ->where('category','LIKE','%'.$request->query('category').'%')\n ->paginate(6);\n }\n elseif(!$request->query('q') || ($request->query('category') && $request->query('category') == \"All\") ) {\n $images = Image::where('user_id', Auth::user()->id)->paginate(6);\n }\n\n return $images;\n }", "function scopeActiveRelated($query){\n return $query\n ->select('name', 'image' )\n ->where('status', 1)\n ->orderBy('created_at', 'desc')\n ->limit(8)\n ->get();\n }", "function show_current_user_attachments( $query = array() ) {\n\n\t// Checks to see if user role is lower than editor\n\tif( !current_user_can('edit_others_pages') ){\n\n\t\t// Alters media query to only those associated w/ user id\n\t\t$user_id = get_current_user_id();\n if( $user_id ) {\n $query['author'] = $user_id;\n }\n\t}\n return $query;\n}", "function wp_edit_attachments_query($q = \\false)\n {\n }", "public function scopeMyMessages($query)\n {\n return $query->where('customer_id', Auth::id());\n }", "public function guestFilter(Request $request)\n {\n if($request->query('q')){\n $images = Image::where('caption','LIKE','%'.$request->query('q').'%')->paginate(6);\n }\n\n elseif ($request->query('category') && $request->query('category') != \"All\"){\n $images = Image::where('category','LIKE','%'.$request->query('category').'%')->paginate(6);\n }\n\n elseif (!$request->query('q') || ($request->query('category') && $request->query('category') == \"All\")){\n $images = Image::latest()->paginate(6);\n }\n\n return $images;\n }", "public function getImageQuery()\n {\n $command = '';\n\n foreach($this->effect as $effect)\n {\n if($effect instanceof PictureEffect)\n {\n $command .= $effect->__toString() . '&';\n }\n }\n\n $command .= 'Quality;' . $this->quality . '&';\n\n // Support for named default image.\n if ($this->fallbackImg)\n {\n $command .= 'FallbackImg;' . $this->fallbackImg . '&';\n }\n\n // Podpora pro možnost definovat cílový formát ukládaného obrázku.\n if ($this->saveAs)\n {\n $command .= $this->saveAs === EPictureFormat::WEBP\n ? 'WebP&'\n : \"SaveAs;$this->saveAs&\";\n }\n\n // Podpora pro progresivní uložení obrázku.\n if($this->progressive)\n {\n $command .= 'Progressive&';\n }\n\n return substr($command, 0, strlen($command) - 1);\n }", "function filter_media( $query ) {\r\n\t\t// admins get to see everything\r\n\t\tif ( ! current_user_can( 'manage_options' ) )\r\n\t\t\t$query['author'] = get_current_user_id();\r\n\t\treturn $query;\r\n\t}", "function getAllImages() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` from `file` WHERE `mime_type` LIKE \\'image/%\\' AND NOT comment = \\'Uploaded via Contact Form\\'');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "public function scopeIsprivate($query)\n\t{\n\t\treturn $query->where('isprivate',1);\n\t}", "public function scopePublished($query)\n {\n if (PreviewMode::fromRequest()->check()) {\n return;\n }\n\n $query->where('published', 1);\n }", "public function scopeApplyPublic($query)\n {\n return $query->whereNotIn('type', [self::TYPE_USER_CREATED]);\n }", "public function scopeGuest($query)\n {\n $user = Auth::user();\n\n if (is_null($user) || ! $user->hasRole('documents')) {\n return $query->where('published', true);\n }\n\n return $query;\n }", "public function scopeOnline($query)\n {\n $fet = $query->whereNotNull('video')\n ->where('video','<>','')\n ->whereNotNull('poster')\n ->where('poster','<>','')\n ->whereNotNull('background')\n ->where('background','<>','');\n\n return $fet; \n }", "public function scopeOfAuthenticatedUser($query)\n {\n $query->whereUserId(Auth::id());\n }", "public function scopeIsNotVisibleCGOS($query)\n {\n return $query->where('isCgos', 0);\n }", "public function scopePublished($query)\n {\n \n $query->with(['category','tags','owner','photos'])\n ->whereNotNull('published_at')\n ->where('published_at','<=',Carbon::now())\n ->latest('published_at');\n }", "function rex_com_mediaaccess_EP_images($params)\n{\n global $REX;\n\n if($params['extension_point'] == 'IMAGE_RESIZE_SEND')\n $file = $params['filename'];\n else\n $file = $params['img']['file'];\n\n ## get auth - isn't loaded yet\n require_once $REX[\"INCLUDE_PATH\"].\"/addons/community/plugins/auth/inc/auth.php\";\n \n $media = rex_com_mediaaccess::getMediaByFilename($file);\n if($media->checkPerm())\n return true;\n\n return false;\n}", "public function scopePublished($query)\n\t{\n\t\t$query->where('published_at', '<=', Carbon::now());\n\t}", "function getUserImage($mail)\n{\n return $GLOBALS['conn']->query(\"SELECT image FROM `users` WHERE mail='$mail'\");\n}", "public function scopePublished($query)\n {\n return $query->where(\"status\", \"=\", \"1\");\n }", "public function scopePublish($query)\n {\n $query->where('status', '=', self::STATUS_PUBLISH);\n }", "public function scopeAtivos($query)\n {\n return $query->where('ativo_listagem', true);\n }", "function getQueryInstance() {\n // Call the parent getQueryInstance method.\n parent::getQueryInstance();\n // We only what permanent files.\n $this->query->propertyCondition('status', FILE_STATUS_PERMANENT);\n }", "public function scopeToSend($query)\n {\n $query->whereIn('status', [static::STATUS_NEW, static::STATUS_FAILED]);\n }", "function DNUI_checkImageDB($ImageName, $postId,$without=false) {\r\n global $wpdb;\r\n //FIND in the post parent the reference, this will useful if the image is used at the same time\r\n $sql = \"SELECT id FROM \" . $wpdb->prefix . \"posts WHERE post_parent in (SELECT post_parent FROM \" . $wpdb->prefix . \"posts WHERE id=\" . $postId . \" ) and post_content LIKE '%/$ImageName%'\";\r\n $wpdb->get_results($sql, \"ARRAY_A\");\r\n $result = $wpdb->get_results($sql, \"ARRAY_A\");\r\n if (!empty($result)) {\r\n return $result;\r\n }else if($without){\r\n $sql = \"SELECT id FROM \" . $wpdb->prefix . \"posts WHERE post_content is not null and post_content!='' and post_type not in ('attachment','nav_menu_item','revision') and post_status !='draft' and post_content LIKE '%/$ImageName%' limit 0,1\";\r\n }else{\r\n $sql = \"SELECT id FROM \" . $wpdb->prefix . \"posts WHERE post_content is not null and post_content!='' and post_type not in ('attachment','nav_menu_item') and post_content LIKE '%/$ImageName%' limit 0,1\";\r\n }\r\n \r\n return $wpdb->get_results($sql, \"ARRAY_A\");\r\n \r\n}" ]
[ "0.62515557", "0.59250057", "0.5905372", "0.5404993", "0.520499", "0.51434827", "0.5117421", "0.51161426", "0.506842", "0.5056685", "0.49923766", "0.49615306", "0.49170655", "0.4879427", "0.48392183", "0.48022836", "0.47465017", "0.47438797", "0.47126323", "0.47036391", "0.47035018", "0.46991992", "0.4682999", "0.46774566", "0.466287", "0.4658675", "0.4631963", "0.46120337", "0.45971897", "0.4590714" ]
0.6776607
0
Scope a query for only document messages.
public function scopeDocument(Builder $query): Builder { return $query->where('type', '=', self::DOCUMENT_MESSAGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scopeMyMessages($query)\n {\n return $query->where('customer_id', Auth::id());\n }", "public function scopeTenderDocs($query)\n {\n return $query->where('type', 0);\n }", "public function scopeSupportingDocs($query)\n {\n return $query->where('type', 3);\n }", "public function scopeGuest($query)\n {\n $user = Auth::user();\n\n if (is_null($user) || ! $user->hasRole('documents')) {\n return $query->where('published', true);\n }\n\n return $query;\n }", "public function scopeLegalPerson($query) {\n\t\treturn $query->where('type', 0);\n\t}", "public function scopeRead($query)\n {\n return $query->where('unread', false);\n }", "public function scopeBidDocs($query)\n {\n return $query->where('type', 2);\n }", "public function scopePublished($query)\n\t{\n\t\t$query->where('published_at', '<=', Carbon::now());\n\t}", "public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }", "public function scopeOnlyPublished($query)\n {\n return $query->where('published', 1);\n }", "public function scopeUnread($query)\n {\n return $query->where('read', '=', false);\n }", "public function scopeNoRead($query){\n return $query->where('read',false)->where('active',false);\n\n }", "public function scopeApplyPublic($query)\n {\n return $query->whereNotIn('type', [self::TYPE_USER_CREATED]);\n }", "public function scopeMy($query)\n {\n return $query->where('created_by', auth()->user()->id);\n }", "public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }", "public function scopeText(Builder $query): Builder\n {\n return $query->where('type', '=', self::MESSAGE);\n }", "public function scopePublished($query)\n {\n if (PreviewMode::fromRequest()->check()) {\n return;\n }\n\n $query->where('published', 1);\n }", "public function scopeRead($query){\n return $query->where('read',true)->where('active',false);\n }", "public function scopePublished($query)\n {\n return $query->where(\"status\", \"=\", \"1\");\n }", "public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }", "public function scopeUrgent($query)\n {\n $query->where('urgent', true);\n }", "public function scopeUnread($query)\n {\n return $query->whereNull('read_at');\n }", "public function scopePublish($query)\n {\n $query->where('status', '=', self::STATUS_PUBLISH);\n }", "public function scopeQuery($query)\n {\n // $query->where();\n }", "public function scopePublished($query)\n {\n return $query->where('status', SpaceStatus::PUBLISHED());\n }", "public function scopeClients($query)\n {\n return $query->where('type', 1);\n }", "public function scopeUnread($query)\n {\n return $query->where('status', '<', self::STATUS_READ);\n }", "public function scopeSubscribers($query) {\n return $query->where('is_admin', 0);\n }", "public function scopeIsprivate($query)\n\t{\n\t\treturn $query->where('isprivate',1);\n\t}", "public function scopePublished($query) {\n return $query->where('published_at', '<=', now());\n }" ]
[ "0.65538335", "0.6456304", "0.61914974", "0.6072131", "0.58127224", "0.5692574", "0.5667296", "0.5510393", "0.54946905", "0.5492436", "0.5483693", "0.54744905", "0.54621184", "0.54296845", "0.54156524", "0.53922653", "0.5360025", "0.535167", "0.5306489", "0.5294455", "0.5290633", "0.5282015", "0.52672154", "0.526436", "0.5252398", "0.5251153", "0.5248581", "0.52275497", "0.5220387", "0.5217896" ]
0.6826309
0
An object with members to configure various horizontal axis elements. To specify properties of this property, create a new hAxis() object, set the values then pass it to this function or to the constructor.
public function hAxis(HorizontalAxis $hAxis) { $this->addOption($hAxis->toArray('hAxis')); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateJavascriptParams(array &$options) {\n\t\t\n\t\t// Titles Position\n\t\tif($this->axisTitlesPosition) {\n\t\t\t$options['axisTitlesPosition'] = $this->axisTitlesPosition;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Baseline\n\t\tif($this->hAxisBaseline !== null) {\n\t\t\t$hAxis['baseline'] = $this->hAxisBaseline;\n\t\t}\n\t\tif($this->hAxisBaselineColor) {\n\t\t\t$hAxis['baselineColor'] = $this->hAxisBaselineColor;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Direction\n\t\tif($this->reverseHAxisDirection) {\n\t\t\t$hAxis['direction'] = -1;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Format\n\t\tif($this->hAxisFormat) {\n\t\t\t$hAxis['format'] = $this->hAxisFormat;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Gridline Color\n\t\tif($this->hAxisGridlineColor) {\n\t\t\t$hAxis['gridlineColor'] = $this->hAxisGridlineColor;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Log Scale\n\t\tif($this->hAxisLogScale) {\n\t\t\t$hAxis['logScale'] = true;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Text Position\n\t\tif($this->hAxisTextPosition) {\n\t\t\t$hAxis['textPosition'] = $this->hAxisTextPosition;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Text Style\n\t\tif($this->hAxisTextColor) {\n\t\t\t$hAxisTextStyle['color'] = $this->hAxisTextColor;\n\t\t}\n\t\tif($this->hAxisTextFontName) {\n\t\t\t$hAxisTextStyle['fontName'] = $this->hAxisTextFontName;\n\t\t}\n\t\tif($this->hAxisTextFontSize) {\n\t\t\t$hAxisTextStyle['fontSize'] = $this->hAxisTextFontSize;\n\t\t}\n\t\tif(isset($hAxisTextStyle)) {\n\t\t\t$hAxis['textStyle'] = $hAxisTextStyle;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Title\n\t\tif($this->hAxisTitle) {\n\t\t\t$hAxis['title'] = $this->hAxisTitle;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Title Style\n\t\tif($this->hAxisTitleColor) {\n\t\t\t$hAxisTitleStyle['color'] = $this->hAxisTitleColor;\n\t\t}\n\t\tif($this->hAxisTitleFontName) {\n\t\t\t$hAxisTitleStyle['fontName'] = $this->hAxisTitleFontName;\n\t\t}\n\t\tif($this->hAxisTitleFontSize) {\n\t\t\t$hAxisTitleStyle['fontSize'] = $this->hAxisTitleFontSize;\n\t\t}\n\t\tif(isset($hAxisTitleStyle)) {\n\t\t\t$hAxis['textStyle'] = $hAxisTitleStyle;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Min & Max\n\t\tif($this->hAxisMin !== null) {\n\t\t\t$hAxis['minValue'] = $this->hAxisMin;\n\t\t}\n\t\tif($this->hAxisMax !== null) {\n\t\t\t$hAxis['maxValue'] = $this->hAxisMax;\n\t\t}\n\t\t\n\t\t// Horizontal Axis View Window\n\t\tif($this->hAxisViewWindowMode) {\n\t\t\t$hAxis['viewWindowMode'] = $this->hAxisViewWindowMode;\n\t\t}\n\t\tif($this->hAxisViewWindowMin !== null) {\n\t\t\t$hAxisViewWindow['min'] = $this->hAxisViewWindowMin;\n\t\t}\n\t\tif($this->hAxisViewWindowMax !== null) {\n\t\t\t$hAxisViewWindow['max'] = $this->hAxisViewWindowMax;\n\t\t}\n\t\tif(isset($hAxisViewWindow)) {\n\t\t\t$hAxis['viewWindow'] = $hAxisViewWindow;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Slanted Text\n\t\tif($this->hAxisSlantedText !== null) {\n\t\t\t$hAxis['slantedText'] = $this->hAxisSlantedText ? true : false;\n\t\t}\n\t\tif($this->hAxisSlantedTextAngle) {\n\t\t\t$hAxis['slantedTextAngle'] = $this->hAxisSlantedTextAngle;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Max Alteration\n\t\tif($this->hAxisMaxAlternation) {\n\t\t\t$hAxis['maxAlternation'] = $this->hAxisMaxAlternation;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Show Text Every\n\t\tif($this->hAxisShowTextEvery) {\n\t\t\t$hAxis['showTextEvery'] = $this->hAxisShowTextEvery;\n\t\t}\n\t\t\n\t\tif(isset($hAxis)) {\n\t\t\t$options['hAxis'] = $hAxis;\n\t\t}\n\t\t\n\t\t// Vertical Axis Baseline\n\t\tif($this->vAxisBaseline !== null) {\n\t\t\t$vAxis['baseline'] = $this->vAxisBaseline;\n\t\t}\n\t\tif($this->vAxisBaselineColor) {\n\t\t\t$vAxis['baselineColor'] = $this->vAxisBaselineColor;\n\t\t}\n\t\t\n\t\t// Vertical Axis Direction\n\t\tif($this->reverseVAxisDirection) {\n\t\t\t$vAxis['direction'] = -1;\n\t\t}\n\t\t\n\t\t// Vertical Axis Format\n\t\tif($this->vAxisFormat) {\n\t\t\t$vAxis['format'] = $this->vAxisFormat;\n\t\t}\n\t\t\n\t\t// Vertical Axis Gridline Color\n\t\tif($this->vAxisGridlineColor) {\n\t\t\t$vAxis['gridlineColor'] = $this->vAxisGridlineColor;\n\t\t}\n\t\t\n\t\t// Vertical Axis Log Scale\n\t\tif($this->vAxisLogScale) {\n\t\t\t$vAxis['logScale'] = true;\n\t\t}\n\t\t\n\t\t// Vertical Axis Text Position\n\t\tif($this->vAxisTextPosition) {\n\t\t\t$vAxis['textPosition'] = $this->vAxisTextPosition;\n\t\t}\n\t\t\n\t\t// Vertical Axis Text Style\n\t\tif($this->vAxisTextColor) {\n\t\t\t$vAxisTextStyle['color'] = $this->vAxisTextColor;\n\t\t}\n\t\tif($this->vAxisTextFontName) {\n\t\t\t$vAxisTextStyle['fontName'] = $this->vAxisTextFontName;\n\t\t}\n\t\tif($this->vAxisTextFontSize) {\n\t\t\t$vAxisTextStyle['fontSize'] = $this->vAxisTextFontSize;\n\t\t}\n\t\tif(isset($vAxisTextStyle)) {\n\t\t\t$vAxis['textStyle'] = $vAxisTextStyle;\n\t\t}\n\t\t\n\t\t// Vertical Axis Title\n\t\tif($this->vAxisTitle) {\n\t\t\t$vAxis['title'] = $this->vAxisTitle;\n\t\t}\n\t\t\n\t\t// Vertical Axis Title Style\n\t\tif($this->vAxisTitleColor) {\n\t\t\t$vAxisTitleStyle['color'] = $this->vAxisTitleColor;\n\t\t}\n\t\tif($this->vAxisTitleFontName) {\n\t\t\t$vAxisTitleStyle['fontName'] = $this->vAxisTitleFontName;\n\t\t}\n\t\tif($this->vAxisTitleFontSize) {\n\t\t\t$vAxisTitleStyle['fontSize'] = $this->vAxisTitleFontSize;\n\t\t}\n\t\tif(isset($vAxisTitleStyle)) {\n\t\t\t$vAxis['textStyle'] = $vAxisTitleStyle;\n\t\t}\n\t\t\n\t\t// Vertical Axis Min & Max\n\t\tif($this->vAxisMin !== null) {\n\t\t\t$vAxis['minValue'] = $this->vAxisMin;\n\t\t}\n\t\tif($this->vAxisMax !== null) {\n\t\t\t$vAxis['maxValue'] = $this->vAxisMax;\n\t\t}\n\t\t\n\t\t// Vertical Axis View Window\n\t\tif($this->vAxisViewWindowMode) {\n\t\t\t$vAxis['viewWindowMode'] = $this->vAxisViewWindowMode;\n\t\t}\n\t\tif($this->vAxisViewWindowMin !== null) {\n\t\t\t$vAxisViewWindow['min'] = $this->vAxisViewWindowMin;\n\t\t}\n\t\tif($this->vAxisViewWindowMax !== null) {\n\t\t\t$vAxisViewWindow['max'] = $this->vAxisViewWindowMax;\n\t\t}\n\t\tif(isset($vAxisViewWindow)) {\n\t\t\t$vAxis['viewWindow'] = $vAxisViewWindow;\n\t\t}\n\t\t\n\t\tif(isset($vAxis)) {\n\t\t\t$options['vAxis'] = $vAxis;\n\t\t}\n\t}", "public function setHAxisBaseline($baseline) {\n\t\t$this->hAxisBaseline = $baseline;\n\t}", "public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null)\n {\n $this->axisOptions['axis_labels'] = (string) $axis_labels;\n ($horizontal_crosses_value !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;\n ($horizontal_crosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontal_crosses : null;\n ($axis_orientation !== null) ? $this->axisOptions['orientation'] = (string) $axis_orientation : null;\n ($major_tmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $major_tmt : null;\n ($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;\n ($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;\n ($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null;\n ($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null;\n ($major_unit !== null) ? $this->axisOptions['major_unit'] = (string) $major_unit : null;\n ($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null;\n }", "function setHeading($h)\n\t{\n\t\t$this->_headingText=$h;\n\t}", "public function __construct(array $tool, array $data, $instances, array $element_data, $options = null)\n {\n $this->content_type = 'HorizontalRule';\n\n parent::__construct($tool, $data, $instances, $element_data, $options);\n }", "public function getTitle() {\r\n if ($this->axisTitle == null) {\r\n $this->axisTitle = new AxisTitle($this->chart);\r\n if ($this->horizontal)\r\n $this->axisTitle->setAngle(0);\r\n else\r\n $this->axisTitle->setAngle(90); \r\n }\r\n return $this->axisTitle;\r\n }", "function set_heading()\n\t{\n\t\t$args = func_get_args();\n\t\t$this->heading = $this->_prep_args($args);\n\t}", "protected function Axes()\n {\n if(!$this->show_axes)\n return $this->Labels();\n\n $this->CalcGrid();\n $main_y_axis = $this->y_axes[$this->main_y_axis];\n $main_x_axis = $this->x_axes[$this->main_x_axis];\n $y0 = $main_y_axis->Zero();\n $x0 = $main_x_axis->Zero();\n $x_axis_visible = $this->show_axis_h && $y0 >= 0 && $y0 <= $this->g_height;\n $y_axis_inside = $x0 >= 1 && $x0 < $this->g_width;\n $yoff = $x_axis_visible ? $y0 : 0;\n $xoff = $y_axis_inside ? $x0 : 0;\n $y_count = count($this->y_axes);\n\n $axis_group = $axes = $label_group = $divisions = $axis_text = '';\n if($this->show_axis_h)\n $axes .= $this->XAxis($yoff);\n if($this->show_axis_v) {\n for($i = 0; $i < $y_count; ++$i) {\n if(!is_null($this->y_axes[$i])) {\n $axes .= $this->YAxis($i);\n }\n }\n }\n\n if($axes != '') {\n $line = array();\n if(empty($this->axis_colour_h) || empty($this->axis_colour_v))\n $line['stroke'] = $this->axis_colour;\n if(empty($this->axis_stroke_width_h) || empty($this->axis_stroke_width_v))\n $line['stroke-width'] = $this->axis_stroke_width;\n $axis_group = empty($line) ? $axes : $this->Element('g', $line, NULL, $axes);\n }\n\n $text_offset = $this->DivisionOverlap($this->x_axes, $this->y_axes);\n if($this->show_axis_text_v) {\n for($i = 0; $i < $y_count; ++$i) {\n $axis = $this->y_axes[$i];\n if(!is_null($axis)) {\n $offset = ($this->label_centre && $this->flip_axes ? -0.5 * $axis->Unit() : 0);\n $points = $this->GetGridPointsY($i);\n $axis_text .= $this->YAxisText($points, \n $text_offset[$i > 0 ? 'r' : 'l'],\n $offset, $this->ArrayOption($this->axis_text_angle_v, $i),\n $i > 0, $i);\n }\n }\n }\n if($this->show_axis_text_h) {\n $axis = $main_x_axis;\n $offset = ($this->label_centre && !$this->flip_axes ? 0.5 * $axis->Unit() : 0);\n $points = $this->GetGridPointsX(0);\n $axis_text .= $this->XAxisText($points, $offset,\n $text_offset['b'], $this->axis_text_angle_h);\n }\n\n $label_group = $this->Labels($axis_text);\n\n if($this->show_divisions) {\n // use an array to join paths with same colour\n $div_paths = array();\n if($this->show_axis_h) {\n $points = $this->GetGridPointsX(0);\n $dx_path = $this->XAxisDivisions($points,\n $this->GetFirst($this->division_style_h, $this->division_style), \n $this->GetFirst($this->division_size_h, $this->division_size),\n $yoff);\n if(!empty($dx_path)) {\n $dx_colour = $this->GetFirst($this->division_colour_h,\n $this->division_colour, $this->axis_colour);\n if(isset($div_paths[$dx_colour]))\n $div_paths[$dx_colour] .= $dx_path;\n else\n $div_paths[$dx_colour] = $dx_path;\n }\n }\n if($this->show_axis_v) {\n for($i = 0; $i < $y_count; ++$i) {\n if(!is_null($this->y_axes[$i])) {\n $points = $this->GetGridPointsY($i);\n $dy_path = $this->YAxisDivisions($points,\n $i > 0 ? $this->g_width : $xoff, false, $i);\n if(!empty($dy_path)) {\n $dy_colour = $this->GetFirst(\n $this->ArrayOption($this->division_colour_v, $i),\n $this->division_colour,\n $this->ArrayOption($this->axis_colour_v, $i),\n $this->axis_colour);\n if(isset($div_paths[$dy_colour]))\n $div_paths[$dy_colour] .= $dy_path;\n else\n $div_paths[$dy_colour] = $dy_path;\n }\n }\n }\n }\n\n if($this->show_subdivisions) {\n if($this->show_axis_h) {\n $subdivs = $this->GetSubDivsX(0);\n $sdx_path = $this->XAxisDivisions($subdivs,\n $this->GetFirst($this->subdivision_style_h,\n $this->subdivision_style), \n $this->GetFirst($this->subdivision_size_h,\n $this->subdivision_size), $yoff);\n\n if(!empty($sdx_path)) {\n $sdx_colour = $this->GetFirst($this->subdivision_colour_h,\n $this->subdivision_colour, $this->division_colour_h,\n $this->division_colour, $this->axis_colour);\n if(isset($div_paths[$sdx_colour]))\n $div_paths[$sdx_colour] .= $sdx_path;\n else\n $div_paths[$sdx_colour] = $sdx_path;\n }\n }\n if($this->show_axis_v) {\n for($i = 0; $i < $y_count; ++$i) {\n if(!is_null($this->y_axes[$i])) {\n $subdivs = $this->GetSubDivsY($i);\n $sdy_path = $this->YAxisDivisions($subdivs,\n $i > 0 ? $this->g_width : $xoff, true, $i);\n if(!empty($sdy_path)) {\n $sdy_colour = $this->GetFirst(\n $this->ArrayOption($this->subdivision_colour_v, $i),\n $this->subdivision_colour,\n $this->ArrayOption($this->division_colour_v, $i),\n $this->division_colour,\n $this->ArrayOption($this->axis_colour_v, $i),\n $this->axis_colour);\n if(isset($div_paths[$sdy_colour]))\n $div_paths[$sdy_colour] .= $sdy_path;\n else\n $div_paths[$sdy_colour] = $sdy_path;\n }\n }\n }\n }\n }\n\n foreach($div_paths as $colour => $path) {\n $div = array(\n 'd' => $path,\n 'stroke-width' => 1,\n 'stroke' => $colour\n );\n $divisions .= $this->Element('path', $div);\n }\n }\n return $divisions . $axis_group . $label_group;\n }", "private function generateHeading()\n {\n //get current dimensions\n\t\t$highestRow = $this->objWorksheet->getHighestRow(); // e.g. 10\n\t\t$highestColumn = $this->objWorksheet->getHighestColumn(); // e.g 'F'\n\n\t\t$highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);\n\n\t\t//insert row on top\n\t\t$this->objWorksheet->insertNewRowBefore(1,2);\n\n\t\t//merge cells\n\t\t$this->objWorksheet->mergeCells(\"A1:\".$highestColumn.\"1\");\n\n\t\t//set the text for header\n\t\t$this->objWorksheet->setCellValue(\"A1\", $this->_headingText);\n\t\t$this->objWorksheet->getStyle('A1')->getAlignment()->setWrapText(true);\n\t\t$this->objWorksheet->getRowDimension('1')->setRowHeight(48);\n\n //Apply style\n\t\t$this->objWorksheet->getStyle(\"A1\")->applyFromArray($this->_headingStyleArray);\n }", "function execute()\n\t{\n\t\t$this->ofc_chart = new OFC_Charts_Bar_Horizontal;\n\n\t\tparent::execute();\n\n\t\tforeach($this->_config as $var=>$value)\n\t\t{\n\t\t\tif (!is_int($var))\n\t\t\t\tcontinue;\n\n\t\t\tswitch($var)\n\t\t\t{\n\t\t\t\tcase self::VALUES:\n\t\t\t\t\t$this->ofc_chart->set_values(null);\n\n\t\t\t\t\tforeach($value as $index=>$values)\n\t\t\t\t\t{\n\t\t\t\t\t\t$v = new OFC_Charts_Bar_Horizontal_Value($values['left'], $values['right']);\n\n\t\t\t\t\t\tif (isset($values[self::TOOLTIP]))\n\t\t\t\t\t\t\t$v->set_tooltip($values[self::TOOLTIP]);\n\n\t\t\t\t\t\t$this->ofc_chart->append_value($v);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getXAxis();", "public function setHeadings($headings);", "function setBottomAxis($axis)\n {\n return $this->setAxis(1, $axis);\n }", "public function setHorizontal($value) {\r\n $this->horizontal = $this->setBooleanProperty($this->horizontal, $value);\r\n }", "private function headings() {\n\t\t$this->section_data['general_h_tags'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_h_tags',\n\t\t\t'label' \t\t\t\t=> __( 'Headings', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ),\n\t\t\t'type' \t\t\t\t\t=> 'multi_checkbox',\n\t\t\t'choices'\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h1' => 'Heading 1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h2' => 'Heading 2',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h3' => 'Heading 3',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h4' => 'Heading 4',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h5' => 'Heading 5',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h6' => 'Heading 6',\n\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t'des'\t\t\t\t\t\t=> __( 'Check which HTML headings automatically generated table of contents.', 'fixedtoc' )\n\t\t);\n\t}", "public function isHorizontal() {\n\t\t$this->direction=\"H\";\n\t}", "function __construct()\n\t{\n\t\tparent::__construct(\n\t\t\t'jetty_widget_horizontal_tab',\n\t\t\t__('Jetty Horizontal Tabs', 'jetty'),\n\t\t\tarray( 'description' => __( 'This widget for display horizontal tab on certain page', 'jetty' ), )\n\t\t);\n\t}", "public function horizontalLayout() {\n }", "public function showDoLayoutAnyHorizontal($scope, $values)\n {\n // possible values for arguments:\n // h - We get to decide\n // h:nxx - First column width in CSS units\n // h:nxx:mxx - CSS units for headers / input elements\n // h:n:m:t - ratio of headers to inputs over space t. If no t, t=n+m\n // h:.c1 - Class for headers\n // h:.c1:.c2 - Class for headers / input elements\n $this->checkShowState($scope);\n\n $apply = &$this->showState[$scope];\n switch (count($values)) {\n case 1:\n // No specification, use our default\n $apply['headingAttributes'] = new Attributes(\n 'style',\n [\n 'display' => 'inline-block',\n 'vertical-align' => 'top',\n 'width' => '25%'\n ]\n );\n $apply['inputWrapperAttributes'] = new Attributes(\n 'style',\n [\n 'display' => 'inline-block',\n 'vertical-align' => 'top',\n 'width' => '75%'\n ]\n );\n break;\n case 2:\n if ($values[1][0] == '.') {\n // Single class specification\n $apply['headingAttributes'] = new Attributes('class', [substr($values[1], 1)]);\n } else {\n // Single CSS units\n $apply['headingAttributes'] = new Attributes(\n 'style',\n [\n 'display' => 'inline-block',\n 'vertical-align' => 'top',\n 'width' => $values[1]\n ]\n );\n }\n break;\n default:\n if ($values[1][0] == '.') {\n // Dual class specification\n $apply['headingAttributes'] = new Attributes('class', [substr($values[1], 1)]);\n $apply['inputWrapperAttributes'] = new Attributes('class', [substr($values[2], 1)]);\n } elseif (preg_match('/^[+\\-]?[0-9](\\.[0-9]*)?$/', $values[1])) {\n // ratio\n $part1 = (float) $values[1];\n $part2 = (float) $values[2];\n if (!$part1 || !$part2) {\n throw new \\RuntimeException(\n 'Invalid ratio: ' . $values[1] . ':' . $values[2]\n );\n }\n $sum = isset($values[3]) ? $values[3] : ($part1 + $part2);\n $apply['headingAttributes'] = new Attributes(\n 'style',\n [\n 'display' => 'inline-block',\n 'vertical-align' => 'top',\n 'width' => round(100.0 * $part1 / $sum, 3) . '%'\n ]\n );\n $apply['inputWrapperAttributes'] = new Attributes(\n 'style',\n [\n 'display' => 'inline-block',\n 'vertical-align' => 'top',\n 'width' => round(100.0 * $part2 / $sum, 3) . '%'\n ]\n );\n } else {\n // Dual CSS units\n $apply['headingAttributes'] = new Attributes(\n 'style',\n [\n 'display' => 'inline-block',\n 'vertical-align' => 'top',\n 'width' => $values[1]\n ]\n );\n $apply['inputWrapperAttributes'] = new Attributes(\n 'style',\n [\n 'display' => 'inline-block',\n 'vertical-align' => 'top',\n 'width' => $values[2]\n ]\n );\n }\n break;\n\n }\n if (isset($apply['inputWrapperAttributes'])) {\n $apply['cellElementAttributes'] = $apply['inputWrapperAttributes'];\n }\n }", "function setTopAxis($axis)\n {\n return $this->setAxis(3, $axis);\n }", "public function setHeadings($headings){\n\t\t\t$this->headings = $headings;\n\t\t}", "public function getHorizontal() {\r\n return $this->horizontal;\r\n }", "public function setHCenter($value) {\n\t}", "public function setH($value)\n {\n $this->setParam('h', $value);\n }", "public static function set_hcol($hcol)\n\t{\n\t\tif ( bbn\\str::check_name($hcol) ){\n\t\t\tself::$hcol = $hcol;\n\t\t}\n\t}", "public function h($value)\n {\n $this->args = array_merge($this->args, ['h' => $value]);\n\n return $this;\n }", "public function setHeading($var)\n {\n GPBUtil::checkDouble($var);\n $this->heading = $var;\n\n return $this;\n }", "public function setNumberOfHMetrics($value) {}", "public function __construct($headers=array())\n\t{\n\t\t$headers = array_merge(array(\n 'title'\t\t\t=> 'Данные с метеостанции',\n 'subject'\t\t=> 'Данные с метеостанции',\n 'description'\t=> 'Данные с метеостанции',\n 'author'\t\t=> 'ВФ МЭИ',\n\n\t\t), $headers);\n\n\t\t$this->_spreadsheet = new PHPExcel();\n\t\t// Set properties\n\t\t$this->_spreadsheet->getProperties()\n\t\t\t->setCreator( $headers['author'] )\n\t\t\t->setTitle( $headers['title'] )\n\t\t\t->setSubject( $headers['subject'] )\n\t\t\t->setDescription( $headers['description'] );\n\t\t\t//->setActiveSheetIndex(0);\n\t\t//$this->_spreadsheet->getActiveSheet()->setTitle('Minimalistic demo');\n\t}", "public static function createFromDiscriminatorValue(ParseNode $parseNode): WorkbookChartAxis {\n return new WorkbookChartAxis();\n }" ]
[ "0.67988026", "0.55860025", "0.54584163", "0.5214826", "0.5046268", "0.5007254", "0.4979601", "0.4885388", "0.48471162", "0.4843735", "0.4809808", "0.48013642", "0.48002616", "0.4786577", "0.47771537", "0.47689515", "0.47265515", "0.47120112", "0.4686496", "0.4662397", "0.46238264", "0.46110192", "0.46017778", "0.458775", "0.45762202", "0.45569545", "0.45541084", "0.44836888", "0.4476827", "0.44411194" ]
0.7327219
0
An object with members to configure various vertical axis elements. To specify properties of this property, create a new vAxis() object, set the values then pass it to this function or to the constructor.
public function vAxis(VerticalAxis $vAxis) { $this->addOption($vAxis->toArray('vAxis')); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function vAxis($verticalAxisConfig)\n {\n return $this->setOption(__FUNCTION__, new VerticalAxis($verticalAxisConfig));\n }", "public function vAxes($vAxisConfigArray)\n {\n if (Utils::arrayIsMulti($vAxisConfigArray) === false) {\n throw new InvalidConfigValue(\n static::TYPE . '->' . __FUNCTION__,\n 'array',\n 'With arrays of VerticalAxis options.'\n );\n }\n\n $vAxes = [];\n\n foreach ($vAxisConfigArray as $hAxisConfig) {\n $vAxes[] = new VerticalAxis($hAxisConfig);\n }\n\n return $this->setOption(__FUNCTION__, $vAxes);\n }", "public function vAxes($a)\n {\n if (Utils::arrayValuesCheck($a, 'class', 'VerticalAxis')) {\n return $this->addOption(array(__FUNCTION__ => $a));\n } else {\n throw $this->invalidConfigValue(\n __FUNCTION__,\n 'array',\n 'of VerticalAxis Objects'\n );\n }\n }", "public function updateJavascriptParams(array &$options) {\n\t\t\n\t\t// Titles Position\n\t\tif($this->axisTitlesPosition) {\n\t\t\t$options['axisTitlesPosition'] = $this->axisTitlesPosition;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Baseline\n\t\tif($this->hAxisBaseline !== null) {\n\t\t\t$hAxis['baseline'] = $this->hAxisBaseline;\n\t\t}\n\t\tif($this->hAxisBaselineColor) {\n\t\t\t$hAxis['baselineColor'] = $this->hAxisBaselineColor;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Direction\n\t\tif($this->reverseHAxisDirection) {\n\t\t\t$hAxis['direction'] = -1;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Format\n\t\tif($this->hAxisFormat) {\n\t\t\t$hAxis['format'] = $this->hAxisFormat;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Gridline Color\n\t\tif($this->hAxisGridlineColor) {\n\t\t\t$hAxis['gridlineColor'] = $this->hAxisGridlineColor;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Log Scale\n\t\tif($this->hAxisLogScale) {\n\t\t\t$hAxis['logScale'] = true;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Text Position\n\t\tif($this->hAxisTextPosition) {\n\t\t\t$hAxis['textPosition'] = $this->hAxisTextPosition;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Text Style\n\t\tif($this->hAxisTextColor) {\n\t\t\t$hAxisTextStyle['color'] = $this->hAxisTextColor;\n\t\t}\n\t\tif($this->hAxisTextFontName) {\n\t\t\t$hAxisTextStyle['fontName'] = $this->hAxisTextFontName;\n\t\t}\n\t\tif($this->hAxisTextFontSize) {\n\t\t\t$hAxisTextStyle['fontSize'] = $this->hAxisTextFontSize;\n\t\t}\n\t\tif(isset($hAxisTextStyle)) {\n\t\t\t$hAxis['textStyle'] = $hAxisTextStyle;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Title\n\t\tif($this->hAxisTitle) {\n\t\t\t$hAxis['title'] = $this->hAxisTitle;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Title Style\n\t\tif($this->hAxisTitleColor) {\n\t\t\t$hAxisTitleStyle['color'] = $this->hAxisTitleColor;\n\t\t}\n\t\tif($this->hAxisTitleFontName) {\n\t\t\t$hAxisTitleStyle['fontName'] = $this->hAxisTitleFontName;\n\t\t}\n\t\tif($this->hAxisTitleFontSize) {\n\t\t\t$hAxisTitleStyle['fontSize'] = $this->hAxisTitleFontSize;\n\t\t}\n\t\tif(isset($hAxisTitleStyle)) {\n\t\t\t$hAxis['textStyle'] = $hAxisTitleStyle;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Min & Max\n\t\tif($this->hAxisMin !== null) {\n\t\t\t$hAxis['minValue'] = $this->hAxisMin;\n\t\t}\n\t\tif($this->hAxisMax !== null) {\n\t\t\t$hAxis['maxValue'] = $this->hAxisMax;\n\t\t}\n\t\t\n\t\t// Horizontal Axis View Window\n\t\tif($this->hAxisViewWindowMode) {\n\t\t\t$hAxis['viewWindowMode'] = $this->hAxisViewWindowMode;\n\t\t}\n\t\tif($this->hAxisViewWindowMin !== null) {\n\t\t\t$hAxisViewWindow['min'] = $this->hAxisViewWindowMin;\n\t\t}\n\t\tif($this->hAxisViewWindowMax !== null) {\n\t\t\t$hAxisViewWindow['max'] = $this->hAxisViewWindowMax;\n\t\t}\n\t\tif(isset($hAxisViewWindow)) {\n\t\t\t$hAxis['viewWindow'] = $hAxisViewWindow;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Slanted Text\n\t\tif($this->hAxisSlantedText !== null) {\n\t\t\t$hAxis['slantedText'] = $this->hAxisSlantedText ? true : false;\n\t\t}\n\t\tif($this->hAxisSlantedTextAngle) {\n\t\t\t$hAxis['slantedTextAngle'] = $this->hAxisSlantedTextAngle;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Max Alteration\n\t\tif($this->hAxisMaxAlternation) {\n\t\t\t$hAxis['maxAlternation'] = $this->hAxisMaxAlternation;\n\t\t}\n\t\t\n\t\t// Horizontal Axis Show Text Every\n\t\tif($this->hAxisShowTextEvery) {\n\t\t\t$hAxis['showTextEvery'] = $this->hAxisShowTextEvery;\n\t\t}\n\t\t\n\t\tif(isset($hAxis)) {\n\t\t\t$options['hAxis'] = $hAxis;\n\t\t}\n\t\t\n\t\t// Vertical Axis Baseline\n\t\tif($this->vAxisBaseline !== null) {\n\t\t\t$vAxis['baseline'] = $this->vAxisBaseline;\n\t\t}\n\t\tif($this->vAxisBaselineColor) {\n\t\t\t$vAxis['baselineColor'] = $this->vAxisBaselineColor;\n\t\t}\n\t\t\n\t\t// Vertical Axis Direction\n\t\tif($this->reverseVAxisDirection) {\n\t\t\t$vAxis['direction'] = -1;\n\t\t}\n\t\t\n\t\t// Vertical Axis Format\n\t\tif($this->vAxisFormat) {\n\t\t\t$vAxis['format'] = $this->vAxisFormat;\n\t\t}\n\t\t\n\t\t// Vertical Axis Gridline Color\n\t\tif($this->vAxisGridlineColor) {\n\t\t\t$vAxis['gridlineColor'] = $this->vAxisGridlineColor;\n\t\t}\n\t\t\n\t\t// Vertical Axis Log Scale\n\t\tif($this->vAxisLogScale) {\n\t\t\t$vAxis['logScale'] = true;\n\t\t}\n\t\t\n\t\t// Vertical Axis Text Position\n\t\tif($this->vAxisTextPosition) {\n\t\t\t$vAxis['textPosition'] = $this->vAxisTextPosition;\n\t\t}\n\t\t\n\t\t// Vertical Axis Text Style\n\t\tif($this->vAxisTextColor) {\n\t\t\t$vAxisTextStyle['color'] = $this->vAxisTextColor;\n\t\t}\n\t\tif($this->vAxisTextFontName) {\n\t\t\t$vAxisTextStyle['fontName'] = $this->vAxisTextFontName;\n\t\t}\n\t\tif($this->vAxisTextFontSize) {\n\t\t\t$vAxisTextStyle['fontSize'] = $this->vAxisTextFontSize;\n\t\t}\n\t\tif(isset($vAxisTextStyle)) {\n\t\t\t$vAxis['textStyle'] = $vAxisTextStyle;\n\t\t}\n\t\t\n\t\t// Vertical Axis Title\n\t\tif($this->vAxisTitle) {\n\t\t\t$vAxis['title'] = $this->vAxisTitle;\n\t\t}\n\t\t\n\t\t// Vertical Axis Title Style\n\t\tif($this->vAxisTitleColor) {\n\t\t\t$vAxisTitleStyle['color'] = $this->vAxisTitleColor;\n\t\t}\n\t\tif($this->vAxisTitleFontName) {\n\t\t\t$vAxisTitleStyle['fontName'] = $this->vAxisTitleFontName;\n\t\t}\n\t\tif($this->vAxisTitleFontSize) {\n\t\t\t$vAxisTitleStyle['fontSize'] = $this->vAxisTitleFontSize;\n\t\t}\n\t\tif(isset($vAxisTitleStyle)) {\n\t\t\t$vAxis['textStyle'] = $vAxisTitleStyle;\n\t\t}\n\t\t\n\t\t// Vertical Axis Min & Max\n\t\tif($this->vAxisMin !== null) {\n\t\t\t$vAxis['minValue'] = $this->vAxisMin;\n\t\t}\n\t\tif($this->vAxisMax !== null) {\n\t\t\t$vAxis['maxValue'] = $this->vAxisMax;\n\t\t}\n\t\t\n\t\t// Vertical Axis View Window\n\t\tif($this->vAxisViewWindowMode) {\n\t\t\t$vAxis['viewWindowMode'] = $this->vAxisViewWindowMode;\n\t\t}\n\t\tif($this->vAxisViewWindowMin !== null) {\n\t\t\t$vAxisViewWindow['min'] = $this->vAxisViewWindowMin;\n\t\t}\n\t\tif($this->vAxisViewWindowMax !== null) {\n\t\t\t$vAxisViewWindow['max'] = $this->vAxisViewWindowMax;\n\t\t}\n\t\tif(isset($vAxisViewWindow)) {\n\t\t\t$vAxis['viewWindow'] = $vAxisViewWindow;\n\t\t}\n\t\t\n\t\tif(isset($vAxis)) {\n\t\t\t$options['vAxis'] = $vAxis;\n\t\t}\n\t}", "public function vertical($vertical = true)\n {\n $this->vertical = $vertical;\n\n return $this;\n }", "function succulents_qodef_set_header_vertical_type_meta_boxes_option( $header_type_options ) {\n\t\t$header_type_options['header-vertical'] = esc_html__( 'Vertical', 'succulents' );\n\t\t\n\t\treturn $header_type_options;\n\t}", "public function set_vertical_freq($freq)\n {\n $this->vertical_freq = $freq;\n }", "function __construct($width = 200, $height = 200, $type = 'g', $direction='v'){\n\t\t$this -> setChartType($type, $direction);\n\t\t$this -> setDimensions($width, $height);\t\n\t}", "public function vertical(): self\n {\n $this->typeForm = 'platform::partials.fields.vertical';\n\n return $this;\n }", "function iver_select_set_header_vertical_type_meta_boxes_option( $header_type_options ) {\n\t\t$header_type_options['header-vertical'] = esc_html__( 'Vertical', 'iver' );\n\t\t\n\t\treturn $header_type_options;\n\t}", "public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null)\n {\n $this->axisOptions['axis_labels'] = (string) $axis_labels;\n ($horizontal_crosses_value !== null) ? $this->axisOptions['horizontal_crosses_value'] = (string) $horizontal_crosses_value : null;\n ($horizontal_crosses !== null) ? $this->axisOptions['horizontal_crosses'] = (string) $horizontal_crosses : null;\n ($axis_orientation !== null) ? $this->axisOptions['orientation'] = (string) $axis_orientation : null;\n ($major_tmt !== null) ? $this->axisOptions['major_tick_mark'] = (string) $major_tmt : null;\n ($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;\n ($minor_tmt !== null) ? $this->axisOptions['minor_tick_mark'] = (string) $minor_tmt : null;\n ($minimum !== null) ? $this->axisOptions['minimum'] = (string) $minimum : null;\n ($maximum !== null) ? $this->axisOptions['maximum'] = (string) $maximum : null;\n ($major_unit !== null) ? $this->axisOptions['major_unit'] = (string) $major_unit : null;\n ($minor_unit !== null) ? $this->axisOptions['minor_unit'] = (string) $minor_unit : null;\n }", "function setVerticalAlignment($verticalAlignment = 'top') {\t \r\n\t \tswitch ($verticalAlignment) {\t\t \r\n\t\t case 'top':\t\t\t\r\n\t\t\t\t$this->verticalAlignment = '\\clvertalt ';\t \t\t \r\n\t\t break;\r\n\t\t \r\n\t\t case 'center':\r\n\t\t\t\t$this->verticalAlignment = '\\clvertalc ';\t\t \r\n\t\t break;\r\n\t\t \r\n\t\t case 'bottom':\t\t \r\n\t\t\t\t$this->verticalAlignment = '\\clvertalb ';\r\n\t\t break;\r\n\t\t}\r\n\t}", "public function isVertical() {\n\t\t$this->direction=\"V\";\n\t}", "public function setAxes($val)\n {\n $this->_propDict[\"axes\"] = $val;\n return $this;\n }", "function kvell_edge_init_register_header_vertical_type() {\n\t\tadd_filter( 'kvell_edge_register_header_type_class', 'kvell_edge_register_header_vertical_type' );\n\t}", "public function makeVerticalRotation() {\n\t\t$this->addMakeVerticalRotationJs = true;\n\n\t\treturn $this;\n\t}", "function succulents_qodef_set_header_vertical_type_global_option( $header_types ) {\n\t\t$header_types['header-vertical'] = array(\n\t\t\t'image' => QODE_FRAMEWORK_HEADER_TYPES_ROOT . '/header-vertical/assets/img/header-vertical.png',\n\t\t\t'label' => esc_html__( 'Vertical', 'succulents' )\n\t\t);\n\t\t\n\t\treturn $header_types;\n\t}", "function kvell_edge_register_header_vertical_widget_areas() {\n\t\tregister_sidebar(\n\t\t\tarray(\n\t\t\t\t'id' => 'edgtf-vertical-area',\n\t\t\t\t'name' => esc_html__( 'Header Vertical Widget Area', 'kvell' ),\n\t\t\t\t'description' => esc_html__( 'Widgets added here will appear on the bottom of header vertical menu', 'kvell' ),\n\t\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s edgtf-vertical-area-widget\">',\n\t\t\t\t'after_widget' => '</div>',\n\t\t\t\t'before_title' => '<h5 class=\"edgtf-widget-title\">',\n\t\t\t\t'after_title' => '</h5>'\n\t\t\t)\n\t\t);\n\t}", "function verticalScrollSet() {\n register_widget( 'verticalScroll' );\n }", "protected function Axes()\n {\n if(!$this->show_axes)\n return $this->Labels();\n\n $this->CalcGrid();\n $main_y_axis = $this->y_axes[$this->main_y_axis];\n $main_x_axis = $this->x_axes[$this->main_x_axis];\n $y0 = $main_y_axis->Zero();\n $x0 = $main_x_axis->Zero();\n $x_axis_visible = $this->show_axis_h && $y0 >= 0 && $y0 <= $this->g_height;\n $y_axis_inside = $x0 >= 1 && $x0 < $this->g_width;\n $yoff = $x_axis_visible ? $y0 : 0;\n $xoff = $y_axis_inside ? $x0 : 0;\n $y_count = count($this->y_axes);\n\n $axis_group = $axes = $label_group = $divisions = $axis_text = '';\n if($this->show_axis_h)\n $axes .= $this->XAxis($yoff);\n if($this->show_axis_v) {\n for($i = 0; $i < $y_count; ++$i) {\n if(!is_null($this->y_axes[$i])) {\n $axes .= $this->YAxis($i);\n }\n }\n }\n\n if($axes != '') {\n $line = array();\n if(empty($this->axis_colour_h) || empty($this->axis_colour_v))\n $line['stroke'] = $this->axis_colour;\n if(empty($this->axis_stroke_width_h) || empty($this->axis_stroke_width_v))\n $line['stroke-width'] = $this->axis_stroke_width;\n $axis_group = empty($line) ? $axes : $this->Element('g', $line, NULL, $axes);\n }\n\n $text_offset = $this->DivisionOverlap($this->x_axes, $this->y_axes);\n if($this->show_axis_text_v) {\n for($i = 0; $i < $y_count; ++$i) {\n $axis = $this->y_axes[$i];\n if(!is_null($axis)) {\n $offset = ($this->label_centre && $this->flip_axes ? -0.5 * $axis->Unit() : 0);\n $points = $this->GetGridPointsY($i);\n $axis_text .= $this->YAxisText($points, \n $text_offset[$i > 0 ? 'r' : 'l'],\n $offset, $this->ArrayOption($this->axis_text_angle_v, $i),\n $i > 0, $i);\n }\n }\n }\n if($this->show_axis_text_h) {\n $axis = $main_x_axis;\n $offset = ($this->label_centre && !$this->flip_axes ? 0.5 * $axis->Unit() : 0);\n $points = $this->GetGridPointsX(0);\n $axis_text .= $this->XAxisText($points, $offset,\n $text_offset['b'], $this->axis_text_angle_h);\n }\n\n $label_group = $this->Labels($axis_text);\n\n if($this->show_divisions) {\n // use an array to join paths with same colour\n $div_paths = array();\n if($this->show_axis_h) {\n $points = $this->GetGridPointsX(0);\n $dx_path = $this->XAxisDivisions($points,\n $this->GetFirst($this->division_style_h, $this->division_style), \n $this->GetFirst($this->division_size_h, $this->division_size),\n $yoff);\n if(!empty($dx_path)) {\n $dx_colour = $this->GetFirst($this->division_colour_h,\n $this->division_colour, $this->axis_colour);\n if(isset($div_paths[$dx_colour]))\n $div_paths[$dx_colour] .= $dx_path;\n else\n $div_paths[$dx_colour] = $dx_path;\n }\n }\n if($this->show_axis_v) {\n for($i = 0; $i < $y_count; ++$i) {\n if(!is_null($this->y_axes[$i])) {\n $points = $this->GetGridPointsY($i);\n $dy_path = $this->YAxisDivisions($points,\n $i > 0 ? $this->g_width : $xoff, false, $i);\n if(!empty($dy_path)) {\n $dy_colour = $this->GetFirst(\n $this->ArrayOption($this->division_colour_v, $i),\n $this->division_colour,\n $this->ArrayOption($this->axis_colour_v, $i),\n $this->axis_colour);\n if(isset($div_paths[$dy_colour]))\n $div_paths[$dy_colour] .= $dy_path;\n else\n $div_paths[$dy_colour] = $dy_path;\n }\n }\n }\n }\n\n if($this->show_subdivisions) {\n if($this->show_axis_h) {\n $subdivs = $this->GetSubDivsX(0);\n $sdx_path = $this->XAxisDivisions($subdivs,\n $this->GetFirst($this->subdivision_style_h,\n $this->subdivision_style), \n $this->GetFirst($this->subdivision_size_h,\n $this->subdivision_size), $yoff);\n\n if(!empty($sdx_path)) {\n $sdx_colour = $this->GetFirst($this->subdivision_colour_h,\n $this->subdivision_colour, $this->division_colour_h,\n $this->division_colour, $this->axis_colour);\n if(isset($div_paths[$sdx_colour]))\n $div_paths[$sdx_colour] .= $sdx_path;\n else\n $div_paths[$sdx_colour] = $sdx_path;\n }\n }\n if($this->show_axis_v) {\n for($i = 0; $i < $y_count; ++$i) {\n if(!is_null($this->y_axes[$i])) {\n $subdivs = $this->GetSubDivsY($i);\n $sdy_path = $this->YAxisDivisions($subdivs,\n $i > 0 ? $this->g_width : $xoff, true, $i);\n if(!empty($sdy_path)) {\n $sdy_colour = $this->GetFirst(\n $this->ArrayOption($this->subdivision_colour_v, $i),\n $this->subdivision_colour,\n $this->ArrayOption($this->division_colour_v, $i),\n $this->division_colour,\n $this->ArrayOption($this->axis_colour_v, $i),\n $this->axis_colour);\n if(isset($div_paths[$sdy_colour]))\n $div_paths[$sdy_colour] .= $sdy_path;\n else\n $div_paths[$sdy_colour] = $sdy_path;\n }\n }\n }\n }\n }\n\n foreach($div_paths as $colour => $path) {\n $div = array(\n 'd' => $path,\n 'stroke-width' => 1,\n 'stroke' => $colour\n );\n $divisions .= $this->Element('path', $div);\n }\n }\n return $divisions . $axis_group . $label_group;\n }", "public function getVerticalMetrics() {}", "public function getYAxis();", "public function hAxis(HorizontalAxis $hAxis)\n {\n $this->addOption($hAxis->toArray('hAxis'));\n\n return $this;\n }", "public function __construct(Video $video)\n {\n $this->video = $video;\n $target = $this->video->target;\n\n $size = explode('x', $target['size']);\n $this->dimension = new Dimension($size[0], $size[1]);\n }", "function iver_select_set_header_vertical_type_global_option( $header_types ) {\n\t\t$header_types['header-vertical'] = array(\n\t\t\t'image' => SELECT_FRAMEWORK_HEADER_TYPES_ROOT . '/header-vertical/assets/img/header-vertical.png',\n\t\t\t'label' => esc_html__( 'Vertical', 'iver' )\n\t\t);\n\t\t\n\t\treturn $header_types;\n\t}", "protected function GetAxisEnds()\n {\n // check guides\n if(is_null($this->guidelines))\n $this->CalcGuidelines();\n\n $v_max = $v_min = $k_max = $k_min = array();\n $y_axis_count = $this->YAxisCount();\n $x_axis_count = $this->XAxisCount();\n if($this->flip_axes) {\n $x_min_fixed = $this->axis_min_v;\n $x_max_fixed = $this->axis_max_v;\n $y_min_fixed = $this->axis_min_h;\n $y_max_fixed = $this->axis_max_h;\n } else {\n $y_min_fixed = $this->axis_min_v;\n $y_max_fixed = $this->axis_max_v;\n $x_min_fixed = $this->axis_min_h;\n $x_max_fixed = $this->axis_max_h;\n }\n\n for($i = 0; $i < $y_axis_count; ++$i) {\n $fixed_max = $this->ArrayOption($y_max_fixed, $i);\n $fixed_min = $this->ArrayOption($y_min_fixed, $i);\n\n // validate\n if(is_numeric($fixed_min) && is_numeric($fixed_max) &&\n $fixed_max < $fixed_min)\n throw new Exception(\"Invalid Y axis options: min > max ({$fixed_min} > {$fixed_max})\");\n\n if(is_numeric($fixed_min)) {\n $v_min[] = $fixed_min;\n } else {\n $minv_list = array($this->GetAxisMinValue($i));\n if(!is_null($this->min_guide['y']))\n $minv_list[] = (float)$this->min_guide['y'];\n\n // if not a log axis, start at 0\n if(!$this->ArrayOption($this->log_axis_y, $i))\n $minv_list[] = 0;\n $v_min[] = min($minv_list);\n }\n\n if(is_numeric($fixed_max)) {\n $v_max[] = $fixed_max;\n } else {\n $maxv_list = array($this->GetAxisMaxValue($i));\n if(!is_null($this->max_guide['y']))\n $maxv_list[] = (float)$this->max_guide['y'];\n\n // if not a log axis, start at 0\n if(!$this->ArrayOption($this->log_axis_y, $i))\n $maxv_list[] = 0;\n $v_max[] = max($maxv_list);\n }\n if($v_max[$i] < $v_min[$i])\n throw new Exception(\"Invalid Y axis: min > max ({$v_min[$i]} > {$v_max[$i]})\");\n }\n\n for($i = 0; $i < $x_axis_count; ++$i) {\n $fixed_max = $this->ArrayOption($x_max_fixed, $i);\n $fixed_min = $this->ArrayOption($x_min_fixed, $i);\n\n if($this->datetime_keys) {\n // 0 is 1970-01-01, not a useful minimum\n if(empty($fixed_max)) {\n $k_max[] = $this->GetAxisMaxKey($i);\n } else {\n $d = SVGGraphDateConvert($fixed_max);\n // subtract a se\n if(!is_null($d))\n $k_max[] = $d - 1;\n else\n throw new Exception(\"Could not convert [{$fixed_max}] to datetime\");\n }\n if(empty($fixed_min)) {\n $k_min[] = $this->GetAxisMinKey($i);\n } else {\n $d = SVGGraphDateConvert($fixed_min);\n if(!is_null($d))\n $k_min[] = $d;\n else\n throw new Exception(\"Could not convert [{$fixed_min}] to datetime\");\n }\n } else {\n // validate\n if(is_numeric($fixed_min) && is_numeric($fixed_max) &&\n $fixed_max < $fixed_min)\n throw new Exception(\"Invalid X axis options: min > max ({$fixed_min} > {$fixed_max})\");\n\n if(is_numeric($fixed_max))\n $k_max[] = $fixed_max;\n else\n $k_max[] = max(0, $this->GetAxisMaxKey($i), (float)$this->max_guide['x']);\n if(is_numeric($fixed_min))\n $k_min[] = $fixed_min;\n else\n $k_min[] = min(0, $this->GetAxisMinKey($i), (float)$this->min_guide['x']);\n }\n if($k_max[$i] < $k_min[$i])\n throw new Exception(\"Invalid X axis: min > max ({$k_min[$i]} > {$k_max[$i]})\");\n }\n return compact('v_max', 'v_min', 'k_max', 'k_min');\n }", "public function setYAxis($y);", "public function isVertical()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function axis($value) {\n return $this->setProperty('axis', $value);\n }", "public function axis($value) {\n return $this->setProperty('axis', $value);\n }" ]
[ "0.7110623", "0.64716506", "0.6348956", "0.5642459", "0.5398261", "0.53171945", "0.5275117", "0.5235656", "0.51376665", "0.50703806", "0.5022218", "0.50192255", "0.49895734", "0.4925289", "0.4907901", "0.4866567", "0.4858949", "0.4836423", "0.48348534", "0.4817004", "0.4807505", "0.4771343", "0.47201264", "0.46097192", "0.45752114", "0.45670834", "0.45501596", "0.45016378", "0.4489999", "0.4489999" ]
0.660422
1
This method will get a description for the shipping on pdfs
public function getPdfShippingDescription(Order $order) { $description = $order->getShippingDescription(); if ($order->getShippingMethod() !== Gfs::METHOD_CODE) { return $description; } $gfsShippingData = $this->getGfsShippingData($order); if (empty($gfsShippingData)) { return $description; } switch ($gfsShippingData['shippingMethodType']) { case 'standard': case 'calendar': $standard = $this->_getStandardDescription($order); if ($standard) { $description = $standard; } break; case 'droppoint': $dropPoint = $this->_getDropPointDescription($order); if ($dropPoint) { $description = $dropPoint; } break; } return $description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShippingDescription();", "public function get_pdfs() {\n\t\treturn apply_filters( 'wc_product_catalog_pdfs', $this->pdfs, $this );\n\t}", "public function getShippingDetails();", "public function getShippingInfo();", "function getDescription() {\n\t\tswitch ($this->type) {\n\t\t\tcase PAYMENT_TYPE_PURCHASE_FILE:\n\t\t\t\treturn __('payment.directSales.monograph.description');\n\t\t\tdefault:\n\t\t\t\t// Invalid payment ID\n\t\t\t\tassert(false);\n\t\t}\n\t}", "public function getDeliverydesc()\n {\n return $this->deliverydesc;\n }", "public function getDescrip()\n {\n return $this->descrip;\n }", "public function getShippingInformation(){\n return $this->_getData(self::SHIPPING_INFORMATION);\n }", "public function get_packaging_details() : array {\n\t\t$items = $this->get_packing_items();\n\t\tif ( empty( $items ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t$out = [];\n\t\tforeach ( $items as $item ) {\n\t\t\t$item_type = $item->find( '.packaging-title' );\n\t\t\t$value = $item->find( '.packaging-des' );\n\t\t\tif ( ! $item_type || ! $value ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$label = str_replace( ':', '', sanitize_text_field( $item_type[0]->text() ) );\n\t\t\t$slug = sanitize_title( $label );\n\n\t\t\tswitch ( $slug ) {\n\t\t\t\tcase 'package-weight':\n\t\t\t\t\t$value = [\n\t\t\t\t\t\t'weight' => floatval( $value[0]->getAttribute( 'rel' ) ),\n\t\t\t\t\t\t'unit' => apply_filters( 'jays_aliex_get_default_shipping_unit', 'kg', $value ),\n\t\t\t\t\t];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'package-size':\n\t\t\t\t\t$value = [\n\t\t\t\t\t\t'size' => array_combine( [ 'length', 'width', 'height' ], array_map( 'intval', explode( '|', $value[0]->getAttribute( 'rel' ) ) ) ),\n\t\t\t\t\t\t'unit' => apply_filters( 'jays_aliex_get_default_size_unit', 'cm', $value ),\n\t\t\t\t\t];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$value = $value[0]->text();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$out[ $slug ] = $value;\n\t\t}\n\n\t\treturn [ 'packaging-details' => $out ];\n\t}", "public function getShipping();", "public function toString()\n {\n return \"Shipping section fits\";\n }", "function shippingDetails($order) {\n echo '<h2>Shipping details</h2>';\n echo get_post_meta( $order->id, 'shippingMethod', true );\n }", "private function getShippingInformation()\n {\n $street = \"\";\n $number = \"\";\n $complement = \"\";\n $district = \"\";\n\n $fullAddress = $this->addressConfig($this->shippingData['street']);\n $street = $fullAddress[0] != '' ? $fullAddress[0] : $this->addressConfig($this->shippingData['street']);\n $number = is_null($fullAddress[1]) ? '' : $fullAddress[1];\n $complement = is_null($fullAddress[2]) ? '' : $fullAddress[2];\n $district = is_null($fullAddress[3]) ? '' : $fullAddress[3];\n\n $PagSeguroShipping = new PagSeguroShipping();\n $PagSeguroAddress = new PagSeguroAddress();\n $PagSeguroAddress->setCity($this->shippingData['city']);\n $PagSeguroAddress->setPostalCode(self::fixPostalCode($this->shippingData['postcode']));\n $PagSeguroAddress->setState($this->shippingData['region']);\n $PagSeguroAddress->setStreet($street);\n $PagSeguroAddress->setNumber($number);\n $PagSeguroAddress->setComplement($complement);\n $PagSeguroAddress->setDistrict($district);\n $PagSeguroShipping->setAddress($PagSeguroAddress);\n\n return $PagSeguroShipping;\n }", "private function getPurchasePageData(){\n\t\t$this->template->imgurl = $this->getParam('imgurl');\n\t\tif ($this->isError()) {\n\t\t\treturn;\n\t\t}\n\t\t$this->getItem();\n\t\tif ($this->isError()) {\n\t\t\treturn;\n\t\t}\n\t\n\t\t// TODO Add 'name' to productdata\n\t\t$itemView = $this->template->item;\n\t\t$name = substr($itemView->description, 0, 35);\n\t\t$itemView->name = $name . '...';\n\n\t\t// Build shippng costs (including insurance)\n\t\t$shippingbase = shop_shipping_fee;\n\t\t$optionShipping = array();\n\t\t$options = $itemView->options;\n\t\tfor ($i = 0; $i < sizeof($options); $i++) {\n\t\t\t$option = $options[$i];\n\t\t\tif ($option->price < 100) {\n\t\t\t\t$ship = $shippingbase + 4;\n\t\t\t} else {\n\t\t\t\t$ship = $shippingbase + 8;\n\t\t\t}\n\t\t\t$optionShipping[$option->seq] = $ship;\n\t\t}\n\t\t$this->template->optionShipping = $optionShipping;\n\t\t\n\t\tLogger::info('Purchase page view ['.$this->template->item->id.']['.$this->template->item->code.']');\n\t}", "public function descargar_pdf(){\n $zonas=Zona::join('colonia','zona.id','=','colonia.id_zona')\n ->join('permiso','permiso.id_colonia','=','colonia.id')\n ->select('zona.*',DB::raw('count(permiso.id)as total'))\n ->groupBy('zona.id')\n ->get();\n\n $pdf=\\PDF::loadView('Pdfs.zonas',compact('zonas'));\n\n return $pdf->stream();\n }", "function get_the_archive_description()\n {\n }", "function get_pictures_and_pdf() {\n\tif ( is_singular( 'companies' ) ) {\n\t\t$field_name = 'company_pictures_and_pdf';\n\t}\n\tif ( is_singular( 'group_of_companies' ) ) {\n\t\t$field_name = 'group_of_companies_pictures_and_pdf';\n\t}\n\tif ( get_field($field_name) ) {\n\t\t$file_ids = get_field($field_name);\n\t\tforeach ($file_ids as $file_id) {\n\t\t\t$file_type = $file_id['mime_type'];\n\t\t\tif ($file_type == 'application/pdf') {\n\t\t\t\t$my_thumbnail_id = get_post_thumbnail_id($file_id['id']);\n\t\t\t\t?>\n\t\t\t\t<div class=\"item\">\n\t\t\t\t\t<a href=\"<?php echo wp_get_attachment_url($file_id['id']); ?>\">\n\t\t\t\t\t\t<img src=\"<?php echo wp_get_attachment_url( $my_thumbnail_id ); ?>\" alt=\"Owl Image\">\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\telse {\n\t\t\t\t?>\n\t\t\t\t<div class=\"item\">\n\t\t\t\t\t<a href=\"<?php echo $file_id['url']; ?>\">\n\t\t\t\t\t\t<img src=\"<?php echo $file_id['url']; ?>\" alt=\"Owl Image\">\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}\n\t}\n}", "public function getPromotionalShippingDiscountDetails()\n {\n return $this->promotionalShippingDiscountDetails;\n }", "function title($ship_id)\n\n{\n\n $shipping_data=$this->shipping->get_data_with_single_cond($ship_id,'shipping_details','id');\n\n\n\n $table_name=$shipping_data[0]['table_name'];\n\n $shipping_details=$this->finddeliveries->get_shipment_by_shiiping_id($ship_id,$table_name);\n\n// print_r($shipping_details);\n\n// die;\n\n if($shipping_details[0]['title']!='') {return substr(str_replace(' ','-',$shipping_details[0]['title']),0,10);}elseif($shipping_details[0]['delivery_title']!=''){return substr(str_replace(' ','-',$shipping_details[0]['delivery_title']),0,10);}else {return substr(str_replace(' ','-',$shipping_details[0]['description']), 0,10);}\n\n}", "function get_desc_file_fields() {\n\treturn array (\n\t\t\t\"Taxonomic name (Name)\",\n\t\t\t\"Diagnostic Description\",\n\t\t\t\"Distribution\",\n\t\t\t\"Habitat\",\n\t\t\t\"Size\",\n\t\t\t\"Habitus image\",\n\t\t\t\"Morphological Description\",\n\t\t\t\"Habitat image\",\n\t\t\t\"Simlar Species (Name)\",\n\t\t\t\"Pronotum image\",\n\t\t\t\"Elytral microsculpture\",\n\t\t\t\"Genitalia left image\",\n\t\t\t\"General description\",\n\t\t\t\"Genetics\" \n\t);\n}", "public function getProdDescription()\n {\n return $this->prod_description;\n }", "public function getBookingInvoicePDF()\n {\n $return = array();\n return $return;\n }", "public function downloadPDF(){\n $classrooms_data = $this->getClassesInformation();\n $pdf = PDF::loadView('pdf', compact('classrooms_data'));\n return $pdf->download('Classrooms Information.pdf');\n }", "function show_product_pdf($content){\n // Only for single product pages (woocommerce)\n if (is_product()){\n global $post;\n $custom_content = \"\";\n if(isset($post->_pdf_id)){\n $pdfs = get_children( array (\n 'post_parent' => $post->ID,\n 'post_type' => 'attachment',\n 'post_mime_type' => 'application/pdf',\n 'orderby' => 'ID',\n 'order' => 'ASC'\n ));\n if (!empty($pdfs)) {\n $custom_content = __(\"<p><strong><u>Downloads</u></strong></p>\", \"rentalshop\");\n $custom_content.= \"<p>\";\n foreach ( $pdfs as $attachment_id => $attachment ) {\n $custom_content.='<a href=\"' . $attachment->guid . '\" target=\"_blank\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i> ' . $attachment->post_title . '</a><br>';\n }\n $custom_content.= \"</p>\";\n $content.= $custom_content;\n }\n }\n }\n return $content;\n }", "public function createPDF()\n {\n $soxId = $this->getEditObjectId();\n if ($soxId != \"-1\" && isset($soxId)) {\n // load object\n $oOrder = oxNew(\"oxorder\");\n if ($oOrder->load($soxId)) {\n $oUtils = oxRegistry::getUtils();\n $sTrimmedBillName = trim($oOrder->oxorder__oxbilllname->getRawValue());\n $sFilename = $oOrder->oxorder__oxordernr->value . \"_\" . $sTrimmedBillName . \".pdf\";\n $sFilename = $this->makeValidFileName($sFilename);\n ob_start();\n $oOrder->genPDF($sFilename, oxRegistry::getConfig()->getRequestParameter(\"pdflanguage\"));\n $sPDF = ob_get_contents();\n ob_end_clean();\n $oUtils->setHeader(\"Pragma: public\");\n $oUtils->setHeader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n $oUtils->setHeader(\"Expires: 0\");\n $oUtils->setHeader(\"Content-type: application/pdf\");\n $oUtils->setHeader(\"Content-Disposition: attachment; filename=\" . $sFilename);\n oxRegistry::getUtils()->showMessageAndExit($sPDF);\n }\n }\n }", "public function exportpdfAction(){ \r\n $id = $this->_getParam('id'); \r\n $sympC = new SympathieCollection();\r\n $symp = $sympC->getDetails($id);\r\n $obiC = new ObituaryCollection();\r\n $obi = $obiC->getDetailsFromNoContract($symp['SD_noContract']); \r\n $newFileName = \"text\"; \r\n\r\n define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../../../lib/');\r\n require(PHPEXCEL_ROOT . 'PHPExcel/fpdf/fpdf.php');\r\n $pdf = new FPDF();\r\n $pdf->SetLeftMargin(25);\r\n $pdf->SetRightMargin(25); \r\n $pdf->AddPage(); \r\n $pdf->Image(Zend_Registry::get('absolute_web_root') . $symp['SD_Theme'], 0, 0,210, 290); \r\n $pdf->SetFont('Times','',17);\r\n $pdf->SetY(99);\r\n $pdf->MultiCell(0,0, utf8_decode($this->view->getCibleText('sympathie_famille') . \" \" . $obi['OD_FirstName'] . \" \" . $obi['OD_Name']),0,C); \r\n $pdf->SetFont('Times','',14);\r\n $pdf->SetY(107);\r\n $pdf->MultiCell(0,0, utf8_decode($this->view->getCibleText('sympathie_from') . \" \" . $symp['SD_Name']),0,C); \r\n $pdf->SetFont('Times','',9);\r\n $pdf->SetY(114);\r\n $pdf->write(5, utf8_decode($symp['SD_Text']));\r\n\r\n $pdf->Output();\r\n exit;\r\n }", "public function getShippingDetails()\n {\n return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails;\n }", "public function printPDF()\n {\n $data = [\n 'title' => 'First PDF for Medium',\n 'heading' => 'Hello from 99Points.info',\n 'content' => \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.\"\n ];\n\n $pdf = PDF::loadView('pdf_view', $data);\n return $pdf->download('medium.pdf');\n }", "public function getDescription(){\n\t\treturn \"Calculate total disk usage to display in the about dialog.\";\n\t}", "abstract protected function extractProductDetail();" ]
[ "0.70815915", "0.62952274", "0.6285794", "0.62541986", "0.6068779", "0.5902405", "0.5873919", "0.5822868", "0.5787383", "0.5757282", "0.5746223", "0.57032514", "0.56932575", "0.5671137", "0.5592489", "0.55664", "0.5519333", "0.55161095", "0.5490061", "0.54784393", "0.5472338", "0.5447478", "0.5445655", "0.5443279", "0.541452", "0.5413333", "0.5405999", "0.5401329", "0.5394606", "0.5385481" ]
0.70847124
0
Check whether there is available supported Storage engine
protected static function check_dependencies_storage ($storage_support) { /** * Component doesn't support (and thus use) any Storage engines, so we don't care what system have */ if (!$storage_support) { return true; } $Core = Core::instance(); $Config = Config::instance(); if (in_array($Core->storage_type, $storage_support)) { return true; } foreach ($Config->storage as $storage) { if (in_array($storage['connection'], $storage_support)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_storage_driver($driver)\n{\n if (is_array($driver)) {\n return in_array(config('filesystems.default'), $driver);\n }\n\n return config('filesystems.default') === $driver;\n}", "function getStorageEngine() {\n \treturn $this->storage_engine;\n }", "function is_upload_space_available()\n {\n }", "public function isSupported();", "public function isSupported();", "static public function isSupported();", "public function isSupported() {\n return is_array($this->_quotausage);\n }", "public static function isSupported(): bool;", "public function checkGCSUsage()\n {\n if (is_null($this->useGCS)) {\n $currentStorage = (int)$this->scopeConfig->getValue(Storage::XML_PATH_STORAGE_MEDIA);\n $this->useGCS = $currentStorage == Storage::STORAGE_MEDIA_GCS;\n }\n return $this->useGCS;\n }", "public function isSupported(): bool;", "function get_upload_space_available()\n {\n }", "public function isSupported() {\n\t\treturn class_exists('Salt');\n\t}", "public function testIsStorageChecksStoragesProperly()\n {\n mkdir(self::$temp.DS.'help');\n file_put_contents(self::$temp.DS.'help'.DS.'foo.txt', 'contents');\n\n $this->assertTrue(Storage::isfile(self::$temp.DS.'help'.DS.'foo.txt'));\n $this->assertFalse(Storage::isfile(self::$temp.DS.'.'.DS.'help'));\n }", "abstract function isSupported(): bool;", "public static function isSupported()\n\t{\n\t\treturn true;\n\t}", "public static function isSupported()\n\t{\n\t\treturn true;\n\t}", "public static function isSupported()\n {\n return true;\n }", "function get_storage()\n{\n return env('FILESYSTEM_DRIVER');\n}", "public function getStorageService();", "public function getSupportedInputStorageFormats()\n {\n return $this->supported_input_storage_formats;\n }", "public function isSupported()\n {\n return true;\n }", "public function isSupported()\n {\n return true;\n }", "public function isSupported()\n {\n return true;\n }", "public function check()\n\t{\n\t\t$output = false;\n\n\t\tif($this->storage == self::STORAGE_FILE)\n\t\t{\n\n\t\t}\n\t\telseif($this->storage == self::STORAGE_APC)\n\t\t{\n\t\t\t$output = apc_exists($this->key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_REDIS)\n\t\t{\n\t\t\tif(self::$redis != null)\n\t\t\t\t$output = self::$redis->exists($key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_MEMCACHED)\n\t\t{\n\t\t\tif(self::$memcached != null)\n\t\t\t\t$output = self::$memcached->get($key) !== false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->storageException();\n\t\t}\n\n\t\treturn $output;\n\t}", "protected function isStorageDiskAvailable($driver)\n {\n return array_key_exists($driver, config('filesystems.disks', []));\n }", "public function is_supported()\n\t{\n\t\treturn true;\n\t}", "public static function isSupported()\n {\n return static::$supported;\n }", "public function isSupported() {\n return $this->cacheFilePath \n && is_dir($this->cacheFilePath) \n && is_writable($this->cacheFilePath);\n }", "public function getStorage() {}", "public function getStorage() {}" ]
[ "0.68390554", "0.6684502", "0.6496166", "0.6267328", "0.6267328", "0.6219662", "0.61985147", "0.61971486", "0.6181", "0.616087", "0.6117043", "0.6073895", "0.6072785", "0.6026296", "0.6024339", "0.6024339", "0.6020639", "0.60188633", "0.59978634", "0.5994162", "0.595709", "0.595709", "0.595709", "0.5950487", "0.5947442", "0.5916036", "0.5871237", "0.5833639", "0.58319426", "0.5831399" ]
0.705407
0
Normalize structure of `meta.json` Addition necessary items if they are not present and casting some string values to arrays in order to decrease number of checks in further code
protected static function normalize_meta ($meta) { foreach (['db_support', 'storage_support', 'provide', 'require', 'conflict'] as $item) { $meta[$item] = isset($meta[$item]) ? (array)$meta[$item] : []; } foreach (['require', 'conflict'] as $item) { $meta[$item] = self::dep_normal($meta[$item]); } return $meta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apply_json_filter( $_post, $post, $context )\n{\n $_post['meta'] = array_merge($_post['meta'],get_fields($post['ID']));\n return $_post;\n}", "function normalize_json_data($json){\n $sums\t= array(); \n foreach($json['label'] as $k=>$v){$sums[$k]=0;} //initialize sums array\n foreach($json['values'] as $val){\t\n foreach($val['values'] as $k=>$v){\n\t$sums[$k] = $sums[$k] + $v;\n }\n }\n \n //second step: normalize the data\n foreach($json['values'] as $index=>$val){\n foreach($val['values'] as $k=>$v){\n\t$norm\t= round(100*$v/$sums[$k]);\n\t$json['values'][$index]['values'][$k] = $norm;\n }\n }\n \n //$json['values'] = $new_values;\n return $json; \n }", "private static function normalize($data)\n {\n $normalized = array();\n foreach ($data as $key => $value) {\n if (in_array($key, self::$documentInfoFields)) {\n $normalized['Info'][$key] = $value;\n } elseif (is_array($value)) {\n if (!isset($normalized[$key])) {\n $normalized[$key] = array();\n }\n $normalized[$key] = array_merge($normalized[$key], $value);\n }\n }\n return $normalized;\n }", "function clean_json_content_array($kind, $content_json_data, $remove_id_field = true, $remove_functions_field = true, $encoded_sub_fields = array()){\n // Make a copy of the origin al JSON data\n $cleaned_json_data = $content_json_data;\n // Remove any known unnecessary or deprecated fields from the data\n if ($remove_id_field){ unset($cleaned_json_data[$kind.'_id']); }\n if ($remove_functions_field){ unset($cleaned_json_data[$kind.'_functions']); }\n if (true){ unset($cleaned_json_data[$kind.'_flag_protected']); }\n // Loop through fields and set any psudeo-empty fields to actally empty\n //foreach ($cleaned_json_data AS $k => $v){ if ($v === '[]'){ $cleaned_json_data[$k] = ''; } }\n // Check to see if there are fields we need to remove before export\n if (method_exists('rpg_'.$kind, 'get_fields_excluded_from_json_export')){\n $skip_fields_on_json_export = call_user_func(array('rpg_'.$kind, 'get_fields_excluded_from_json_export'));\n if (!empty($skip_fields_on_json_export)){ foreach ($skip_fields_on_json_export AS $field){ unset($cleaned_json_data[$field]); } }\n }\n // If not empty, loop through any encoded sub-fields and auto-expand them\n if (empty($encoded_sub_fields)\n && method_exists('rpg_'.$kind, 'get_json_index_fields')){\n $encoded_sub_fields = call_user_func(array('rpg_'.$kind, 'get_json_index_fields'));\n }\n if (!empty($encoded_sub_fields)){\n foreach ($encoded_sub_fields AS $sub_field_name){\n $sub_field_value = $cleaned_json_data[$sub_field_name];\n if (!empty($sub_field_value)){\n $fchar = substr($sub_field_value, 0, 1);\n $lchar = substr($sub_field_value, -1, 1);\n if (($fchar === '{' && $lchar === '}') || ($fchar === '[' && $lchar === ']')){\n $sub_field_value = json_decode($sub_field_value, true);\n } else {\n $sub_field_value = array(trim($sub_field_value));\n }\n } else {\n $sub_field_value = array();\n }\n $cleaned_json_data[$sub_field_name] = $sub_field_value;\n }\n }\n // If there are an image editor fields, translate them to contributor IDs\n global $user_ids_to_contributor_usernames;\n $image_fields = array($kind.'_image_editor', $kind.'_image_editor2');\n foreach ($image_fields AS $image_field){\n if (!isset($cleaned_json_data[$image_field])){ continue; }\n if (!empty($cleaned_json_data[$image_field])){\n $user_id = $cleaned_json_data[$image_field];\n if (!empty($user_ids_to_contributor_usernames[$user_id])){\n $contributor_name = $user_ids_to_contributor_usernames[$user_id];\n $cleaned_json_data[$image_field] = $contributor_name;\n }\n } else {\n $cleaned_json_data[$image_field] = '';\n }\n }\n // If there is game field, convert it to the newer format\n if (isset($cleaned_json_data[$kind.'_game'])){\n $xkind = preg_match('/y$/i', $kind) ? substr($kind, 0, -1).'ies' : $kind.'s';\n $new_game_data = migrate_object_game_settings_to_new_format($kind, $xkind, $cleaned_json_data);\n $cleaned_json_data[$kind.'_game'] = $new_game_data[$kind.'_game'];\n }\n // Return the cleaned JSON data\n $cleaned_json_data = $cleaned_json_data;\n return $cleaned_json_data;\n}", "function prepareFields() {\r\n\t\t$data = array_keys($this->modx->getFieldMeta('msProductData'));\r\n\t\tforeach ($this->resourceArray as $k => $v) {\r\n\t\t\tif (is_array($v) && in_array($k, $data)) {\r\n\t\t\t\t$tmp = $this->resourceArray[$k];\r\n\t\t\t\t$this->resourceArray[$k] = array();\r\n\t\t\t\tforeach ($tmp as $v2) {\r\n\t\t\t\t\tif (!empty($v2)) {\r\n\t\t\t\t\t\t$this->resourceArray[$k][] = array('value' => $v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (empty($this->resourceArray['vendor'])) {\r\n\t\t\t$this->resourceArray['vendor'] = '';\r\n\t\t}\r\n\t}", "public function safeUp()\n\t{\n\t $json = '{\"content\":{\"entries\":[{\"slug\":\"sample-speaking-event\",\"section\":\"events\",\"locales\":{\"en_us\":{\"slug\":\"sample-speaking-event\",\"section\":\"events\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-10-14 18:56:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Sample Speaking Event\",\"entryType\":\"events\",\"eventDescription\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\",\"date\":{\"date\":\"2018-01-26 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"location\":\"Some location\"}}},{\"slug\":\"sample-workshop-event\",\"section\":\"events\",\"locales\":{\"en_us\":{\"slug\":\"sample-workshop-event\",\"section\":\"events\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-10-14 18:57:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Sample Workshop Event\",\"entryType\":\"events\",\"eventDescription\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\",\"date\":{\"date\":\"2017-12-22 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"location\":\"Boston, MA\"}}},{\"slug\":\"sample-other-event\",\"section\":\"events\",\"locales\":{\"en_us\":{\"slug\":\"sample-other-event\",\"section\":\"events\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-10-14 18:57:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Sample Other Event\",\"entryType\":\"events\",\"eventDescription\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\",\"date\":{\"date\":\"2017-12-28 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"location\":\"Some location\"}}},{\"slug\":\"resource-1\",\"section\":\"resources\",\"locales\":{\"en_us\":{\"slug\":\"resource-1\",\"section\":\"resources\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-10-14 19:18:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"AWIS Presentation\",\"entryType\":\"resources\",\"description\":\"PPT slides from AWIS presentation\",\"resourceFile\":[{\"elementType\":\"Asset\",\"filename\":\"AWIS-presentation.pptx\",\"folder\":\"Resources\",\"source\":\"resources\"}]}}},{\"slug\":\"resource-2\",\"section\":\"resources\",\"locales\":{\"en_us\":{\"slug\":\"resource-2\",\"section\":\"resources\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-10-14 19:19:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Slides for GRI Presentation\",\"entryType\":\"resources\",\"description\":\"PowerPoint of slides from GRI presentation\",\"resourceFile\":[{\"elementType\":\"Asset\",\"filename\":\"Slides-for-GRI.pptx\",\"folder\":\"Resources\",\"source\":\"resources\"}]}}},{\"slug\":\"resource-3\",\"section\":\"resources\",\"locales\":{\"en_us\":{\"slug\":\"resource-3\",\"section\":\"resources\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-10-14 19:19:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Reset Book Club Discussion Guide\",\"entryType\":\"resources\",\"description\":\"Draft of Reset Book Club discussion guide and talking points\",\"resourceFile\":[{\"elementType\":\"Asset\",\"filename\":\"Reset-Book-Club-Discussion-Guide.doc\",\"folder\":\"Resources\",\"source\":\"resources\"}]}}},{\"slug\":\"resource-4\",\"section\":\"resources\",\"locales\":{\"en_us\":{\"slug\":\"resource-4\",\"section\":\"resources\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-10-14 19:19:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Mentalligence Book Club Discussion Guide\",\"entryType\":\"resources\",\"description\":\"\",\"resourceFile\":[{\"elementType\":\"Asset\",\"filename\":\"Mentalligence-Book-Club.doc\",\"folder\":\"Resources\",\"source\":\"resources\"}]}}},{\"slug\":\"resource-5\",\"section\":\"resources\",\"locales\":{\"en_us\":{\"slug\":\"resource-5\",\"section\":\"resources\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-16 05:18:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Dr. Kris Speaking Packet 2017\",\"entryType\":\"resources\",\"description\":\"Speakers packet for Dr. Kris, updated Nov. 2017\",\"resourceFile\":[{\"elementType\":\"Asset\",\"filename\":\"Dr.-Kristen-Lee-Speakers-Packet-2017.pdf\",\"folder\":\"Resources\",\"source\":\"resources\"}]}}},{\"slug\":\"resource-6\",\"section\":\"resources\",\"locales\":{\"en_us\":{\"slug\":\"resource-6\",\"section\":\"resources\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-16 05:18:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Reset Model PDF\",\"entryType\":\"resources\",\"description\":\"PDF of the model covered by RESET\",\"resourceFile\":[{\"elementType\":\"Asset\",\"filename\":\"Dr.-Kristen-Lee-Reset-Model-PDF.pdf\",\"folder\":\"Resources\",\"source\":\"resources\"}]}}},{\"slug\":\"arrived-at-the-family-party\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"arrived-at-the-family-party\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:13:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Arrived at the family party\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"1974-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"IPhones weren\\u2019t a thing\\u2014plus I was always crying, so this is earliest available baby picture without tantrum mode.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"File0212.bmp\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"my-obsession-with-words-already-in-full-bloom\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"my-obsession-with-words-already-in-full-bloom\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:13:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"My obsession with words already in full bloom\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"1983-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"I took being a book worm literally\\u2014my favorite read in third grade was \\u201cHow to Eat Fried Worms\\u201d. Yes, my legs took up my entire body; teeth entire face.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"File0215.bmp\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"mrs-hermann-my-10th-grade-english-teacher-teenage-idol-nudged-me-to-take-my-first-public-platform\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"mrs-hermann-my-10th-grade-english-teacher-teenage-idol-nudged-me-to-take-my-first-public-platform\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:14:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Mrs. Hermann, my 10th grade English teacher/teenage idol nudged me to take my first public platform\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"1990-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"The speech competition theme was \\u201cIf you could change one thing in the world\\u2026\\u201d and mine was on \\u201cracism and stereotyping\\u201d. Despised it then, still do now. Look at those bangs!\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"1990.jpg\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"tori-my-starlight-was-born-on-a-full-moon\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"tori-my-starlight-was-born-on-a-full-moon\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:14:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Tori, my starlight was born on a full moon\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"1996-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"After the big event, I couldn\\u2019t sleep for two full days. Couldn\\u2019t take my eyes her. Still can\\u2019t.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"1996_tori.jpg\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"time-to-start-officially-adulting\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"time-to-start-officially-adulting\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:20:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Time to start officially adulting\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"1996-12-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"Why not have three major rites of passage all within six months? Baby, college graduation, marriage. Definition of \\u201csleeping in\\u201d changed forever.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"1996adul ting.jpg\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"friday-the-13th-became-lucky\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"friday-the-13th-became-lucky\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:21:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Friday the 13th became lucky\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"1999-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"Ryan enters the scene. He\\u2019s a charmer, right from his grand entrance. Some things never change.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"1999_ryan.JPG\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"graduated-from-boston-university-school-of-social-work\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"graduated-from-boston-university-school-of-social-work\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:21:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Graduated from Boston University School of Social Work\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"2000-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"On a mission with my master\\u2019s in tow. Totally green and overzealous, but I eventually ripened. Still overzealous.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"2 000bu.jpg\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"reset-inception\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"reset-inception\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:21:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"RESET inception\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"2008-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"Developed clinical model in response to consistent requests for strategies that actually work. Right?\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"RESET INCEPTION.jpg\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"graduated-from-northeastern-university\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"graduated-from-northeastern-university\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:22:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Graduated from Northeastern University\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"2011-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"My studies focused on burnout; ironically became my own case study. A freshly minted doctor, I thought those new letters would make me shiny and bulletproof. Still had a lot to learn/unlearn/relearn.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"2011 Graduate from Northeastern.jpg\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"we-blinked\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"we-blinked\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:23:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"We blinked\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"2014-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"Tori graduates and moves to DC, Ryan moves up to high school. That empty nest. Nothing can prepare you for it.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"2014 Graduation, empty nestTori and Ryan.JPG\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"published-reset-make-the-most-of-your-stress-on-halloween\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"published-reset-make-the-most-of-your-stress-on-halloween\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:23:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Published Reset: Make the Most of Your Stress on Halloween\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"2014-12-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"It didn\\u2019t go viral. Surrounded by brown boxes for at least two years. Synchronicity would eventually arrive.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"2014 Reset published, brown boxes.jpg\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"reset-named-motivational-book-of-2015-and-finalist-in-self-help-and-wellness-categories-at-the-indie-book-awards-in-nyc\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"reset-named-motivational-book-of-2015-and-finalist-in-self-help-and-wellness-categories-at-the-indie-book-awards-in-nyc\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:24:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Reset named Motivational Book of 2015, and finalist in self-help and wellness categories at the Indie Book Awards in NYC\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"2015-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"Met Marilyn Allen, soon-to-be book agent extraordinaire. Made a fool of myself, but didn\\u2019t scare her away\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"2015 Me and Marilyn RESET Indie Book Awards.jpg\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"ted-x-talk-the-risk-we-must-take-given-in-ocala-florida\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"ted-x-talk-the-risk-we-must-take-given-in-ocala-florida\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:24:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Ted X Talk: The Risk We Must Take given in Ocala, Florida\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"2017-11-18 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"Shook in my grey suede booties. But I was honest and brave, mainly because of my students, who are really my teachers.\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"TedX_Ocala.jpg\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"mentalligence-a-new-psychology-of-thinking-to-debut\",\"section\":\"timelineEvents\",\"locales\":{\"en_us\":{\"slug\":\"mentalligence-a-new-psychology-of-thinking-to-debut\",\"section\":\"timelineEvents\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:24:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Mentalligence: A New Psychology of Thinking to debut\",\"entryType\":\"timelineEvents\",\"eventDate\":{\"date\":\"2018-01-01 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"eventInfo\":\"So ready to share it with you!\",\"eventImage\":[{\"elementType\":\"Asset\",\"filename\":\"Mentalligence.png\",\"folder\":\"Timeline Photos\",\"source\":\"timelinePhotos\"}]}}},{\"slug\":\"dr-kris-tedx\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"dr-kris-tedx\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:50:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Dr. Kris @ Tedx\",\"entryType\":\"pressWrittenBy\",\"description\":\"In a visceral, relatable talk, Dr. Kris shares deep insights from her teaching and research regarding authenticity\",\"linkToContent\":\"https://www.youtube.com/watch?v=THjpwpNgebo\",\"publication\":\"TEDxOcala\",\"publicationDate\":\"Nov. 4, 2017\",\"thumbnailImageUrl\":\"./static/images/drkris/tedx.jpg\",\"isVideo\":\"1\"}}},{\"slug\":\"psychologists-explain-how-to-deal-with-the-nightmare-that-is-thanksgiving-dinner\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"psychologists-explain-how-to-deal-with-the-nightmare-that-is-thanksgiving-dinner\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:51:44.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Psychologists Explain How To Deal With The Nightmare That Is Thanksgiving Dinner\",\"entryType\":\"pressMentionedIn\",\"description\":\"It doesn\\u0027t have to be this way.\",\"linkToContent\":\"https://www.huffingtonpost.com/entry/psychologists-thanksgiving-dinner-stress_us_59ee86b1e4b03535fa937e9c\",\"publication\":\"Huffington Post\",\"publicationDate\":\"Nov. 10, 2017\",\"thumbnailImageUrl\":\"https://img.huffingtonpost.com/asset/5a09eddf1c0000c018b3492f.jpeg?cache=hfnnx0ywci&ops=scalefit_720_noupscale\"}}},{\"slug\":\"healthy-hanover-show\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"healthy-hanover-show\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-27 03:53:59.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Healthy Hanover Show\",\"entryType\":\"pressVideoAndPodcasts\",\"description\":\"A short description on Dr.Kris\\u0027s talk, what it\\u0027s about, and how much she rocked it. Here\\u0027s more text\",\"linkToContent\":\"http://www.kristenlee.com/\",\"publication\":\"Hanover Show\",\"publicationDate\":\"June 23, 2017\",\"thumbnailImageUrl\":\"./static/images/drkris/healthy-hanover-show.jpg\"}}},{\"slug\":\"amazon\",\"section\":\"resetBuyLinks\",\"locales\":{\"en_us\":{\"slug\":\"amazon\",\"section\":\"resetBuyLinks\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-30 06:34:35.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Amazon\",\"entryType\":\"resetBuyLinks\",\"buyLink\":\"https://www.amazon.com/RESET-Make-Most-Stress-Well-Being/dp/1491747552\",\"seller\":\"Amazon\"}}},{\"slug\":\"walmart\",\"section\":\"resetBuyLinks\",\"locales\":{\"en_us\":{\"slug\":\"walmart\",\"section\":\"resetBuyLinks\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-30 06:35:05.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"WalMart\",\"entryType\":\"resetBuyLinks\",\"buyLink\":\"https://www.walmart.com/ip/Reset-Make-the-Most-of-Your-Stress-Your-24-7-Plan-for-Well-Being/53075802?wmlspartner=wlpa&selectedSellerId=0&adid=22222222227091087059&wmlspartner=wmtlabs&wl0=&wl1=g&wl2=c&wl3=204419602051&wl4=pla-354955738074&wl5=9001979&wl6=&wl7=&wl8=&wl9=pla&wl10=8175035&wl11=online&wl12=53075802&wl13=&veh=sem\",\"seller\":\"WalMart\"}}},{\"slug\":\"barnes-nobles\",\"section\":\"resetBuyLinks\",\"locales\":{\"en_us\":{\"slug\":\"barnes-nobles\",\"section\":\"resetBuyLinks\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-11-30 06:35:31.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Barnes & Nobles\",\"entryType\":\"resetBuyLinks\",\"buyLink\":\"https://www.barnesandnoble.com/w/reset-edd-licsw-kristen-lee-costa/1120677295?ean=9781491747568&st=PLA&sid=NOK_DRS_NOOK+EBooks_00000000&2sid=Google_&sourceId=PLGoP75008&gclid=Cj0KCQiA0vnQBRDmARIsAEL0M1mDbT7JC46xozPyLcLpCskrFxUsH-WGU24zMWkYXFgTrq2YluesKawaAhWqEALw_wcB\",\"seller\":\"Barnes & Nobles\"}}},{\"slug\":\"abbe\",\"section\":\"meetTheTeam\",\"locales\":{\"en_us\":{\"slug\":\"abbe\",\"section\":\"meetTheTeam\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 01:44:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Abbe\",\"entryType\":\"meetTheTeam\",\"memberBio\":\"Abigail Nasshan is a certified Human Capital coach, who lives and breathes human connection. She was the winner of the 2016 Northeastern University case study writing competition, holds a M.S. in Non-profit Management and Leadership from Northeastern University and a B.A. from Smith College. Abbe has brought impact in the health and non-profit arenas in a vast range of roles and settings, wielding her finesse to maximize outcomes for executive leadership teams. In her spare time, she can be found meditating, running, knitting, watching documentaries, and attempting a more minimalistic life.\",\"position\":\"Communications Director\",\"memberProfileImage\":[{\"elementType\":\"Asset\",\"filename\":\"NasshanOConnell_Headshot.jpg\",\"folder\":\"Meet the Team\",\"source\":\"meetTheTeam\"}]}}},{\"slug\":\"thor\",\"section\":\"meetTheTeam\",\"locales\":{\"en_us\":{\"slug\":\"thor\",\"section\":\"meetTheTeam\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 01:44:33.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Thor\",\"entryType\":\"meetTheTeam\",\"memberBio\":\"Thor Blanco-Reynoso is an educator dedicated to ensuring equity for all. He has served as a Behavioral Science intern and teaching assistant at Northeastern University and holds a B.S. in Psychology. Thor has brought impact through a wide range of professional and volunteer roles, bringing his genuine love for people to help leverage the human condition. In his spare time, he can be found speaking Spanish, Portuguese and Italian, traveling, playing soccer, chatting about his latest research discovery, and spending time with his loved ones.\",\"position\":\"Global Liaison/Trainer\",\"memberProfileImage\":[{\"elementType\":\"Asset\",\"filename\":\"ThorBlanco.jpg\",\"folder\":\"Meet the Team\",\"source\":\"meetTheTeam\"}]}}},{\"slug\":\"harvard-kennedy-school\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"harvard-kennedy-school\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:29:33.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Harvard Kennedy School\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"harvard_kennedy.svg\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"virgin-pulse\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"virgin-pulse\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:29:51.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Virgin Pulse\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"virgin-color.png\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"johnson-johnson\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"johnson-johnson\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:30:10.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Johnson & Johnson\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"1024px-JohnsonandJohnsonLogo.svg.png\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"mclean-hospital-harvard-medical-school\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"mclean-hospital-harvard-medical-school\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:30:31.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"McLean Hospital (Harvard Medical School)\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"McLean-Hospital.png\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"national-institute-on-the-teaching-of-psychology\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"national-institute-on-the-teaching-of-psychology\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:31:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"National Institute on the Teaching of Psychology\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"nitop.png\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"national-alliance-on-mental-illness\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"national-alliance-on-mental-illness\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:31:48.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"National Alliance on Mental Illness\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"nami-logo-blue.gif\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"emerson-college\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"emerson-college\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:32:25.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Emerson College\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"emerson-college.png\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"boston-ballet\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"boston-ballet\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:32:40.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Boston Ballet\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"boston-ballet-logo.png\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"association-for-women-in-science\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"association-for-women-in-science\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:33:12.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Association for Women in Science\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"AWIS_logo_GTW.png\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"girl-scouts-of-america\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"girl-scouts-of-america\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:33:27.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Girl Scouts of America\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"girl-scouts.png\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"tedx\",\"section\":\"clientList\",\"locales\":{\"en_us\":{\"slug\":\"tedx\",\"section\":\"clientList\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 02:33:39.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"TedX\",\"entryType\":\"clientList\",\"clientLogo\":[{\"elementType\":\"Asset\",\"filename\":\"tedx-logo.png\",\"folder\":\"Clients\",\"source\":\"clients\"}]}}},{\"slug\":\"amazon\",\"section\":\"mentalligenceBuyLinks\",\"locales\":{\"en_us\":{\"slug\":\"amazon\",\"section\":\"mentalligenceBuyLinks\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 03:40:20.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Amazon\",\"entryType\":\"mentalligenceBuyLinks\",\"buyLink\":\"https://www.amazon.com/Mentalligence-Psychology-Thinking-Learn-Mindful-Connected/dp/0757320570\",\"seller\":\"Amazon\"}}},{\"slug\":\"mindfulness-matters\",\"section\":\"eventCarousel\",\"locales\":{\"en_us\":{\"slug\":\"mindfulness-matters\",\"section\":\"eventCarousel\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 05:50:10.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Mindfulness Matters\",\"entryType\":\"eventCarousel\",\"date\":{\"date\":\"2017-09-04 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"location\":\"Somewhere, Earth\",\"eventDescription\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua\",\"carouselImage\":[{\"elementType\":\"Asset\",\"filename\":\"Minfulness Matters.jpg\",\"folder\":\"Event Page Photos\",\"source\":\"eventPagePhotos\"}]}}},{\"slug\":\"harvard-kennedy-school-book-event\",\"section\":\"eventCarousel\",\"locales\":{\"en_us\":{\"slug\":\"harvard-kennedy-school-book-event\",\"section\":\"eventCarousel\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 05:51:45.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Harvard Kennedy School Book Event\",\"entryType\":\"eventCarousel\",\"date\":{\"date\":\"2017-10-12 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"location\":\"Cambridge, MA\",\"eventDescription\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua\",\"carouselImage\":[{\"elementType\":\"Asset\",\"filename\":\"Harvard Kennedy School.JPG\",\"folder\":\"Event Page Photos\",\"source\":\"eventPagePhotos\"}]}}},{\"slug\":\"360-corporate-wellbeing\",\"section\":\"eventCarousel\",\"locales\":{\"en_us\":{\"slug\":\"360-corporate-wellbeing\",\"section\":\"eventCarousel\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 05:52:30.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"360 Corporate Wellbeing\",\"entryType\":\"eventCarousel\",\"date\":{\"date\":\"2017-04-14 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"location\":\"Boston, MA\",\"eventDescription\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua\",\"carouselImage\":[{\"elementType\":\"Asset\",\"filename\":\"360 Corporate Wellbeing.JPG\",\"folder\":\"Event Page Photos\",\"source\":\"eventPagePhotos\"}]}}},{\"slug\":\"indie-book-awards\",\"section\":\"eventCarousel\",\"locales\":{\"en_us\":{\"slug\":\"indie-book-awards\",\"section\":\"eventCarousel\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 05:54:18.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Indie Book Awards\",\"entryType\":\"eventCarousel\",\"date\":{\"date\":\"2017-01-20 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"location\":\"New York City, NY\",\"eventDescription\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua\",\"carouselImage\":[{\"elementType\":\"Asset\",\"filename\":\"Indie Book Awards New York.JPG\",\"folder\":\"Event Page Photos\",\"source\":\"eventPagePhotos\"}]}}},{\"slug\":\"northeastern-resident-assistants-talk\",\"section\":\"eventCarousel\",\"locales\":{\"en_us\":{\"slug\":\"northeastern-resident-assistants-talk\",\"section\":\"eventCarousel\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 05:54:58.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Northeastern Resident Assistants Talk\",\"entryType\":\"eventCarousel\",\"date\":{\"date\":\"2017-08-14 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"location\":\"Boston, MA\",\"eventDescription\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua\",\"carouselImage\":[{\"elementType\":\"Asset\",\"filename\":\"Northeatern Residential Assistants.JPG\",\"folder\":\"Event Page Photos\",\"source\":\"eventPagePhotos\"}]}}},{\"slug\":\"harvard-medical-school-talk\",\"section\":\"eventCarousel\",\"locales\":{\"en_us\":{\"slug\":\"harvard-medical-school-talk\",\"section\":\"eventCarousel\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-04 05:55:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Harvard Medical School Talk\",\"entryType\":\"eventCarousel\",\"date\":{\"date\":\"2017-11-06 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"location\":\"Boston, MA\",\"eventDescription\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua\",\"carouselImage\":[{\"elementType\":\"Asset\",\"filename\":\"Harvard Medical School.JPG\",\"folder\":\"Event Page Photos\",\"source\":\"eventPagePhotos\"}]}}},{\"slug\":\"book-review-kirkus-reviews-2017-12-07\",\"section\":\"bookReviews\",\"locales\":{\"en_us\":{\"slug\":\"book-review-kirkus-reviews-2017-12-07\",\"section\":\"bookReviews\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-07 01:36:17.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"book-review-Kirkus Reviews-2017-12-07\",\"entryType\":\"bookReviews\",\"reviewText\":\"Join Dr. Kris as she chats about ways you can be a more global thinker in today\\u0027s workaholic world.\",\"reviewAuthor\":\"Kirkus Reviews\"}}},{\"slug\":\"book-review-amy-morin-lcsw-bestselling-author-of-13-things-mentally-strong-people-dont-do-2017-12-07\",\"section\":\"bookReviews\",\"locales\":{\"en_us\":{\"slug\":\"book-review-amy-morin-lcsw-bestselling-author-of-13-things-mentally-strong-people-dont-do-2017-12-07\",\"section\":\"bookReviews\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-07 01:38:30.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"book-review-Amy Morin, LCSW & Bestselling Author of 13 Things Mentally Strong People Don\\u2019t Do-2017-12-07\",\"entryType\":\"bookReviews\",\"reviewText\":\"Filled with skills you can start applying to your life today, RESET serves as a practical guide to coping with stress. Backed by scientific evidence, yet presented in an easy-to-digest format, Dr. Kris\\u2019 advice will prepare you for challenges of all sizes..\",\"reviewAuthor\":\"Amy Morin, LCSW & Bestselling Author of 13 Things Mentally Strong People Don\\u2019t Do\"}}},{\"slug\":\"book-review-cameron-marzelli-phd-2017-12-07\",\"section\":\"bookReviews\",\"locales\":{\"en_us\":{\"slug\":\"book-review-cameron-marzelli-phd-2017-12-07\",\"section\":\"bookReviews\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-07 01:38:59.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"book-review-Cameron Marzelli, PhD-2017-12-07\",\"entryType\":\"bookReviews\",\"reviewText\":\"Reset offers a breakthrough model that reframes our ideas about stress in support of well-being\\u2026\",\"reviewAuthor\":\"Cameron Marzelli, PhD\"}}},{\"slug\":\"book-review-kirkus-reviews-2017-12-07\",\"section\":\"bookReviews\",\"locales\":{\"en_us\":{\"slug\":\"book-review-kirkus-reviews-2017-12-07\",\"section\":\"bookReviews\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-07 01:39:26.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"book-review-Kirkus Reviews-2017-12-07\",\"entryType\":\"bookReviews\",\"reviewText\":\"Lee\\u2019s voice and the book\\u2019s structure will be useful to readers looking for a leg up\\u2026A well-written, sensible self-help guide.\",\"reviewAuthor\":\"Kirkus Reviews\"}}},{\"slug\":\"rethink-your-way-to-a-saner-holiday-season\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"rethink-your-way-to-a-saner-holiday-season\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-07 13:27:16.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Rethink Your Way to a Saner Holiday Season\",\"entryType\":\"pressWrittenBy\",\"description\":\"Holiday sanity is hard to come by. Research shows it can\\u0027t be bought.\",\"linkToContent\":\"https://www.psychologytoday.com/blog/reset-247/201711/rethink-your-way-saner-holiday-season\",\"publication\":\"Psychology Today\",\"publicationDate\":\"November 29, 2017\",\"thumbnailImageUrl\":\"https://cdn.psychologytoday.com/sites/default/files/styles/article-inline-half/public/field_blog_entry_images/2017-11/shutterstock_531572137_1.jpg?itok=L589JSmB\",\"isVideo\":\"0\"}}},{\"slug\":\"npr-anxiety-as-frenemy\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"npr-anxiety-as-frenemy\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-07 23:03:19.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"NPR: Anxiety as Frenemy\",\"entryType\":\"pressVideoAndPodcasts\",\"description\":\"Dr. Kris helps distinguish between beneficial and harmful anxiety in your life and how to identify it.\",\"linkToContent\":\"http://www.scpr.org/programs/airtalk/2015/08/05/43982/anxiety-as-frenemy-the-good-and-the-bad-of-dreadfu/\",\"publication\":\"NPR\",\"publicationDate\":\"August 5, 2015\",\"thumbnailImageUrl\":\"https://a.scpr.org/i/5a575e6e63fdc634607b7d98fab85048/109687-full.jpg\"}}},{\"slug\":\"npr-5-tips-for-coping-with-college-stress\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"npr-5-tips-for-coping-with-college-stress\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-07 23:08:02.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"NPR: 5 tips for coping with college stress\",\"entryType\":\"pressVideoAndPodcasts\",\"description\":\"Burnout expert Dr. Kris shares her research findings on best coping mechanisms for the students to manage stress\",\"linkToContent\":\"http://www.scpr.org/programs/airtalk/2015/10/29/45029/five-tips-for-coping-with-college-stress/\",\"publication\":\"NPR\",\"publicationDate\":\"October 29, 2015\",\"thumbnailImageUrl\":\"https://a.scpr.org/i/5b9b766ff8c634eef4a4613a4cb95132/113737-full.jpg\"}}},{\"slug\":\"forget-helicopter-parenting-its-all-about-submarine-parenting\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"forget-helicopter-parenting-its-all-about-submarine-parenting\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-07 23:11:38.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Forget helicopter parenting. It\\u2019s all about submarine parenting.\",\"entryType\":\"pressMentionedIn\",\"description\":\"\\u0022While it\\u2019s very much in our brain chemistry to protect our kids, don\\u2019t jump into the emotional disarray with them.\\u201d\",\"linkToContent\":\"https://www.bostonglobe.com/lifestyle/2016/05/12/forget-helicopter-parenting-all-about-submarine-parenting/jNKHMvmT8cEzgyYHTokgZL/story.html\",\"publication\":\"Boston Globe\",\"publicationDate\":\"May 13, 2016\",\"thumbnailImageUrl\":\"https://c.o0bg.com/rf/image_960w/Boston/2011-2020/2016/05/11/BostonGlobe.com/Lifestyle/Images/14submarine.jpg\"}}},{\"slug\":\"your-mental-health-is-more-important-than-your-grades\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"your-mental-health-is-more-important-than-your-grades\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-08 00:33:38.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Your Mental Health is More Important Than Your Grades\",\"entryType\":\"pressWrittenBy\",\"description\":\"After countless interviews and discussions, I wanted to share five key lessons to keep in mind for those in college related stress\",\"linkToContent\":\"https://www.huffingtonpost.com/kristen-lee-costa/your-mental-health-is-mor_b_8357368.html\",\"publication\":\"Huffington Post\",\"publicationDate\":\"October 22, 2015\",\"thumbnailImageUrl\":\"https://images.huffingtonpost.com/2015-10-22-1445524619-9270217-university105709_640-thumb.jpg\",\"isVideo\":\"0\"}}},{\"slug\":\"bye-bye-perfectionism-im-done-with-you\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"bye-bye-perfectionism-im-done-with-you\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-08 00:35:38.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Bye Bye, Perfectionism: I\\u2019m Done With You\",\"entryType\":\"pressWrittenBy\",\"description\":\"\\u0022I\\u2019ve been practicing, how I can put this, and I realize there\\u2019s no easy way to do this. I\\u2019m done.\\u0022\",\"linkToContent\":\"https://www.huffingtonpost.com/kristen-lee-costa/bye-bye-perfectionism-im_b_8620422.html\",\"publication\":\"Huffington Post\",\"publicationDate\":\"November 21, 2015\",\"thumbnailImageUrl\":\"https://images.huffingtonpost.com/2015-11-22-1448158557-259074-wisdom92901_640-thumb.jpg\",\"isVideo\":\"0\"}}},{\"slug\":\"why-work-life-balance-talk-might-make-us-more-stressed-out\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"why-work-life-balance-talk-might-make-us-more-stressed-out\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-08 00:36:57.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Why \\u2018 Work-Life Balance\\u2019 Talk Might Make Us More Stressed Out\",\"entryType\":\"pressWrittenBy\",\"description\":\"\\u0022Work-life risk. Work-life chaos. Work-life spillover. Work-life burnout. More like it.\\u0022\",\"linkToContent\":\"https://www.huffingtonpost.com/kristen-lee-costa/why--work-life-balance-ta_b_9818832.html\",\"publication\":\"Huffington Post\",\"publicationDate\":\"May 2, 2016\",\"thumbnailImageUrl\":\"https://s-i.huffpost.com/gen/1986539/images/n-LIFE-CHOICES-628x314.jpg\",\"isVideo\":\"0\"}}},{\"slug\":\"rethinking-the-college-mental-health-crisis\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"rethinking-the-college-mental-health-crisis\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-08 00:39:04.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"Rethinking the College Mental Health Crisis\",\"entryType\":\"pressWrittenBy\",\"description\":\"Dr. Kris addresses the myth of \\u0022special snowflake generation\\u0022 and how it is limiting needed change in the education department\",\"linkToContent\":\"https://www.huffingtonpost.com/entry/rethinking-the-college-me_b_14683448.html\",\"publication\":\"Huffington Post\",\"publicationDate\":\"February 10, 2017\",\"thumbnailImageUrl\":\"https://images.huffingtonpost.com/2017-02-11-1486774491-206900-library1400312_640-thumb.jpg\",\"isVideo\":\"0\"}}},{\"slug\":\"a-psychologists-theory-of-rational-compassion-can-help-fight-burnout\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"a-psychologists-theory-of-rational-compassion-can-help-fight-burnout\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-08 00:42:18.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"A psychologist\\u2019s theory of \\u201crational compassion\\u201d can help fight burnout...\",\"entryType\":\"pressMentionedIn\",\"description\":\"\\u201cIt\\u2019s important to maintain healthy boundaries, practice self-care. It\\u2019s your life. Time is really precious.\\u201d\",\"linkToContent\":\"https://qz.com/1101030/how-to-deal-with-anxiety-and-burnout-in-the-age-of-nonstop-bad-news/\",\"publication\":\"Quartz\",\"publicationDate\":\"October 12, 2017\",\"thumbnailImageUrl\":\"https://qzprod.files.wordpress.com/2017/10/ap_17275305024887-e1507824675423.jpg?quality=80&strip=all&w=3200\"}}},{\"slug\":\"what-to-do-when-youve-got-the-holiday-blues\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"what-to-do-when-youve-got-the-holiday-blues\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-08 00:44:39.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"What to Do When You\\u2019ve Got the Holiday Blues\",\"entryType\":\"pressMentionedIn\",\"description\":\"The holidays can intensify feelings of loss. Here are 8 ways to make it through the season when you\\u2019re not feeling very merry.\",\"linkToContent\":\"https://www.success.com/article/what-to-do-when-youve-got-the-holiday-blues\",\"publication\":\"SUCCESS Magazine\",\"publicationDate\":\"October 26, 2015\",\"thumbnailImageUrl\":\"https://www.success.com/sites/default/files/styles/article_main/public/main/articles/coping.png?itok=57TqyIo6\"}}},{\"slug\":\"southcoast-matters-talk\",\"section\":\"press\",\"locales\":{\"en_us\":{\"slug\":\"southcoast-matters-talk\",\"section\":\"press\",\"enabled\":\"1\",\"locale\":\"en_us\",\"localeEnabled\":\"1\",\"postDate\":{\"date\":\"2017-12-08 00:52:16.000000\",\"timezone_type\":3,\"timezone\":\"UTC\"},\"expiryDate\":null,\"title\":\"SouthCoast Matters Talk\",\"entryType\":\"pressVideoAndPodcasts\",\"description\":\"A conversation with Dr. Kristen Lee Costa on SouthCoast Matters\",\"linkToContent\":\"https://www.youtube.com/watch?v=IcJrIGpNhHE&amp;feature=youtu.be\",\"publication\":\"Taunton Community Access and Media\",\"publicationDate\":\"May 2, 2016\",\"thumbnailImageUrl\":\"https://i.ytimg.com/vi/IcJrIGpNhHE/hqdefault.jpg?sqp=-oaymwEXCNACELwBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLDZV3LtbfniGf3Gy1z_f8WZOKJ98w\"}}}]}}';\n return craft()->migrationManager_migrations->import($json);\n }", "public function normalizeEntity($item): array\n {\n $data = [\n 'prid' => $item['prid'],\n 'enabled' => boolval(\n is_null($item['prstatus']) ? false : $item['prstatus']\n ),\n 'product_id' => $item['productnumber'],\n 'images' => [],\n 'options' => [],\n 'price' => $item['punitprice'] ? intval($item['punitprice'] * 100) : 0,\n 'name' => StringNormalizer::toTitle($item['productname']),\n 'sku' => $item['partnumber'],\n 'slug' => StringNormalizer::toSlug($item['seourl']),\n 'timestamp' => time(),\n 'weight' => $item['weight'],\n ];\n\n $data['description'] = $item['gendescription'] ?? null;\n $data['variant_description'] = $item['pdescription'] ?? null;\n\n $this->normalizeAttributes($data, $item);\n $this->normalizeCategories($data, $item);\n $this->normalizeDescription($data, $item);\n $this->normalizeDimensions($data, $item);\n $this->normalizeImages($data, $item);\n $this->normalizeMeta($data, $item);\n $this->normalizeOptions($data, $item);\n\n return $data;\n }", "function sanitizeArray( $arr ) {\n if (is_array($arr)) {\n foreach($arr as $key => &$data) {\n if (is_array($data)) {\n $data = sanitizeArray($data);\n } else {\n try {\n $json = json_decode( $data , true);\n if (is_array($json)) {\n $data = sanitizeArray( $json );\n continue;\n }\n } catch(Exception $e) {\n $data = sanitize($data);\n }\n }\n }\n }\n return $arr;\n}", "private function normalizePhoto($raw)\n {\n $photo = array('tags' => array());\n $photo['id'] = strval($raw->Name);\n $photo['appId'] = $this->config->application->appId;\n foreach($raw->Attribute as $item)\n {\n $name = (string)$item->Name;\n $value = (string)$item->Value;\n if($name == 'tags' || $name == 'groups')\n {\n if($value != '')\n $photo[$name][] = $value;\n continue;\n }\n\n $photo[$name] = $value;\n }\n\n // we have to do this because natcasesort preserves array keys and turns it into an object literal (not an array literal)\n if(isset($photo['tags']))\n {\n $tags = $photo['tags'];\n natcasesort($tags);\n $photo['tags'] = array();\n foreach($tags as $tag)\n $photo['tags'][] = $tag;\n }\n\n return $photo;\n }", "public function onMetaParsed(&$meta)\n {\n $meta['tags'] = PicoTags::parseTags($meta['tags']);\n $meta['filter'] = PicoTags::parseTags($meta['filter']);\n }", "function _get_metadata_as_array($metadata) {\n $metadata_array = array();\n \n foreach ($metadata as $m) {\n if (isset($metadata_array[$m->label])) {\n if (is_array($metadata_array[$m->label])) {\n array_push($metadata_array[$m->label], $m->value);\n } else {\n $metadata_array[$m->label] = array($metadata_array[$m->label], $m->value);\n }\n } else {\n $metadata_array[$m->label] = $m->value;\n }\n }\n\n return $metadata_array;\n}", "function sanitizeArray($data = array())\r\n{\r\n foreach ($data as $k => $v) {\r\n if (!is_array($v) && !is_object($v)) { // deep enough to only be values? sanitize them now.\r\n $data[$k] = sanitizeValue($v);\r\n }\r\n if (is_array($v)) { // go deeper\r\n $data[$k] = sanitizeArray($v);\r\n }\r\n }\r\n return $data;\r\n}", "public function prepareForValidation()\n {\n if (is_string($this->images)) {\n $this->merge([\n 'images' => json_decode($this->images, true),\n ]);\n }\n }", "function acapi_convert_values($arr) {\n foreach ($arr as $k => $v) {\n if (!isset($v)) {\n $arr->{$k} = '';\n }\n elseif (is_array($v) || is_object($v)) {\n $arr->{$k} = '...';\n }\n }\n return (array) $arr;\n}", "private function _normalizeData($data)\n\t{\n\t\t$ret = array();\n\t\tforeach($data as $key=>$val)\n\t\t{\n\t\t\tif($val instanceof \\Framework\\Interfaces\\IModelDataType)\n\t\t\t\t$val = $this->_driver->convertModelDataTypeToNativeDataType($val);\n\t\t\telseif(is_array($val))\n\t\t\t\t$val = $this->_normalizeData($val);\n\n\t\t\t//Set value\n\t\t\t$ret[$key] = $val;\n\t\t}\n\n\t\treturn $ret;\n\t}", "public static function getMeta() {\n return json_decode(\n '['\n . ' {'\n . ' \"name\":\"appointment_id\",'\n . ' \"type\":\"int\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"appointment_patient_id\",'\n . ' \"type\":\"int\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"appointment_time\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"appointment_date\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"appointment_reason\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"appointment_doctor_id\",'\n . ' \"type\":\"int\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"appointment_cncl\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"appointment_cncl_reason\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"doctor_firstname\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"doctor_lastname\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"user_firstname\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"user_lastname\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"appointment_state_descr\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' },'\n . ' {'\n . ' \"name\":\"appointment_cncl_descr\",'\n . ' \"type\":\"varchar\",'\n . ' \"default\": null'\n . ' }'\n . ']'\n );\n }", "function get_clean($raw) {\n $results = json_decode($raw);\n\n $clean = array();\n\n foreach($results[0]->RESULT->ROWS AS $row) {\n $new = array();\n foreach($row AS $k => $v) {\n $new[$results[0]->RESULT->HEADER[$k]] = $v;\n }\n $clean[] = $new;\n }\n\treturn $clean;\n}", "protected function prepareJsonStructure(){\n\t\t\n\t}", "function get_meta($items) {\n\t\tif($items) {\n\t\t\tif(is_array($items)) {\n\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t$item->meta = get_post_custom($item->ID);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$items->meta = get_post_custom($items->ID);\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}", "private function parseMeta( $data ) {\n $regex = $this->regex;\n \n // Extract\n preg_match($regex['meta'], $data, $match);\n \n // Save the raw data.\n $this->raw = $raw = $match[0];\n \n // Remove data boundaries, and create a basic array from the data.\n $raw = preg_split($regex['break'], trim(preg_replace($regex['bound'], '', $raw)));\n \n // Interpret the raw data.\n $raw = array_map(function($pair) use ($regex){\n \n $array = array_map('trim', preg_split($regex['data'], $pair, 2));\n\n return $array;\n \n }, array_filter($raw, function($item){\n \n return isset($item);\n \n }));\n \n // Format the raw data.\n foreach( $raw as &$meta ) { \n \n $meta[1] = $this->formatMeta( $meta[1] );\n \n }\n \n // Reduce the raw data.\n for( $i = count($raw) - 1; $i > -1; $i-- ) { \n \n $meta = $raw[$i];\n \n $raw[$meta[0]] = $meta[1];\n \n unset($raw[$i]);\n \n }\n\n // Return the real meta data.\n return array_merge( $raw );\n \n }", "protected function prepareForValidation()\n {\n $this->merge([\n 'insumos' => json_decode($this->insumos, true),\n ]);\n }", "public function buildWithMetas($jsonArray, $parentID = 0) {\n\n $return = array();\n $idx = 0;\n foreach($jsonArray as $subArray) {\n\n $returnSubArray = array();\n\n if(isset($subArray['children'])) {\n $returnSubArray['children'] = $this->buildWithMetas($subArray['children'], $subArray['id']);\n }\n\n $safe_item = [\n 'id' => $subArray['id'], \n 'parentID' => $parentID,\n 'post_type'=> $subArray['post_type'], \n 'image'=> $subArray['image'], \n 'title'=> $subArray['title'], \n 'slug'=> $subArray['slug'], \n 'url'=> $subArray['url'], \n ];\n\n $taxoMeta = (array)userMeta($subArray->taxoMetas);\n\t\t\t$safe_item = array_merge($safe_item, $taxoMeta);\n $return[$idx] = array_merge($safe_item, $returnSubArray);\n $idx++;\n }\n\n return $return;\n }", "function modifyMeta(array $meta)\n {\n $meta = array_replace_recursive(\n $meta,\n [\n $this->groupContainer => [\n 'children' => $this->getGeneralChildren(),\n ],\n ]\n );\n return $meta;\n }", "protected function cleanUpValue( $value ) {\n\t\t$cleanValue = [];\n\t\tif ( !is_array( $value ) ) {\n\t\t\treturn $cleanValue;\n\t\t}\n\t\tforeach ( $value as $singleValue ) {\n\t\t\t$singleValue = parent::cleanUpValue( $singleValue );\n\t\t\t// Remove options that we don't have here\n\t\t\tif ( !isset( $this->fields[ $singleValue ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$cleanValue[] = $singleValue;\n\t\t}\n\t\treturn $cleanValue;\n\t}", "function _wp_json_prepare_data($data)\n {\n }", "private function convertContent(){\n $newContent = array();\n foreach ($this->content as $key => $value) {\n if (is_scalar($value)) {\n $newContent[$key] = $this->format($value);\n }\n }\n return $newContent;\n }", "private static function validate_meta( $meta_value ) {\n\t\treturn is_array( $meta_value ) && isset( $meta_value['uuid'], $meta_value['created_at'], $meta_value['completed'], $meta_value['current'], $meta_value['show_after'] );\n\t}", "private function prepareArray()\n {\n $tempItems = trim(Input::get('items'));\n $items = explode(PHP_EOL, $tempItems);\n $badItemsToTest = ['shp#', 'totals', 'total', 'shipment', 'shipment#', ''];\n\n $finalArray = array();\n\n foreach ($items as $item) {\n\n if (in_array(strtolower(trim($item)), $badItemsToTest) == false) {\n array_push($finalArray, trim($item));\n }\n\n }\n return $finalArray;\n\n\n }", "function awm_basic_meta_structure($fields)\n {\n $metas = array();\n\n foreach ($fields as $field) {\n $meta_key = awm_clean_string($field['key']);\n $metas[$meta_key] = $field;\n $metas[$meta_key]['label'] = __($field['label'], 'extend-wp');\n\n $metas[$meta_key]['class'] = !empty($field['class']) ? explode(',', $field['class']) : array();\n $attributes = array();\n if (isset($field['attributes'])) {\n foreach ($field['attributes'] as $attribute) {\n if (!empty($attribute['label']) && !empty($attribute['value'])) {\n $attributes[$attribute['label']] = $attribute['value'];\n }\n }\n }\n $metas[$meta_key]['attributes'] = $attributes;\n switch ($field['case']) {\n case 'select':\n case 'radio':\n $metas[$meta_key]['options'] = array();\n if (!empty($field['options'])) {\n foreach ($field['options'] as $option) {\n $metas[$meta_key]['options'][$option['option']] = array('label' => __($option['label'], 'extend-wp'));\n }\n }\n break;\n }\n }\n\n return $metas;\n }", "function _cleanup_input_data($data = array()) {\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Cleanup data array\n\t\t$_tmp = array();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\t$k = trim($k);\n\t\t\tif (!strlen($k)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$_tmp[$k] = $v;\n\t\t}\n\t\t$data = $_tmp;\n\t\tunset($_tmp);\n\t\t// Remove non-existed fields from query\n\t\t$avail_fields = $this->_get_avail_fields();\n\t\tforeach ((array)$data as $k => $v) {\n\t\t\tif (!isset($avail_fields[$k])) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\t// Last check\n\t\tif (empty($data) || !is_array($data)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $data;\n\t}" ]
[ "0.59674025", "0.58108276", "0.5731738", "0.5583344", "0.55310774", "0.5329212", "0.5260093", "0.52088845", "0.52078414", "0.5189728", "0.5189538", "0.5162135", "0.51534456", "0.5132234", "0.5128982", "0.5121208", "0.5119698", "0.5112313", "0.50871646", "0.508283", "0.50719595", "0.5051104", "0.50462437", "0.5036244", "0.5015259", "0.5012939", "0.5005907", "0.5000764", "0.49944517", "0.49813014" ]
0.6595983
0
Function for normalization of dependencies structure
protected static function dep_normal ($dependence_structure) { $return = []; foreach ((array)$dependence_structure as $d) { preg_match('/^([^<=>!]+)([<=>!]*)(.*)$/', $d, $d); /** @noinspection NestedTernaryOperatorInspection */ $return[$d[1]][] = [ isset($d[2]) && $d[2] ? $d[2] : (isset($d[3]) && $d[3] ? '=' : '>='), isset($d[3]) && $d[3] ? $d[3] : 0 ]; } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function normalize() {}", "private function arrangeDependencies(array $input): void\n {\n $order = [];\n $checkList = [];\n\n $inputCount = count($input);\n\n while ($inputCount > count($order)) {\n $done = false;\n $lastCheckedName = $lastCheckedDependency = null;\n\n foreach ($input as $name => $dependencies) {\n if (array_key_exists($name, $checkList)) {\n continue;\n }\n\n $resolved = true;\n\n foreach ($dependencies as $dependency) {\n if (!array_key_exists($dependency, $checkList)) {\n $resolved = false;\n $lastCheckedName = $name;\n $lastCheckedDependency = $dependency;\n break;\n }\n }\n\n if ($resolved) {\n $checkList[$name] = true;\n $order[] = $name;\n\n $done = true;\n }\n }\n\n if ($done === false) {\n $input[$lastCheckedName] = array_diff($input[$lastCheckedName], [$lastCheckedDependency]);\n\n $this->arrangeDependencies($input);\n $order = $this->getTablesInOrder();\n $postLinkMerged = array_merge_recursive(\n [$lastCheckedName => [$lastCheckedDependency]],\n $this->referencesToPostpone\n );\n $filteredDependencies = [];\n /** @var string $name */\n foreach ($postLinkMerged as $name => $dependencies) {\n $filteredDependencies[$name] = $dependencies;\n }\n $this->referencesToPostpone = $filteredDependencies;\n }\n }\n\n $this->tablesInOrder = $order;\n }", "protected function _preFlatten() {}", "protected static function normalize_meta ($meta) {\n\t\tforeach (['db_support', 'storage_support', 'provide', 'require', 'conflict'] as $item) {\n\t\t\t$meta[$item] = isset($meta[$item]) ? (array)$meta[$item] : [];\n\t\t}\n\t\tforeach (['require', 'conflict'] as $item) {\n\t\t\t$meta[$item] = self::dep_normal($meta[$item]);\n\t\t}\n\t\treturn $meta;\n\t}", "function remove_dependents() {\n\t\t/** todo\n\t\tforeach($this->has_many_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\n\t\t}\n\n\t\tforeach($this->has_one_data as $key => $value) {\n\t\t\tdebug($key, $value);\n\t\t}\n\t\t*/\n\n\t\treturn true;\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "public function buildRelations()\n\t{\n\t}", "protected function resolveDependencies() {\n\t\t$sortedNodes = array();\n\t\twhile (count($this->nodesWithoutIncoming) > 0) {\n\t\t\t$node = array_pop($this->nodesWithoutIncoming);\n\t\t\t$sortedNodes[] = $node;\n\t\t\t$nodeHash = spl_object_hash($node);\n\t\t\tif (isset($this->dependenciesOutgoing[$nodeHash])) {\n\t\t\t\tforeach ($this->dependenciesOutgoing[$nodeHash] as $dependencyHash => $dependencyNode) {\n\t\t\t\t\tunset($this->dependenciesOutgoing[$nodeHash][$dependencyHash]);\n\t\t\t\t\tunset($this->dependenciesIncoming[$dependencyHash][$nodeHash]);\n\n\t\t\t\t\tif (count($this->dependenciesIncoming[$dependencyHash]) === 0) {\n\t\t\t\t\t\t$this->nodesWithoutIncoming[$dependencyHash] = $dependencyNode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $sortedNodes;\n\t}", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "public function buildRelations()\n {\n }", "static function fs2dn($data,$struct='childs',$set=array()){\n $_int = array('pos','lev','cns','par','pth','key');\n $def = array('set'=>'=','def'=>'label','childs'=>'childs');\n foreach($_int as $ci) $def[$ci] = NULL;\t\t \n $set = ops_array::Setdefault($set,$def);\n $res = array(); \n $par = array();\n foreach($data as $key=>$val){\n if(is_null($set['set'])) $item = NULL;\n else list($key,$item) = ops_narray::expl2($set['set'],$key);\n if(!is_null($item)){\n\tif($item!=$struct)\n\t $res[$key][$item] = $val;\n\telse if(is_array($val))\n\t foreach($val as $cv) $par[$cv] = $key;\n\telse \n\t $par[$key] = $val;\n } else {\n\tif(!is_array($val))\n\t $res[$key][$set['def']] = $val;\n\telse {\n\t foreach($val as $ck=>$cv){\n\t if($ck!=$struct)\n\t $res[$key][$ck] = $cv;\n\t else if(is_array($cv))\n\t foreach($cv as $sv) $par[$sv] = $key;\n\t else \n\t $par[$key] = $cv;\n\t }\n\t}\n }\n }\n while(count($par)>0){\n $ak = array_keys($par);\n foreach($ak as $ck){\n\tif(!in_array($ck,$par)){\n\t $res[$par[$ck]][$set['childs']][$ck] = isset($res[$ck])?$res[$ck]:array();\n\t unset($res[$ck]);\n\t unset($par[$ck]);\n\t}\n }\n }\n return($res);\n }", "public function normalize()\n {\n }", "private function parseRelations()\n {\n if ($this->parentRelations === null) {\n $this->parentRelations = [];\n $this->parentEntities = [];\n $this->childEntities = [];\n $this->childRelations = [];\n $this->siblingEntities = [];\n $this->siblingRelations = [];\n foreach ($this->getModule()->getRelations() as $relation) {\n if ($relation->getEntityOneInstance() === $this) {\n if ($relation->getType() === Relation::TYPE_ONE_TO_MANY) {\n $this->childRelations[] = $relation;\n $childEntity = $relation->getRelatedEntity($this);\n $this->childEntities[$childEntity->getNameSingular()] = $childEntity;\n } elseif ($relation->getType() === Relation::TYPE_MANY_TO_MANY) {\n $siblingEntity = $relation->getRelatedEntity($this);\n $this->siblingRelations[] = $relation;\n $this->siblingEntities[$siblingEntity->getNameSingular()] = $siblingEntity;\n }\n }\n if ($relation->getEntityTwoInstance() === $this) {\n if ($relation->getType() === Relation::TYPE_ONE_TO_MANY) {\n $this->parentRelations[] = $relation;\n $parentEntity = $relation->getRelatedEntity($this);\n $this->parentEntities[$parentEntity->getNameSingular()] = $parentEntity;\n } elseif ($relation->getType() === Relation::TYPE_MANY_TO_MANY) {\n $siblingEntity = $relation->getRelatedEntity($this);\n $this->siblingRelations[] = $relation;\n $this->siblingEntities[$siblingEntity->getNameSingular()] = $siblingEntity;\n }\n }\n }\n }\n }", "protected function resolveDataArrayDependencies() {}", "public function parseRelationships()\n {\n foreach ($this->relationships as $relationship) {\n if (in_array($relationship->getRelation(), $this::SUBJECTS))\n {\n $root = $this->getRelationship($relationship->getDependentId());\n $root->addDependency($relationship);\n }\n }\n }", "protected function orderCollection(array $wrappers): array\n {\n // First, reset all dependencies and required references\n array_walk($wrappers, function(DependencyCollectonElement $element) {\n $element->_realDependencies = [];\n $element->_realDepends = [];\n });\n\n // Then create the real tree (real dependency elements) of dependencies and required references\n\n $createdDependencies = [];\n\n $dependencyResolver = function(DependencyCollectonElement $element) use (&$dependencyResolver, &$createdDependencies) {\n foreach($element->getDependencies() as $depName) {\n if(!isset($element->_realDependencies[$depName])) {\n if(!isset($this->collection[$depName])) {\n // Dependency does not exist. create it if possible\n $this->collection[$depName] = NULL;\n\n /** @var DependencyCollectonElement $dep */\n if($dep = $this->getUnexistingRequiredElement($depName)) {\n if(!isset($dep->_realDependencies))\n $dep->_realDependencies = [];\n if(!isset($dep->_realDepends))\n $dep->_realDepends = [];\n\n $dependencyResolver($dep);\n $this->collection[$depName] = $dep;\n $createdDependencies[$depName] = $dep;\n } else\n continue;\n } else\n $dep = $this->collection[$depName];\n\n $element->_realDependencies[$depName] = $dep;\n $dep->_realDepends[$element->getName()] = $element;\n }\n }\n };\n\n array_walk($wrappers, $dependencyResolver);\n\n if($createdDependencies)\n $wrappers = array_merge($wrappers, $createdDependencies);\n\n $initial = [];\n if(count($wrappers)>1) {\n // Now order the wrappers that the ones with zero required references is first, additionally capture all which are not referenced as dependency\n uasort($wrappers, function(DependencyCollectonElement $A, DependencyCollectonElement $B) use (&$initial) {\n if(count($A->_realDepends) == 0 && !in_array($A, $initial))\n $initial[] = $A;\n if(count($B->_realDepends) == 0 && !in_array($B, $initial))\n $initial[] = $B;\n\n return count($A->_realDepends) <=> count($B->_realDepends);\n });\n } else {\n $initial = $wrappers;\n }\n\n\n $orderedWrappers = [];\n\n $resolveAlgorythm = function(DependencyCollectonElement $element, array $recursion = []) use (&$resolveAlgorythm, &$orderedWrappers) {\n /** @var DependencyCollectonElement $dependency */\n $circulars = [];\n\n foreach($element->_realDependencies as $dependency) {\n $depName = $dependency->getName();\n\n if(isset($recursion[$depName])) {\n if($p = $this->handleCircularDependency($dependency, $element)) {\n $circulars[] = $p;\n continue;\n } else {\n $theStack = array_keys( $recursion );\n\n $chain = implode(\" >> \", $theStack);\n if(!$chain) {\n $chain = $element->getName();\n $last = \"\";\n } else {\n $last = sprintf(\" >> #%s! (recursion!)\", $dependency->getName());\n }\n $e = new CircularDependencyException(\"Can not resolve dependencies for %s :: $chain$last\", 0, NULL, $element->getName());\n $e->setDependency($element);\n $e->setDependencyChain($recursion);\n throw $e;\n }\n }\n\n $localRecursion = $recursion;\n $localRecursion[$depName] = $dependency;\n $resolveAlgorythm($dependency, $localRecursion);\n }\n\n $add = function(DependencyCollectonElement $dep) use (&$orderedWrappers) {\n if(!isset($orderedWrappers[$dep->getName()]))\n $orderedWrappers[ $dep->getName() ] = $dep;\n };\n\n foreach ($circulars as $c)\n $add($c);\n\n $add($element);\n };\n\n if(count($initial = $this->getRootElements($initial)) < 1) {\n $e = new CircularDependencyException(\"Could not resolve dependencies to get an entry point\");\n throw $e;\n }\n\n foreach($initial as $init)\n $resolveAlgorythm($init);\n\n return $orderedWrappers;\n }", "function tw_asset_normalize($asset) {\n\n\tif (!is_array($asset)) {\n\t\treturn $asset;\n\t}\n\n\t$base_url = get_template_directory_uri() . '/assets/';\n\n\t$defaults = [\n\t\t'deps' => [\n\t\t\t'style' => [],\n\t\t\t'script' => []\n\t\t],\n\t\t'style' => '',\n\t\t'script' => '',\n\t\t'footer' => true,\n\t\t'prefix' => 'tw_',\n\t\t'version' => null,\n\t\t'display' => false,\n\t\t'directory' => '',\n\t\t'localize' => [],\n\t\t'object' => ''\n\t];\n\n\t$asset = wp_parse_args($asset, $defaults);\n\n\tforeach (['style', 'script'] as $type) {\n\n\t\tif (!empty($asset[$type])) {\n\n\t\t\tif (is_string($asset[$type])) {\n\t\t\t\t$asset[$type] = [$asset[$type]];\n\t\t\t}\n\n\t\t\tforeach ($asset[$type] as $key => $link) {\n\n\t\t\t\tif (strpos($link, 'http') !== 0 and strpos($link, '//') !== 0) {\n\n\t\t\t\t\t$directory = '';\n\n\t\t\t\t\tif (!empty($asset['directory'])) {\n\t\t\t\t\t\t$directory = trailingslashit($asset['directory']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$asset[$type][$key] = $base_url . $directory . $link;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif (!empty($asset['deps'])) {\n\n\t\tif (is_string($asset['deps'])) {\n\t\t\t$asset['deps'] = [$asset['deps']];\n\t\t}\n\n\t\tif (is_array($asset['deps'])) {\n\n\t\t\tif (empty($asset['prefix'])) {\n\t\t\t\t$prefix = '';\n\t\t\t} else {\n\t\t\t\t$prefix = $asset['prefix'];\n\t\t\t}\n\n\t\t\t$deps = [];\n\n\t\t\t$assets = tw_asset_list();\n\n\t\t\tforeach (['script', 'style'] as $type) {\n\n\t\t\t\tif (isset($asset['deps'][$type]) and empty($asset['deps'][$type])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$asset_deps = [];\n\n\t\t\t\tif (!empty($asset['deps'][$type])) {\n\n\t\t\t\t\tif (!is_array($asset['deps'][$type])) {\n\t\t\t\t\t\t$asset['deps'][$type] = [$asset['deps'][$type]];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!empty($asset['deps'][$type][0]) and is_string($asset['deps'][$type][0])) {\n\t\t\t\t\t\t$asset_deps = $asset['deps'][$type];\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ($type !== 'script' and !empty($asset['deps']['script']) and is_string($asset['deps']['script'][0])) {\n\t\t\t\t\t\t$asset_deps = array_merge($asset_deps, $asset['deps']['script']);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($type !== 'style' and !empty($asset['deps']['style']) and is_string($asset['deps']['style'][0])) {\n\t\t\t\t\t\t$asset_deps = array_merge($asset_deps, $asset['deps']['style']);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($asset['deps'][0]) and is_string($asset['deps'][0])) {\n\t\t\t\t\t\t$asset_deps = array_merge($asset_deps, $asset['deps']);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tforeach ($asset_deps as $dep) {\n\n\t\t\t\t\tif ($assets and !empty($assets[$dep]) and !empty($assets[$dep][$type])) {\n\n\t\t\t\t\t\t$deps[$type][] = $prefix . $dep;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ($type == 'script' and wp_script_is($dep, 'registered')) {\n\t\t\t\t\t\t\t$deps[$type][] = $dep;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($type == 'style' and wp_style_is($dep, 'registered')) {\n\t\t\t\t\t\t\t$deps[$type][] = $dep;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$asset['deps'] = $deps;\n\n\t\t}\n\n\t}\n\n\treturn $asset;\n\n}" ]
[ "0.55357337", "0.55160856", "0.53974277", "0.52803683", "0.51903397", "0.5166813", "0.5166813", "0.5166813", "0.5166813", "0.5166813", "0.5166813", "0.5166813", "0.5166813", "0.5116904", "0.5068284", "0.5068284", "0.5068284", "0.5068284", "0.5068284", "0.5068284", "0.5068284", "0.5068284", "0.5068284", "0.50032693", "0.5001455", "0.49911782", "0.49851912", "0.49792922", "0.49201924", "0.49101725" ]
0.5738955
0
Opening for Shopify's ProductsCreate webhook
public function productsCreate(Request $request) { try { \Log::info('Data incoming from Shopify ProductsCreate Webhook'); //retrieving json data $content = json_decode($request->getContent(), true); app(ProductService::class)->queueProductsCreateConversionTriggers($content); return response('', 202); } catch (\Exception $e) { \Log::error(sprintf('Could not process data from Shopify ProductsCreate webhook => %s', $e->getMessage())); return response('Error occurred', 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createAppWebhooks()\n {\n if ($this->shopifyUseWebhooks == 'true') {\n Log::info('ShopifyApi.createAppWebhooks: register webhooks');\n\n // create webhook for uninstalling\n $result = $this->call('POST', '/admin/webhooks.json',\n array('webhook' => array(\n 'topic' => 'app/uninstalled',\n 'address' => secure_url('webhookAppUninstall'),\n 'format' => 'json')));\n Log::info('ShopifyApi.createProductWebhooks: topic = app/uninstalled');\n\n } else {\n Log::debug('ShopifyApi.createProductWebhooks: do NOT register webhooks');\n }\n }", "public function store(CreateProductRequest $request)\n {\n $product = $this->productRepository->saveRecord($request);\n\n $details = [];\n $details['product_id'] = $product->id;\n $details['description'] = $request->description;\n $details['price'] = $request->price;\n ProductDetails::create($details);\n\n $slot = [];\n $slot['product_id'] = $product->id;\n $slot['title'] = 'Slot 1';\n $done = Slot::create($slot);\n\n $slotBooking = [];\n $slotBooking['slot_id'] = $done->id;\n $slotBooking['user_id'] = Auth::id();\n $slotBooking['status'] = 1;\n SlotBookings::create($slotBooking);\n\n Flash::success($this->BreadCrumbName . ' saved successfully.');\n if (isset($request->continue)) {\n $redirect_to = redirect(route('admin.products.create'));\n } elseif (isset($request->translation)) {\n $redirect_to = redirect(route('admin.products.edit', $product->id));\n } else {\n $redirect_to = redirect(route('admin.products.index'));\n }\n return $redirect_to->with([\n 'title' => $this->BreadCrumbName\n ]);\n }", "public function createProduct($data);", "public function created(Product $producto)\n {\n\n // Notification::route('slack', env('SLACK_HOOK'))\n // ->notify(new NewSaleNotification());\n //auth()->user()->notify(new NewSaleNotification());\n //Notification::send(User::first(), new NewSaleNotification());\n\n //Notification::route('slack', env('SLACK_NOTIFICATION_WEBHOOK'))\n // ->notify(new NewSaleNotification);\n // \\Log::info('asdasdasdasdasd');\n }", "public function store(CreateProductRequest $request)\n {\n $input = $request->all();\n\n $provider = Provider::find($input[\"provider_id\"]);\n\n $product = Product::create([\n \"code\" => Product::generateUniqueCode(implode(\" \", $input[\"title\"]) , $provider->sku_suffix ),\n \"provider_id\" => $provider->id,\n\t\t\t'publish_id'\t=> $input[\"publish_id\"],\n\t\t\t'publish_at'\t=> $input[\"publish_date\"],\n ]);\n\n if (!$product) {\n return Redirect::back()->withErrors([\"El producto no pudo ser creado\"]);\n }\n\n foreach ($this->languages as $language) {\n $product->updateTranslationByIso($language->iso6391,[\n 'title' => $input[\"title\"][$language->iso6391],\n 'description' => $input[\"description\"][$language->iso6391],\n 'slug' => Product::generateUniqueSlug($input[\"title\"][$language->iso6391])\n ]);\n }\n\n updateMYSQLTimestamp();\n\n return Redirect::route('admin::products.edit',$product->id)->with('status', \"El producto fue correctamente creado\");\n }", "public function store(ProductCreateRequest $request) : RedirectResponse\n {\n $product = Product::create($request->only('name', 'art', 'status', 'data'));\n $this->dispatch(new SendProductCreatedJob($product));\n\n return redirect()->route('products.index')\n ->with('success', 'Product created successfully.');\n }", "public function store(ProductsRequest $request)\n {\n //\n }", "public function addProduct(){\n\t\t// prepares the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/product/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: ' . TOKEN));\n\n\t\t// unset unused attributes from the variable\n\t\tunset($_POST['_token']);\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($_POST));\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\treturn redirect('/');\n\t}", "function spf_get_shop_products(){\nwp_send_json([\n 'message' => 'thank you the endpoint is fine'\n], 200);\n}", "public function store(ProductRequest $request)\n {\n //\n }", "public function testProductCreation()\n {\n $response = $this->json('POST', '/api/v1/products', ['name' => 'Sally','sku'=>'Test']);\n\n $response->assertStatus(201)->assertJson(['code' => 201]);\n }", "public function storeMenu(Request $request)\n {\n $result = Product::create($request->all());\n\n if ($result['success']) {\n return response()->json([\n 'status' => true,\n 'data' => Product::find($result['data']->id)->get(),\n ], 200);\n } else {\n return response()->json([\n 'status' => false,\n 'message' => $result['errors'],\n ], 400);\n }\n }", "public function store(CreateProductRequest $request)\n {\n $product = Product::create([\n 'name' => $request->name,\n 'slug' => $request->slug,\n 'sku' => $request->sku,\n 'price' => $request->price,\n 'description' => $request->description,\n 'quantity' => $request->quantity,\n 'status' => $request->has('status')\n ]);\n\n return redirect()->route('products.index')->with('success', 'Product created successfully.');\n }", "public function postNew()\n {\n $sku = request()->json('sku');\n $client_id = auth()->user()->current_client_id;\n $warehouse_id = auth()->user()->current_warehouse_id;\n\n //first check to make sure this is not a duplicate\n $products = $this->getCheckDuplicate($sku, $client_id, $warehouse_id);\n if( count($products) > 0 )\n {\n $error_message = array('errorMsg' => 'The product with sku of ' . $sku . ' already exists for this warehouse and client.');\n return response()->json($error_message);\n }\n\n //create new item\n $product_id = $this->saveItem();\n\n return response()->json(['id' => $product_id]);\n }", "public function create(Request $data)\n {\n //return view('cataloguemodule::create');\n $Product = new SimpleProductsFactory();\n $simpleProduct = $Product->CreateProduct($data);\n $this->store($simpleProduct);\n\n }", "public function store(ProductCreateRequest $request)\n {\n\n $product = Product::create($request->all());\n try {\n $product->sale_price = ($request->sale_price == null) ? $request->price : $request->sale_price;\n $product->save();\n return (new ProductResource($product))->additional([\n 'errors' => null,\n ])->response()->setStatusCode(201);\n } catch (Exception $e) {\n Log::info(\"fails in create a new product\" . json_encode($e));\n if (env('APP_ENV') == 'development') {\n return (new ProductResource(null))->additional([\n 'errors' => [\"fail\" => [\"fails in create a new product\" . json_encode($e)]],\n ])->response()->setStatusCode(500);\n } else if (env('APP_ENV') == 'production') {\n return (new ProductResource(null))->additional([\n 'errors' => [\"fail\" => [\"fails in create a new product\"]],\n ])->response()->setStatusCode(500);\n }\n }\n }", "function onAction()\n {\n global $application;\n $request = $application->getInstance('Request');\n\t$msgres = $application->getInstance(\"MessageResources\", \"messages\");\n\n // checking if wishlist product is being added\n $wl_id = $request->getValueByKey('wl_id');\n if ($wl_id > 0)\n {\n $data = modApiFunc('Wishlist', 'getWishlistRecordCartData', $wl_id);\n if (!$data)\n {\n // invalid wishlist record...\n $request = new Request();\n $request -> setView('Wishlist');\n $application -> redirect($request);\n\t\t$this->setStatusError();\n\t\t$this->setMessage('Invalid wishlist record');\n }\n\n $options_sent = $data['options_sent'];\n $prod_id = $data['entity_id'];\n }\n else\n {\n $prod_id = $request->getValueByKey('prod_id');\n\n $data=array(\n 'parent_entity' => 'product'\n ,'entity_id' => $prod_id\n ,'options' => $request->getValueByKey('po')\n ,'qty' => $request->getValueByKey('quantity_in_cart')\n \t\t ,'colorname' => $request->getValueByKey('colorname')\n\n );\n\n $options_sent = $request->getValueByKey('options_sent');\n }\n\n // setting qty=1 if quantity_in_stock is not specified\n if (!$data['qty'] && $data['qty'] !== 0)\n $data['qty'] = 1;\n\n if($data['options']==null)\n {\n $data['options']=array();\n }\n\n\n $result = modApiFunc('Cart', 'processPostedProductData', $data, $options_sent);\n\n if (!$result['is_error'])\n {\n if(!empty($result['stock_discarded_by_warning']))\n {\n modApiFunc('Session','set','StockDiscardedBy',$result['stock_discarded_by_warning']);\n }\n\n $added = modApiFunc('Cart', 'addToCart', $result['data']);\n\t $cc = modApiFunc('Cart', 'getCartContent');\n\t $cartPrice = '';\n\t $cart_id = $prod_id.\"_\".modApiFunc(\"Product_Options\", \"getCombinationHash\", $result['data']['options']);\n\t if( !empty($cc))\n\t\t foreach($cc as $product)\n\t\t\t if($product[\"CartID\"]==$cart_id)\n\t\t\t\t $cartPrice = modApiFunc(\"Localization\", \"format\", $product[\"CartItemSalePrice\"], \"currency\");\n\n\t $this->setStatusSuccess();\n\n\t $p = new CProductInfo($prod_id);\n\t $message = array(\n\t\t \"<h2>\".$msgres->getMessage('CATALOG_PRODUCT_ADDED').\"</h2>\".\n\t\t \"<div class='ajax_message_cart_prod_link'><a href='\". $p->getProductInfoLink($prod_id, $p->chooseCategoryID()) .\"'>\".$p->getProductTagValue('name').\"</a></div>\".\n \"<div class='ajax_message_cart_prod_qty'>\".$data['qty'].\"&nbsp;\".$msgres->getMessage('CATALOG_X').\"&nbsp;\".$cartPrice.\"</div>\"\n );\n\n // if a wishlist product is being added...\n if ($wl_id > 0 && $added)\n {\n modApiFunc('Wishlist', 'removeFromWishlist', $wl_id);\n\t\t$message[] = 'This product was removed from your Wishlist';\n }\n\n\t $this->setMessage($message);\n $request = new Request();\n $request->setView(CURRENT_REQUEST_URL);\n $application->redirect($request);\n }\n else\n {\n\t $this->setStatusError();\n\t $message = array();\n\n if($result['discard_by'] != 'none')\n {\n modApiFunc('Session','set','OptionsDiscardedBy',$result['discard_by']);\n\t\t$message[] = $msgres->getMessage($result['discard_by']);\n }\n if($result['stock_discarded_by'] != 'none')\n {\n\t\t modApiFunc('Session','set','StockDiscardedBy',$result['stock_discarded_by']);\n\t\t $message[] = $msgres->getMessage($result['stock_discarded_by']);\n }\n modApiFunc('Session','set','sentCombination',$result['data']['options']);\n\t $this->setMessage($message);\n $request = new Request();\n $request->setView('ProductInfo');\n $request->setAction('SetCurrentProduct');\n $request->setKey('prod_id',$prod_id);\n $request->setProductID($prod_id);\n $p = new CProductInfo($prod_id);\n $request->setCategoryID($p->chooseCategoryID());\n $application->redirect($request);\n };\n }", "public function store(CreateProductRequest $request)\n\t{\n\t\t$this->product->create($request->all());\n\t\t\n\t\treturn redirect()->route('product.index');\n\t}", "public function createShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathMultipleResource(),\n 'METHOD' => 'POST',\n 'DATA' => [\n /*\n * Using static:: instead of self:: because static:: binds at runtime\n * If we use self this would not work because it would\n * always call ShopifyResource::getResourceSingularName()\n */\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function store(CreateProductRequest $request)\n {\n $this->productService->create($request->except('_token'));\n\n return redirect()->route('products.index')\n ->with(config('core.session_success'), __('product::labels.product') . ' ' . __('core::labels.create_success'));\n }", "public function notifyProductCreated(ProductCreatedEvent $event) : void\n {\n // prepare Product data to use it in email template\n // us some Mailer to send Email notification\n }", "public function actionProductCreate()\n\t{\n\n\t\t$data = $_POST;\n\t\t$merchantId=$data['merchant_id'];\n\t\t$logFIle = 'product/create/'.$data['merchant_id'];\n\t\tData::createLog('Data : '.json_encode($data),$logFIle,'a');\n\t\n\t\t$connection = Yii::$app->getDb();\n\t\t$result = Jetproductinfo::saveNewRecords($data['data'],$data['merchant_id'],$connection);\n\t}", "public function store()\n {\n $this->product->name = $_POST['name'];\n $this->product->price = $_POST['price'];\n $this->product->description = $_POST['description'];\n $this->product->category_id = $_POST['category_id'];\n\n // create the product\n if($this->product->create()){\n echo \"<div class=\\\"alert alert-success alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Product was created.\";\n echo \"</div>\";\n }\n\n // if unable to create the product, tell the user\n else{\n echo \"<div class=\\\"alert alert-danger alert-dismissable\\\">\";\n echo \"<button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-hidden=\\\"true\\\">&times;</button>\";\n echo \"Unable to create product.\";\n echo \"</div>\";\n }\n }", "public function store(Request $request)\n {\n product_client::create($request->all());\n }", "public function store(ProductRequest $request)\n {\n $data = $request->all();\n Product::create([\n 'Product_name' => $data['Product_name'],\n 'description' => $data['description'],\n 'section_id' => $data['section_id'],\n 'created_at' => now()\n ]);\n Session::flash('success','تمت اضافة المنتج بنجاح');\n return redirect()->back();\n }", "public function create(Request $request)\n {\n // Is the Menu published, if so, you cannot create product.\n if (Menu::find($request->input('menu_id'))->period->status == 'visible') {\n return response()->json(['status' => 2]); // forbidden\n } else {\n $product = new Product;\n $product->menu_id = $request->input('menu_id');\n $product->name = $request->input('name');\n $product->unit_type = $request->input('unit_type');\n $product->inventory = $request->input('inventory');\n $product->price = $request->input('price');\n $product->description = $request->input('description');\n $product->save();\n\n return response()->json([\n 'product_id' => $product->getAttribute('id'),\n 'status' => 0\n ]);\n }\n }", "public function store(CreateProductRequest $request)\n {\n $input = $request->all();\n\n $product = $this->productService->create($input);\n\n Flash::success('Product saved successfully.');\n\n return redirect(route('products.index'));\n }", "public function store(ProductRequest $request)\n {\n Product::create($request->all());\n return redirect()->route('products.index')->with('info', 'Product addes successfully');\n }", "public function create(Product $product)\n {\n \n }", "public function create(Request $request)\n {\n\n $data = [\n 'title' => $request->title,\n 'sku' => $request->sku,\n 'warehouses_id' => $request->warehouse_id,\n 'description' => $request->description\n ];\n\n Products::create($data);\n\n return;\n\n }" ]
[ "0.6411869", "0.6360106", "0.6353351", "0.63149637", "0.63084435", "0.6269012", "0.62610835", "0.6237266", "0.61834115", "0.61123335", "0.61063516", "0.6103958", "0.6092949", "0.60666865", "0.6051973", "0.603461", "0.6029515", "0.6026004", "0.602499", "0.6003323", "0.5988656", "0.5987096", "0.5970528", "0.59687734", "0.5964759", "0.5958163", "0.59484506", "0.5939684", "0.592517", "0.59250146" ]
0.7722122
0
Decodes the ETF bytes array (a small tuple) to an object.
static function decodeSmall(Decoder $etf, string $data, int &$pos): BaseObject { $length = \ord($data[$pos]); $tuple = array(); for(; $length > 0; $length--) { $pos++; $tuple[] = $etf->parseAny($data[$pos], $data, $pos); } return (new static($tuple)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function decodeLarge(Decoder $etf, string $data, int &$pos): BaseObject {\n $length = \\unpack('N', $data[$pos++].$data[$pos++].$data[$pos++].$data[$pos])[1];\n \n $tuple = array();\n for(; $length > 0; $length--) {\n $tuple[] = $etf->parseAny($data[++$pos], $data, $pos);\n }\n \n return (new static($tuple));\n }", "abstract function decode($bytes);", "abstract public function decode($data);", "public function decodeBlob( $b ) {\n\t\treturn $b;\n\t}", "private function unpackData()\n {\n return json_decode($this->packedData, true);\n }", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data);", "public function deserialize($data);", "public function unpack($raw);", "private function objectFromBlob($blob){\n return json_decode($blob);\n }", "public function decode(array $txData): array;", "static function decodeSimple($o){\n\t\t// get type\n\t\t$pos = strpos($o,\"\\n\");\n\t\tif($pos !== false){\n\t\t\t$type = substr($o,2,$pos - 2);\n\t\t\t$endPos = $pos + strlen(\"\\n\");\n\t\t\t}\n\t\n\t\t// create object or array\n\t\tif(strlen($type) and $type != 'array' and class_exists($type))\n\t\t\t$ret = new $type;\n\t\telse\n\t\t\t$ret = array();\n\t\n\t\tself::complexify($ret,$o,$endPos);\n\t\n\t\t//funx::debug(var_export($ret,true),'object decoded');\n\t\treturn $ret;\n\t\t}", "public function decode ($raw);", "public function decode($raw);", "public function decodeBytes(string $bytes): UuidInterface;", "private function convert_array_to_object($array)\n {\n return json_decode(json_encode($array), FALSE);\n }", "function deserialise(string $data): void;", "protected function decodeData($value) {\n\t\treturn wireDecodeJSON($value);\n\t}", "public function deserialize($data)\n {\n }", "public static function deserialize(array $body);", "function sqlite_udf_decode_binary($data)\n{\n}", "public function decode($binary, array $tagMap = []): AbstractType;", "function frame_decode($frame_ref, $offset) { return Frame::frame_decode($this, $frame_ref, $offset); }", "public function arrayToObjectR(array $array): object;", "public function convertToObject(\\SetaPDF_Core_Type_Raw $data) {}", "public function arrayToObject($array): static;" ]
[ "0.6682192", "0.6189172", "0.57958674", "0.5763395", "0.5721916", "0.56966853", "0.56966853", "0.56966853", "0.56966853", "0.56966853", "0.5650378", "0.5591325", "0.55898213", "0.5543718", "0.55316913", "0.5479639", "0.54089534", "0.53799635", "0.5364158", "0.5315713", "0.5297132", "0.5283597", "0.5244054", "0.5236579", "0.52182716", "0.52042043", "0.5178028", "0.5156187", "0.51496875", "0.5125865" ]
0.64004236
1
Decodes the ETF bytes array (a large tuple) to an object.
static function decodeLarge(Decoder $etf, string $data, int &$pos): BaseObject { $length = \unpack('N', $data[$pos++].$data[$pos++].$data[$pos++].$data[$pos])[1]; $tuple = array(); for(; $length > 0; $length--) { $tuple[] = $etf->parseAny($data[++$pos], $data, $pos); } return (new static($tuple)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function decodeSmall(Decoder $etf, string $data, int &$pos): BaseObject {\n $length = \\ord($data[$pos]);\n \n $tuple = array();\n for(; $length > 0; $length--) {\n $pos++;\n $tuple[] = $etf->parseAny($data[$pos], $data, $pos);\n }\n \n return (new static($tuple));\n }", "abstract function decode($bytes);", "public function decodeBlob( $b ) {\n\t\treturn $b;\n\t}", "abstract public function decode($data);", "private function unpackData()\n {\n return json_decode($this->packedData, true);\n }", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data) {}", "public function decode($data);", "public function unpack($raw);", "public function decode(array $txData): array;", "public function deserialize($data);", "private function objectFromBlob($blob){\n return json_decode($blob);\n }", "function sqlite_udf_decode_binary($data)\n{\n}", "static function decodeSimple($o){\n\t\t// get type\n\t\t$pos = strpos($o,\"\\n\");\n\t\tif($pos !== false){\n\t\t\t$type = substr($o,2,$pos - 2);\n\t\t\t$endPos = $pos + strlen(\"\\n\");\n\t\t\t}\n\t\n\t\t// create object or array\n\t\tif(strlen($type) and $type != 'array' and class_exists($type))\n\t\t\t$ret = new $type;\n\t\telse\n\t\t\t$ret = array();\n\t\n\t\tself::complexify($ret,$o,$endPos);\n\t\n\t\t//funx::debug(var_export($ret,true),'object decoded');\n\t\treturn $ret;\n\t\t}", "public function decodeBytes(string $bytes): UuidInterface;", "public static function deserialize(array $body);", "public function decode ($raw);", "public function decode($raw);", "function frame_decode($frame_ref, $offset) { return Frame::frame_decode($this, $frame_ref, $offset); }", "public function decode($binary, array $tagMap = []): AbstractType;", "function deserialise(string $data): void;", "private function convert_array_to_object($array)\n {\n return json_decode(json_encode($array), FALSE);\n }", "protected function decodeData($value) {\n\t\treturn wireDecodeJSON($value);\n\t}", "public function deserialize($data)\n {\n }", "function xmlrpc_decoder($xmlrpc_val)\n {\n $kind = $xmlrpc_val->kindOf();\n\n if ($kind == 'scalar')\n {\n return $xmlrpc_val->scalarval();\n }\n elseif ($kind == 'array')\n {\n reset($xmlrpc_val->me);\n list($a,$b) = each($xmlrpc_val->me);\n $size = count($b);\n\n $arr = array();\n\n for ($i = 0; $i < $size; $i++)\n {\n $arr[] = $this->xmlrpc_decoder($xmlrpc_val->me['array'][$i]);\n }\n return $arr;\n }\n elseif ($kind == 'struct')\n {\n reset($xmlrpc_val->me['struct']);\n $arr = array();\n\n while (list($key,$value) = each($xmlrpc_val->me['struct']))\n {\n $arr[$key] = $this->xmlrpc_decoder($value);\n }\n return $arr;\n }\n }", "function arrayIntoObject (&$object,$array) {\nwhile(list($key,$val)=@each($array)) {\n if (!is_numeric($key)) {\n if ($v2 = @unserialize($val)) { $val = $v2; }\n $object->$key = $val;\n }\n}\n}", "abstract protected function unserializeData(array $data);" ]
[ "0.6395274", "0.62112725", "0.5846947", "0.5782601", "0.5775643", "0.5642737", "0.5642737", "0.5642737", "0.5642737", "0.5642737", "0.5609598", "0.55687517", "0.5566453", "0.5555274", "0.5521541", "0.5378768", "0.5374671", "0.5344452", "0.52841973", "0.5262716", "0.52363163", "0.52213407", "0.52211475", "0.52210575", "0.5217562", "0.52169096", "0.52104247", "0.5189696", "0.5171515", "0.51707673" ]
0.70681643
0
find all rows from database associted with given model class
public function all($model){ if(!class_exists($model)){ return new $model; } $table = $this->getTableName($model); $stmt = $this->pdo->prepare('select * from ' . $table); $stmt->execute(); return $stmt->fetchAll(\PDO::FETCH_CLASS, $model); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAll($model)\n {\n $sql = \"SELECT * FROM {$this->table}\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_CLASS,get_class($this->model));\n }", "public function modelFetchAll(){\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban\");\n\t\t\t//tra ve tat ca cac ban ghi\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function find() {\r\n\t\t\t$class = new ReflectionObject($this);\r\n\t\t\t$properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);\r\n\r\n\t\t\t// Loop through the properties to set them from the current row\r\n\t\t\t$select = $this->db->select();\r\n\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t$name = $property->getName();\r\n\t\t\t\t// Set only DO field names of subclass\r\n\t\t\t\tif ($property->class == $class->name) {\r\n\t\t\t\t\tif (!is_null($this->$name)) {\r\n\t\t\t\t\t\t$columnName = $this->map($name);\r\n\t\t\t\t\t\t$select->where(\"$columnName = ?\", $this->$name);\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$select->from($this->table);\r\n\t\t\t$stmt = $this->db->query($select);\r\n\t\t\t$rs = $stmt->fetchAll();\r\n\r\n\t\t\t$dataobjects = array();\r\n\t\t\tforeach ($rs as $row) {\r\n\t\t\t\t$dataobject = new $class->name($this->app);\r\n\t\t\t\treset($properties);\r\n\t\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t\t$name = $property->getName();\r\n\t\t\t\t\t$dataobject->$name = $row[$this->map($name)];\r\n\t\t\t\t}\r\n\t\t\t\t$dataobjects[] = $dataobject;\r\n\t\t\t}\r\n\t\t\treturn $dataobjects;\r\n\t\t}", "public static function find_all()\n {\n return static::find_by_sql(\"SELECT * FROM \".self::$table_name.\";\");\n }", "public static function find_all()\n {\n return self::find_by_sql(\"SELECT * from \".self::$table_name);\n }", "public static function find_all() {\r\n\t\treturn self::find_by_sql(\"SELECT * FROM \".self::$table_name);\r\n\t}", "public function findAll(){\n //recupere le nom de la classe et le formate\n $table = strtolower(get_class($this));\n\n //Prepare la requete\n $query = \"SELECT * FROM $table\";\n $results = $this->conn->prepare($query);\n\n //Execution requete et stockage resultats dans une variable\n $results->execute();\n $resultats = $results->fetchAll(PDO::FETCH_ASSOC);\n return $resultats;\n }", "public function findAll()\n {\n $this->ensureIsConfigured();\n $classname = $this->getRecordClassname();\n return $classname::find();\n }", "public function findAll($model);", "public static function find_all(){\n global $database;\n $result_set = static::find_by_sql(\"SELECT * FROM \".static::$table_name);\n return $result_set;\n }", "public function findAll()\n {\n return $this->driver->findAll($this->model);\n }", "function get_all()\n {\n return $this->db->get($this->table)->result();\n }", "public function getAll(){\n\t\treturn $this->db->get($this->table);\n\t}", "public function get(){\n\n if(is_null($this->columns)) $this->columns = ['*'];\n $select_statement = $this->grammer->compileSelect($this);\n \n \n $result = $this->connection->get($select_statement); \n \n if(!empty($this->model)){\n \n return $this->return_results_objects($result);\n\n }else{\n \n return $this->return_result_as_array($result);\n }\n \n }", "public function all()\n {\n return $this->model->get();\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 static function all() {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$liste = db::findAll(db::table($table));\n\t\treturn $liste;\n\t}", "public static function findAll()\n\t\t{\n\t\t\t$tb = self::get('tabla') ;\n\t\t\t\n\t\t\treturn Database::getInstance()\n\t\t\t\t\t->query(\"SELECT * FROM $tb ;\")\n\t\t\t\t\t->getObjects(get_called_class()) ;\n\t\t}", "public function findCriteria()\r\n\t{\n\t\t$result = $this -> connection -> setTable($this -> entity)\n\t\t\t\t\t\t\t\t\t -> fetch();\r\n\n\t\treturn $result;\r\n\t}", "public function getAll()\n {\n return $this->db->table($this->tableName)->select('*')->findAll();\n }", "public function all()\n {\n return $this->model->get();\n }", "public function findAll() {\r\n$sql = \"SELECT * FROM $this->tabela\";\r\n$stm = DB::prepare($sql);\r\n$stm->execute();\r\nreturn $stm->fetchAll();\r\n}", "public function getAll()\n {\n return $this->prepare(DB::findAll($this->table));\n }", "public function find($model, $id){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table . ' where id=?');\n $stmt->execute([$id]);\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "protected function findModel()\n {\n $class = $this->model;\n $query = $class::query();\n\n foreach ($this->input as $key => $value) {\n $where = is_array($value) ? 'whereIn' : 'where';\n $query->$where($key, $value);\n }\n\n return $query->get();\n }", "public static function find_all(){\n\n return static::find_by_query(\"SELECT * FROM \" . static::$table_users);\n\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM \".$this->table;\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_OBJ);\n \n }", "public function all()\r\n {\r\n return $this->db->table($this->table)->get();\r\n }", "public function find()\n {\n return $this->model->find(1)->toArray();\n }", "public function fetchAll();" ]
[ "0.7110202", "0.70281315", "0.7025125", "0.70193225", "0.7010695", "0.6993319", "0.6857536", "0.6853986", "0.6841917", "0.67934513", "0.67653817", "0.67347395", "0.6732563", "0.6720762", "0.6713448", "0.6712909", "0.67030215", "0.6639903", "0.6607262", "0.65681994", "0.6562364", "0.6561587", "0.6557915", "0.65219164", "0.6509195", "0.64993525", "0.6498563", "0.6486875", "0.64740944", "0.64736813" ]
0.7677564
0
find all rows from database associted with given model class by id
public function find($model, $id){ if(!class_exists($model)){ return new $model; } $table = $this->getTableName($model); $stmt = $this->pdo->prepare('select * from ' . $table . ' where id=?'); $stmt->execute([$id]); return $stmt->fetchAll(\PDO::FETCH_CLASS, $model); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function findById($id)\n\t{\n\t\t$model = new self;\n\t\treturn $model->fetchRow($model->select()->where('id=?', $id));\n\t}", "public function findById($id)\n {\n return $this->model->find($id);\n //return $this->model->whereId($id)->get();\n }", "public function find($id){\n return $this->db->find($this->table,$id);\n }", "public function findById($id){\n //recupere le nom de la classe et le formate\n $table = strtolower(get_class($this));\n\n //Prepare la requete\n $query = \"SELECT * FROM $table WHERE id=$id\";\n $results = $this->conn->prepare($query);\n\n //Execution requete et stockage resultats dans une variable\n $results->execute();\n $resultats = $results->fetchAll(PDO::FETCH_ASSOC);\n return $resultats;\n }", "public function findByID($id){\n return $this->Find(self::TABLE,$id);\n }", "public function find($id){\n return parent::find($this->table, $id);\n }", "function get_by_id($id) {\r\n $this->db->where('id', $id);\r\n return $this->db->get($this->tbl);\r\n }", "public function find($model, $id);", "public function fetchById($id)\r\n {\r\n return $this->findByPk($id);\r\n }", "public function find($id) {\r\n\t\t$this->query = \"SELECT * FROM \" . strtolower($this->table) . \" WHERE id=\" . $id;\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. find()\");\r\n\r\n\t\t# Fetch the data\r\n\t\t$result = $result->FetchAll();\r\n\r\n\t\t/*# Convert array to object, so we can use -> instead of ['']\r\n\t\t$result = json_decode(json_encode($result), FALSE);*/\r\n\r\n\t\t# Return this instance of the class, so we can chain methods\r\n\t\treturn $result;\r\n\t}", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);", "public function find($id);" ]
[ "0.7439723", "0.7430075", "0.72887707", "0.7227014", "0.71489674", "0.7062684", "0.7039826", "0.70137835", "0.70119137", "0.70022655", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033", "0.6965033" ]
0.74587345
0
BID /add a new bid for an item by a specific user
public function addBid($itemid, $buserid, $bidamount) { $itemid = mysql_real_escape_string( $itemid); $buserid = mysql_real_escape_string( $buserid); $biddate = date('Y-m-d'); $bidtime = time('H:i:s'); $bidamount = mysql_real_escape_string($bidamount); $sql="INSERT INTO bid VALUES( $itemid, $buserid,$biddate, $bidtime, $bidamount)"; $result=mysql_query($sql); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddBidApi()\n {\n $this->user = factory(User::class)->create();\n $user2 = factory(User::class)->create();\n $flight = $this->addFlight($this->user);\n\n $uri = '/api/user/bids';\n $data = ['flight_id' => $flight->id];\n\n $body = $this->put($uri, $data);\n $body = $body->json('data');\n\n $this->assertEquals($body['flight_id'], $flight->id);\n\n // Now try to have the second user bid on it\n // Should return a 409 error\n $response = $this->put($uri, $data, [], $user2);\n $response->assertStatus(409);\n\n // Try now deleting the bid from the user\n $response = $this->delete($uri, $data);\n $body = $response->json('data');\n $this->assertCount(0, $body);\n }", "public function addBid($auctionID, $userId, $bidPrice, $bidDate){\n\t\t$bidQuery = \"INSERT INTO `bids` (`auctionID`, `userId`, `bidPrice`, `bidDate`) VALUES ('$auctionID', '$userId', '$bidPrice', '$bidDate') ON DUPLICATE KEY UPDATE `bidDate` = '$bidDate', `bidPrice`='$bidPrice'\";\n\t\t//update auction bid count\n\t\t$updateQuery = \"UPDATE `auction` SET bids = bids+1 WHERE auctionID='$auctionID'\";\n\n\t\tif(mysqli_query($this->conn, $bidQuery) && mysqli_query($this->conn, $updateQuery)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function insertProjectBid($user_id,$userData,$userFile)\n\t\t{\n\t\t\t//checking that project is open or not\n\t\t\t$project_values = $this->manageContent->getValue_where(\"project_info\",\"*\",\"project_id\",$userData['pid']);\n\t\t\tif(empty($project_values[0]['award_bid_id']) && time() <= strtotime($project_values[0]['ending_date'].' 23:59:59'))\n\t\t\t{\n\t\t\t\t//checking that is bids is remaining\n\t\t\t\t$bids_left = $this->manageContent->getLastValue_where('user_bid_details', '*', 'user_id', $user_id, 'id');\n\t\t\t\tif($bids_left[0]['bids_remaining'] > 0)\n\t\t\t\t{\n\t\t\t\t\t//getting user info\n\t\t\t\t\t$userInfo = $this->manageContent->getValue_where(\"user_info\",\"*\",\"user_id\",$user_id);\n\t\t\t\t\tif(!empty($userInfo[0]))\n\t\t\t\t\t{\n\t\t\t\t\t\t//create bid id\n\t\t\t\t\t\t$bid_id = uniqid('bid');\n\t\t\t\t\t\t//uploading bid attachement file\n\t\t\t\t\t\tif(!empty($userFile['file']['name']) && !empty($userFile['file']['size']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$original_file = $userFile['file']['name'];\n\t\t\t\t\t\t\t//get unix timestamp\n\t\t\t\t\t\t\t$unixTimeStamp = time();\n\t\t\t\t\t\t\t//image desired name\n\t\t\t\t\t\t\t$bid_file_name = md5($bid_id.$unixTimeStamp);\n\t\t\t\t\t\t\t$bid_pic = $this->manageFileUploader->upload_document_file($bid_file_name,$userFile['file'],'../files/project/');\n\t\t\t\t\t\t\t$bid_file = 'files/project/'.$bid_pic;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$original_file = '';\n\t\t\t\t\t\t\t$bid_file = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//get bid amount and currency\n\t\t\t\t\t\t$bid_amount = intval($userData['bid_price']);\n\t\t\t\t\t\t$currency = '$';\n\t\t\t\t\t\t//getting date, time, ip of bid post\n\t\t\t\t\t\t$curDate = $this->getCurrentDate();\n\t\t\t\t\t\t$curTime = $this->getCurrentTime();\n\t\t\t\t\t\t$ip = $this->manageUtility->getIpAddress();\n\t\t\t\t\t\t//setting status = 1\n\t\t\t\t\t\t$status = 1;\n\t\t\t\t\t\t//inserting the value to table\n\t\t\t\t\t\t$column_name = array(\"bid_id\",\"project_id\",\"user_id\",\"description\",\"original_file\",\"file\",\"currency\",\"amount\",\"time_range\",\"date\",\"time\",\"ip\",\"status\");\n\t\t\t\t\t\t$column_value = array($bid_id,$userData['pid'],$user_id,$userData['bid_pro'],$original_file,$bid_file,$currency,$bid_amount,$userData['time_range'],$curDate,$curTime,$ip,$status);\n\t\t\t\t\t\t$insert = $this->manageContent->insertValue(\"bid_info\",$column_name,$column_value);\n\t\t\t\t\t\t//increasing total no of bids in project info table\n\t\t\t\t\t\tif($insert == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//increment the value by 1\n\t\t\t\t\t\t\t$increamentValue = $this->manageContent->increamentValue(\"project_info\",\"total_bids\",1,\"project_id\",$userData['pid']);\n\t\t\t\t\t\t\t//for decrement remaining bids number after a bid\n\t\t\t\t\t\t\t$remaining_bids = $bids_left[0]['bids_remaining'] - 1;\n\t\t\t\t\t\t\t$update_bids = $this->manageContent->updateValueMultipleCondition('user_bid_details', 'bids_remaining', $remaining_bids, array('user_id', 'status'), array($user_id, 1));\n\t\t\t\t\t\t\t//get user details\n\t\t\t\t\t\t\t$userDetails = $this->getEmailIdFromUserId($user_id);\n\t\t\t\t\t\t\t//mail to the contractor\n\t\t\t\t\t\t\t$this->mailSent->mailAfterBidding($userDetails[0],$userDetails[1],$project_values[0]['title']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $insert;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn 'You Have To Fill Up Your Personal Information, Then Only You Are Eligible To Place A Bid!!';\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\treturn 'You have no bids left';\t\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 'Job Is Closed. You Can Not Place Bid!!';\n\t\t\t}\n\t\t\t\n\t\t}", "public function placeBid(User $user, $amount)\n {\n $bid = Bid::updateOrCreate(\n [\n 'user_id' => $user->id,\n 'product_id' => $this->id],\n [\n 'amount' => $amount\n ]);\n\n // Todo: dispatch runAutoBidEvent\n\n return $bid;\n }", "public function addBedOffer($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "public function whmcs_add_billable_item($params = array()) {\n\t\t$params['action'] = 'AddBillableItem';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function add()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t\n\t\t# user has posted the new bid information\n\t\tif(!empty($_POST)){\n\t\t\t# Upload the file before you proceed with the rest of the process\n\t\t\t$fileUrls = upload_many_files($_FILES, 'document__fileurl', 'document_', 'pdf,doc,docx');\n\t\t\t$_POST['documents'] = !empty($fileUrls)? $fileUrls: array();\n\t\t\t$result = $this->_bid->add($_POST);\n\t\t\t\n\t\t\tif(!$result['boolean']) echo \"ERROR: The bid could not be added. \".$result['reason'];\n\t\t}\n\t\t# just coming to the form\n\t\telse {\n\t\t\t# if the tender notice id is provided\n\t\t\tif(!empty($data['t'])){\n\t\t\t\t$this->load->model('_tender');\n\t\t\t\t$data['tender'] = $this->_tender->details($data['t']);\n\t\t\t}\n\t\t\tif(!empty($data['d'])) $data['bid'] = $this->_bid->details(array('bid_id'=>$data['d']));\n\t\t\telse if(!empty($data['t'])) $data['bid'] = $this->_bid->details(array('tender_id'=>$data['t']));\n\t\t\t\n\t\t\t$this->load->view('bids/new_bid', $data);\n\t\t}\n\t}", "public function addBreed($breed_name,$user)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$q = \"SELECT max(breed_id)\r\n\t\t\t\t\tFROM pig_breeds\";\r\n\t\t\t\t$r = mysqli_query($link, $q);\r\n\t\t\t\t$ro = mysqli_fetch_row($r);\r\n\t\t\t\t$max = $ro[0] + 1;\r\n\t\t\t\t$query = \"INSERT INTO pig_breeds(breed_id,breed_name) \r\n\t\t\t\t\t\tVALUES('\" . $max . \"','\" . $breed_name . \"');\";\r\n\t\t\t\tif ($result = mysqli_query( $link, $query )) {\r\n\t\t \t$data = array(\"success\"=>\"true\",\r\n\t\t \"newId\"=> $link->insert_id);\r\n\t \t\t\t$this->userTransactionEdit($user,$max,\"breed\",0,$breed_name,1,0);\r\n\t\t\t }else {\r\n\t\t\t $data = array(\"success\"=>\"false\",\r\n\t\t\t \"error\"=>mysqli_error($link));\r\n\t\t\t }\r\n\t\t\t return $data;\r\n\t\t}", "public function actionSaveBid(){\n\t\t$question_id = $_GET['question_id'];\n\t\t$option_id = $_GET['option_id'];\n\t\t$bid_amount = $_GET['bid'];\n\t\t$question_max_bid_amount = $_GET['question_max_bid_amount'];\n\t\t//$user_model = getUserBalance($fb_me['id']);\n\t\t$question_model = Questions::model()->findByPk($question_id);\n\t\t$question_max_bid_amount = $question_model->maximum_bid_amount;\n\t\tif (strtotime($question_model->end_time) < time()){\n\t\t\techo \"ERROR: Oops! you are late, Bidding on this question is closed\";\t\n\t\t} else {\n\t\t\t$authentic = new Authentication();\n\t $status = $authentic->authenticate();\n\t\t\tif ($status == 'TRUE')\n\t\t\t{\n\t\t\t\t$fb_me = $authentic->getMe();\t\t\t\n\t\t\t\t$me = $fb_me['id'];\n\t\t\t\t$criteria1 = new CDbCriteria;\n\t\t\t\t$criteria1->condition = 'uid=:u';\n\t\t\t\t$criteria1->params = array('u'=>$fb_me['id']);\n\t\t\t\t$user = UserInfo::model()->find($criteria1);\n\t\t\t\tif($user->invite_money_status == 'invited') {\n\t\t\t\t\t$user->invite_money_status = 'transfer_pending';\n\t\t\t\t\t$user->save();\n\t\t\t\t\tprint_r($user->getErrors());\n\t\t\t\t}\n\t\t\t\t$user_model = $this->getUserBalance($me);\n\t\t\t\tif ($user_model !== NULL){\n\t\t\t\t\tforeach ($user_model as $key => $value) {\n\t\t\t\t\t\t$id = $value->id;\n\t\t\t\t\t\t$user_balance = $value->closing_balance;\n\t\t\t\t\t}\n\t\t\t\t\t$user_question_pot = $this->getUserPot($id, $question_id);\t\n\t\t\t\t\tif($user_question_pot === NULL){\n\t\t\t\t\t\t$user_question_pot = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (($user_question_pot + $bid_amount) > $question_max_bid_amount){\n\t\t\t\t\t\techo \"ERROR: Maximum bid amount is \".$question_max_bid_amount.\" for this question. You have already bid: \".$bid_amount;\n\t\t\t\t\t} else if ($bid_amount > $question_max_bid_amount){\n\t\t\t\t\t\techo \"ERROR: Maximum bid amount is \".$question_max_bid_amount.\" for this question.\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$question_model = Questions::model()->findAllByPk($question_id);\n\t\t\t\t\t\tforeach ($question_model as $key => $value) {\n\t\t\t\t\t\t\t$event_id = $value->event_id;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$bid_amount = abs($bid_amount);\n\t\t\t\t\t\tif ($this->saveBidInfo($id, $bid_amount, $question_id, $option_id, $event_id)){\n\t\t\t\t\t\t\t/* We need to pass $id rather than $me to update user closing balance */\n\t\t\t\t\t\t\t$user_balance = $this->updateUserProfileInfo($id, $bid_amount);\t\n\t\t\t\t\t\t\t$trans_create_time = $this->saveTransactionInfo($id, $bid_amount, $question_id, $option_id, $event_id);\n\t\t\t\t\t\t\t$this->saveBankReconInfo($id, $bid_amount, $trans_create_time);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Send updated Balance information to the View */\n\t\t\t\t\t\t\t$user_info['question_pot_user'] = $user_question_pot + $bid_amount;\n\t\t\t\t\t\t\t$user_info['user_balance'] = $user_balance;\n\t\t\t\t\t\t\techo json_encode($user_info);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"ERROR: Sorry We lost your Bid\";\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo \"ERROR: Sorry We Lost You\";\n\t\t\t\t}\t\t\n\t\t\t} else {\n\t\t\t\t$this->redirect(array('/application/main'));\n\t\t\t}\n\t\t}\t\t\n\t}", "public function update(User $user, Bid $bid)\n {\n //\n }", "public function wkauto_auctionbids_insertbids($data,$user){\n\n\t\t$date = new DateTime('2014-06-1', new DateTimeZone($this->config->get('wkproduct_auction_timezone_set')));\n\t\t$zone = $date->format('P');\n\t\t$query = \"SELECT CONVERT_TZ(NOW(), @@session.time_zone, '$zone') as time;\";\n\t\t$data_time = $this->db->query($query)->row;\n\t\t\n\t\t$time = date(\"Y-m-d H:i:s\", strtotime($data_time['time']));\n\t\t\n\t\t$userExist = $this->db->query(\"SELECT user_id,product_id FROM \".DB_PREFIX.\"wk_automatic_auctionbids WHERE user_id = '\".$data['user'].\"' AND product_id='\".$data['product_id'].\"' AND winner = 0 \" )->row;\n\n $sql=$this->db->query(\"SELECT MAX(wab.user_bid) id,wa.min,wa.max,wa.product_id FROM \" . DB_PREFIX . \"wkauction wa LEFT JOIN \". DB_PREFIX . \"wk_automatic_auctionbids wab ON (wa.id=wab.auction_id) WHERE wa.id = '\" . (int)$data['auction'] . \"' AND wab.winner = 0 AND wab.start_date<='\".$time.\"' AND wab.end_date>='\".$time.\"' \")->row;\n\n $normal_max_bid=$this->db->query(\"SELECT MAX(wab.user_bid) id,wa.min,wa.max,wa.product_id FROM \" . DB_PREFIX . \"wkauction wa LEFT JOIN \". DB_PREFIX . \"wkauctionbids wab ON (wa.id=wab.auction_id) WHERE wa.id = '\" . (int)$data['auction'] . \"' AND wab.winner = 0 AND wab.start_date<='\".$time.\"' AND wab.end_date>='\".$time.\"' \")->row;\n\n $range = $this->db->query(\"SELECT min,max FROM \".DB_PREFIX.\"wkauction WHERE id='\".$data['auction'].\"' \")->row;\n\n if($data['amount']>=$range['max'] || $data['amount']<=$range['min']){\n\t\t\t return 'not done';\n\t\t\t}\n\n\t\t\tif(isset($normal_max_bid['product_id'])){\n\t\t\t\t if(count($normal_max_bid)!=0 && $data['amount']<=$normal_max_bid['id']){\n\t\t\t\t return 'not_min_auction'; //only for checking not messages\n\t\t\t\t }\n\n }\n\n if(isset($sql['product_id'])){\n\n\t\t\t\t if(count($sql)!=0 && $data['amount']<=$sql['id']){\n\t\t\t\t return 'not'; //only for checking not messages\n\t\t\t\t }\n }\n \n\t if($userExist) {\n\t \t\t$sql = \"UPDATE \" . DB_PREFIX . \"wk_automatic_auctionbids SET winner='0',sold='0',auction_id = '\" . (int)$data['auction']. \"', user_id = '\" .(int)$user.\"', product_id = '\" .(int)$data['product_id'].\"', start_date = '\" .$this->db->escape($data['start_date']). \"', end_date = '\" .$this->db->escape($data['end_date']).\"', date = '\".$time.\"', user_bid = '\" .(double)$data['amount'].\"' WHERE user_id = '\".$userExist['user_id'].\"' AND product_id = '\".$userExist['product_id'].\"' AND winner = 0 \";\n\t \t\n\t \t$query=$this->db->query($sql);\n\t }else{\n\t \t\t$sql = \"INSERT INTO \" . DB_PREFIX . \"wk_automatic_auctionbids SET winner='0',sold='0',auction_id = '\" . (int)$data['auction']. \"', user_id = '\" .(int)$user.\"', product_id = '\" .(int)$data['product_id'].\"', start_date = '\" .$this->db->escape($data['start_date']). \"', end_date = '\" .$this->db->escape($data['end_date']).\"', date = '\".$time.\"', user_bid = '\" .(double)$data['amount'].\"'\";\n\t \t\t\n\t \t$query=$this->db->query($sql);\n\t }\n return 'done'; //only for checking not mesaages\n\t}", "function bidItem($conn,$userID){\n\t$itemID = $_POST['itemID'];\n\t\n\t$sql_checktype = \"select auctiontype from Items where itemID = {$itemID} and status = 0\";\n\t$result = $conn->query($sql_checktype);\n\tif($result->num_rows>0)\n {\n\t\t$row = $result->fetch_assoc();\n\t\t$auctiontype = $row['auctiontype']; \n\t\t//Ebay\n\t if($auctiontype == '0'){\n\t\tbidinEBay($conn,$userID);\n\t\t}\n\t //Vickrey\n\t else if($auctiontype == '1'){\n\t\tbidinVickrey($conn,$userID);\n\t }\n\t //Dutch\n\t else if($auctiontype == '2'){\n\t\tbidinDutch($conn,$userID);\n\t }\n\t\t\n }\n\t\n\telse {\n\t\t$response = array();\n\t\t$response['data'] = 'The auction has ended';\n\t\t$response['status'] = 0;\n\t\techo json_encode($response);\n\t}\n\t\n}", "public function createBudget($user_id, $name) {\n\t\t$budget = new Budget();\n\t\t$dbh = Database::getPdo();\n\t\t\ttry {\n\t\t\t\t$created = date(\"Y-m-d H:i:s\");\n\t\t\t\t$sql = \"INSERT INTO \" . self::DB_TABLE . \" (user_id, name, created) VALUES (:user_id, :name, :created)\";\n\t\t\t\t$stmt = $dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(':user_id', $user_id, PDO::PARAM_INT);\n\t\t\t\t$stmt->bindParam(':name', $name, PDO::PARAM_STR,45);\n\t\t\t\t$stmt->bindParam(':created', $created);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$return = $stmt->rowCount();\n\t\t\t\tif ($return == 1) {\n\t\t\t\t\theader('Location:/dashboard');\n\t\t\t\t} elseif ($return != 1) {\n\t\t\t\t\techo 'Could not create budget.';\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (PDOException $e) {\n\t\t\t\techo 'Unable to create budget: ' . $e->getMessage();\n\t\t\t}\n\t\t}", "public function testBidForUserReturnViewNewDBEntry()\n {\n $this->setUp();\n\n $user = factory(User::class)->create();\n $role = factory(Role::class)->create(['name' => 'admin']);\n $specialty = factory(Specialty::class)->create();\n $user->specialties()->attach($specialty);\n $user->roles()->attach($role);\n\n factory(Officer::class)->create([ 'user_id' => 3 ]);\n\n //Create the Bid, Schedule, Spot and Shift\n factory(Schedule::class)->create([\n 'start_date' => '2019-11-23',\n 'end_date' => '2019-11-30',\n 'currently_active' => 1,\n ]);\n\n factory(Shift::class)->create([\n 'schedule_id' => 1,\n 'specialty_id' => 1,\n 'name' => 'Shift A'\n ]);\n\n factory(Spot::class)->create([\n 'shift_id' => 1,\n 'qty_available' => 2,\n 'wednesday_s' => '12:00:00',\n 'wednesday_e' => '20:00:00',\n 'thursday_s' => '12:00:00',\n 'thursday_e' => '20:00:00'\n\n ]);\n\n factory(BiddingQueue::class)->create([\n 'user_id' => 3,\n 'schedule_id' => 1,\n ]);\n\n $response = $this->post('/admin/schedules/bidforuser', ['spot_id' => 1, 'user_id' => 3, 'shift_id' => 1]);\n\n $bid = Bid::find(1);\n\n $this->assertNotEquals(0, $bid);\n $response->assertRedirect('/admin/schedule/1/biddingQueue');\n }", "function addItem ($userId, $item)\n\t{\n\t\t$now = date (\"Y-m-d H:i:s\");\n\t\t$query = sprintf ($this->queries['addItem'],\n\t\t\t$userId,\n\t\t\taddslashes ($item->parentId),\n\t\t\taddslashes ($item->isParent),\n\t\t\taddslashes ($item->name),\n\t\t\taddslashes ($item->description),\n\t\t\taddslashes ($item->visibility),\n\t\t\taddslashes ($item->category),\n\t\t\t$now,\n\t\t\taddslashes ($item->login),\n\t\t\taddslashes ($item->password),\n\t\t\taddslashes ($item->url));\n\t\t$result = $this->db->Execute($query)\n\t\t\tor die(\"AddItem: \" . $this->db->ErrorMsg() . \" \" . $query);\n\t}", "public function addToLove($userid,$itemid){\n if(isset($userid) && isset($itemid)){\n $params=array(\n \"user_id\" => $userid,\n \"item_id\" => $itemid\n );\n \n //insert data into cart\n $result=$this->insertIntoLove($params);\n if($result){\n //reload page\n header(\"Location: \".$_SERVER['PHP_SELF']);\n }\n }\n }", "function AddBid(&$bid)\n\t{\n\t\t$bid->supplierId = $this->supplierId;\n\t\t$found = false;\n\t\tforeach($this->_bidList as $bid2)\n\t\t{\n\t\t\tif ($bid->bidId > 0 && $bid->bidId == $bid2->bidId)\n\t\t\t{\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$found)\n\t\t{\n\t\t\t$this->_bidList[] = $bid;\n\t\t}\n\t}", "public function add_item($boat_id, $item, $type) {\n $data = array(\n 'BOAT_ID' => $boat_id,\n 'CL_DES' => $item,\n 'TYPE' => $type,\n 'CHECKED' => false\n );\n $this->db->insert('CL', $data);\n }", "function updateUserBid($user_id,$userData,$userFile)\n\t\t{\n\t\t\t//get the id number of this bid\n\t\t\t$id_nmbr = $this->manageContent->getValue_where(\"bid_info\",\"*\",\"bid_id\",$userData['bid']);\n\t\t\t//checking that project is open or not\n\t\t\t$project_values = $this->manageContent->getValue_where(\"project_info\",\"*\",\"project_id\",$id_nmbr[0]['project_id']);\n\t\t\tif(empty($project_values[0]['award_bid_id']) && time() <= strtotime($project_values[0]['ending_date'].' 23:59:59'))\n\t\t\t{\n\t\t\t\t$id = $id_nmbr[0]['id'];\n\t\t\t\tif(!empty($userFile['file']['name']) && !empty($userFile['file']['size']))\n\t\t\t\t{\n\t\t\t\t\t$original_file = $userFile['file']['name'];\n\t\t\t\t\t//get unix timestamp\n\t\t\t\t\t$unixTimeStamp = time();\n\t\t\t\t\t//image desired name\n\t\t\t\t\t$bid_file_name = md5($userData['bid'].$unixTimeStamp);\n\t\t\t\t\t$bid_pic = $this->manageFileUploader->upload_document_file($bid_file_name,$userFile['file'],'../files/project/');\n\t\t\t\t\t$bid_file = 'files/project/'.$bid_pic;\n\t\t\t\t\t//updating the file\n\t\t\t\t\t$update_orfile = $this->manageContent->updateValueWhere(\"bid_info\",\"original_file\",$original_file,\"id\",$id);\n\t\t\t\t\t$update_file = $this->manageContent->updateValueWhere(\"bid_info\",\"file\",$bid_file,\"id\",$id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//update the other field\n\t\t\t\tif(isset($userData['bid_pro']))\n\t\t\t\t{\n\t\t\t\t\t$updte_des1 = $this->manageContent->updateValueWhere(\"bid_info\",\"description\",$userData['bid_pro'],\"id\",$id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(isset($userData['bid_price']))\n\t\t\t\t{\n\t\t\t\t\t$updte_des2 = $this->manageContent->updateValueWhere(\"bid_info\",\"amount\",$userData['bid_price'],\"id\",$id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(isset($userData['bid_price']))\n\t\t\t\t{\n\t\t\t\t\t$updte_des3 = $this->manageContent->updateValueWhere(\"bid_info\",\"amount\",$userData['bid_price'],\"id\",$id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(isset($userData['time_range']))\n\t\t\t\t{\n\t\t\t\t\t$updte_des4 = $this->manageContent->updateValueWhere(\"bid_info\",\"time_range\",$userData['time_range'],\"id\",$id);\n\t\t\t\t}\n\t\t\t\tif($update_orfile == 1 || $update_file == 1 || $updte_des1 == 1 || $updte_des2 == 1 || $updte_des3 == 1 || $updte_des4 == 1)\n\t\t\t\t{\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 'Job Is Closed. You Can Not Modify Your Bid!!';\n\t\t\t}\n\t\t\t\t\n\t\t}", "function get_bid($bid){\n\t\t$this->bid = $bid;\n\t}", "public function addToBasketUser($params) {\n\n $basketUser = $this->getBasketUserFromAuth();\n\n // if there is no basket for this indentity we have to make it\n if ($basketUser == null) {\n $usersModel = new Application_Model_Users();\n $user = $usersModel->getUserByIdentityRole($this->getUserFromAuth());\n //var_dump($user);\n $paramUserId = array('usersId' => $user['usersID']);\n $basketId = $this->insert($paramUserId);\n } else {\n $basketId = $basketUser['basketID'];\n }\n // here we have to add the products to the db for details\n $insert_data = array(\n 'basketID' => $basketId,\n 'productID' => $params['id'],\n 'number' => $params['number']\n );\n\n $basketDetailModel = new Application_Model_BasketDetail();\n\n $result = $basketDetailModel->addToBasketDetail($insert_data);\n\n if ($result != null) {\n echo 'Product is toegevoegd';\n }\n }", "public function add_item()\n {\n $request = new Types\\AddItemRequestType();\n\n // An user token is required when using the Trading service.\n $request->RequesterCredentials = new Types\\CustomSecurityHeaderType();\n $request->RequesterCredentials->eBayAuthToken = $this->config->item('authToken');\n\n\n // Begin creating the auction item.\n $item = new Types\\ItemType();\n\n $item->DispatchTimeMax = 3;\n /**\n * We want a single quantity auction.\n * Otherwise known as a Chinese auction.\n */\n $item->ListingType = Enums\\ListingTypeCodeType::C_CHINESE;\n $item->Quantity = 1;\n\n $item->ProductListingDetails = new Types\\ProductListingDetailsType();\n $item->ProductListingDetails->ISBN = $ISBN;\n $item->ProductListingDetails->UPC = $UPC;\n $item->ProductListingDetails->EAN = $EAN;\n\n $item->ProductListingDetails->BrandMPN = new DTS\\eBaySDK\\Trading\\Types\\BrandMPNType();\n $item->ProductListingDetails->BrandMPN->Brand = '';\n $item->ProductListingDetails->BrandMPN->MPN = '';\n\n $item->ListingDuration = Enums\\ListingDurationCodeType::C_DAYS_7;\n\n }", "public function addBed($item, $id){\n\n $storedItem = ['qty' => 0, 'productPrice' => $item->productPrice, 'item' => $item];\n if($this->items){\n if(array_key_exists($id, $this->items)){\n $storedItem = $this->items[$id];\n }\n }\n\n $storedItem['qty']++;\n $storedItem['productPrice'] = $item->productPrice * $storedItem['qty'];\n $this->items[$id] = $storedItem;\n $this->totalQty++;\n $this->totalPrice += $item->productPrice;\n }", "public function addAuction($datePosted, $endDate, $startPrice, $resPrice, $itemID, $userId){\n\t\t$insertAuctionQuery = \"INSERT INTO `auction` (`datePosted`, `endDate`, `startPrice`, `resPrice`, `noViews`, `itemID`, `userId`, `bids`) VALUES ('$datePosted', '$endDate', '$startPrice', '$resPrice', 0, '$itemID', '$userId', 0)\";\n\t\tif(mysqli_query($this->conn, $insertAuctionQuery)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function buy($itemid)\n {\n //check for valid id for eg. it should be numeric\n //do buying\n\n }", "public function store($user, $id)\r\n {\r\n\t\t\r\n\t\t$facebook = new Facebook(array(\r\n\t\t 'appId' => Config::get('app.fbappid'),\r\n\t\t 'secret' => Config::get('app.fbappsecret'),\r\n\t\t));\r\n\t\t\r\n\t\t$user = $facebook->getUser();\r\n\t\t\r\n\t\tif (isset($user)) {\r\n\t\t\r\n $checkvote = Vote::where('fbid', '=', $user)->where('item_id', '=', $id)->count();\r\n\t\t\t\r\n\t\t\t\tif ($checkvote!=0) {\r\n\t\t\t\t\r\n\t\t\t\t\techo \"<h1>Hol dir deinen Blob!</h1><p class='error'>Du hast für diesen Teilnehmer bereits abgestimmt.</p>\";\r\n\t\t\t\t\r\n\t\t \t\t} else {\r\n\t\t\t\r\n\t\t\t\t\t$vote = new Vote;\t\t\r\n\t\t\t\t\t$vote->fbid = $user;\r\n\t\t\t\t\t$vote->item_id = $id;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$vote->save();\r\n\t\t\t\t\t\r\n\t\t\t\t\techo \"<h1>Hol dir deinen Blob!</h1><p class='message'>Danke für deine Stimme.</p>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*$response = $facebook->api(\r\n\t\t\t\t\t 'me/blobaustriavoting:vote',\r\n\t\t\t\t\t 'POST',\r\n\t\t\t\t\t array(\r\n\t\t\t\t\t\t'location' => \"http://app.blueberrymedia.at/blob/items/\".$id\r\n\t\t\t\t\t )\r\n\t\t\t\t\t);*/\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n }", "public function __construct($user, $outBidder, $oldBid, $bid, $item)\n {\n $this->user = $user;\n $this->outBidder = $outBidder;\n $this->oldBid = $oldBid;\n $this->bid = $bid;\n $this->item = $item;\n }", "public function placebid(Request $request, $id)\n {\n\n $transaction = new Transaction();\n $transaction->product_id = $id;\n $transaction->bid_amount = $request->get('amount');\n $transaction->bid_owner_email = $request->get('email');\n $transaction->description = 'New Product Bid !';\n $transaction->save();\n\n if(Transaction::where('bid_amount', '>', $request->get('amount'))) {\n event(new HigherBidder($request));\n }\n\n $product = Product::find($id);\n return view('shop.show', ['product' => $product]);\n }", "final public function addItemOwner() {\n $this->addUserByField('users_id', true);\n }", "function addBook($userid,$bookid,$num=1){\n \t\n \t\n \t$res=$this->fetchAll(\"userid=$userid AND bookid=$bookid\")->toArray();\n \t\n \t\n\n//======means the client has bought this kind of products before\n\t \tif (count($res)>0) { \t\t\t\t\n\t \t\t$data=array(\n\t \t\t\t'nums'=>$res[0]['nums']+1\n\t \t\t);\n\t \t\t$where=\"userid=$userid AND bookid=$bookid\";\n\t \t\t$this->update($data, $where);\n\t \t\treturn true;\n\t \t}else{\n//========means the client buy this kind of products first time\n\t\t \t$date=time();\n\t\t \t$data=array(\n\t\t \t\t\t'userid'=>$userid,\n\t\t \t\t\t'bookid'=>$bookid,\n\t\t \t\t\t'nums'=>$num, \n\t\t \t\t\t'date'=>$date\n\t\t \t);\n\t\t \t\n\t\t \tif ($this->insert($data)>0) {\n\t\t \t\t\n\t\t \t\treturn true;\n\t\t \t}else{\n\t\t \t\treturn false;\n\t\t \t}\n\t \t}\n \t\n }" ]
[ "0.6823075", "0.67634946", "0.6679334", "0.66029906", "0.63387895", "0.63337296", "0.6311391", "0.6289009", "0.62849826", "0.6234969", "0.6224868", "0.6202702", "0.6188577", "0.6183651", "0.61680514", "0.613493", "0.61273754", "0.6125426", "0.60928774", "0.6068024", "0.60511136", "0.60110873", "0.5988769", "0.59564936", "0.5924104", "0.5915486", "0.59037435", "0.58618027", "0.58447194", "0.5812759" ]
0.7319223
0
/FIND THE MAXIMUM BID FROM ALL bid history for a particular item
public function getmaxbid ($itemid){ //returns the max bid for an itel $itemid = mysql_real_escape_string( $itemid); $sql = "SELECT MAX(bidAmount) FROM bid WHERE itemid= '$itemid'"; $bidarray = mysql_fetch_array(mysql_query($sql)); $bid = $bidarray[0]; return $bid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdMax() {\n $sql = \"select ItemID from Mst_ItemList\";\n $query = $this->db->query($sql);\n $jml = $query->num_rows();\n if ($jml == 0) {\n $ItemID = \"001\";\n return $ItemID;\n } else {\n $sql = \"select max(ItemID) as ItemID from Mst_ItemList\";\n $query = $this->db->query($sql);\n $hasil = $query->result();\n $ItemID = $hasil[0]->ItemID;\n $ItemID = sprintf('%06u', $ItemID + 1);\n return $ItemID;\n }\n }", "function fetchLastBetID() {\n $query = \"SELECT BETID FROM \" . $this->table_name_1 . \n \" WHERE BETID = (select MAX(BETID) FROM \" . $this->table_name_1 . \n \" WHERE ACCOUNTID=\" . $this->accountID . \")\";\n\n $stmt = $this->database->executePlainSQL($query);\n return $stmt;\n }", "function _getMaxNr($a_item_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$q = \"SELECT max(nr) AS max_nr FROM map_area WHERE item_id = \".\n\t\t\t$ilDB->quote($a_item_id, \"integer\");\n\t\t$max_set = $ilDB->query($q);\n\t\t$max_rec = $ilDB->fetchAssoc($max_set);\n\n\t\treturn $max_rec[\"max_nr\"];\n\t}", "public function idMax ()\n {\n $db = $this->dbConnect ();\n $req = $db->query ('SELECT id_chapter,number_chapter FROM chapter ORDER BY id_chapter DESC LIMIT 0,1');\n $resultat = $req->fetch ();\n return $resultat;\n }", "function getMaxBatch(){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"SELECT MAX(batch_no) from breeding_tbl\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['MAX(batch_no)'];\n\n\t}\n\n\t$crud->disconnect();\n}", "public static function get_latest_bid( $post_id ) {\n global $wpdb;\n return $wpdb->get_var( $wpdb->prepare( 'SELECT bid FROM '.$wpdb -> prefix .'wauc_auction_log WHERE auction_id = %d ORDER BY date DESC', $post_id ) );\n }", "function recuperer_nb_bsm(){\n global $db;\n $sql = \"SELECT MAX(id) FROM bsm \";\n $req = $db->prepare($sql);\n $req-> execute();\n $results = array();\n while($rows = $req->fetchObject()){\n $results[] = $rows;\n }\n return $results;\n}", "function getHighestBid($dbh, $id)\n{\n try {\n $stmt = $dbh->prepare(\"SELECT MAX(Bodbedrag) as Hoogstebod FROM Bod b WHERE b.Voorwerp = :Voorwerp\"); /* prepared statement */\n $stmt->bindValue(\":Voorwerp\", $id, PDO::PARAM_STR); /* helpt tegen SQL injection */\n $stmt->execute(); /* stuurt alles naar de server */\n if ($results = $stmt->fetch()) {\n $row = $results['Hoogstebod'];\n }\n return $row;\n } catch (PDOException $e) {\n echo \"Fout\" . $e->getMessage();\n header('Location: ../errorpage.php?err=500');\n }\n\n}", "function get_bid($dbc,$id){\n\t#Create a query to get the current highest bid for a character\n\t$query='SELECT bid FROM smash WHERE id='.$id;\n\t\n\t#Execute the query\n\t$results = mysqli_query($dbc, $query );\n\tcheck_results($results);\n\t\n\tif($results)\n\t{\n \t\t#Return the bid\n \t\twhile ( $row = mysqli_fetch_array( $results , MYSQLI_ASSOC ) )\n \t\t{\n\t\t\t#Free up the results in memory first\n\t\t\tmysqli_free_result( $results );\n\t\t\treturn $row['bid'];\n\t\t}\n\t}\n}", "function lastBid($auction_id = null) {\n\t// cause it needs the auction included in result array\n\t$res=mysql_query(\"SELECT \tid, \n\t\t\t\t\tdebit, \n\t\t\t\t\tdescription, \n\t\t\t\t\tuser_id, \n\t\t\t\t\tcreated \n\t\t\t\t\tFROM bids\n\t\t\t\t\tWHERE auction_id = $auction_id \n\t\t\t\t\tORDER BY id DESC\n\t\t\t\t\tLIMIT 1\");\n\t$lastBid = mysql_fetch_array($res, MYSQL_ASSOC);\n\tmysql_free_result($res);\n\t\n\t\t\t\t\t\t\t\t\n\t$bid = array();\n\n\tif(!empty($lastBid)) {\n\t\t//*** Performance is better to do a simple query here than to do a JOIN in the query above\n\t\t$res=mysql_query(\"SELECT \tautobidder,\n\t\t\t\t\t\tusername\n\t\t\t\t\t\tFROM users\n\t\t\t\t\t\tWHERE id='\".$lastBid['user_id'].\"'\");\n\t\t$user=mysql_fetch_array($res, MYSQL_ASSOC);\n\t\tmysql_free_result($res);\n\t\t\n\t\t\n\t\t$bid = array(\n\t\t\t'debit' => $lastBid['debit'],\n\t\t\t'created' => $lastBid['created'],\n\t\t\t'username' => $user['username'],\n\t\t\t'description' => $lastBid['description'],\n\t\t\t'user_id' => $lastBid['user_id'],\n\t\t\t'autobidder' => $user['autobidder']\n\t\t);\n\t}\n\treturn $bid;\n}", "function getHighestBidder($dbh, $id)\n{\n try {\n $stmt = $dbh->prepare(\"SELECT top 1 MAX(Bodbedrag) as Hoogstebod, gebruiker from Bod b WHERE b.Voorwerp = :Voorwerp group by gebruiker order by Hoogstebod desc\"); /* prepared statement */\n $stmt->bindValue(\":Voorwerp\", $id, PDO::PARAM_STR); /* helpt tegen SQL injection */\n $stmt->execute(); /* stuurt alles naar de server */\n if ($results = $stmt->fetch()) {\n $row = $results['gebruiker'];\n }\n return $row;\n } catch (PDOException $e) {\n echo \"Fout\" . $e->getMessage();\n header('Location: ../errorpage.php?err=500');\n }\n\n}", "private function getMaxBOrder($id) {\n\t\t//SELECT Board, MAX(B_Order)+1 AS T_ORDER FROM ebbv3.ebb_boards WHERE Category=1;\n\t\t$this->db->select('MAX(B_Order)+1 AS T_ORDER', FALSE)->from('ebb_boards')->where('Category', $id);\n\t\t$query = $this->db->get();\n\t\t\n\t\tif($query->num_rows() > 0) {\n\t\t\t$res = $query->row();\n\t\t\treturn $res->T_ORDER;\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t}", "private static function getMaxId () {\n return Dao::queryValue(\"select max(id) from medicines where id < 10000000\");\n }", "function getLastPofId()\n\t {\n\t\t \n\t\t $query = $this->db->query('SELECT max(pof_id) as maxid FROM pof');\n $row = $query->row();\n $max_id = $row->maxid; \n\t\t\t return $max_id; \n\t\t }", "public function getMaximumId($restaurant){\r\n $stmt = $this->db->prepare(\"SELECT MAX(id_event) as max_id FROM event WHERE restaurant = ?\");\r\n $stmt->execute(array($restaurant));\r\n $max = $stmt->fetch(PDO::FETCH_ASSOC);\r\n $aux = $max['max_id'];\r\n return $aux;\r\n }", "public function log_fetch_highest_id () {\n\t\t# fetch\n\t try { $id = $this->Database->getObjectQuery(\"select id from logs order by id desc limit 1;\"); }\n\t\tcatch (Exception $e) { $this->Result->show(\"danger\", $e->getMessage(), false);\treturn false; }\n\t\t# return result\n\t\treturn $id->id;\n\t}", "private function getMinimumBid()\n {\n if ( count($this->bids) < $this->maxNumber ) {\n return 1;\n } else {\n $winningBids = $this->getWinningBids();\n $lastPlaceBid = $winningBids[count($winningBids) - 1];\n //min wager is 1 more than current wager\n $minWage = $lastPlaceBid->wager + 1;\n return $minWage;\n }\n }", "public function getLastBatchNo()\n {\n $query = \"SELECT max(BatchNumber) AS BatchNumber FROM voucherbatch\";\n $sql = Yii::app()->db->createCommand($query);\n $result = $sql->queryRow();\n \n if($result['BatchNumber'] > 0)\n return $result['BatchNumber'] + 1;\n else\n return 1;\n }", "function query_select_winning_bid($auctionId) {\n global $connection;\n\n //no need to prep input as input comes from another query\n $auctionId = mysqli_real_escape_string($connection, $auctionId);\n\n //prep query:\n $subquery_select_max_bid_for_auction = \"SELECT MAX(bidAmount) FROM bid \";\n $subquery_select_max_bid_for_auction .= \"WHERE auction_id='{$auctionId}' \";\n $subquery_select_max_bid_for_auction .= \"LIMIT 1\";\n\n $query = \"SELECT user_id, bidAmount AS value \";\n $query .= \"FROM bid WHERE bidAmount = ($subquery_select_max_bid_for_auction)\";\n\n //do query:\n $result = mysqli_query($connection, $query);\n\n if($result)\n $result = mysqli_fetch_assoc($result);\n // print_r($result);\n return $result;\n}", "function do_get_max_s_id() {\n\t# Dim some Vars\n\t\tglobal $_CCFG, $_DBCFG, $db_coin;\n\t\t$max_s_id = $_CCFG['BASE_SUPPLIER_ID'];\n\n\t# Set Query and select for max field value.\n\t\t$query\t= 'SELECT max(s_id) FROM '.$_DBCFG['suppliers'];\n\t\t$result\t= $db_coin->db_query_execute($query);\n\t\tIF ($db_coin->db_query_numrows($result) ) {\n\n\t\t# Get Max Value\n\t\t\twhile(list($_max_id) = $db_coin->db_fetch_row($result)) {$max_s_id = $_max_id;}\n\t\t}\n\n\t# Check / Set Value for return\n\t\treturn $max_s_id;\n}", "public function getMaxID(){\n\t\t try{\n\t\t\t$conn = DBConnection::GetConnection();\t\n\t\t\t$queryForGetMaxId=\"SELECT MAX(product_id) AS max_value FROM product\";\n\t\t\t$max_result=$conn->prepare($queryForGetMaxId);\n\t\t\t$max_result->execute();\n\t\t\t$maxId = $max_result->fetch(PDO::FETCH_ASSOC); \n\t\t\t$pId=$maxId['max_value']; \n\t\t\t$incrementPid=$pId+1;\n\t\t\treturn $incrementPid;\n\t\t}catch(PDOException $e){\n\t\t\techo 'Fail to connect';\n\t\t\techo $e->getMessage();\n\t\t}\t\n }", "function getRecentPurchaseId(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT MAX(idPurchase)AS idPurchase from purchases\");\n \n $results=[];\n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n else{\n $results = false;\n }\n return $results;\n }", "function checkLatest($a, $key) {\n // set the max record\n $max_record = Array(\n \"amount\" => -1\n );\n\n foreach ($a as $record) {\n\n // check if the key exists in the current array\n if (array_key_exists($key, $record) && isset($record[$key])) {\n\n // next compare it with the max record\n if ($max_record[\"amount\"] < $record[$key]) {\n $max_record[\"amount\"] = $record[$key];\n $max_record[\"source_name\"] = $record[\"source_name\"];\n $max_record[\"source_url\"] = $record[\"source_url\"];\n }\n }\n }\n return $max_record;\n}", "function get_max_id($table_name,$col_name=\"id\") {\n\tglobal $db, $dbname;\n //$stmt = $db->prepare(\"SELECT MAX($col_name) AS max_id FROM `$dbname`.`$table_name`\");\n $stmt->execute();\n $invNum = $stmt->fetch(PDO::FETCH_ASSOC); //echo \"Max:\".$invNum['max_id'];\n return $invNum['max_id'];\n}", "function calcMinBid($dbh, $id)\n{\n $minBod = 0;\n $highestBid = getHighestBid($dbh, $id);\n if(is_null($highestBid)){\n $highestBid = getStartPrice($dbh, $id);\n }\n $minIncrement = 0.01;\n $increment = 0.50;\n $increment1 = 1.00;\n $increment2 = 5.00;\n $increment3 = 10.00;\n $increment4 = 50.00;\n\n if ($highestBid < 1) {\n $minBod = $highestBid + $minIncrement;\n } else if ($highestBid < 49.99) {\n $minBod = $highestBid + $increment;\n } else if ($highestBid < 499.99) {\n $minBod = $highestBid + $increment1;\n } else if ($highestBid < 999.99) {\n $minBod = $highestBid + $increment2;\n } else if ($highestBid < 4999.99) {\n $minBod = $highestBid + $increment3;\n } else if ($highestBid > 5000) {\n $minBod = $highestBid + $increment4;\n }\n return $minBod;\n}", "function get_max_id($mdb,$coll,$field){\n $prevmdb = $this->mdb;\n $prevcollection = $this->collection;\n\n $max_log = new thelog();\n \n \t$this->setMdb($mdb);\t\t//set db\n \t$this->setDbcoll($coll); //set collection\n \n $check = $this->query();\t//run query\n\t\t$size = sizeof($check) + 1;\n\t\t$doc['_id'] = $size;\n\t\t\n\t\t$check = $this->query([$doc]);\t\n\t\twhile(sizeof($check) > 0)\n\t\t{\n\t\t\t$size++;\n\t\t\t$doc['_id'] = $size;\n\t\t\t$check = $this->query($doc);\n\t\t}\n //total hack !!!!!\n\n return $size;\n\n // need to rewrite / test below\n if(sizeof($check) > 0){\n if(array_key_exists($check[0],$field)){\n $options = [\t\t\t\t//sort descending so largest val at index 0\n 'sort' => [\n $field => -1\n ],\n ];\n $max = $this->query([],$options);\t//run query\n $max = (array)$max[0];\t\t\t\t//convert to array so I can index\n $max = $max[$field];\n }\n }else{\n $max = 0;\n }\n \t\t\t\t\t\t\t\t\t\t\t\n \t$this->setMdb($prevmdb);\t\t\t //re-set db\n \t$this->setDbcoll($prevcollection); //re-set collection\n\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn \t$max;\n }", "function get_max_id($table_name) {\n\tglobal $db, $dbname;\n $stmt = $db->prepare(\"SELECT MAX(id) AS max_id FROM `$dbname`.`$table_name`\");\n $stmt->execute();\n $invNum = $stmt->fetch(PDO::FETCH_ASSOC);\n return $invNum['max_id'];\n}", "function getMaxId($db)\n{\n $info['table'] = \"account\";\n $info['fields'] = array(\n \"max(id) as maxid\"\n );\n $info['where'] = \"1=1\";\n\n $resmax = $db->select($info);\n if (count($resmax) > 0) {\n $max = $resmax[0]['maxid'] + 1;\n } else {\n $max = 0;\n }\n return $max;\n}", "function getNextAttempt($item_id){\n $query = \"select max(attempt) as attempt from email_history where item_id = \" . $item_id;\n\n $queryResponse = db::query($query);\n if($queryResponse){\n $queryResponse = $queryResponse[0];\n return $queryResponse['attempt'] + 1;\n }\n return 1;\n }", "function getMaxDocketNoConsignmentInfo($account_id_local,$DbC)\n{\n\t$query1=\"SELECT MAX(docket_no) as max_count FROM consignment_info WHERE account_id=$account_id_local\";\n\t$result1=mysql_query($query1,$DbC);\n\t$max_no = mysql_fetch_object($result1);\n\t$max_no1=$max_no->max_count;\n\treturn $max_no1;\n}" ]
[ "0.66153866", "0.64492005", "0.6321777", "0.6144939", "0.60688573", "0.6068402", "0.6063239", "0.6014831", "0.5998061", "0.5995669", "0.59757495", "0.59511584", "0.59371305", "0.58879596", "0.5880034", "0.584081", "0.5802528", "0.5795414", "0.57822484", "0.56913036", "0.5689096", "0.56648594", "0.5653594", "0.56173843", "0.56162125", "0.5610519", "0.5600015", "0.5593591", "0.5588094", "0.55875266" ]
0.7575839
0
/ search by userid or itemid or all to view bid history
public function viewbidhistory($searchby,$value) { //search by will take as input: // 1 for search by userid; // 2 for search by itemid; // 3 for all // need to check in html to ensure that search is being passed the right values $search= ""; $a = "WHERE bUserid = '$value'"; $b = "WHERE itemid = '$value'"; $c = " "; $search = ($searchby==1)?$a:($searchby==2)?$b:$c; $value = mysql_real_escape_string( $value); $sql = "SELECT * FROM bid . $search ."; $bidhistoryarray = mysql_fetch_array(mysql_query($sql)); $bidhistory = $bidhistoryarray[0]; return $bidhistory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewBiddingofUser($conn,$userID){\n\t$status = 0;\n $response = array();\n\t//select all item whicn is available and is bid by this user\n\t$sql = \"select distinct Items.* from Items inner join Bids on Items.itemID = Bids.itemID and Bids.bidderID = {$userID}\";\n\t$result = $conn->query($sql);\n\t$i = 0;\n\twhile($row = $result->fetch_assoc())\n {\n\t\t$eachline['item']= $row;\n\t\t$itemID = $row['itemID'];\n\t\t$eachline['bids'] = viewBiddingofItem($conn,$itemID);\t\t\n\t\t$resultarr[$i++] = $eachline;\n\t\t$status = 1;\n\t\t\t\n \n }\n\t$response['status'] = $status;\n\t$response['data'] = $resultarr;\n\t$conn->close();\n\techo json_encode($response);\n\t\n}", "public function allItemsByUser() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $idUser = $params['idUser'];\n $item = new Item;\n $items = $item->allItemsByUser($idUser);\n View::renderJson($items);\n }", "public function getHistories($user_id = null ,$fromDate = null ,$toDate = null,$params = array())\n {\n \n $condition = array();\n $condition =\" 1=1 \";\n if ($user_id != null)\n {\n $condition .= \" AND his.user_id = \".$user_id;\n }\n if ($fromDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$fromDate.\"')>=0\";\n }\n if ($toDate != null)\n {\n $condition .= \" AND DATEDIFF(DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d'),'\".$toDate.\"')<=0\";\n }\n foreach($params as $key=>$value)\n {\n if ( $key != 'limit' && $key!='group_by')\n $condition .= $value;\n }\n if(!isset($params['limit']))\n $params['limit'] = 50;\n $count = 0;\n if(!isset($params['group_by']))\n {\n $count = 0;\n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d')\")\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') DESC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n else\n {\n $count = 0; \n $t_table = Engine_Api::_()->getDbTable('transactionTrackings', 'mp3music');\n $t_name = $t_table->info('name');\n $select = $t_table->select()->setIntegrityCheck(false)\n ->from(\"$t_name as his\",array(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d' ) as pDate\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='song' and item_id>0 and transaction_status =1) as selling_sold_songs\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_type='album' and item_id>0 and transaction_status =1) as selling_sold_albums\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 0) as selling_transaction_fail\",\n \"(SELECT count(*) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and item_id > 0 and transaction_status = 1) as selling_transaction_succ\",\n \"(SELECT sum(amount) FROM \".$t_name.\" as t1 WHERE DATE_FORMAT( FROM_UNIXTIME(t1.transaction_date),'%Y-%m-%d') = pDate and (item_type='song' or item_type='album') and item_id>0 and transaction_status = 1 ) as selling_total_amount\"\n ));\n $select ->where($condition)\n ->group($params['group_by'])\n ->order(\"DATE_FORMAT( FROM_UNIXTIME(his.transaction_date),'%Y-%m-%d') ASC\")\n ->limit($params['limit']);\n $histories = $t_table->fetchAll($select)->toArray();\n $count = count($histories); \n return array($histories,$count);\n }\n \n }", "public function orderHistory($user_id){\n $sql=\"SELECT * FROM `orders`\n INNER JOIN `items` ON orders.item_id=items.item_id WHERE `user_id`='$user_id'\";\n $result=$this->conn->query($sql);\n // var_dump($sql);\n // var_dump($result);\n if($result->num_rows>0){\n while($displayHistory=$result->fetch_assoc()){\n $rows[]=$displayHistory;\n }\n return $rows;\n }else{\n return false;\n }\n }", "function getItemsBasedOnUser($user_id) {\n $item_query = \"SELECT \n item.id AS item_id,\n item.name AS item_name,\n item.category_id AS category,\n item.fee AS item_fee,\n item.description AS item_description,\n item.pickup_lat AS item_pickup_lat,\n item.pickup_long AS item_pickup_long,\n item.return_lat AS item_return_lat,\n item.return_long AS item_return_long,\n item.date_available AS item_date_available,\n item.borrowed AS item_borrowed,\n item.promoted AS item_promoted,\n item.created AS item_created,\n item.last_updated AS item_last_updated,\n c.name AS categories_name,\n c.image_url AS categories_image_url,\n image.image_link,\n image.cover AS cover_image\n FROM items item, item_images image, categories c\n WHERE item.id = image.item_id \n AND item.user_id = \" . $user_id .\"\n AND c.id = item.category_id\n ORDER BY item.created DESC\";\n\n $go_q = pg_query($item_query);\n $items = array();\n\n $status_query = \"SELECT\n item.id AS item_id,\n bid.date_of_loan AS loan_date,\n bid.duration_of_loan AS loan_duration,\n loan.bid_id AS loan_id\n FROM items item LEFT OUTER JOIN loans loan ON item.id = loan.item_id\n LEFT OUTER JOIN bids bid ON bid.id = loan.bid_id\n WHERE item.user_id = \". $user_id .\"\n ORDER BY item.created DESC\";\n\n $st_q = pg_query($status_query);\n\n while ($fe_q = pg_fetch_assoc($go_q)) {\n $items[$fe_q['item_id']]['id'] = $fe_q['item_id'];\n $items[$fe_q['item_id']]['name'] = $fe_q['item_name'];\n $items[$fe_q['item_id']]['category'] = $fe_q['category'];\n $items[$fe_q['item_id']]['fee'] = $fe_q['item_fee'];\n $items[$fe_q['item_id']]['description'] = $fe_q['item_description'];\n $items[$fe_q['item_id']]['pickup_lat'] = $fe_q['item_pickup_lat'];\n $items[$fe_q['item_id']]['pickup_long'] = $fe_q['item_pickup_lat'];\n $items[$fe_q['item_id']]['return_lat'] = $fe_q['item_return_lat'];\n $items[$fe_q['item_id']]['return_long'] = $fe_q['item_return_long'];\n $items[$fe_q['item_id']]['date_available'] = $fe_q['item_date_available'];\n $items[$fe_q['item_id']]['borrowed'] = $fe_q['item_borrowed'];\n $items[$fe_q['item_id']]['promoted'] = $fe_q['item_promoted'];\n $items[$fe_q['item_id']]['created'] = $fe_q['item_created'];\n $items[$fe_q['item_id']]['last_updated'] = $fe_q['item_last_updated'];\n $items[$fe_q['item_id']]['categories_name'] = $fe_q['categories_name'];\n $items[$fe_q['item_id']]['categories_image_url'] = $fe_q['categories_image_url'];\n $items[$fe_q['item_id']]['username'] = $fe_q['user_username'];\n $items[$fe_q['item_id']]['profile_image_url'] = $fe_q['user_profile_image_url'];\n\n $itemLoan = pg_fetch_assoc($st_q);\n $returnDate = date_add(date_create($itemLoan['loan_date']), date_interval_create_from_date_string($itemLoan['loan_duration'].' days'));\n //var_dump($returnDate);\n if (is_null($itemLoan['loan_id'])) {\n $items[$fe_q['item_id']]['loan_status'] = 'item-available';\n } else if ($returnDate < new DateTime(\"now\")) {\n $items[$fe_q['item_id']]['loan_status'] = 'item-done';\n } else {\n $items[$fe_q['item_id']]['loan_status'] = 'item-loaned';\n }\n\n if ($fe_q['cover_image'] == t) {\n $items[$fe_q['item_id']]['cover_image'] = $fe_q['image_link'];\n } else {\n $items[$fe_q['item_id']]['images'][] = array('image_link' => $fe_q['image_link']);\n }\n }\n\n return $items;\n}", "function getItems($user_id)\n {\n $this->db->select(\"*\");\n $this->db->from('favourite_goods');\n $this->db->where('user_id', $user_id);\n $query = $this->db->get();\n return $query->result();\n }", "abstract public function getByItemId($itemId);", "public function getItems($user_id){\r\n $this->db->query('SELECT *, FROM items WHERE user_id = :user_id');\r\n $this->db->bind(':user_id', $user_id);\r\n\r\n $results = $this->db->resultSet();\r\n return $results;\r\n }", "public function listOwnItems(){\n $userId = $_SESSION['userID'];\n $item = new Item();\n $data=$item->listOwnItems($userId);\n }", "public function viewItem($user_id, $item_id) {\n $this->itemAction($user_id, $item_id, 'view');\n }", "static function getAllBuddies($userID)\n {\n $conn = Db::getConnection();\n $statement = $conn->prepare(\"SELECT * FROM buddies INNER JOIN user ON (CASE WHEN buddy1ID = :userID THEN buddy2ID = user.userID WHEN buddy2ID = :userID THEN buddy1ID = user.userID END)\");\n //$statement = $conn->prepare(\"SELECT u.firstname, u.lastname* FROM buddies as b, user u \n //WHERE (u.userID = b.buddy1ID OR u.userID = b.buddy2ID) AND (buddy1ID = :currentUser OR buddy2ID = :currentUser)\");\n $statement->bindValue(\":userID\", $userID);\n if ($statement->execute()) {\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }\n }", "public function allReadForUser($userId);", "public function search($userid)\n {\n //$query = MOrder::find();\n $user = User::findOne([\"id\" => $userid]);\n\n if($user->role == 1)\n $query = MOrder::find()->orderBy(['create_time' => SORT_DESC]);\n else\n $query = MOrder::find()->where([\"userid\" => $user->id])->orderBy(['create_time' => SORT_DESC]);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'order_id' => $this->order_id,\n 'feesum' => $this->feesum,\n 'create_time' => $this->create_time,\n 'status' => $this->status,\n 'goods_id' => $this->goods_id,\n 'userid' => $this->userid,\n ]);\n\n $query->andFilterWhere(['like', 'oid', $this->oid])\n ->andFilterWhere(['like', 'title', $this->title])\n ->andFilterWhere(['like', 'username', $this->username])\n ->andFilterWhere(['like', 'usermobile', $this->usermobile])\n ->andFilterWhere(['like', 'address', $this->address])\n ->andFilterWhere(['like', 'memo', $this->memo])\n ->andFilterWhere(['like', 'memo_reply', $this->memo_reply]);\n\n return $dataProvider;\n }", "public function itemHistory($catalog_id) {\n\t\t//pull catalog id from the hash\n\t\t$c = $this->validateSelect($catalog_id, 'li');\n\t\t//discover item id from catalog record\n\t\t$id = $this->Item->Catalog->field('item_id', array('id' => $c[0]));\n\t\t$item = $this->Item->fetchItemHistory($id);\n\t\tif(!empty($item['Cart'])){\n\t\t\tforeach ($item['Cart'] as $index => $cart) {\n\t\t\t\t$item['Cart'][$index]['username'] = $this->User->discoverName($cart['user_id']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// generate an iventory report for the past 3 months\n\t\t// this could be improved to start on the first of a month. \n\t\t// it just does 90 day backwards from today\n\t\t$end = time();\n\t\t$start = time() - (3*MONTH);\n\t\t$this->activity($start, $end, $item['Catalog'][0]['customer_user_id']);\n\t\t$raw = $this->report;\n\t\t\n\t\t// only report ont this one inventory item\n\t\tforeach($raw['items'] as $item_id => $data) {\n\t\t\tif ($item_id != $id) {\n\t\t\t\tunset($this->report['items'][$item_id]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->set('report', $this->report);\n\t\t\n\t\t$this->set('item', $item);\n\t\t$this->render();\n\t}", "public function allForUser($userId);", "public function allForUser($userId);", "function getBorrowItemsBorrowedBy($user_id)\n\t{\n\t\treturn $this->query->getBorrowItemsBorrowedBy($user_id);\n\t}", "public static function getIAPPurchaseHistoryForUserID($userID)\n\t\t{\n\t\t\tif(empty($userID))\n\t\t\t{\n\t\t\t\terror_log(\"TDOInAppPurchase::getIAPPurchaseHistoryForUserID() failed because userID is empty\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n $link = TDOUtil::getDBLink();\n if(!$link)\n {\n error_log(\"TDOInAppPurchase::getIAPPurchaseHistoryForUserID() unable to get link\");\n return false;\n }\n\t\t\t\n\t\t\t$purchases = array();\n\t\t\t$sql = \"select UNIX_TIMESTAMP(purchase_date) AS timestamp,product_id,bid FROM tdo_iap_payment_history WHERE userid='$userID' ORDER BY timestamp DESC\";\n\t\t\t$result = mysql_query($sql, $link);\n\t\t\tif (!$result)\n\t\t\t{\n\t\t\t\terror_log(\"TDOInAppPurchase::getIAPPurchaseHistoryForUserID() failed to make the SQL call\" . mysql_error());\n\t\t\t\tTDOUtil::closeDBLink($link);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\twhile ($row = mysql_fetch_array($result))\n\t\t\t{\n\t\t\t\t$timestamp = $row['timestamp'];\n\t\t\t\t$productID = $row['product_id'];\n\t\t\t\t$bundleID = $row['bid'];\n\t\t\t\t\n\t\t\t\t$subscriptionTypeString = NULL;\n\t\t\t\tif (strpos($productID, \"month\") > 0)\n\t\t\t\t\t$subscriptionTypeString = \"month\";\n\t\t\t\telse if (strpos($productID, \"year\") > 0)\n\t\t\t\t\t$subscriptionTypeString = \"year\";\n\t\t\t\telse\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\t// Determine what iOS app this was purchased from\n\t\t\t\t$productName = \"Todo\";\n\t\t\t\tif (strpos($bundleID, \"todoipad\") > 0)\n\t\t\t\t\t$productName = \"Todo for iPad\";\n\t\t\t\telse if (strpos($bundleID, \"todolite\") > 0)\n\t\t\t\t\t$productName = \"Todo Lite\";\n\t\t\t\telse if (strpos($bundleID, \"todopro\") > 0)\n\t\t\t\t\t$productName = \"Todo Cloud\";\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$description = \"In-App Purchase from $productName\";\n\t\t\t\t\n\t\t\t\t$purchase = array(\n\t\t\t\t\t\t\t\t \"timestamp\" => $timestamp,\n\t\t\t\t\t\t\t\t \"subscriptionType\" => $subscriptionTypeString,\n\t\t\t\t\t\t\t\t \"description\" => $description\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\n\t\t\t\t$purchases[] = $purchase;\n\t\t\t}\n\t\t\t\n\t\t\tTDOUtil::closeDBLink($link);\n\t\t\treturn $purchases;\n\t\t}", "public function basket_list($user_id)\n\t{\n\t\t$sql = $this->pdo->prepare(\"select * from basket_tbl where user_id='$user_id' AND status='0' \");\n\t\t$sql->execute();\n\t\t$row = $sql->fetchAll(PDO::FETCH_OBJ);\n\t\treturn $row;\n\t}", "public function getPlaceBetsOngoingStatusByUserId ($id,$db){\r\n $sql = \"SELECT movies.title as bet_movie ,users.username as username , current_bets.bet_status, place_bets.amount, place_bets.bet_type,place_bets.current_bet_id,place_bets.result,place_bets.earning_loss,place_bets.bet_won_lost,place_bets.result_status,place_bets.date, place_bets.id FROM movies INNER JOIN current_bets ON movies.id = current_bets.movie_id inner join place_bets on current_bets.id = place_bets.current_bet_id inner join users on users.id = place_bets.user_id where place_bets.user_id = :id AND place_bets.result_status = 'Ongoing' \";\r\n $pdostm = $db->prepare($sql);\r\n $pdostm->bindParam(':id', $id);\r\n $pdostm->execute();\r\n $bet = $pdostm->fetchAll(\\PDO::FETCH_OBJ);\r\n return $bet;\r\n }", "public function show(ItemUser $itemUser)\n {\n //\n }", "public function view(User $user, Bid $bid)\n {\n //\n }", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n $searchData['provider_id'] =$this->user_model->getProviderId($this->global['login_id']);\n\n // get top list data in homepage\n switch ($id) {\n case 1:\n if($this->isTicketter() == FALSE){\n $header = array(\"序号\", \"订单号\", \"终端便利店\", \"收货人\", \"联系电话\", \"付款方式\", \"订单状态\", \"配送员\", \"提交时间\", \"操作\");\n $cols = 10;\n }else if($this->isAdmin() == FALSE){\n $header = array(\"序号\", \"订单号\", \"终端便利店\", \"收货人\", \"联系电话\", \"付款方式\", \"订单状态\", \"所属区域总代理\", \"提交时间\", \"操作\");\n $cols = 10;\n }\n\n $contentList = $this->order_model->getItems($searchData);\n// foreach ($contentList as $item){\n// // get activity information\n// $activity = $this->activity_model->getItemById($item->activity_ids);\n// $activity->products = $this->activity_model->getProductsFromIds($activity->product_id, $activity->provider_id);\n//\n// $orderinfo = array(\n// 'id' => $item->id,\n// 'product_info' => json_encode($activity->products)\n// );\n// $this->order_model->update($orderinfo, $item->id);\n// }\n\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有订单.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "function get_all($userid){\n\t\t\n\t\t$this->stmt = $this->db->select('activation');\n // set where values\n $this->stmt->where('userid','i',$userid);\n\t\treturn parent::get();\n\t}", "public function indexAction()\n { \n if(!$this->_rParams->id) {\n // we want all items\n }\n }", "abstract protected function get_item_from_db($item_id);", "function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n $searchData['kind'] = 1;\n $searchData['login_user'] = $this->login_id;\n\n switch ($id) {\n case 1:\n $header = array(\"序号\", \"账号\", \"姓名\", \"角色\", \"新增时间\", \"操作\");\n $cols = 6;\n\n $contentList = $this->user_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有数据.\" : '';\n break;\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }", "public function item($id)\n {\n return BusinessTrainer::where('id',$id)->with(['user', 'histories'])->first();\n \n }", "public function itemQuery()\n {\n return $this->item($this->getInput('id'));\n }", "function getAvailHistory($conn){\r\n\t$cid = $_SESSION['uid'];\r\n\t$sql = \"SELECT a.aid, a.ato, a.afrom, a.ptype FROM availability a, bid b WHERE a.cid = '$cid' AND a.aid = b.aid AND b.status = 'successful'\";\r\n\t$result = pg_query($conn, $sql);\r\n\twhile ($row = pg_fetch_assoc($result)) {\r\n\t\t\t\techo \"<div class='panel panel-warning'><div class='panel panel-heading'><h3>\";\r\n\t\t\t\techo $row['ptype'];\r\n\t\t\t\techo \"</div><div class='panel panel-body'>\";\r\n\t\t\t\techo \"From \".$row['afrom'].\"</h3>\".\" to \".$row['ato'];\r\n\t\t\tshowSuccessfulBidders($conn, $row['aid']);\r\n\t\techo \"</div></div>\";\r\n\t}\r\n\t\r\n}" ]
[ "0.61964935", "0.59355515", "0.59265864", "0.5840404", "0.5756959", "0.5653218", "0.55807334", "0.55773526", "0.55662936", "0.5512365", "0.5505614", "0.54814947", "0.5456186", "0.54509836", "0.54487604", "0.54487604", "0.54351866", "0.54315704", "0.5429153", "0.5419071", "0.5399367", "0.539444", "0.53870076", "0.5379334", "0.53667086", "0.53641844", "0.5361072", "0.5350159", "0.53294486", "0.5324594" ]
0.6932384
0
HOUSE /add house to database by first adding it as an item(foreign key constraint)
public function addhouse($itemid,$bedrooms,$bathrooms, $facilities, $price,$locatedNear , $description, $bUserId,$category,$saletype,$uploadtime,$keyword,$image){ $itemid = mysql_real_escape_string($itemid); $bedrooms = mysql_real_escape_string($bedrooms); $bathrooms = mysql_real_escape_string($bathrooms); $facilities = mysql_real_escape_string($facilities); $price = mysql_real_escape_string( $price); $locatedNear = mysql_real_escape_string( $locatedNear); $description = mysql_real_escape_string($description); $api = new Api(); $api->additem($bUserId, $category,$saletype, $uploadtime, $keyword, $image); $sql="INSERT INTO house VALUES( $itemid, $bedrooms, $bathrooms, $facilities, $price, $locatedNear, $description)"; $result = mysql_query($sql); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItemToDB()\n {\n $this->database->addItemToDB($this);\n }", "abstract protected function addForeignKeys(&$script);", "public function addToDb()\n {\n\n // make sure this is a valid new entry\n if ($this->isValid()) {\n // check for duplicate\n $vals = sprintf(\"('%s',%d)\",$this->email,$this->level);\n $sql = \" insert into Admins values $vals\";\n Dbc::getReader()->Exec($sql);\n }\n else\n print \"<br> Invalid entry. STOP! ($sql)<br>\";\n }", "public function addItem($params){\n $sql = \"insert into fruit_table (name) values (:name)\";\n $sth = $this->parent->db->prepare($sql);\n // Key = value pair\n $sth->execute(array(\":name\"=>$params[\"name\"]));\n }", "public function add() {\n if ($this->id == 0) {\n $reponse = $this->bdd->prepare('INSERT INTO chapitres SET title = :title, body = :body');\n $reponse->execute([\n 'body'=>$this->body, \n 'title'=>$this->title\n ]);\n }\n }", "public function store($id) /* Maria Rennemark - add a house to a specific booking*/\n\t{\n\t\t$house = new Houses(\n\t\t\tarray(\n\t\t\t\t'name' => Input::get('checkbox1') ));\n\t\t$booking = Bookings::find($id);\n\t\t$house = $booking->houses()->save($house);\n\n\t\treturn Redirect::to('verification'.$id);\n\n}", "public function actionCreate()\n {\n $model = new House();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function createItem($item) {\n\t\tglobal $dbh;\n\t\t$stmt = $dbh->prepare('INSERT INTO ITEM VALUES (NULL, ?, ?, ?, ?)');\n\t\t$success = $stmt->execute(array($item['content'],\n\t\t\t\t\t\t\t\t\t\t$item['image'],\n\t\t\t\t\t\t\t\t\t\t$item['checked'],\n\t\t\t\t\t\t\t\t\t\t$item['listID']));\n\t\treturn $success;\n\t}", "function addUser($id=0, $first_name, $last_name, $email_primary, $email_secondary, $phone_primary, $mag_stripe, $prox_id, $affil, $campus_id, $netid, $level){\n\t// This \"try\" runs completely unless something gets \"caught\" by the \"catch\" portion below.\n\ttry {\n\t\t$db = getDatabase(); // Creates a database connection (found in database.php), and returns the connection.\n\t\t$query = $db->prepare( \"INSERT INTO dbUser (ID, First_Name, Last_Name, Email_Primary, Email_Secondary, Phone_Primary, Mag_Stripe, Prox_ID, Affil, Campus_ID, Netid, Level) VALUES ( :id, :first_name, :last_name, :email_primary, :email_secondary, :phone_primary, :mag_Stripe, :prox_ID, :affil, :campus_id, :netid, :level)\"); // Prepare an SQL statement to be performed on the database. In this example we are telling the database to Insert a row into the dbItem table, with the provided information of ID, Name, and Description (all of which have to be the exact table names in our database). The first parenthesis contains the database columns that we will fill with the values in the second parenthesis. Notice how the values in the second parenthesis are prefaced with a colon (:). These are placeholders for our information given by the saveItem function - before we execute the call on the database, we will have to replace these placeholders with the item information we were given. Lastly, the ON DUPLICATE KEY UPDATE portion tells the database what to do if an item already exists with the ID that we specified. In this case, it is telling the database to update the item with the same ID that we were given, so essentially it is doing nothing.\n\t\t// We fill in the placeholders in our prepare statement above with the variables passed to our saveItem function (that we are currently in), using the bindParam function. Our :id, :name, and :description values should now be substituted with their actual values.\n\t\t\n\t\t$query->bindParam( ':id', $id );\n\t\t$query->bindParam( ':first_name', $first_name );\n\t\t$query->bindParam( ':last_name', $last_name );\n\t\t$query->bindParam( ':email_primary', $email_primary );\n\t\t$query->bindParam( ':email_secondary', $email_secondary );\n\t\t$query->bindParam( ':phone_primary', $phone_primary );\n\t\t$query->bindParam( ':mag_stripe', $mag_stripe );\n\t\t$query->bindParam( ':prox_id', $prox_id );\n\t\t$query->bindParam( ':affil', $affil );\n\t\t$query->bindParam( ':campus_id', $campus_id );\n\t\t$query->bindParam( ':net_id', $net_id );\n\t\t$query->bindParam( ':level', $level );\n\n\t\t// Execute the request. The execute function returns true or false based on if it was successful or not, so we will check here for the status of the call.\n\t\tif ( $query->execute() ) {\n\t\t\t// Create a success response, and echo the message back, and reset the database.\n\t\t\t$response = '{\"success\":{\"text\":\"Saved User Successfully.\" }}';\n\t\t\t\n\t\t\t$db = null;\n\t\t\techo $response;\n\t\t}\n\t\t// Run something if the query failed.\n\t\telse {\n\t\t\t// This is how you generate a custom error message, below in the \"catch\" portion of our try, we will echo out these errors if any were created.\n\t\t\tthrow new PDOException(\"User could not be saved.\");\n\t\t}\n\t}\n\t// Catches any thrown error in the try{}, and returns the error message in JSON form.\n\tcatch(PDOException $e) {\n\t\techo '{\"error\": {\"text\":\"' . $e->getMessage() . '\"}}';\n\t}\n}", "public function addDBData()\n {\n\n if ( Title::newFromText( 'Checklist', NS_TEMPLATE )->exists() ) {\n return;\n }\n\n $title = Title::newFromText( \"Checklist\", NS_TEMPLATE );\n\n $user = User::newFromName( 'UTSysop' );\n $comment = __METHOD__ . ': Sample page for unit test.';\n\n $page = WikiPage::factory( $title );\n $page->doEditContent( ContentHandler::makeContent(\n \" [[Category:Checklist]]\"\n , $title ), $comment, 0, false, $user );\n\n $result = $this->insertPage( \"UTChecklist\", \"{{Checklist||Checklist name=UTChecklist||Checklist items=* Test item 1}}\" );\n\n self::$_checklistId = $result['id'];\n\n }", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "public function run()\n {\n $meal = new Meal;\n $meal->type_id = 3;\n $meal->save();\n\n $meal->recipes()->attach(1, ['sidedish' => 1]);\n }", "function addHouse($PDO){\n\n $name = strip_tags($_POST['residenceName']);\n\n $address = strip_tags($_POST['address']);\n\n $zipCode = strip_tags($_POST['zipCode']);\n\n $city = strip_tags($_POST['residenceCity']);\n\n $type = strip_tags($_POST['residenceType']);\n\n $country = strip_tags($_POST['residenceCountry']);\n\n $req = $PDO->prepare(\"INSERT INTO residence(type ,name,address,zipCode,city,country) VALUES(?,?,?,?,?,?)\");\n $req->execute([$type, $name, $address, $zipCode, $city, $country]);\n $req->closeCursor();\n\n $req = $PDO->prepare(\"INSERT INTO user_residence(idUser, idResidence) VALUES (?,LAST_INSERT_ID())\");\n $req->execute([$_SESSION['idClient']]);\n $req->closeCursor();\n\n $_SESSION[\"idResidence\"] = $PDO->lastInsertId();\n}", "function add($record)\n {\n $data = get_object_vars($record);\n $this->rest->initialize(array('server' => REST_SERVER));\n $this->rest->option(CURLOPT_PORT, REST_PORT);\n $retrieved = $this->rest->post('recipe/maintenance/item/id/' . $record->menu_id.'-'.$record->inventory_id, $data);\n }", "abstract public function add_item();", "public function insertItem($item){\n\t\t$hour = date ( 'H', strtotime ( $item->list_time ) );\n\t\t$this->hours[$hour][DayShelfStrategy::HOUR_FIELD_ITEMLIST][] = $item;\n\t}", "private function addPaymentToDatabase()\n {\n $this->setReceiptKey();\n \n $this->createDonorEntry();\n $this->createDonationEntry();\n $this->createDonationContentEntry();\n $this->createDonorAddressEntry();\n $this->addDonationToFundraisersTotalRaise();\n \n $this->redirect('donations');\n }", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "private final function ensureObjectInDb()\n {\n # WORKING_ON\n $class_reflection = new ReflectionClass(get_class($this));\n do {\n # use reflection to SKIP abstract classes\n if (!$class_reflection->isInstantiable())\n continue;\n\n if (!$this->getLoadedFromDb($class_reflection->getName())) {\n $this->insert($class_reflection->getName());\n break;\n }\n\n } while (($class_reflection = $class_reflection->getParentClass()) && # get the parent\n $class_reflection->getName() != __CLASS__); # check that we're not hitting the top\n }", "private function addToDatabase($s_ObjName,$a_mapping){\n\t\t//inspired by http://bobsguides.com/custom-db-tables.html\n\t\t$fields = array();\n\t\tforeach($a_mapping as $a){\n\t\t\t$o_formObj = $a[0];\n\t\t\t$s_keyName = $a[1];\n\t\t\t\n\t\t\t$fields[$s_keyName]=$_POST[$o_formObj->getId()];\n\t\t};\n\t\t$newObj = $this->modx->newObject($s_ObjName, $fields);\n\t\t$res = $newObj->save();\n\t\tif($res===true){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function run()\n {\n HouseTypeModel::create(['name' => 'Villa']);\n HouseTypeModel::create(['name' => 'Flat']);\n HouseTypeModel::create(['name' => 'Twin House']);\n \n }", "public function addGame(Games $item){\n try {\n $db = new Database();\n $db->connect();\n //The INSERT query\n $query =\"INSERT INTO Games VALUES ('\". $item->id.\"','\". $item->name .\"',\n '\". $item->developer .\"','\". $item->publisher .\"',\n \". $item->price .\",'\". $item->image .\"');\";\n $db->getConnection()->exec($query);\n echo \"New item added successfully\";\n } catch (PDOException $pdo_exception) {\n echo \"Error: \" . $pdo_exception->getMessage() . \"\\n\";\n }\n $db->disconnect();\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 addNewHospital()\n {\n }", "public function house()\n {\n return $this->belongsTo(House::class);\n }", "function addChild($key, IBabylonModel $child) : IBabylonModel;", "public function test_1_1()\n {\n global $Address;\n\n $out = SetupTestData::hasmany_save_1();\n\n $address = $Address->create([\n 'line1' => 'line1_4',\n 'zipcode' => '44444',\n 'state' => 'MN'\n ]);\n\n $out['person']->add_to_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($address->id !== NULL, 'New object id is set');\n\n $this->assert($out['person']->size_addresses() === 4, 'Has many has 4 objects');\n\n foreach ($out['person']->get_addresses() as $i => $address)\n {\n $this->assert($address->zipcode === str_repeat(($i+1).'', 5), 'Address zipcode correct');\n }\n }", "function add_topping($db, $topping_name, $is_meat) \n{\n// TODO: add code\n $query = 'INSERT into menu_toppings'\n . '(topping, is_meat)'\n . 'VALUES'\n . '(:topping_name, :is_meat)';\n $statement = $db->prepare($query);\n $statement->bindValue(':topping_name', $topping_name);\n $statement->bindValue(':is_meat', $is_meat);\n $statement->execute();\n $statement->closeCursor();\n \n}", "public function createNewItem();", "public function addChild(Doctrine_Record $record);" ]
[ "0.68566364", "0.5730414", "0.5693351", "0.56910217", "0.5667941", "0.5556799", "0.55476177", "0.55266845", "0.55088127", "0.5488969", "0.5472634", "0.5470492", "0.5459089", "0.5450411", "0.5419483", "0.5413704", "0.53813565", "0.53698695", "0.5366958", "0.53642327", "0.5362609", "0.5359451", "0.5349449", "0.53302485", "0.5326484", "0.5318897", "0.5286709", "0.52687335", "0.5265969", "0.52623177" ]
0.59025425
1
/remove house with a particual item id
public function rmhouse($itemid){ $api = new Api(); $api->rmitem($itemid); $itemid = mysql_real_escape_string( $itemid); $sql = "delete FROM house where itemid='$itemid'"; mysql_query($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function removeItem($id){\n $this->totalQty -= $this->items[$id]['qty'];\n $this->totalPrice -= $this->items[$id]['price'];\n unset($this->items[$id]);\n }", "public function remove($item);", "function DeleteSHItem($id)\n{\n\tglobal $db;\n\t$sh_table = DB_PREFIX . 'pico_site_heirarchy';\n\t$sub_items = $db->force_multi_assoc('SELECT * FROM `'.$sh_table.'` WHERE `parent`=? ORDER BY `position` ASC', $id);\n\tif (is_array($sub_items))\n\t{\n\t\tforeach ($sub_items as $item)\n\t\t{\n\t\t\tDeleteSHItem($item['entry_id']);\n\t\t}\n\t}\n\t$info = $db->assoc('SELECT * FROM `'.$sh_table.'` WHERE `entry_id`=?', $id);\n\t$db->run('UPDATE `'.$sh_table.'` SET `position` = (`position`-1) WHERE `parent`=? AND `position`>?', $info['parent'], $info['position']);\n\t$db->run('DELETE FROM `'.$sh_table.'` WHERE `entry_id`=?', $id);\n}", "function item_delete()\n {\n $key = $this->get('id');\n $this->supplies->delete($key);\n $this->response(array('ok'), 200);\n }", "public function deleteItem( $id ) {\n\t}", "public function deleteItem($item);", "abstract function del ($item);", "public function remove($item) {\n unset($this->items[$item->id()]);\n }", "public function destroy($id) //passar o id do item + o id_user\n {\n //\n }", "public function action_remove(){\n $abuse = ORM::factory('BoardAbuse', $this->request->param('id'));\n if($abuse->loaded()){\n if($abuse->ad->loaded())\n $abuse->ad->delete();\n $abuse->delete();\n }\n $this->redirect('admin/boardAbuses' . URL::query());\n }", "function remove_hold($mediaitem_id, $patron_id)\n{\n\tglobal $mysqli;\n\t\n\tclean_string($mediaitem_id);\n\tclean_string($patron_id);\n\t\n\t$check_for_hold_query = \"SELECT * FROM `hold` WHERE `mediaitem_id` = $mediaitem_id AND `patron_id` = $patron_id\"; \n\t$result = $mysqli->query($check_for_hold_query);\n\t\n\tif($temp = check_sql_error($result))\n\t{\n\t\treturn $temp;\n\t}\n\t\n\tif($result->fetch_assoc())\n\t{\t//The mediaitem is on hold\n\t\t$query = \"DELETE FROM `hold` WHERE `mediaitem_id` = $mediaitem_id AND `patron_id` = $patron_id\";\n\t\n\t\t$result = $mysqli->query($query);\n\t}\n\telse\n\t{\n\t\treturn array\n\t\t(\n\t\t\t'error'\t\t\t=>\t'Not found', \n\t\t\t'error_code'\t=>\t1\n\t\t);\n\t}\n\t\n\treturn array();\n}", "public function deleteItem(Item $item) {\n\t\t$id = $item->getId();\n unset($this->items[$id]);\n }", "function deleteItem($db, $resource_pk, $item_pk) {\r\n\r\n// Update order for other items for the same resource link\r\n reorderItem($db, $resource_pk, $item_pk, 0);\r\n\r\n// Delete any ratings\r\n deleteRatings($db, $item_pk);\r\n\r\n// Delete the item\r\n $prefix = DB_TABLENAME_PREFIX;\r\n $sql = <<< EOD\r\nDELETE FROM {$prefix}item\r\nWHERE (item_pk = :item_pk) AND (resource_link_pk = :resource_pk)\r\nEOD;\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('item_pk', $item_pk, PDO::PARAM_INT);\r\n $query->bindValue('resource_pk', $resource_pk, PDO::PARAM_STR);\r\n $ok = $query->execute();\r\n\r\n return $ok;\r\n\r\n }", "abstract public function remove($id);", "function delArticle($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "function removeItem($item){\n\t\tif( $item instanceof cacheItem)\n\t\t\t$item = $item->name;\n\t\tcacheItem::dropInstance($item);\n\t\treturn $this->db->delete(self::$tableName,array('WHERE name=?',$item));\n\t}", "abstract public function delete($item);", "function spamhurdles_db_remove($key)\n{\n global $PHORUM;\n\n phorum_db_interact(\n DB_RETURN_RES,\n \"DELETE FROM {$PHORUM['spamhurdles_table']}\n WHERE id='\".phorum_db_interact(DB_RETURN_QUOTED, $key).\"'\",\n NULL, DB_MASTERQUERY\n );\n}", "public function removeItem($key);", "public function deleteItem($key);", "public function removeItem()\n\t{\n\t\t$this->autoRender = false;\n\t\t$this->layout = false;\n\t\t$id = \"\";\n\t\tif($this->request->is(array('POST')))\n\t\t{\n\t\t\t$data = $this->request->data;\n\t\t\t$cateId = $data['cate_id'];\n\t\t\t$row = $data['row'];\n\t\t\t$id= '';\n\t\t\tif($this->Session->check('item_'.$cateId))\n\t\t\t{\n\t\t\t\t$itemId = $this->Session->read('item_'.$cateId);\n\t\t\t\tif(!empty($itemId))\n\t\t\t\t{\n\t\t\t\t\t$i = $row*2 -2;\n\t\t\t\t\tif(isset($itemId[$i+1]))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($itemId[$i+1]);\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($itemId[$i]))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($itemId[$i]);\n\t\t\t\t\t}\n\t\t\t\t\t$this->Session->write('item_'.$cateId,$itemId);\n\t\t\t\t\t$id = implode(',',$itemId);\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $id;\n\t\t\texit;\n\t}", "public function remove($id);", "public function remove($id);", "abstract public function removeItem($name);", "public function deleteArmure()\n {\n $delete = $this->_bdd->prepare(\"DELETE FROM `armure` WHERE `id_armure` = ?\");\n $delete->execute(array($this->_idArmure));\n }", "public function delete($id)\n {\n $house=House::find($id);\n $house->delete();\n\n $rent=Rent::where('house_id',$id);\n $rent->delete();\n return redirect()->route('housedetails.index');\n \n }", "public function remove($people_id) {\n\t}", "function remove($pr_id) {\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute(\"delete from \".$this->_db_table.\" where pr_id=$pr_id\");\n\t}", "function removeByPackingID($packing_bizhub_id) {\r\n $sql = \"SELECT shipdet_bizhub_id FROM shipping_bizhub_detail WHERE packing_bizhub_id = \".$packing_bizhub_id;\r\n $query = $this->db->query($sql);\r\n $row = $query->row_array();\r\n\r\n $this->removeItems($row['shipdet_bizhub_id']);\r\n }", "public function destroy($id)\n {\n\t\t$house = House::find($id);\n\t\t$house->delete();\n\t\treturn redirect()->route('upr.houses.index');\n\t}" ]
[ "0.661204", "0.651905", "0.64688337", "0.643625", "0.63931245", "0.63831264", "0.6382464", "0.63712573", "0.6364224", "0.6272251", "0.6182763", "0.61547744", "0.61497456", "0.61373633", "0.6129773", "0.61192006", "0.6110689", "0.6109178", "0.60906", "0.60832936", "0.60635877", "0.605962", "0.605962", "0.605746", "0.6052015", "0.6048317", "0.60160685", "0.60091615", "0.60081977", "0.6000779" ]
0.797697
0
/ Get all house with specific item id
public function viewhouse($itemid){ $itemid = mysql_real_escape_string( $itemid); $sql2 = "SELECT * from house WHERE itemid = '$itemid'"; $housearray = mysql_fetch_array(mysql_query($sql2)); $house = $housearray[0]; return $house; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_item_by_id($id) {\n\tglobal $wpdb;\n\tglobal $webgrain2;\n\t$sql = \"SELECT * FROM \" . $webgrain2->second_menu_table . \" WHERE id = $id\";\n\t$result = $wpdb->get_results($wpdb->prepare($sql, 0));\n\tif(!empty($result)) { foreach($result as $r) { return $r; } }\n}", "public function getHouseListAttribute(){\n return $this->houses->lists('id')->all();\n }", "function getListOfHouseByUserID($user_id){\n\t// Create connection\n\t$conn = openConnectDB();\n\t\n\t$sql = \"SELECT * FROM house WHERE owner_id=$user_id\";\n\t$result = $conn->query($sql);\n\t\n\tif ($result->num_rows > 0) {\n\t // output data of each row\n\t while($row = $result->fetch_assoc()) {\n\t $result_array[] = $row;\n\t }\n\t} else {\n\t echo \"0 results\" . \"<br>\";\n\t}\n\t\n\tcloseConnectDB($conn);\n\treturn $result_array;\n}", "function get_by_id($item_id) {\n return $this->db\n ->select(DB_POINT . '.*, ' . DB_CATEGORY . '.item_id as category_id, ' . DB_CATEGORY . '.item_name, ' . DB_CATEGORY . '.item_icon, ' . DB_PHOTO . '.item_filename')\n ->join(DB_CATEGORY, DB_CATEGORY . '.item_id = ' . DB_POINT . '.item_category', 'left')\n ->join(DB_PHOTO, DB_PHOTO . '.item_point = ' . DB_POINT . '.item_id', 'left')\n ->where(DB_POINT . '.item_id', $item_id)\n ->get(DB_POINT)->row();\n }", "function GetDetailPPHItemById($id){\n\n $data = $this->db\n ->select('form_bd_item_pph.id_form_bd_item_pph as id_item_pph,form_bd_item_pph.id_form_bd_item as id_item,form_bd_item_pph.*,form_bd_item.real_amount,form_bd_item.name as item_name')\n ->where('form_bd_item_pph.id_form_bd_item_pph',$id)\n ->join('form_bd_item','form_bd_item.id_form_bd_item=form_bd_item_pph.id_form_bd_item')\n ->get('form_bd_item_pph')\n ->row_array();\n return $data;\n }", "public function index($id)\n {\n $house =House::findOrFail($id);\n $house_list = House::where('active_status',1)->where('id','<>',$id)->take(3)->get();\n $setup = SetUp::get()->first();\n // dd($house_list);\n $hf = HeaderFooter::get()->first();\n return view('detail',compact('hf','house','house_list','setup'));\n }", "public function item($id)\n {\n return BusinessTrainer::where('id',$id)->with(['user', 'histories'])->first();\n \n }", "public function getHouse();", "function get_by_poi($production_order_item_id)\r\n {\r\n $sql = 'SELECT\r\n id,\r\n excluido,\r\n date_record,\r\n production_order_item_id,\r\n block_id,\r\n path,\r\n file,\r\n type,\r\n size,\r\n obs\r\n FROM block_photo\r\n WHERE production_order_item_id = ? \r\n AND excluido = \\'N\\' ';\r\n\r\n $params[] = $production_order_item_id;\r\n\r\n $query = DB::query($sql, $params);\r\n \r\n $photos = array();\r\n\r\n foreach ($query as $key => $row) {\r\n $photo = new self;\r\n $photo->fill($row);\r\n $photos[] = $photo;\r\n }\r\n\r\n return $photos;\r\n }", "abstract protected function get_item_from_db($item_id);", "public function get_by_item_id_all($id = FALSE)\n {\n if (!$id)\n {\n $query = $this->db->get('stock');\n return $query->result_array();\n }\n\n //$this->db->where('stock > 0');\n $this->db->where('itemID', $id);\n $this->db->where('stock >0');\n $query = $this->db->get('stock');\n\n return $query->result_array();\n }", "static function searchGriditemById($griditem_id=0)\r\n\t{\r\n\t\t$foundlocation = array();\r\n\t\t$foundlocation['scene_id'] = 0;\r\n\t\t$foundlocation['cell_id'] = 0;\t\t\r\n\t\t$itemlocations = self::getGriditemsInfo();\r\n\t\tforeach ($itemlocations as $scene_id=>$sceneitemInfo)\r\n\t\t{\r\n\t\t\tforeach ($sceneitemInfo['griditems'] as $cell_id=>$cell)\r\n\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\tif ($cell['id'] == $griditem_id)\r\n\t\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\t\t$foundlocation['scene_id'] = $scene_id;\r\n\t\t\t\t\t$foundlocation['cell_id'] = $cell_id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $foundlocation;\r\n\t}", "function getItem($id){\n global $db;\n \n $stmt=$db->prepare(\"SELECT idItem, `name`, amount, unitPrice, salesPrice, parAmount FROM inventory WHERE idItem = :id\");\n \n\t\t$binds= array(\n\t\t\t\":id\"=>$id\n\t\t);\n\t\t\n if($stmt->execute($binds) && $stmt->rowCount()>0){\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return ($results);\n }\n else{\n return false;\n }\n }", "function GetDetailPPHItemByIdSOA($id){\n\n $data = $this->db\n ->select('form_soa_item_pph.id_form_soa_item_pph as id_item_pph,form_soa_item_pph.id_form_soa_item as id_item,form_soa_item_pph.*,form_soa_item.real_amount,form_soa_item.name as item_name')\n ->where('form_soa_item_pph.id_form_soa_item_pph',$id)\n ->join('form_soa_item','form_soa_item.id_form_soa_item=form_soa_item_pph.id_form_soa_item')\n ->get('form_soa_item_pph')\n ->row_array();\n return $data;\n }", "function get_menu_item_by_id($id)\n{\n\t// You'd probably be doing a database lookup here\n\tif( $id == 1 )\n\t{\n\t\treturn array(\n\t\t\t\t\"id\" => 1,\n\t\t\t\t\"cost\" => \"1.99\",\n\t\t\t\t\"title\" => \"Item 1 Title\"\n\t\t\t);\n\t} \n\telse if( $id == 2 )\n\t{\n\t\treturn array(\n\t\t\t\t\"id\" => 2,\n\t\t\t\t\"cost\" => \"2.99\",\n\t\t\t\t\"title\" => \"Item 2 Title\"\n\t\t\t);\n\t}\n}", "public function item_details($item_id)\n {\n $url = preg_replace('/set/i', 'item:' . $item_id, $this->public_url);\n return $this->curl($url)->item;\n }", "public function byId($id)\n {\n return $this->cottage //->with('images', 'areas', 'features')\n ->find($id);\n }", "function item_get()\n {\n $key = $this->get('id');\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }", "public function get_by_item_id($id = FALSE)\n {\n if (!$id)\n {\n $query = $this->db->get('stock');\n return $query->result_array();\n }\n\n //$this->db->where('stock > 0');\n $this->db->where('itemID', $id);\n $this->db->where('stock >0');\n $query = $this->db->get('stock');\n\n return $query->result_array();\n }", "public function itemQuery()\n {\n return $this->item($this->getInput('id'));\n }", "function getItemInfo($id, $obDB)\n{\n $obDB->doQuery(\"select * from auctionitems where itemID=\".$id.\" LIMIT 1\");\n $aResult = $obDB->fetchAssocResult()[0];\n return $aResult;\n \n}", "public function show($id)\n {\n return $this->commandBus->execute(new \\Sailr\\Item\\GetSingleItemCommand($id));\n }", "public function all_items($id) {\n $items = new stdClass();\n\n $items->bulk = DB::select('select I.name, B.quantity \n from (transaction_bulk as B \n join items as I on B.item_id = I.id)\n where B.transaction_id = ?',\n [ $id ]);\n\n $itm_info = DB::select('select I.item_id, C.name, I.item_code, I.serial_no \n from (transaction_inventory as T \n join inventory_items as I on T.inventory_item_id = I.id\n join items as C on I.item_id = C.id)\n where T.transaction_id = ? order by item_id',\n [ $id ]);\n\n //$items->inv = $itm_info;\n\n $items->inv = $this->process_inv_info($itm_info);\n\n return response()->json($items);\n }", "public function loadItem($itemId)\n {\n\n $orm = $this->getOrm();\n\n return $orm->get(\"WbfsysAddressItem\", $itemId);\n\n }", "public function getAllitemEventoByID($id)\n {\n \n $this->db->select('item_evento.id as id, item_evento.descricao as item, eventos.nome_evento as evento')\n ->join('eventos', 'item_evento.evento = eventos.id', 'left'); \n $q = $this->db->get_where('item_evento', array('item_evento.id' => $id));\n \n if ($q->num_rows() > 0) {\n return $q->row();\n }\n return FALSE;\n }", "public function getOneItem($id)\n {\n $item = Item::find($id);\n // dd($item);\n return $item;\n }", "public function index($id)\n {\n $admin = auth('admin')->user();\n\n $model = EventItem::with(['item'=>function($query){\n $query->orderBy('order_id', 'ASC');\n }])->where('event_id',$id);\n if ($admin->shop_id) {\n $model->where('shop_id', $admin->shop_id);\n }\n $items = $model->paginate(20);\n return EventItemResource::collection($items);\n }", "function getItemById($id) {\n \n $connection = getConnection();\n \n // TODO Prevent SQL injection. Prepared statement?\n $data = mysqli_query($connection, \"SELECT * FROM inventory WHERE item_id = $id\");\n\n $result = mysqli_fetch_assoc($data);\n \n mysqli_close($connection);\n\n return $result;\n }", "public function all($id){\n return $this->model->query()->where('persona_id',$id)->get();\n }", "function getById($id){\n $item=new Alumnos();\n $query=$this->db->conn()->prepare('SELECT * FROM ALUMNO WHERE id_alumno=:id');\n try{\n $query->execute(['id'=>$id]);\n while($row=$query->fetch()){\n $item->id=$row['id_alumno'];\n $item->nombre=$row['nombre'];\n $item->apellido=$row['apellido'];\n $item->telefono=$row['telefono'];\n }\n return $item;\n }catch(PDOException $e){\n return [];\n }\n }" ]
[ "0.62867564", "0.62841487", "0.62188727", "0.617941", "0.61291367", "0.6116844", "0.60571027", "0.6052588", "0.60323054", "0.59531176", "0.5910118", "0.58998185", "0.58909637", "0.58906114", "0.58549917", "0.58087736", "0.57904506", "0.57675475", "0.5760003", "0.57452047", "0.5732413", "0.57241535", "0.57237077", "0.57174677", "0.56980664", "0.568941", "0.5686784", "0.56814307", "0.5668065", "0.56674486" ]
0.7190658
0
This is used to fetch external Auto Shop Audi Resources and save them to Database.
public function fetchAudi() { $url = 'https://www.polovniautomobili.com/putnicka-vozila/pretraga?brand=38&price_from=40000&without_price=1&showOldNew=all'; $html = file_get_contents($url); $dom = FluentDOM::QueryCss($html, 'text/html'); $cars = \Helpers::get_cars($dom); if (count($cars)) { // Now we need to save external cars to database foreach ($cars as $car) { $car['category'] = 'Audi'; $car['added_by'] = auth()->id(); $car['approved'] = 1; // We need to check if this car already exists so we use firstOrCreate instead of create method /** * TODO: maybe exclude image_path before we call create method and use firstOrNew to add image_path and then save(), * because each time image_path is unique and we will always get new instance of Vehicle even if everything else is same, * or maybe you wanted to clear Audi vehicles each time and add new, updated cars? */ $vehicle = Vehicle::firstOrCreate($car); // We will probably call this method over AJAX and update category view over JavaScript // that's why we will just return json of added cars $vehicles[] = $vehicle; } // Now we need to create pagination of this vehicles $vehicles_pagination = \Helpers::create_pagination($vehicles, config('pagination.per_page')); $carousel_images = []; foreach ($vehicles_pagination as $vehicle) { array_push($carousel_images, $vehicle->image_path); } return \View::make('partials.ajax_vehicles', ['vehicles' => $vehicles_pagination, 'carousel_images' => $carousel_images, 'category' => 'Audi']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathMultipleResource(),\n 'METHOD' => 'POST',\n 'DATA' => [\n /*\n * Using static:: instead of self:: because static:: binds at runtime\n * If we use self this would not work because it would\n * always call ShopifyResource::getResourceSingularName()\n */\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\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 }", "protected function fetchStorageRecords() {}", "private function _populateArco()\n {\n return $this->promotor->create(\n $this->promotorData['dealer_ID'], \n $this->promotorData['phone'], \n Hash::make($this->promotorData['password']), \n $this->promotorData['name'], \n $this->promotorData['gender'], \n 'arco', \n $this->promotorData['parent_ID']\n );\n }", "public function loadFromStore() {\r\n $licenses = $this->context->dbDriver->get(RestoDatabaseDriver::LICENSES, array('licenseId' => $this->licenseId));\r\n if (!isset($licenses[$this->licenseId])) {\r\n RestoLogUtil::httpError(400, 'License ' . $this->licenseId . ' does not exist in database');\r\n }\r\n $this->description = $licenses[$this->licenseId];\r\n }", "public function loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }", "protected function _initResources () {\r\n\r\n\t\t$bFreshData = false;\r\n\r\n\t\tif (self::$_bUseCache) {\r\n\t\t\t$oCacheManager = Kwgl_Cache::getManager();\r\n\t\t\t$oAclCache = $oCacheManager->getCache('acl');\r\n\r\n\t\t\tif (($aResourceListing = $oAclCache->load(self::CACHE_IDENTIFIER_RESOURCES)) === false) {\r\n\t\t\t\t// Not Cached or Expired\r\n\r\n\t\t\t\t$bFreshData = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$bFreshData = true;\r\n\t\t}\r\n\r\n\t\tif ($bFreshData) {\r\n\t\t\t// Get Resources from the Database\r\n\t\t\t$oDaoResource = Kwgl_Db_Table::factory('System_Resource'); /* @var $oDaoResource Dao_System_Resource */\r\n\t\t\t//$aResourceListing = $oDaoResource->fetchAll();\r\n\t\t\t$aResourceListing = $oDaoResource->getResources();\r\n\r\n\t\t\tif (self::$_bUseCache) {\r\n\t\t\t\t$oAclCache->save($aResourceListing, self::CACHE_IDENTIFIER_RESOURCES);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tforeach ($aResourceListing as $aResourceDetail) {\r\n\t\t\t$sResourceName = $aResourceDetail['name'];\r\n\t\t\tif (is_null($aResourceDetail['parent'])) {\r\n\t\t\t\t// Add the Resource if it hasn't been defined yet\r\n\t\t\t\tif (!$this->has($sResourceName)) {\r\n\t\t\t\t\t$this->addResource(new Zend_Acl_Resource($sResourceName));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// Parent Resource assigned\r\n\t\t\t\t$sResourceParentName = $aResourceDetail['parent'];\r\n\t\t\t\t// Add the Parent Role if the Parent Role hasn't been defined yet\r\n\t\t\t\tif (!$this->has($sResourceParentName)) {\r\n\t\t\t\t\t$this->addResource(new Zend_Acl_Resource($sResourceParentName));\r\n\t\t\t\t}\r\n\t\t\t\t$this->addResource(new Zend_Acl_Resource($sResourceName), $sResourceParentName);\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t}", "private function load() {\n\n $db = Database::getInstance(); \n\t $con = $db->getConnection();\n \n $query = \"SELECT * FROM Products ORDER by ID DESC\";\n \n if ($result = $con->query($query)) {\n \t/* fetch object array */\n \t while ($prod = $result->fetch_object(\"Product\")) {\n\t\t\t \tarray_push($this->products, $prod);\n \t}\n \t/* free result set */\n \t$result->close();\n }\n\t}", "abstract public function retrieve();", "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 preRetrieve();", "private function setup_data_from_db() {\n\t\tglobal $wpdb;\n\n\t\t// get products\n\t\t$this->setup_products();\n\n\t\t// get 'devices'\n\t\t$this->devices = $wpdb->get_results( \"SELECT * FROM `{$wpdb->prefix}spa_devices` as devices\", ARRAY_A );\n\n\t\t// get 'volume'/'type'\n\t\t$this->data = $wpdb->get_results( \"SELECT * FROM `{$wpdb->prefix}spa_volume` as volume\", ARRAY_A );\n\n\t\tfor ( $i = 0; $i < count( $this->data ); $i++ ) {\n\t\t\t// get 'chemical'\n\t\t\t$this->data[$i]['data'] = $wpdb->get_results(\n\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\tSELECT chemical.* FROM `{$wpdb->prefix}spa_chemical` as chemical\n\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_volume_chemical` as relationtips\n\t\t\t\t\tON chemical.`id` = relationtips.`id_chemical`\n\t\t\t\t\tWHERE relationtips.`id_volume` = '%d'\n\t\t\t\t\", $this->data[$i]['id'] ), ARRAY_A );\n\n\t\t\t// get 'global_result'\n\t\t\t$this->data[$i]['global_result'] = $wpdb->get_results(\n\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\tSELECT global_result.* FROM `{$wpdb->prefix}spa_global_result` as global_result\n\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_volume_global_result` as relationtips\n\t\t\t\t\tON global_result.`id` = relationtips.`id_global_result`\n\t\t\t\t\tWHERE relationtips.`id_volume` = '%d'\n\t\t\t\t\", $this->data[$i]['id'] ), ARRAY_A );\n\n\t\t\tfor ( $j = 0; $j < count( $this->data[$i]['data'] ); $j++ ) {\n\t\t\t\t// get 'test'\n\t\t\t\t$this->data[$i]['data'][$j]['data'] = $wpdb->get_results(\n\t\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\t\tSELECT test.* FROM `{$wpdb->prefix}spa_test` as test\n\t\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_chemical_test` as relationtips\n\t\t\t\t\t\tON test.`id` = relationtips.`id_test`\n\t\t\t\t\t\tWHERE relationtips.`id_chemical` = '%d'\n\t\t\t\t\t\", $this->data[$i]['data'][$j]['id'] ), ARRAY_A );\n\n\t\t\t\tfor ( $k = 0; $k < count( $this->data[$i]['data'][$j]['data'] ); $k++ ) {\n\t\t\t\t\t// get 'value'\n\t\t\t\t\t$this->data[$i]['data'][$j]['data'][$k]['data'] = $wpdb->get_results(\n\t\t\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\t\t\tSELECT spa_value.* FROM `{$wpdb->prefix}spa_value` as spa_value\n\t\t\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_test_value` as relationtips\n\t\t\t\t\t\t\tON spa_value.`id` = relationtips.`id_value`\n\t\t\t\t\t\t\tWHERE relationtips.`id_test` = '%d'\n\t\t\t\t\t\t\", $this->data[$i]['data'][$j]['data'][$k]['id'] ), ARRAY_A );\n\n\t\t\t\t\tfor ( $l = 0; $l < count( $this->data[$i]['data'][$j]['data'][$k]['data'] ); $l++ ) {\n\t\t\t\t\t\t// get 'result'\n\t\t\t\t\t\t$this->data[$i]['data'][$j]['data'][$k]['data'][$l]['data'] = $wpdb->get_results(\n\t\t\t\t\t\t\t$wpdb->prepare( \"\n\t\t\t\t\t\t\t\tSELECT result.* FROM `{$wpdb->prefix}spa_result` as result\n\t\t\t\t\t\t\t\tLEFT JOIN `{$wpdb->prefix}spa_value_result` as relationtips\n\t\t\t\t\t\t\t\tON result.`id` = relationtips.`id_result`\n\t\t\t\t\t\t\t\tWHERE relationtips.`id_value` = '%d'\n\t\t\t\t\t\t\t\", $this->data[$i]['data'][$j]['data'][$k]['data'][$l]['id'] ), ARRAY_A );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function createStore($shop)\n {\n // Require only on this function to not overload memory with unneeded classes\n require_once _PS_MODULE_DIR_ . 'doofinder/lib/EasyREST.php';\n $client = new EasyREST();\n $apikey = Configuration::getGlobalValue('DF_AI_APIKEY');\n $admin_endpoint = Configuration::getGlobalValue('DF_AI_ADMIN_ENDPOINT');\n $languages = Language::getLanguages(true, $shop['id_shop']);\n $currencies = Currency::getCurrenciesByIdShop($shop['id_shop']);\n $shopId = $shop['id_shop'];\n $shopGroupId = $shop['id_shop_group'];\n $primary_lang = new Language(Configuration::get('PS_LANG_DEFAULT', null, $shopGroupId, $shopId));\n $installationID = null;\n $callbacksUrls = [];\n\n $this->setDefaultShopConfig($shopGroupId, $shopId);\n\n $shop_url = $this->getShopURL($shopId);\n $store_data = [\n 'name' => $shop['name'],\n 'platform' => 'prestashop',\n 'primary_language' => $primary_lang->language_code,\n 'search_engines' => [],\n 'sector' => '',\n ];\n\n foreach ($languages as $lang) {\n foreach ($currencies as $cur) {\n if ($cur['deleted'] == 1) {\n continue;\n }\n $ciso = $cur['iso_code'];\n $lang_code = $lang['language_code'];\n $feed_url = $this->buildFeedUrl($shopId, $lang['iso_code'], $ciso);\n $store_data['search_engines'][] = [\n 'name' => $shop['name'] . ' | Lang:' . $lang['iso_code'] . ' Currency:' . strtoupper($ciso),\n 'language' => $lang_code,\n 'currency' => $ciso,\n 'site_url' => $shop_url,\n 'stopwords' => false,\n 'datatypes' => [\n [\n 'name' => 'product',\n 'preset' => 'product',\n 'datasources' => [\n [\n 'options' => [\n 'url' => $feed_url,\n ],\n 'type' => 'file',\n ],\n ],\n 'options' => [\n 'exclude_out_of_stock_items' => false,\n 'group_variants' => false,\n ],\n ],\n ],\n ];\n $callbacksUrls[$lang_code][$ciso] = $this->getProcessCallbackUrl();\n }\n }\n $store_data['callback_urls'] = $callbacksUrls;\n\n $json_store_data = json_encode($store_data);\n $this->debug('Create Store Start');\n $this->debug(print_r($store_data, true));\n\n $response = $client->post(\n 'https://' . $admin_endpoint . '/plugins/create-store',\n $json_store_data,\n false,\n false,\n 'application/json',\n ['Authorization: Token ' . $apikey]\n );\n\n if ($response->getResponseCode() == 200) {\n $response = json_decode($response->response, true);\n $installationID = @$response['installation_id'];\n $this->debug('Create Store response:');\n $this->debug(print_r($response, true));\n\n if ($installationID) {\n $this->debug(\"Set installation ID: $installationID\");\n Configuration::updateValue('DF_INSTALLATION_ID', $installationID, false, $shopGroupId, $shopId);\n Configuration::updateValue('DF_ENABLED_V9', true, false, $shopGroupId, $shopId);\n $this->setSearchEnginesByConfig();\n } else {\n $this->debug('Invalid installation ID');\n exit('ko');\n }\n } else {\n $error_msg = \"Create Store failed with code {$response->getResponseCode()} and message '{$response->getResponseMessage()}'\";\n $response_msg = 'Response: ' . print_r($response->response, true);\n $this->debug($error_msg);\n $this->debug($response_msg);\n echo $response->response;\n exit;\n }\n }", "private function ImportEquipment()\n {\n\t\tDebug::log('<hr><h3>Common Equipment</h3>', LEVEL_NORMAL);\n\n global $mysql;\n\n $equipment = simplexml_load_file($this->vehicles_path . '/common/optional_devices.xml');\n\n foreach($equipment->children() as $node => $item) {\n $icon = (string)$item->icon;\n $icon = explode(' ', $icon);\n $icon = $icon[0];\n $icon = str_replace('../maps/icons/artefact/', '', $icon);\n \n $price = 0;\n $price_gold = 0;\n if (isset($item->price->gold))\n {\n $price_gold = (int)$item->price;\n }else{\n $price = (int)$item->price;\n }\n \n $weight = 0;\n if (isset($item->script->weight))\n $weight = (int)$item->script->weight;\n \n $include = '';\n $exclude = '';\n \n $inc = 'include';\n if (isset($item->vehicleFilter->$inc->vehicle->tags)){\n $include = (string)$item->vehicleFilter->$inc->vehicle->tags;\n }\n if (isset($item->vehicleFilter->exclude->vehicle->tags)){\n $exclude = (string)$item->vehicleFilter->exclude->vehicle->tags;\n }\n \n //remove tabs\n $include = preg_replace('/\\s+/', ' ', $include);\n $exclude = preg_replace('/\\s+/', ' ', $exclude);\n \n $data = array(\n 'wot_version_id' => $this->versionId,\n 'name' => $this->TranslateToLocal((string)$item->userString),\n 'name_node' => $node,\n 'description' => $this->TranslateToLocal((string)$item->description),\n 'icon' => $icon,\n 'price' => $price,\n 'price_gold' => $price_gold,\n 'removable' => (mb_strtolower(((string)$item->removable)) == mb_strtolower('true') ? 1 : 0),\n 'weight' => $weight,\n 'vehicle_tags_include' => $mysql->quoteString($include),\n 'vehicle_tags_exclude' => $mysql->quoteString($exclude)\n );\n \n $this->InsertData('wot_equipment',$node,\"name_node = '$node' AND wot_version_id = '$this->versionId'\",$data);\n\n $equipment_id = $mysql->query(\"SELECT wot_equipment_id FROM wot_equipment WHERE name_node = '$node' AND wot_version_id = '$this->versionId'\");\n $equipment_id = $mysql->row($equipment_id);\n $equipment_id = $equipment_id['wot_equipment_id'];\n\n $break = false;\n \n foreach($item->script->children() as $param_node => $param_value) {\n if ($param_node == 'weight'){\n continue;\n }\n if ($param_node == 'attribute' || $param_node == 'value' || $param_node == 'factor') {\n $data = array(\n 'wot_equipment_id' => $equipment_id,\n 'param' => (string)$item->script->attribute,\n 'value' => isset($item->script->value) ? (string)$item->script->value : (string)$item->script->factor\n );\n $break = true;\n } else {\n $data = array(\n 'wot_equipment_id' => $equipment_id,\n 'param' => (string)$param_node,\n 'value' => (string)$param_value\n );\n }\n if (strpos($data['param'], '/'))\n {\n $data['param'] = substr($data['param'], strpos($data['param'], '/')+1);\n }\n \n $this->InsertData('wot_equipment_params',$node,\"wot_equipment_id = '$equipment_id' AND param = '{$data['param']}'\",$data);\n\n if ($break)\n {\n break;\n }\n }\n \n }\n }", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "static function saveToDB() {\n try {\n $diff_id = self::arrayDiff()[\"diff_id\"];\n\n //errors handling\n } catch (\\Exception $e) {\n return [\"uploadedlist\"=>\"\",\"title\"=>$e->getMessage()];\n }\n\n\n\n try {\n $count = 0;\n if (empty($diff_id)) { throw new Exception(\"All items saved!\");}\n //for debugging only 100\n //$diff_id=array_slice($diff_id,0,300);\n foreach ($diff_id as $id) {\n $offer = self::getDataByID($id, $_SESSION[\"api_key\"]);\n //$offer = self::getDataByID(\"14646350\", $_SESSION[\"api_key\"]);\n //to get keys for checking\n $offer_keys = array_keys($offer);\n\n $model = new Offers();\n $isExists = [];\n //saving all items except for having prefix \"c\"\n foreach ($offer_keys as $k => $offer_key) {\n if ($model->hasProperty($offer_key)) {\n $model[$offer_key] = $offer[$offer_key];\n $isExists[] = true;\n }\n }\n //saving items having prefix \"c\"\n if (!empty($offer[\"characteristics_values\"])) {\n $offerChars = $offer[\"characteristics_values\"];\n $offer_keysChars = array_keys($offerChars);\n foreach ($offer_keysChars as $k => $offer_key) {\n if ($model->hasProperty(\"c\" . $offer_key)) {\n $model[\"c\" . $offer_key] = round($offerChars[$offer_key]);\n $isExists[] = true;\n }\n\n }\n //echo var_export($offer[\"characteristics_values\"]);\n\n\n //echo var_export(self::$charValuesArr);\n }\n\n //saving data about Agency\n if (!empty($offer[\"agency\"])) {\n $offerAgency = $offer[\"agency\"];\n $offer_keysAgency = array_keys($offerAgency);\n foreach ($offer_keysAgency as $k => $offer_key) {\n if ($model->hasProperty($offer_key)) {\n $model[$offer_key] = round($offerAgency[$offer_key]);\n $isExists[] = true;\n }\n\n }\n }\n //saving \"user\" and \"priceUSD\"\n //to add agency id like $model[\"agency_id\"] = $offer_keys[\"user\"][\"name\"];\n if (!empty($offer[\"priceArr\"])) {\n $model[\"priceUSD\"] = $offer[\"priceArr\"][1];\n }\n $model->save(false);\n $count++;\n }\n return [\"uploadedlist\" => $count . \" items uploaded\", \"title\" => \"Success\"];\n //echo var_dump($charValuesArr);\n //return [\"uploadedlist\" => $charValuesArr, \"title\" => \"Success\"];\n } catch (\\Exception $e) {\n return [\"uploadedlist\"=>$count .\" items uploaded, id=\".$id,\"title\"=>$e->getMessage()];\n\n //echo var_dump(self::$charValuesArr);\n //return [\"uploadedlist\"=>self::$charValuesArr,\"title\"=>$e->getMessage()];\n }\n /*\n 'admin_id' => 'Admin ID',\n 'street_name' => 'Street Name',\n 'price_item' => 'Price Item',\n 'rooms_count' => 'Rooms Count',\n 'type' => 'Type',\n 'is_commercial' => 'Is Commercial',\n 'state_name' => 'State Name',\n 'beautiful_url' => 'Beautiful Url',\n 'description' => 'Description',\n 'currency_type' => 'Currency Type',\n 'metro_station_name' => 'Metro Station Name',\n 'wall_type' => 'Wall Type',\n 'publishing_date' => 'Publishing Date',\n 'realty_type_name' => 'Realty Type Name',\n 'realty_sale_type' => 'Realty Sale Type',\n 'latitude' => 'Latitude',\n 'longitude' => 'Longitude',\n 'main_photo' => 'Main Photo',\n 'building_number_str' => 'Building Number Str',\n 'city_name' => 'City Name',\n 'living_square_meters' => 'Living Square Meters',\n 'realty_type_id' => 'Realty Type ID',\n 'floors_count' => 'Floors Count',\n 'kitchen_square_meters' => 'Kitchen Square Meters',\n 'flat_number' => 'Flat Number',\n 'total_square_meters' => 'Total Square Meters',\n 'realty_id' => 'Realty ID',\n 'date_end' => 'Date End',\n 'district_name' => 'District Name',\n 'advert_type_name' => 'Advert Type Name',\n 'advert_type_id' => 'Advert Type ID',\n 'price_type' => 'Price Type',\n 'created_at' => 'Created At',\n 'levels_expired' => 'Levels Expired',\n 'is_exchange' => 'Is Exchange',\n 'floor' => 'Floor',\n 'is_bargain' => 'Is Bargain',\n 'user' => 'User',\n 'priceUSD' => 'Price Usd',\n 'c1501' => 'C1501',\n 'c1502' => 'C1502',\n 'c1503' => 'C1503',\n 'c1504' => 'C1504',\n 'c443' => 'C443',\n 'c1607' => 'C1607',\n 'c1608' => 'C1608',\n 'c1011' => 'C1011',\n 'c1464' => 'C1464',\n 'c274' => 'C274',\n 'c265' => 'C265',\n 'c1437' => 'C1437',\n 'admin_time_entered' => 'Admin Time Entered',\n }\n */\n\n\n\n }", "function loadArticulo(){\n\t\t\t$r = $this->ar->getArticuloById($this->id);\n\t\t\tif($r != -1){\n\t\t\t\t$this->id \t\t\t= $r['doa_id'];\n\t\t\t\t$this->alcance \t\t= $r['alc_id'];\n\t\t\t\t$this->documento \t= $r['doc_id'];\n\t\t\t\t$this->nombre \t\t= $r['doa_nombre'];\n\t\t\t\t$this->descripcion\t= $r['doa_descripcion'];\n\t\t\t}else{\n\t\t\t\t$this->id \t\t\t= \"\";\n\t\t\t\t$this->alcance \t\t= \"\";\n\t\t\t\t$this->documento \t= \"\";\n\t\t\t\t$this->nombre \t\t= \"\";\n\t\t\t\t$this->descripcion\t= \"\";\n\t\t\t}\n\t}", "public function getAllManufactures(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM manufactures\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "public function retrieve(){\n\t\tswitch ($this->host) {\n\t\t\tcase 'www.subito.it':\n\t\t\t\t$this->retrieveAllSubito();\n\t\t\t\tbreak;\n\t\t\tcase 'www.portaportese.it':\n\t\t\t\t// call the appropriate method when it is written\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function store()\n {\n $this->validateData();\n $path = null;\n\n if (request()->hasFile('src')) {\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory = Accessories::create(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function gatherData() {\r\n\t\t$this->resource->gatherData();\r\n\t}", "public function airtable()\n {\n\n ServiceAddress::truncate();\n $airtable = new Airtable(array(\n 'api_key' => 'keyIvQZcMYmjNbtUO',\n 'base' => 'app2sk6MlzyikwbzL',\n ));\n\n $request = $airtable->getContent( 'address' );\n\n do {\n\n\n $response = $request->getResponse();\n\n $airtable_response = json_decode( $response, TRUE );\n\n foreach ( $airtable_response['records'] as $record ) {\n\n $service_address = new ServiceAddress();\n $service_address->address_recordid = $record[ 'id' ];\n $service_address->services_address_1 = isset($record['fields']['address_1'])?$record['fields']['address_1']:null;\n $service_address->services_address_2 = isset($record['fields']['address_2'])?$record['fields']['address_2']:null;\n $service_address->services_address_city = isset($record['fields']['city'])?$record['fields']['city']:null;\n $service_address->services_address_state_province = isset($record['fields']['state_province'])?$record['fields']['state_province']:null;\n $service_address->services_address_state_province = isset($record['fields']['state_province'])?$record['fields']['state_province']:null;\n $service_address->services_address_postalcode = isset($record['fields']['postal_code'])?$record['fields']['postal_code']:null;\n $service_address->services_address_region = isset($record['fields']['region'])?$record['fields']['region']:null;\n $service_address->services_address_country = isset($record['fields']['country'])?$record['fields']['country']:null;\n $service_address->services_address_attention = isset($record['fields']['attention'])?$record['fields']['attention']:null;\n $service_address->services_address_type = isset($record['fields']['type'])? implode(\",\", $record['fields']['type']):null;\n $service_address->services_address_locations = isset($record['fields']['locations'])? implode(\",\", $record['fields']['locations']):null;\n $service_address->save();\n\n }\n \n }\n while( $request = $response->next() );\n\n $date = date(\"Y/m/d H:i:s\");\n $airtable = Airtable_services::where('table_name', '=', 'Services_address')->first();\n $airtable->total_records = ServiceAddress::count();\n $airtable->last_synced = $date;\n $airtable->save();\n }", "protected function _resourceMap()\n\t{\n\t\t$resourceMap = new \\ResourceMapGenerator();\n\t\t$id = '';\n\n\t\t// Retrieves the ID from alias\n\t\tif (substr(strtolower($this->_alias), -4) == '.rdf')\n\t\t{\n\t\t\t$lastSlash = strrpos($this->_alias, '/');\n\t\t\t$lastDot = strrpos($this->_alias, '.rdf');\n\t\t\t$id = substr($this->_alias, $lastSlash, $lastDot);\n\t\t}\n\n\t\t// Create download headers\n\t\t$resourceMap->pushDownload($this->config->get('webpath'));\n\t\texit;\n\t}", "public function getCategoryDataFront()\n {\n // Get Categorys\n $categories = CategoryWiseSpecification::orderBy('updated_at', 'desc')->Where('deactivate', 0)->take(4)->get();\n\n foreach($categories as $categoryWiseResource)\n {\n $files = explode(\",\", $categoryWiseResource['file']);\n $categoryWiseResource['attachments'] = Attachment::WhereIn('id', $files)->get();\n }\n \n // Return collection of Categorys as a resource\n return CategoryWiseSpecificationResouerce::collection($categories);\n }", "private function getData()\n\t{\n\t\t// get the record\n\t\t$this->record = (array) BackendBannersModel::get($this->id);\n\n\t\t// no item found, throw an exceptions, because somebody is fucking with our URL\n\t\tif(empty($this->record)) $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');\n\t}", "public function fetchSources () {\r\n\t}", "protected function obtainData()\n\t{\n\t\t$this->obtainDataReferences();\n\t\t$this->obtainDataOrders();\n\t}", "public function getShopResource()\n {\n return $this->shop_resource;\n }", "public function syncImages() {\r\n\r\n /** @var Mage_Catalog_Helper_Product_Flat $helper */\r\n $process = Mage::helper('catalog/product_flat')->getProcess();\r\n $status = $process->getStatus();\r\n $process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);\r\n\r\n // Fetch attribute set id by attribute set name\r\n /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */\r\n $attributeSetId = Mage::getModel('eav/entity_attribute_set')\r\n ->load('Oodji', 'attribute_set_name')\r\n ->getAttributeSetId();\r\n\r\n $website = Mage::getResourceModel('core/website_collection')\r\n ->addFieldToFilter('code', 'oodji')\r\n ->getFirstItem();\r\n\r\n $storeId = Mage::app()->getStore(Mage::app()->getWebsite($website)->getDefaultGroup()->getDefaultStoreId())->getId();\r\n\r\n // Load product model collection filtered by attribute set id\r\n $products = Mage::getResourceModel('catalog/product_collection')\r\n ->setStoreId($storeId)\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToFilter('type_id', 'configurable')\r\n ->addFieldToFilter('attribute_set_id', $attributeSetId)\r\n ->addFieldToFilter('status', 2);\r\n\r\n $process->setStatus($status);\r\n\r\n // Process your product collection as per your bussiness logic\r\n /** @var Agere_PhotoGrabber_Helper_Grabber $grab */\r\n $grab = Mage::helper('photoGrabber/grabber');\r\n\r\n foreach($products as $product){\r\n $grab->searchProduct($product->getSku());\r\n }\r\n }", "public function storeItems()\n {\n return response()->json([\n 'status' => 200,\n 'data' => new ProductResourceCollection(Product::all())\n ]);\n }" ]
[ "0.5622425", "0.54324424", "0.5321501", "0.52135664", "0.51623595", "0.50290745", "0.5015088", "0.49947172", "0.49897242", "0.49355063", "0.48643458", "0.48641953", "0.48595572", "0.48524553", "0.4840576", "0.47902724", "0.4775086", "0.47648528", "0.47582084", "0.4747132", "0.47469118", "0.4729428", "0.47243428", "0.47198012", "0.4717599", "0.47171217", "0.4716697", "0.47159398", "0.47158405", "0.47149342" ]
0.5527455
1